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

24 lines
816 B
Plaintext

void main()
{
object oMe=OBJECT_SELF;
object oDeployed=GetLocalObject(oMe,"oDeployed");
int bDeployed=GetLocalInt(oMe,"bDeployed");
object oTarget=GetLocalObject(oMe,"oTarget");
object oEnemy=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oMe,1,CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,CREATURE_TYPE_PERCEPTION,PERCEPTION_SEEN);
if (oDeployed!=OBJECT_INVALID&&bDeployed)
{ // artillery is deployed
if (oEnemy==OBJECT_INVALID||GetDistanceBetween(oEnemy,oMe)>10.0)
{ // no enemy concerns
// processed on heartbeat
} // no enemy concerns
else
{ // self defense
ExecuteScript("nw_c2_default3",oMe);
} // self defense
} // artillery is deployed
else
{ // normal
ExecuteScript("nw_c2_default3",oMe);
} // normal
}