HoS_PRC8/_mod/_module/nss/wazoo_s0_pshift1.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

59 lines
2.4 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
// Spells out the Wazoo - SPELL PLANE SHIFT - Do it!!
// By Deva Bryson Winblood. 12/18/2003
////////////////////////////////////////////////////////////////////////////////
// this script is called by a conversation after the caster has selected a
// destination and specified whether or not they wish to take anyone with them.
void main()
{
object oPC=GetPCSpeaker();
object oTarget=GetLocalObject(oPC,"oSpellTarget");
int nParm=GetLocalInt(oPC,"nParm"); // 0 = single target 1 = nearby friends
float fDist;
object oOb;
int nC;
int nL;
object oDest=GetLocalObject(oPC,"oPlaneShift");
effect eVis=EffectVisualEffect(VFX_FNF_IMPLOSION);
if (oDest!=OBJECT_INVALID)
{ // destination not invalid
DeleteLocalObject(oPC,"oSpellTarget"); // clean up locals
DeleteLocalObject(oPC,"oPlaneShift");
DeleteLocalInt(oPC,"nParm");
if (nParm==0)
{ // single target
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget,3.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oDest,3.0);
DelayCommand(1.5,AssignCommand(oTarget,ClearAllActions(TRUE)));
DelayCommand(1.6,AssignCommand(oTarget,JumpToObject(oDest)));
} // single target
else
{ // multiple targets
nL=1;
oOb=GetNearestObject(OBJECT_TYPE_CREATURE,oTarget,nL);
fDist=GetDistanceBetween(oOb,oTarget);
nC=0;
while(oOb!=OBJECT_INVALID&&fDist<5.1&&nC<7)
{ // look for things to take
if (GetIsFriend(oOb,oTarget)==TRUE)
{ // shift them
nC++;
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oOb,3.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oDest,3.0);
DelayCommand(1.5,AssignCommand(oOb,ClearAllActions(TRUE)));
DelayCommand(1.6,AssignCommand(oOb,JumpToObject(oDest)));
} // shift them
nL++;
oOb=GetNearestObject(OBJECT_TYPE_CREATURE,oTarget,nL);
fDist=GetDistanceBetween(oOb,oTarget);
} // look for things to take
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget,3.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oDest,3.0);
DelayCommand(1.5,AssignCommand(oTarget,ClearAllActions(TRUE)));
DelayCommand(1.6,AssignCommand(oTarget,JumpToObject(oDest)));
} // multiple targets
} // destination not invalid
}