Aller au contenu

Photo

Rogue XP for Traps and Locks


  • Veuillez vous connecter pour répondre
14 réponses à ce sujet

#1
WoC_Builder

WoC_Builder
  • Members
  • 225 messages
What do you folks use for the above mentioneed XP rewards for Rogues being...well, Roguish.  :whistle:

Is there much on the Vault that comes recommended as the best performing?

Thanks.  :)

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Well this is what we used. It is for a PW where you can open locks or disarm traps that both respawn. But it works to where you can only do it once per lock/trap per server reset.


For traps:

void main()
{
    object oPC = GetLastDisarmed();
    string sPC = "T" + GetName(oPC);
    
    if (!GetLocalInt(OBJECT_SELF, sPC))
    {
        int iDC = GetTrapDisarmDC(OBJECT_SELF);
        int iXP = iDC * 10;

        GiveXPToCreature(oPC, iXP);
        SetLocalInt(OBJECT_SELF, sPC, 1);        
    }
}


And locks:

void main()
{
    object oPC = GetLastUnlocked();
    string sPC = "L" + GetName(oPC);
    
    if (!GetLocalInt(OBJECT_SELF, sPC))
    {
        int iDC = GetLockUnlockDC(OBJECT_SELF);
        int iXP = iDC * 10;
        
        GiveXPToCreature(oPC, iXP);
        SetLocalInt(OBJECT_SELF, sPC, 1);
    }
}

Modifié par GhostOfGod, 25 février 2012 - 10:19 .


#3
henesua

henesua
  • Members
  • 3 882 messages
Vives used a local int as well, but placed a ceiling on how much XP could be gained in this manner.

I think it is better to track XP per lock by the Key tag. I think I came up with a method for traps tracking XP but ... cant recall off the top of my head.

Have you found where the event scripts are entered in the toolset for these items?

#4
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
I should have explained the scripts a bit better but I was walking out the door to work as I was posting.

We just had a bunch of traps, locked chests and doors all over the place just for rogues. They didn't give a lot of xp. But these scripts only dished out the xp for each of the traps/locks once per player per server reset since the locks/traps would respawn. This way rogues could still go around unlocking the respawned ones if they wanted to but they only get the xp once.

It was just a really simple solution to what we needed. Nothing really fancy

As for where the scripts go, the lock script just go in the OnUnLock event for anything locked and the trap script just gos in the OnDisarm event of anything that is trapped.

Modifié par GhostOfGod, 25 février 2012 - 09:23 .


#5
WhiZard

WhiZard
  • Members
  • 1 204 messages

GhostOfGod wrote...
As for where the scripts go, the lock script just go in the OnUnLock event for anything locked and the trap script just gos in the OnDisarm event of anything that is trapped.

Note that scripting a reward for trap recovery is a bit more difficult.  OnDisarm does not fire.  Even for actual disarming and unlocking you might want to check whether the player is doing the action through a possessed pixie familiar.

Modifié par WhiZard, 25 février 2012 - 05:02 .


#6
henesua

henesua
  • Members
  • 3 882 messages
AFAIK, OnDisarm does execute. Its worked in Vives for years.

However you need to check for GetLastUnlocked() to determine if the trap was disarmed.

#7
GhostOfGod

GhostOfGod
  • Members
  • 863 messages

WhiZard wrote...

GhostOfGod wrote...
As for where the scripts go, the lock script just go in the OnUnLock event for anything locked and the trap script just gos in the OnDisarm event of anything that is trapped.

Note that scripting a reward for trap recovery is a bit more difficult.  OnDisarm does not fire.  Even for actual disarming and unlocking you might want to check whether the player is doing the action through a possessed pixie familiar.



The OnDisarm does fire when recovering traps from doors and objects, just not the ones on the ground yes. We never did come up with a non-exploitable way of doing that so we ended up just leaving it alone. Your shiny new trap was reward enough. Haha. And good suggestion with the "pixie" as OP did specify rogue. Something else we considered at the time but opted to leave that alone as well. Gave people a reason to be a pixie.

If you know of a non-exploitable way to give xp for recovering ground traps I'd like to know as well.

