RoT2_PRC8/_module/nss/aw_archermoredig.nss
Jaysyn904 499aba4eb3 Initial upload
Initial upload
2023-09-25 18:13:22 -04:00

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;
}