Skip to content

Switches Help

I would like to make use of the special palemaster item switch, but am a bit confused. Does the script I specify have to add equip/unequip commands plus the bonuses I would apply or is that handled automatically by the module event scripts ? Any direction is appreciated.


  • ForSeriousForSerious Member Posts: 364
    I've been rereading this a few times now, but am not sure what to say.
    Are you thinking of using something like a player tool feat to give abilities? (And maybe take them away?)
  • DefiantShadeDefiantShade Member Posts: 21
    Sorry, reading my post I realize it's not very clear. In the switches include is a variable for pale master special item. It vaguely states that (I think) you place the variable on an item and name the script you wish to fire when the item is equip. to provide bonus to summon. I haven't been able to find any other documentation on it searching the various forums.
  • ForSeriousForSerious Member Posts: 364
    edited June 23
    Okay. Yeah. Reading over that does not explain much about how to go about using it.
    // * This allows you to script items that enhance a palemaster's summoned creatures.
    Sounds like what you want to do.
    // * You need to put the name of a script into this variable that will be run on any creature called by the pale master's summon undead ability.
    Sure, you can do that in the loader script.
    // * You can use this script to add effects to the creature.
    The script can use OBJECT_SELF to point to the summon being enhanced or whatnot.
    // * You can use the OnEquip/OnUnEquip event hooks set this variable.
    This statement doesn't make sense to me at all. I mean, you could define it there, but the loader script seems more sure. Makes me doubt if I understood any of it.
  • KamirynKamiryn Member Posts: 59
    edited June 23
    The idea seems to be that the pale master has to equip the item to get the bonus. So in the OnEquip event script the variable is set and in the OnUnEquip event script the variable is cleared.

    I guess the variable has to be put on the pale master / player.
  • DefiantShadeDefiantShade Member Posts: 21
    Thanks for the responses, guess I’ll have to test a script with the variable set on an item and see what happens. I’ll be at work most of today but I will report back after I tinker with it in the toolset.
  • KamirynKamiryn Member Posts: 59
    As I've said you have to set the variable on the pale master. Setting the variable on an item makes no sense as the summon script (x2_s2_sumundead) does not know about the item.

    Here's the relevant part from x2_s2_sumundead:
        // * If the character has a special pale master item equipped (variable set via OnEquip)
        // * run a script on the summoned monster.
        string sScript = GetLocalString(OBJECT_SELF,"X2_S_PM_SPECIAL_ITEM");
        if (sScript != "")
            object oSelf = OBJECT_SELF;
  • DefiantShadeDefiantShade Member Posts: 21
    Thanks , didn’t see this heh. Should’ve looked at the summon script a little closer. Appreciate the help.
  • ForSeriousForSerious Member Posts: 364
    edited June 23
    Oh I think I get it. The reason you want to define it on equip is because it's a local variable stored on the player object. Obviously no player objects are logged in when the loader script is fired.
    When a player logs in, they do so without any items equipped, then equip to their last state—I think. (That's why on acquire fires for every item in a players inventory when they log in, so I'm assuming the same happens for on equip.) In that case, setting it in on equip would be a way to make sure your Pale Master has the script defined.
    Still though…
    OnClientEnter makes more sense to me. You could just set the variable for all players that enter, or limit it to only those with PM levels.
    …Unless you want it to be some actual item that you equip to empower your summons.
  • KamirynKamiryn Member Posts: 59
    I guess the idea is that the upgrade is controlled by the item. And that you can have different items with different upgrades.

    Of course you can forget about the item and just set the variable on the player to have the upgrade all the time.
  • DefiantShadeDefiantShade Member Posts: 21
    Ok, so I created an item with the tag of the pm switch for testing purposes, gave it a matching script that has OnEquip set the variable on PC to execute script “pmitem “, and OnUnEquip delete the variable on the PC.

    The pmitem script applies boost to STR,DEX and CON plus adds Haste and Magic Damage 2d12.

    I’m happy to report that the item works as intended . Looks like it’s only applied to summon and greater summon undead and not to animate dead but I think that’s how it’s intended to be used. Of note, if you unequip the item after summoning ,the undead retains stat boosts but the the next summon spawns in without the boost as the variable is removed from the PC. I suppose additional script could be done to have the boost dispel from the summon if item is unequip, but I’m happy to use it as it is in my test module. Thanks for the help in sorting the switch use out.
Sign In or Register to comment.