I want to check if a character is immune to the spell Drown. The immunity might come from an equipped item/skin, spell or non-spell scripted effect (e.g. from any script that uses
EffectSpellImmunity(SPELL_DROWN)
). More generally, I'd like to be able to determine if a creature has immunity to a specific spell.
This seems like it should be easy enough recoding something similar to
x0_i0_match
's
GetHasEffect()
and checking for
EFFECT_TYPE_SPELL_IMMUNITY
, but I realize I don't know how to get the spell subtype for that effect. In other words, I can check if a character has the effect
EFFECT_TYPE_SPELL_IMMUNITY
, but I don't know how to determine which specific spell it is immune to.
It seems like there is probably something analogous to the check one would make to see if an item property grants immunity from a specific spell. E.g. if I were looking for this as an objects item property, I might try:
- Loop through the object's item properties.
- For each one, check if
GetItemPropertyType()
returns ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL
- If so, check if
GetItemPropertyCostTable()
returns IPRP_SPELLCOST
- If so, check if
GetItemPropertyCostTableValue()
returns 201 (the Drown entry from iprp_spellcost.2da
)
Is there a similar way to check for effects on characters? Am I way off on how to go about this?
Thanks for any advice or pointers to another thread that covers this. :-)
[EDIT: It appears that list termination is broken on the boards.]
Modifié par MrZork, 20 avril 2012 - 07:05 .