Author Topic: Rogue XP for Traps and Locks  (Read 410 times)

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Rogue XP for Traps and Locks
« on: February 24, 2012, 09:00:47 pm »


               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.  '<img'>
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #1 on: February 24, 2012, 10:49:53 pm »


               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 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #2 on: February 24, 2012, 11:13:53 pm »


               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?
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #3 on: February 25, 2012, 08:07:52 am »


               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 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #4 on: February 25, 2012, 04:59:07 pm »


               

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 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #5 on: February 25, 2012, 06:47:04 pm »


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

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

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #6 on: February 25, 2012, 10:10:12 pm »


               

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 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #7 on: February 25, 2012, 10:35:12 pm »


               

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 .
                     
                  


            

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #8 on: February 25, 2012, 11:48:07 pm »


               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.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #9 on: February 25, 2012, 11:55:03 pm »


               

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.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #10 on: February 26, 2012, 01:49:59 am »


               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.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #11 on: February 26, 2012, 09:51:33 am »


               

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 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #12 on: February 26, 2012, 05:58:18 pm »


               

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.
               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #13 on: February 27, 2012, 03:44:48 pm »


               

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.
               
               

               
            

Legacy_Snowbug

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Rogue XP for Traps and Locks
« Reply #14 on: February 27, 2012, 05:06:39 pm »


               

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 .