Skip to content

Can't get an item created effect on a player

Hey guys,
I'm trying to know if a player is under haste, so I just go the usual route:

effect eE=GetFirstEffect(oPC);
while (GetIsEffectValid(eE)) {
if (eE==EffectHaste()) { // do stuff here
}
eE=GetNextEffect(oPC);
}

but I can't catch the haste effect coming from an armor.
So I tried GetHasSpellEffect(SPELL_HASTE, oPC) which doesn't get me any further.
How am I supposed to get an effect coming from an item?

Cheers

Comments

  • MermutMermut Member Posts: 44
    Cycle through the items and then the effects on each item
  • JapualtahJapualtah Member Posts: 165
    Will try that, a bit CPU intensive though :(
  • PhantasmaPhantasma Member Posts: 79
    edited July 2018
    I think you generally should use GetEffectType(EFFECT_TYPE_HASTE) as your comparison but it doesnt help in these circumstances :-) I tried investigating last night and got nowhere other than checking item property which does seem intensive.

    Item enhancements never seem to give detectable effects but something must be applied to the pc .... maybe check if it gets applied to the pc skin? (Edit - I tried, it doesn't. Only checking Item Property on the item gives a successful check, but I can't quite believe this is the best way)
    Post edited by Phantasma on
  • ghowriterghowriter Member Posts: 35
    I went through something similar. I created an armor that gave a concealed bonus when equipped and removed the bonus when unequipped. My unequip script couldn't find the effect even though it was applied correctly. Anyway, I found a tutorial online and rewrote how the item applies the effect so that the item is the creator and my unequip script searches for the owners of effect to remove only that one.

    Don't know if that'll help you... if you ask I will try to find the tutorial again, I have my PC wipe history when I close the browser so I'd have to search for it. Or you could just ask for a copy of my scripts but they're formatted for NWN2.
  • ghowriterghowriter Member Posts: 35
    ghowriter said:

    I went through something similar. I created an armor that gave a concealed bonus when equipped and removed the bonus when unequipped. My unequip script couldn't find the effect even though it was applied correctly. Anyway, I found a tutorial online and rewrote how the item applies the effect so that the item is the creator and my unequip script searches for the owners of effect to remove only that one.

    Don't know if that'll help you... if you ask I will try to find the tutorial again, I have my PC wipe history when I close the browser so I'd have to search for it. Or you could just ask for a copy of my scripts but they're formatted for NWN2.

    You can ignore my post if you want, I cannot keep the effect active. They (the makers) claim supernatural permanent effects will not be removed yet they do remove them all the time, intentionally so.
Sign In or Register to comment.