Battledale_PRC8/_module/nss/jw_jeghri_spell.nss
Jaysyn904 e5b3f6ad61 Finished PRC8 integration
Finished PRC8 integration.  Moved creature abilities to top hak.  Setup tooling.  Created release archive
2024-03-12 21:27:23 -04:00

60 lines
1.9 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Default: On Spell Cast At
//:: NW_C2_DEFAULTB
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This determines if the spell just cast at the
target is harmful or not.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Dec 6, 2001
//:://////////////////////////////////////////////
#include "NW_I0_GENERIC"
void main()
{
ExecuteScript("prc_npc_spellat", OBJECT_SELF);
int nSpell=GetLastSpell();
object oCaster = GetLastSpellCaster();
if(GetLastSpellHarmful())
{
if (GetObjectSeen(oCaster))
{
ClearAllActions();
ActionCastSpellAtObject(SPELL_GREATER_DISPELLING,oCaster,METAMAGIC_EMPOWER,TRUE,20,PROJECTILE_PATH_TYPE_DEFAULT,TRUE);
ActionCastSpellAtObject(nSpell,oCaster,METAMAGIC_EMPOWER,TRUE,20,PROJECTILE_PATH_TYPE_DEFAULT,TRUE);
}
if(
!GetIsObjectValid(GetAttackTarget()) &&
!GetIsObjectValid(GetAttemptedSpellTarget()) &&
!GetIsObjectValid(GetAttemptedAttackTarget()) &&
GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN))
)
{
if(GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL))
{
DetermineSpecialBehavior(oCaster);
}
else
{
DetermineCombatRound(oCaster);
}
//Shout Attack my target, only works with the On Spawn In setup
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
//Shout that I was attacked
SpeakString("NW_I_WAS_ATTACKED", TALKVOLUME_SILENT_TALK);
}
}
if(GetSpawnInCondition(NW_FLAG_SPELL_CAST_AT_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1011));
}
}