Amon_PRC8/_module/nss/x0_d1_henchspell.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

31 lines
953 B
Plaintext

// the henchman casts their spell
#include "X0_INC_HENAI"
void main()
{
int nBuffType = GetLocalInt(OBJECT_SELF, "X2_BUFFING_TYPE");
ClearAllActions();
if(nBuffType != 0)
{
// forward call to hench_o0_enhance
ExecuteScript("hench_o0_enhanc", OBJECT_SELF);
return;
}
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject(OBJECT_SELF, "Henchman_Spell_Target");
SetAssociateState(NW_ASC_IS_BUSY, TRUE);
int nSpell = GetLocalInt(OBJECT_SELF, "Deekin_Spell_Cast");
if ((nSpell > 0) && (GetIsObjectValid(oTarget)))
{
ClearAllActions();
ActionCastSpellAtObject(nSpell, oTarget);
ActionDoCommand(SetLocalInt(OBJECT_SELF, "Deekin_Spell_Cast", 0));
ActionDoCommand(SetLocalObject(OBJECT_SELF, "Henchman_Spell_Target", OBJECT_INVALID));
}
else PlayVoiceChat(VOICE_CHAT_CUSS);
ActionDoCommand(SetAssociateState(NW_ASC_IS_BUSY, FALSE));
}