56 lines
1.9 KiB
Plaintext
56 lines
1.9 KiB
Plaintext
//:: jw_inc_spells.nss
|
|
#include "x0_i0_transform"
|
|
|
|
// Trigger the nearest object with matching tag to convert.
|
|
// This should be called by the trigger object! It ASSUMES
|
|
// that GetEnteringObject() will work for OBJECT_SELF here.
|
|
void JWTriggerObjectTransform(string sCreature, int nVisualEffect=VFX_NONE, string sTag="tag_of_trigger");
|
|
|
|
int ScrollResist(object oCaster, object oTarget, float fDelay = 0.0);
|
|
|
|
int ScrollResist(object oCaster, object oTarget, float fDelay = 0.0)
|
|
{
|
|
|
|
oCaster=GetObjectByTag("PR_Zacharias");
|
|
if (fDelay > 0.5)
|
|
{
|
|
fDelay = fDelay - 0.1;
|
|
}
|
|
int nResist = ResistSpell(oCaster, oTarget);
|
|
effect eSR = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
|
|
effect eGlobe = EffectVisualEffect(VFX_IMP_GLOBE_USE);
|
|
effect eMantle = EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE);
|
|
if(nResist == 1) //Spell Resistance
|
|
{
|
|
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSR, oTarget));
|
|
}
|
|
else if(nResist == 2) //Globe
|
|
{
|
|
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGlobe, oTarget));
|
|
}
|
|
else if(nResist == 3) //Spell Mantle
|
|
{
|
|
if (fDelay > 0.5)
|
|
{
|
|
fDelay = fDelay - 0.1;
|
|
}
|
|
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMantle, oTarget));
|
|
}
|
|
return nResist;
|
|
}
|
|
|
|
// Trigger the nearest object with matching tag to convert.
|
|
// This should be called by the trigger object! It ASSUMES
|
|
// that GetEnteringObject() will work for OBJECT_SELF here.
|
|
void JWTriggerObjectTransform(string sCreature, int nVisualEffect=VFX_NONE, string sTag="tag_of_trigger")
|
|
{
|
|
object oPC = GetEnteringObject();
|
|
if ( ! GetIsPC(oPC) ) { return; }
|
|
if (sTag=="tag_of_trigger")
|
|
{
|
|
sTag=GetTag(OBJECT_SELF);
|
|
}
|
|
object oOrigin = GetNearestObjectByTag(sTag);
|
|
TransformObjectToCreature(oOrigin, sCreature, nVisualEffect);
|
|
//DestroyObject(OBJECT_SELF, 5.0);
|
|
} |