2025/07/18 Update
Added PEPS. Full compile.
This commit is contained in:
22
_module/nss/0e_do_combat_rnd.nss
Normal file
22
_module/nss/0e_do_combat_rnd.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
/*//////////////////////////////////////////////////////////////////////////////
|
||||
Script: 0e_do_combat_rnd
|
||||
Programmer: Philos
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Used to execute a combat round just after the current action is over.
|
||||
Note: Do not use with an attack action since it will continue until
|
||||
the attacked enemy is dead. We end attack actions with a ClearAllActions
|
||||
command and would also end this one so it will not work with attack actions.
|
||||
*///////////////////////////////////////////////////////////////////////////////
|
||||
#include "0i_associates"
|
||||
void main()
|
||||
{
|
||||
object oCreature = OBJECT_SELF;
|
||||
if(AI_DEBUG) ai_Debug("0e_do_combat_rnd", "14", GetName(oCreature) + " is calculating a new round." +
|
||||
"nAction: " + IntToString(GetCurrentAction(oCreature)));
|
||||
if(ai_GetIsInCombat(oCreature))
|
||||
{
|
||||
if(GetAssociateType(oCreature) == ASSOCIATE_TYPE_NONE &&
|
||||
!ai_GetIsCharacter(oCreature)) ai_DoMonsterCombatRound(oCreature);
|
||||
else if(ai_CanIAttack(oCreature)) ai_DoAssociateCombatRound(oCreature);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user