LoD_PRC8/_module/nss/sf_ondmg_jump.nss
Jaysyn904 94990edc60 Initial Upload
Initial Upload
2023-09-21 21:20:34 -04:00

48 lines
1.2 KiB
Plaintext

//::///////////////////////////////////////////////
/*
This script will take a ranged dmg attack and
cause the monster to "jump" into the air, land
behind the PC and attack.
*/
//:://////////////////////////////////////////////
//:: Created By: SoulFlame
//:: Created On: Jan 20/05
//:://////////////////////////////////////////////
#include "nw_i0_generic"
void JumpAttack()
{
object oPC = GetLastHostileActor();
if (!GetIsPC(oPC)) return;
float fDistance = GetDistanceToObject(oPC);
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
if (fDistance > 20.0) DoOnce = FALSE;
if (DoOnce==TRUE) return;
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
object oTarget;
oTarget = OBJECT_SELF;
location lTarget = GetLocation(oPC);
effect eFly = EffectDisappearAppear(lTarget);
AssignCommand(oTarget, ClearAllActions());
DelayCommand(1.0, AssignCommand(oTarget, PlaySound("sim_destruct_low")));
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, oTarget, 2.0));
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
}
void main()
{
if (GetPlotFlag(OBJECT_SELF))
return;
JumpAttack();
}