48 lines
1.2 KiB
Plaintext
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();
|
|
}
|
|
|