Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
|
|
//::///////////////////////////////////////////////
|
|
//:: Henchmen: On Spell Cast At
|
|
//:: NW_CH_ACB
|
|
//:: 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()
|
|
{
|
|
object oCaster = GetLastSpellCaster();
|
|
if(GetLastSpellHarmful())
|
|
{
|
|
SetCommandable(TRUE);
|
|
if(
|
|
!GetIsObjectValid(GetAttackTarget()) &&
|
|
!GetIsObjectValid(GetAttemptedSpellTarget()) &&
|
|
!GetIsObjectValid(GetAttemptedAttackTarget()) &&
|
|
!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN)) &&
|
|
!GetIsFriend(oCaster)
|
|
)
|
|
{
|
|
SetCommandable(TRUE);
|
|
//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);
|
|
DetermineCombatRound(oCaster);
|
|
}
|
|
}
|
|
}
|
|
|
|
|