henesua wrote...

AFAIK, OnDisarm does execute. Its worked in Vives for years.

However you need to check for GetLastUnlocked() to determine if the trap was disarmed.


In testing It doesn't seem that the OnDisarm event fires for ground traps when recovering the trap. Perhaps it was another trap event?

Modifié par GhostOfGod, 25 février 2012 - 10:19 .


#8
Shadooow

Shadooow
  • Members
  • 4 471 messages

WhiZard wrote...
OnDisarm does not fire.

works for me for years, and for both door/placeable and ground traps, even those respawned via scripting command

the only problem I had is that I gave XP based on trap DC, however I was unable to find out trap DC when recovered so I had to give constant XP ammount

Modifié par ShaDoOoW, 25 février 2012 - 10:36 .


#9
Birdman076

Birdman076
  • Members
  • 186 messages
The big problem with xp for locks and traps is the exploitability. What I would love to do is keep track of how many times a lock has been picked by said individual and add some randomness to the equation in the form of a harder dc (lock upgrade for the break ins), traps on untrapped doors, or harder traps, alarms, guards, and the like. Always kind of ruined it for me playing a rogue and having run of the city without any repercussions because none were scripted and made it seem the xp was an afterthought just to cater in some small way to rogue characters as opposed to being an actual reward for their hard work. But thats just me.

#10
WhiZard

WhiZard
  • Members
  • 1 204 messages

ShaDoOoW wrote...

WhiZard wrote...
OnDisarm does not fire.

works for me for years, and for both door/placeable and ground traps, even those respawned via scripting command

I just did a ground trap that would send my character a message in the OnDisarmed event.  The message was only sent when disarmed, not recovered.

#11
henesua

henesua
  • Members
  • 3 882 messages
Interesting on the recovered versus disarmed bit. I had forgotten about that.

For a PC its a trade-off between the material reward of the trap versus simply disarming it and gaining XP. Thats how it works in Vives.

To prevent XP exploitation I only give out XP once per object. But that takes some planning ahead as you need unique identifiers for traps. Its easier for doors which can only give out an XP reward once per key tag.

#12
Shadooow

Shadooow
  • Members
  • 4 471 messages

WhiZard wrote...

ShaDoOoW wrote...

WhiZard wrote...
OnDisarm does not fire.

works for me for years, and for both door/placeable and ground traps, even those respawned via scripting command

I just did a ground trap that would send my character a message in the OnDisarmed event.  The message was only sent when disarmed, not recovered.

yes exactly, OnDisarm = when is trap disarmed

recovering trap fires OnAcquire

Modifié par ShaDoOoW, 26 février 2012 - 03:53 .


#13
WhiZard

WhiZard
  • Members
  • 1 204 messages

ShaDoOoW wrote...
recovering trap fires OnAcquire


If there is room in the inventory.

But I had maintained that there was an issue with OnDisarmed not firing, to which you responded that you had no problems.

#14
WoC_Builder

WoC_Builder
  • Members
  • 225 messages

GhostOfGod wrote...

 And good suggestion with the "pixie" as OP did specify rogue. Something else we considered at the time but opted to leave that alone as well. Gave people a reason to be a pixie.


Yes, what I am looking at is rewarding those who are functioning in their class-skills, not someone who simply cross-classed and took 1 pt. of open lock and has some gloves and a ring to boost.

#15
Snowbug

Snowbug
  • Members
  • 148 messages

WoC_Builder wrote...

Yes, what I am looking at is rewarding those who are functioning in their class-skills, not someone who simply cross-classed and took 1 pt. of open lock and has some gloves and a ring to boost.


In that case, maybe something like this:

void main()
{
    object oUnlocker = GetLastUnlocked();

    int nDC = GetLockUnlockDC(OBJECT_SELF);
    int nRogueLevel = GetLevelByclass(class_TYPE_ROGUE, oUnlocker);

    GiveXPToCreature(oUnlocker , nDC * nRogueLevel);
}

In other words, the more rogue levels the PC has, the more XP they get. If they have no rogue levels, they get nothing.

Modifié par Snowbug, 27 février 2012 - 05:07 .