PWE_PRC8/_module/nss/j_inc_heartbeat.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

548 lines
24 KiB
Plaintext

// Include for heartbeat
// Animations:
// Randomwalk normally, or move to nearest ally.
int AMBIENT_ANIMATIONS = 1;
// These will face nearest ally, and talk or laugh. If no ally then look right/left.
int IMMOBILE_AMBIENT_ANIMATIONS = 2;
// This is the bird animations.
int AMBIENT_ANIMATIONS_AVIAN = 3;
// This will make the creatures "group" and sit, and normally talk.
int AMBIENT_GROUP_ANIMATIONS = 4;
// This will make the creature talk with nearby allies, as to not look dead.
// Also, if alone, it will take drinks, and things like that.
int IMMOBILE_ANIMATIONS_AND_SOLO = 5;
// This is a consitution for just random walking, nothing else.
int AMBIENT_ANIMAL_WALKING = 6;
// Used for fast buffing
int NW_FLAG_FAST_BUFF_ENEMY = 0x04000000;
// Tracks day/night.
int TRACK_DAY_NIGHT = 0x20000000;
// Heartbeat event.
int NW_FLAG_HEARTBEAT_EVENT = 0x00100000;
// Just a handy string.
string AI_ANIMATIONS = "AI_ANIMATIONS";
//AMBIENT ANIMATION COMMANDS
// Plays animations! If any set.
void PlayAllAnimations();
// Returns True if the specific int is there.
int GetSpawnInCondition(int nCondition);
// Sets all Spawn in Stuff, as Hexidcimals (like SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);)
void SetSpawnInCondition(int nCondition, int bValid = TRUE);
// TRUE if walking waypoints.
int GetIsPostOrWalking(object oWalker = OBJECT_SELF);
// Advance buff, checked in heartbeat.
int TalentAdvancedBuff(float fDistance);
// Equip the weapon appropriate to enemy and position
void EquipAppropriateWeapons(object oTarget);
// Used to set and get conditions.
void SetSpawnInCondition(int nCondition, int bValid = TRUE)
{
int nPlot = GetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER");
if(bValid == TRUE)
{
nPlot = nPlot | nCondition;
SetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER", nPlot);
}
else if (bValid == FALSE)
{
nPlot = nPlot & ~nCondition;
SetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER", nPlot);
}
}
int GetSpawnInCondition(int nCondition)
{
int nPlot = GetLocalInt(OBJECT_SELF, "NW_GENERIC_MASTER");
if(nPlot & nCondition)
{
return TRUE;
}
return FALSE;
}
//::///////////////////////////////////////////////
//:: Check for Walkways
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
int GetIsPostOrWalking(object oWalker = OBJECT_SELF)
{
string sTag = GetTag(oWalker);
object oPost = GetWaypointByTag("POST_" + sTag);
if(!GetIsObjectValid(oPost))
{
oPost = GetWaypointByTag("NIGHT_" + sTag);
if(!GetIsObjectValid(oPost))
{
oPost = GetWaypointByTag("WP_" + sTag + "_01");
if(!GetIsObjectValid(oPost))
{
oPost = GetWaypointByTag("WN_" + sTag + "_01");
if(!GetIsObjectValid(oPost))
{
return FALSE;
}
}
}
}
return TRUE;
}
/*::///////////////////////////////////////////////
//:: Play Animations
//::///////////////////////////////////////////////
This will play one of the 5 animations possible.
//:://///////////////////////////////////////////*/
void PlayAnimations()
{
vector vFrnd;
int nRoll;
object oFriend = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, nRoll, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
int iAnimations = GetLocalInt(OBJECT_SELF, "ANIMATIONS");
switch (iAnimations)
{
case (1):// AMBIENT_ANIMATIONS
{
/*
Use this animation for all player races and humanoids
who are civilized. Monstrous races will wonder about
and try to look busy in as non-social manner.
*/
int iRace = GetRacialType(OBJECT_SELF);
if(GetIsPlayableRacialType(OBJECT_SELF) || iRace == RACIAL_TYPE_HUMANOID_GOBLINOID ||
iRace == RACIAL_TYPE_HUMANOID_REPTILIAN || iRace == RACIAL_TYPE_HUMANOID_ORC)
{
nRoll = d6();
if(nRoll == 4 || nRoll == 5)
{
ClearAllActions();
ActionRandomWalk();
}
else
{
if(!GetIsObjectValid(oFriend) || GetIsPC(oFriend) || GetIsDM(oFriend) || IsInConversation(oFriend))
{
ClearAllActions();
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.75);
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.75));
}
else
{
if(GetDistanceToObject(oFriend) >= 3.0 && GetDistanceToObject(oFriend) <= 5.0)
{
ClearAllActions();
ActionMoveToObject(oFriend, FALSE, 2.0);
}
else if(GetDistanceToObject(oFriend) >= 5.0)
{
ClearAllActions();
ActionMoveToObject(oFriend, FALSE, 2.0);
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_GREETING));
}
vFrnd = GetPosition(oFriend);
SetFacingPoint(vFrnd);
}
// If we have a valid friend...
if(GetIsObjectValid(oFriend))
{
nRoll = d4();
ClearAllActions();
if(nRoll == 1)
{
ActionPlayAnimation(ANIMATION_LOOPING_TALK_NORMAL, 1.0, 6.0);
}
else if(nRoll == 2)
{
ActionPlayAnimation(ANIMATION_LOOPING_LISTEN, 1.0, 4.0);
}
else if(nRoll == 3)
{
ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING, 1.0, 6.0);
}
else
{
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.75);
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.75));
}
}
}
}
else
{
ClearAllActions();// Stop what we are doing.
int nRand = d6();
if(nRand == 1)
{
if(GetDistanceToObject(oFriend) >= 3.0 && GetDistanceToObject(oFriend) <= 10.0)
{
ActionMoveToObject(oFriend, FALSE, 2.0);
vFrnd = GetPosition(oFriend);
SetFacingPoint(vFrnd);
}
}
else if(nRand >= 2 && nRand <= 4)
{
ActionRandomWalk();
}
else if(nRand == 5)
{
ActionPlayAnimation(ANIMATION_LOOPING_GET_MID);
}
else if(nRand == 6)
{
ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 6.0);
}
}
break;
}
case (2):// IMMOBILE_AMBIENT_ANIMATIONS
{
/*
Used for spawned creatures to not look like
zombies
*/
int iRace = GetRacialType(OBJECT_SELF);
if(GetIsPlayableRacialType(OBJECT_SELF) || iRace == RACIAL_TYPE_HUMANOID_GOBLINOID ||
iRace == RACIAL_TYPE_HUMANOID_REPTILIAN || iRace == RACIAL_TYPE_HUMANOID_ORC)
{
if(!GetIsObjectValid(oFriend) || GetIsPC(oFriend) || GetIsDM(oFriend) || IsInConversation(oFriend))
{
if(d2() == 1)
{
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.75);
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.75));
}
else
{
ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED, 1.0, 5.0);
}
}
else
{
if(GetIsObjectValid(oFriend) && GetDistanceToObject(oFriend) <= 3.0)
{
nRoll = d4();
vFrnd = GetPosition(oFriend);
SetFacingPoint(vFrnd);
ClearAllActions();
if(nRoll == 1)
{
ActionPlayAnimation(ANIMATION_LOOPING_TALK_NORMAL, 1.0, 6.0);
}
else if(nRoll == 2)
{
ActionPlayAnimation(ANIMATION_LOOPING_LISTEN, 1.0, 5.0);
}
else if(nRoll == 3)
{
ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING, 1.0, 6.0);
}
else
{
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.75);
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.75));
}
}
}
}
break;
}
case (3):// AMBIENT_ANIMATIONS_AVIAN
{
/*
Uses some wierd things, sadly. Normally, moving away from friend.
*/
nRoll = d4();
location lFriend;
if(GetIsObjectValid(oFriend))
{
lFriend = GetLocation(oFriend);
}
else
{
lFriend = GetLocation(OBJECT_SELF);
}
if(nRoll < 4)
{
ClearAllActions();
ActionMoveAwayFromObject(oFriend, TRUE, 100.0);
}
else
{
// wierd one...
ClearAllActions();
effect eBird = EffectDisappearAppear(lFriend);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBird, OBJECT_SELF, 4.0);
ActionMoveAwayFromObject(oFriend, TRUE, 100.0);
}
break;
}
case (4):// AMBIENT_GROUP_ANIMATIONS
{
/*
This will group creatures, if spaced out, for talking and sitting.
*/
int iRace = GetRacialType(OBJECT_SELF);
if(GetIsPlayableRacialType(OBJECT_SELF) || iRace == RACIAL_TYPE_HUMANOID_GOBLINOID ||
iRace == RACIAL_TYPE_HUMANOID_REPTILIAN || iRace == RACIAL_TYPE_HUMANOID_ORC)
{
if(!GetIsObjectValid(oFriend) || GetIsPC(oFriend) || GetIsDM(oFriend) || IsInConversation(oFriend))
{
if(d2() == 1)
{
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.75);
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.75));
}
else
{
ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED, 1.0, 5.0);
}
}
else
{
if(GetIsObjectValid(oFriend) && GetDistanceToObject(oFriend) <= 20.0)
{
if(GetDistanceToObject(oFriend) > 4.0)
{
ClearAllActions();
ActionMoveToObject(oFriend);
}
else
{
nRoll = d10();
vFrnd = GetPosition(oFriend);
SetFacingPoint(vFrnd);
ClearAllActions();
if(nRoll <= 3)
{
ActionPlayAnimation(ANIMATION_LOOPING_TALK_NORMAL, 1.0, 12.0);
}
else if(nRoll == 2)
{
ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING, 1.0, 12.0);
}
else if(nRoll >= 4)
{
ActionPlayAnimation(ANIMATION_LOOPING_SIT_CROSS, 1.0, 18.0);
}
}
}
}
}
break;
}
case (5):// IMMOBILE_ANIMATIONS_AND_SOLO
{
// These will stay still, perhaps look around, drink, or listen.
int iRace = GetRacialType(OBJECT_SELF);
if(GetIsPlayableRacialType(OBJECT_SELF) || iRace == RACIAL_TYPE_HUMANOID_GOBLINOID ||
iRace == RACIAL_TYPE_HUMANOID_REPTILIAN || iRace == RACIAL_TYPE_HUMANOID_ORC)
{
ClearAllActions();
nRoll = d8();
if(nRoll <= 2)
{
ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 0.75);
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 0.75));
}
else if(nRoll == 3)
{
ActionPlayAnimation(ANIMATION_FIREFORGET_DRINK);
}
else if(nRoll == 4)
{
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED);
}
else if(nRoll >= 5)
{
ActionPlayAnimation(ANIMATION_LOOPING_LISTEN, 1.0, 5.5);
}
}
break;
}
case (6):// AMBIENT_ANIMAL_WALKING
{
// If there is a person, we will run away.
if(d2() == 1 && GetIsObjectValid(oFriend))
{
ClearAllActions();
ActionMoveAwayFromObject(oFriend, TRUE, 50.0);
}
else
{
// Else random walk if no people
ClearAllActions();
ActionRandomWalk();
}
break;
}
}// End switch
}
//::///////////////////////////////////////////////
//:: Equip Appropriate Weapons
//:://////////////////////////////////////////////
/*
This will use the set weapons, especially good
for deul wielding and ranged weapon choosing, and shields!
*/
//:://////////////////////////////////////////////
void EquipAppropriateWeapons(object oTarget)
{
object oRanged = GetLocalObject(OBJECT_SELF, "DW_RANGED");
int iRanged = GetIsObjectValid(oRanged);
if(iRanged && GetItemPossessor(oRanged) != OBJECT_SELF)
{
DeleteLocalObject(OBJECT_SELF, "DW_RANGED");
iRanged = FALSE;
}
object oRight = (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND));
if(GetDistanceToObject(oTarget) > 3.0 && iRanged && (oRight != oRanged) && GetIsObjectValid(oTarget))
{
ActionEquipItem(oRanged, INVENTORY_SLOT_RIGHTHAND);
}
else if(GetDistanceToObject(oTarget) <= 3.0 || !GetIsObjectValid(oTarget) || !iRanged)
{
object oPrimary = GetLocalObject(OBJECT_SELF, "DW_PRIMARY");
int iPrimary = GetIsObjectValid(oPrimary);
if(iPrimary && GetItemPossessor(oPrimary) != OBJECT_SELF)
{
DeleteLocalObject(OBJECT_SELF, "DW_PRIMARY");
iPrimary = FALSE;
}
object oSecondary = GetLocalObject(OBJECT_SELF, "DW_SECONDARY");
int iSecondary = GetIsObjectValid(oSecondary);
if(iPrimary && GetItemPossessor(oSecondary) != OBJECT_SELF)
{
DeleteLocalObject(OBJECT_SELF, "DW_SECONDARY");
iSecondary = FALSE;
}
object oShield = GetLocalObject(OBJECT_SELF, "DW_SHIELD");
int iShield = GetIsObjectValid(oShield);
if(iPrimary && GetItemPossessor(oShield) != OBJECT_SELF)
{
DeleteLocalObject(OBJECT_SELF, "DW_SHIELD");
iShield = FALSE;
}
object oTwoHanded = GetLocalObject(OBJECT_SELF, "DW_TWO_HANDED");
int iTwoHanded = GetIsObjectValid(oTwoHanded);
if(iTwoHanded && GetItemPossessor(oTwoHanded) != OBJECT_SELF)
{
DeleteLocalObject(OBJECT_SELF, "DW_TWO_HANDED");
iTwoHanded = FALSE;
}
object oLeft = (GetItemInSlot(INVENTORY_SLOT_LEFTHAND));
// Complete change - it will check the slots, if not eqip, then do so.
if(iPrimary && (oRight != oPrimary))
{
ActionEquipItem(oPrimary, INVENTORY_SLOT_RIGHTHAND);
}
if(iSecondary && (oLeft != oSecondary))
{
ActionEquipItem(oSecondary, INVENTORY_SLOT_LEFTHAND);
}
else if(!iSecondary && iShield && (oLeft != oShield))
{
ActionEquipItem(oShield, INVENTORY_SLOT_LEFTHAND);
}
if(!iPrimary && iTwoHanded && (oRight != oTwoHanded))
{
ActionEquipItem(oTwoHanded, INVENTORY_SLOT_RIGHTHAND);
}
// If all else fails...TRY most damaging melee weapon.
if(!iPrimary && !iTwoHanded)
ActionEquipMostDamagingMelee(oTarget, TRUE);
}
}
// FAST BUFF SELF
int TalentAdvancedBuff(float fDistance)
{
object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
if(GetIsObjectValid(oEnemy))
{
if(GetDistanceToObject(oEnemy) <= fDistance)
{
if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget()))
{
ClearAllActions();
SpeakString("[AI] " + GetName(OBJECT_SELF) + " [AREA] " + GetName(GetArea(OBJECT_SELF)) + " [Action] Fast Buffing", TALKVOLUME_SILENT_TALK);
WriteTimestampedLogEntry("[AI] " + GetName(OBJECT_SELF) + " [AREA] " + GetName(GetArea(OBJECT_SELF)) + " [Action] Fast Buffing");
//Combat Protections
if(GetHasSpell(SPELL_PREMONITION))
{ActionCastSpellAtObject(SPELL_PREMONITION, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_GREATER_STONESKIN))
{ActionCastSpellAtObject(SPELL_GREATER_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, 0, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_STONESKIN))
{ActionCastSpellAtObject(SPELL_STONESKIN, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
//Visage Protections
if(GetHasSpell(SPELL_SHADOW_SHIELD))
{ActionCastSpellAtObject(SPELL_SHADOW_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_ETHEREAL_VISAGE))
{ActionCastSpellAtObject(SPELL_ETHEREAL_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_GHOSTLY_VISAGE))
{ActionCastSpellAtObject(SPELL_GHOSTLY_VISAGE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
//Mantle Protections
if(GetHasSpell(SPELL_GREATER_SPELL_MANTLE))
{ActionCastSpellAtObject(SPELL_GREATER_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SPELL_MANTLE))
{ActionCastSpellAtObject(SPELL_SPELL_MANTLE, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_LESSER_SPELL_BREACH))
{ActionCastSpellAtObject(SPELL_LESSER_SPELL_BREACH, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
// Globes
if(GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY))
{ActionCastSpellAtObject(SPELL_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY))
{ActionCastSpellAtObject(SPELL_MINOR_GLOBE_OF_INVULNERABILITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
//Misc Protections
if(GetHasSpell(SPELL_ELEMENTAL_SHIELD))
{ActionCastSpellAtObject(SPELL_ELEMENTAL_SHIELD, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
//Elemental Protections
if(GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS))
{ActionCastSpellAtObject(SPELL_PROTECTION_FROM_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_RESIST_ELEMENTS))
{ActionCastSpellAtObject(SPELL_RESIST_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_ENDURE_ELEMENTS))
{ActionCastSpellAtObject(SPELL_ENDURE_ELEMENTS, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
//Mental Protections
if(GetHasSpell(SPELL_MIND_BLANK))
{ActionCastSpellAtObject(SPELL_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_LESSER_MIND_BLANK))
{ActionCastSpellAtObject(SPELL_LESSER_MIND_BLANK, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_CLARITY))
{ActionCastSpellAtObject(SPELL_CLARITY, OBJECT_SELF, METAMAGIC_NONE, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
//Summon Ally
if(GetHasSpell(SPELL_SUMMON_CREATURE_IX))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IX, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VIII))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VIII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VII))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VII, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_VI))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_VI, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_V))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_V, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_IV))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_IV, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_III))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_III, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_II))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_II, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
else if(GetHasSpell(SPELL_SUMMON_CREATURE_I))
{ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_I, GetLocation(OBJECT_SELF), METAMAGIC_NONE, FALSE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);}
EquipAppropriateWeapons(oEnemy);
return TRUE;
}
}
}
return FALSE;
}