55 lines
1.7 KiB
Plaintext
55 lines
1.7 KiB
Plaintext
#include "nw_i0_generic"
|
|
#include "nw_i0_plot"
|
|
|
|
void DigOut(object oWP)
|
|
{
|
|
if(GetIsDead(OBJECT_SELF))
|
|
return;
|
|
effect eDust = EffectVisualEffect(137);
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDust, GetLocation(oWP));
|
|
DelayCommand(0.5, JumpToObject(oWP));
|
|
DelayCommand(0.8, DetermineCombatRound());
|
|
|
|
}
|
|
|
|
void DigIn()
|
|
{
|
|
effect eDust = EffectVisualEffect(137);
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDust, GetLocation(OBJECT_SELF));
|
|
object oWP = GetWaypointByTag("aw_DIGIN");
|
|
JumpToObject(oWP);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
int nEvent = GetUserDefinedEventNumber();
|
|
if(nEvent == EVENT_HEARTBEAT || nEvent == EVENT_DAMAGED || nEvent == EVENT_ATTACKED ||
|
|
nEvent == EVENT_END_COMBAT_ROUND)
|
|
{
|
|
object oCreature = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE);
|
|
if(!GetIsPlayerCharacter(oCreature) && !(GetMaster(oCreature) != OBJECT_INVALID))
|
|
return;
|
|
float fDistance = GetDistanceBetween(OBJECT_SELF, oCreature);
|
|
if(fDistance > 10.0 || !GetIsInCombat())
|
|
return;
|
|
|
|
int nJumpCount = GetLocalInt(OBJECT_SELF, "Q1_JUMP_COUNT");
|
|
string sWPTag = "Q1_WP_NEXT_" + GetTag(OBJECT_SELF) + IntToString(nJumpCount);
|
|
object oWP = GetWaypointByTag(sWPTag);
|
|
if(oWP == OBJECT_INVALID)
|
|
return;
|
|
nJumpCount++;
|
|
SetLocalInt(OBJECT_SELF, "Q1_JUMP_COUNT", nJumpCount);
|
|
|
|
int nDoOnce = GetLocalInt(OBJECT_SELF, "DO_ONCE_JUMP" + IntToString(nJumpCount));
|
|
if(nDoOnce == 1)
|
|
return;
|
|
SetLocalInt(OBJECT_SELF, "DO_ONCE_JUMP" + IntToString(nJumpCount), 1);
|
|
|
|
DigIn();
|
|
DelayCommand(2.5, DigOut(oWP));
|
|
}
|
|
return;
|
|
|
|
}
|