2224 lines
200 KiB
Plaintext
2224 lines
200 KiB
Plaintext
////////////////////////////////////////////////////////////////////////////////
|
|
// cai_inc_hos - Combat AI Include for Harvest of Souls
|
|
// By Deva Bryson Winblood. 11/2004
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
#include "prc_inc_racial"
|
|
|
|
//////////////////////////////////////
|
|
// CONSTANTS
|
|
//////////////////////////////////////
|
|
const int CAI_WEAPON_MELEE = 1;
|
|
const int CAI_WEAPON_RANGED = 2;
|
|
const int CAI_WEAPON_NONE = 0;
|
|
const int CAI_WEAPON_CREATURE = 3;
|
|
const int CAI_CHARM_NONE = 0;
|
|
const int CAI_CHARM_PERSON = 1;
|
|
const int CAI_CHARM_MONSTER = 2;
|
|
const int CAI_CHARM_ANIMAL = 3;
|
|
|
|
/////////////////////////////////////
|
|
// PROTOTYPES
|
|
/////////////////////////////////////
|
|
|
|
// GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE
|
|
|
|
// FUNCTION: caiGetHasAmmo()
|
|
// Returns TRUE is the NPC has ammo for their ranged weapon
|
|
void caiGetHasAmmo(object oNPC);
|
|
|
|
// FUNCTION: caiGetEquippedWeaponType()
|
|
// Returns the weapon type that the NPC currently is wielding in specified
|
|
// hand.
|
|
int caiGetEquippedWeaponType(object oNPC,int nInventorySlot);
|
|
|
|
// FUNCTION: caiGetNearbyWounded()
|
|
// Returns a nearby ally that has been wounded the specified amount
|
|
// within the specified distance. If bDEAD is set to TRUE it will
|
|
// return nearby allies that are dead also.
|
|
object caiGetNearbyWounded(object oNPC,float fDistance,int nWoundedPercent,int bDEAD=FALSE);
|
|
|
|
// FUNCTION: caiGetNearbyEnemyCleric()
|
|
// Returns the nearest enemy cleric within specified distance.
|
|
object caiGetNearbyEnemyCleric(object oNPC,float fDistance);
|
|
|
|
// FUNCTION: caiGetNearbyEnemyRanged()
|
|
// Returns the nearest enemy that has ranged weapons equipped.
|
|
object caiGetNearbyEnemyRanged(object oNPC,float fDistance);
|
|
|
|
// FUNCTION: caiGetNearbyEnemyCaster()
|
|
// Returns the nearest enemy that has spell casting abilities.
|
|
object caiGetNearbyEnemyCaster(object oNPC,float fDistance);
|
|
|
|
// FUNCTION: caiGetNearbyEnemyNearestDeath()
|
|
// Returns the nearest enemy that is closest to death.
|
|
object caiGetNearbyEnemyNearestDeath(object oNPC,float fDistance);
|
|
|
|
// FUNCTION: caiGetAvailableHeal()
|
|
// Returns the best fit for healing the amount of damage specified that is
|
|
// available to this NPC.
|
|
int caiGetAvailableHeal(object oNPC,int nDamageAmount,int bMUSTHEAL=FALSE);
|
|
|
|
// FUNCTION: caiGetAvailableBuff()
|
|
// Returns the best fit for a buff spell that is available to be applied to
|
|
// the specified target.
|
|
int caiGetAvailableBuff(object oNPC,object oTarget);
|
|
|
|
// FUNCTION: caiGetAvailableCombatSpell()
|
|
// Returns the best fit for a combat spell that is available to be applied
|
|
// against the specified target.
|
|
int caiGetAvailableCombatSpell(object oNPC,object oTarget);
|
|
|
|
// FUNCTION: caiGetAvailableDefensiveSpell()
|
|
// Returns the best fit for a defensive spell that is available to be applied
|
|
// to the specified target.
|
|
int caiGetAvailableDefensiveSpell(object oNPC,object oTarget);
|
|
|
|
// FUNCTION: caiGetWeaponType()
|
|
// Returns the item type of the weapon
|
|
int caiGetWeaponType(object oItem);
|
|
|
|
// FUNCTION: caiRestSentinel()
|
|
// Handles making the NPC be able to rest every eight hours
|
|
void caiRestSentinel(object oNPC);
|
|
|
|
// FUNCTION: caiGetAvailableSummonSpell()
|
|
// Returns a summon spell to use based on target
|
|
int caiGetAvailableSummonSpell(object oNPC);
|
|
|
|
// FUNCTION: caiGetIsCleric()
|
|
// returns TRUE if this NPC has any levels as cleric
|
|
int caiGetIsCleric(object oNPC);
|
|
|
|
// FUNCTION: caiGetIsArcane()
|
|
// returns TRUE if this NPC has any wizard or sorcerer levels
|
|
int caiGetIsArcane(object oNPC);
|
|
|
|
// FUNCTION: caiGetAvailableHealPC()
|
|
// This function will check for raise dead, stone to flesh, restoration, and
|
|
// heal opportunities on a PC.
|
|
int caiGetAvailableHealPC(object oNPC,object oTarget);
|
|
|
|
/////////////////////////////////////
|
|
// FUNCTIONS
|
|
/////////////////////////////////////
|
|
|
|
int caiGetIsCleric(object oNPC)
|
|
{ // PURPOSE: return TRUE if cleric
|
|
int nC=GetClassByPosition(1,oNPC);
|
|
if (nC==CLASS_TYPE_CLERIC||nC==CLASS_TYPE_DRUID) return TRUE;
|
|
nC=GetClassByPosition(2,oNPC);
|
|
if (nC==CLASS_TYPE_CLERIC||nC==CLASS_TYPE_DRUID) return TRUE;
|
|
nC=GetClassByPosition(3,oNPC);
|
|
if (nC==CLASS_TYPE_CLERIC||nC==CLASS_TYPE_DRUID) return TRUE;
|
|
return FALSE;
|
|
} // caiGetIsCleric()
|
|
|
|
int caiGetIsArcane(object oNPC)
|
|
{ // PURPOSE: return TRUE if wizard or sorcerer
|
|
int nC=GetClassByPosition(1,oNPC);
|
|
if (nC==CLASS_TYPE_WIZARD||nC==CLASS_TYPE_SORCERER||nC==CLASS_TYPE_BARD) return TRUE;
|
|
nC=GetClassByPosition(2,oNPC);
|
|
if (nC==CLASS_TYPE_WIZARD||nC==CLASS_TYPE_SORCERER||nC==CLASS_TYPE_BARD) return TRUE;
|
|
nC=GetClassByPosition(3,oNPC);
|
|
if (nC==CLASS_TYPE_WIZARD||nC==CLASS_TYPE_SORCERER||nC==CLASS_TYPE_BARD) return TRUE;
|
|
return FALSE;
|
|
} // caiGetIsArcane()
|
|
|
|
int fnGetCurrentTime()
|
|
{ // PURPOSE: return MONTH+DAY+HOUR in hours
|
|
int nRet=GetTimeHour()+(GetCalendarDay()*24)+(GetCalendarMonth()*24*30);
|
|
return nRet;
|
|
} // fnGetCurrentTime()
|
|
|
|
void caiRestSentinel(object oNPC)
|
|
{ // PURPOSE: To handle resting every eight hours
|
|
int nLT=GetLocalInt(oNPC,"nCAILastRestHour");
|
|
if (nLT==0||fnGetCurrentTime()-nLT>23)
|
|
{ // enough time has passed to rest
|
|
if (GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,oNPC,1,CREATURE_TYPE_IS_ALIVE,TRUE)==OBJECT_INVALID)
|
|
{ // okay to rest
|
|
DeleteLocalInt(oNPC,"bCAIRESTSENTINEL");
|
|
AssignCommand(oNPC,ClearAllActions(TRUE));
|
|
AssignCommand(oNPC,ActionRest());
|
|
SetLocalInt(oNPC,"nCAILastRestHour",fnGetCurrentTime());
|
|
} // okay to rest
|
|
else { DelayCommand(HoursToSeconds(1),caiRestSentinel(oNPC)); }
|
|
} // enough time has passed to rest
|
|
else { DelayCommand(HoursToSeconds(1),caiRestSentinel(oNPC)); }
|
|
} // caiRestSentinel()
|
|
|
|
int caiGetWeaponType(object oItem)
|
|
{ // PURPOSE: Get the weapon type
|
|
int nRet=CAI_WEAPON_NONE;
|
|
int nBT=GetBaseItemType(oItem);
|
|
switch(nBT)
|
|
{
|
|
case BASE_ITEM_BASTARDSWORD:
|
|
case BASE_ITEM_BATTLEAXE:
|
|
case BASE_ITEM_CLUB:
|
|
case BASE_ITEM_DAGGER:
|
|
case BASE_ITEM_DIREMACE:
|
|
case BASE_ITEM_DOUBLEAXE:
|
|
case BASE_ITEM_DWARVENWARAXE:
|
|
case BASE_ITEM_GREATAXE:
|
|
case BASE_ITEM_GREATSWORD:
|
|
case BASE_ITEM_HALBERD:
|
|
case BASE_ITEM_HANDAXE:
|
|
case BASE_ITEM_HEAVYFLAIL:
|
|
case BASE_ITEM_KAMA:
|
|
case BASE_ITEM_KATANA:
|
|
case BASE_ITEM_KUKRI:
|
|
case BASE_ITEM_LIGHTFLAIL:
|
|
case BASE_ITEM_LIGHTHAMMER:
|
|
case BASE_ITEM_LIGHTMACE:
|
|
case BASE_ITEM_LONGSWORD:
|
|
case BASE_ITEM_MORNINGSTAR:
|
|
case BASE_ITEM_MAGICSTAFF:
|
|
case BASE_ITEM_MAGICROD:
|
|
case BASE_ITEM_QUARTERSTAFF:
|
|
case BASE_ITEM_RAPIER:
|
|
case BASE_ITEM_SCIMITAR:
|
|
case BASE_ITEM_SCYTHE:
|
|
case BASE_ITEM_SHORTSPEAR:
|
|
case BASE_ITEM_SHORTSWORD:
|
|
case BASE_ITEM_SICKLE:
|
|
case BASE_ITEM_TWOBLADEDSWORD:
|
|
case BASE_ITEM_WARHAMMER:
|
|
case BASE_ITEM_WHIP:
|
|
{ nRet=CAI_WEAPON_MELEE; break; }
|
|
case BASE_ITEM_DART:
|
|
case BASE_ITEM_GRENADE:
|
|
case BASE_ITEM_HEAVYCROSSBOW:
|
|
case BASE_ITEM_LIGHTCROSSBOW:
|
|
case BASE_ITEM_LONGBOW:
|
|
case BASE_ITEM_SHORTBOW:
|
|
case BASE_ITEM_SHURIKEN:
|
|
case BASE_ITEM_SLING:
|
|
case BASE_ITEM_THROWINGAXE: {
|
|
nRet=CAI_WEAPON_RANGED; break; }
|
|
case BASE_ITEM_CBLUDGWEAPON:
|
|
case BASE_ITEM_CPIERCWEAPON:
|
|
case BASE_ITEM_CREATUREITEM:
|
|
case BASE_ITEM_CSLASHWEAPON:
|
|
case BASE_ITEM_CSLSHPRCWEAP:
|
|
{ nRet=CAI_WEAPON_CREATURE; break; }
|
|
default: { break;}
|
|
}
|
|
return nRet;
|
|
} // caiGetWeaponType()
|
|
|
|
int caiGetEquippedWeaponType(object oNPC,int nInventorySlot)
|
|
{ // PURPOSE: Determine type of weapon equipped
|
|
int nRet=CAI_WEAPON_NONE;
|
|
object oItem=GetItemInSlot(nInventorySlot,oNPC);
|
|
int nBT;
|
|
if (GetIsObjectValid(oItem))
|
|
{ // has an item in that slot
|
|
nRet=caiGetWeaponType(oItem);
|
|
} // has an item in that slot
|
|
else
|
|
{ // check for creature weapons
|
|
oItem=GetItemInSlot(INVENTORY_SLOT_CWEAPON_R,oNPC);
|
|
if (GetIsObjectValid(oItem)) nRet=CAI_WEAPON_CREATURE;
|
|
oItem=GetItemInSlot(INVENTORY_SLOT_CWEAPON_L,oNPC);
|
|
if (GetIsObjectValid(oItem)) nRet=CAI_WEAPON_CREATURE;
|
|
oItem=GetItemInSlot(INVENTORY_SLOT_CWEAPON_B,oNPC);
|
|
if (GetIsObjectValid(oItem)) nRet=CAI_WEAPON_CREATURE;
|
|
} // check for creature weapons
|
|
return nRet;
|
|
} //caiGetEquippedWeaponType()
|
|
|
|
int caiGetHasNegativeEffects(object oTarget)
|
|
{ // PURPOSE: return TRUE if the target has negative effects
|
|
effect eE=GetFirstEffect(oTarget);
|
|
int nET;
|
|
while(GetIsEffectValid(eE))
|
|
{ // check each effect
|
|
nET=GetEffectType(eE);
|
|
switch(nET)
|
|
{
|
|
case EFFECT_TYPE_BLINDNESS:
|
|
case EFFECT_TYPE_CONFUSED:
|
|
case EFFECT_TYPE_CURSE:
|
|
case EFFECT_TYPE_DAMAGE_DECREASE:
|
|
case EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE:
|
|
case EFFECT_TYPE_DAZED:
|
|
case EFFECT_TYPE_DEAF:
|
|
case EFFECT_TYPE_DISEASE:
|
|
case EFFECT_TYPE_FRIGHTENED:
|
|
case EFFECT_TYPE_MOVEMENT_SPEED_DECREASE:
|
|
case EFFECT_TYPE_NEGATIVELEVEL:
|
|
case EFFECT_TYPE_PARALYZE:
|
|
case EFFECT_TYPE_POISON:
|
|
case EFFECT_TYPE_SILENCE:
|
|
case EFFECT_TYPE_SKILL_DECREASE:
|
|
case EFFECT_TYPE_SPELL_RESISTANCE_DECREASE:
|
|
case EFFECT_TYPE_STUNNED:
|
|
case EFFECT_TYPE_TURN_RESISTANCE_DECREASE:
|
|
case EFFECT_TYPE_ABILITY_DECREASE:
|
|
case EFFECT_TYPE_AC_DECREASE:
|
|
case EFFECT_TYPE_ATTACK_DECREASE: { return TRUE; break; }
|
|
default: break;
|
|
}
|
|
eE=GetNextEffect(oTarget);
|
|
} // check each effect
|
|
return FALSE;
|
|
} // caiGetHasNegativeEffects();
|
|
|
|
int fnIsPetrified(object oTarget)
|
|
{ // PURPOSE: return if the target is petrified
|
|
effect eE=GetFirstEffect(oTarget);
|
|
int nET;
|
|
while(GetIsEffectValid(eE))
|
|
{ // check each effect
|
|
nET=GetEffectType(eE);
|
|
switch(nET)
|
|
{
|
|
case EFFECT_TYPE_PETRIFY: { return TRUE; break; }
|
|
default: break;
|
|
}
|
|
eE=GetNextEffect(oTarget);
|
|
} // check each effect
|
|
return FALSE;
|
|
} // fnIsPetrified()
|
|
|
|
int caiGetAvailableHealPC(object oNPC,object oTarget)
|
|
{ // PURPOSE: return a useful to spell to help with target PC
|
|
int nDMG=GetMaxHitPoints(oTarget)-GetCurrentHitPoints(oTarget);
|
|
int bHasNegativeEffects=caiGetHasNegativeEffects(oTarget);
|
|
if ((GetHasSpellEffect(SPELL_FLESH_TO_STONE,oTarget)||fnIsPetrified(oTarget))&&GetHasSpell(SPELL_STONE_TO_FLESH,oNPC)>0) return SPELL_STONE_TO_FLESH;
|
|
else if (GetIsDead(oTarget)&&GetHasSpell(SPELL_RESURRECTION,oNPC)>0) return SPELL_RESURRECTION;
|
|
else if (GetIsDead(oTarget)&&GetHasSpell(SPELL_RAISE_DEAD,oNPC)>0) return SPELL_RAISE_DEAD;
|
|
else if (GetHasSpellEffect(SPELL_BESTOW_CURSE,oTarget)&&GetHasSpell(SPELL_REMOVE_CURSE,oNPC)>0) return SPELL_REMOVE_CURSE;
|
|
else if (GetHasSpellEffect(SPELL_CONTAGION,oTarget)&&GetHasSpell(SPELL_REMOVE_DISEASE,oNPC)>0) return SPELL_REMOVE_DISEASE;
|
|
else if ((GetHasSpellEffect(SPELL_BLINDNESS_AND_DEAFNESS,oTarget)||GetHasSpellEffect(SPELL_MASS_BLINDNESS_AND_DEAFNESS,oTarget))&&GetHasSpell(SPELL_REMOVE_BLINDNESS_AND_DEAFNESS,oNPC)>0) return SPELL_REMOVE_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpellEffect(SPELL_FEAR,oTarget)&&GetHasSpell(SPELL_REMOVE_FEAR,oNPC)>0) return SPELL_REMOVE_FEAR;
|
|
else if (GetHasSpellEffect(SPELL_HOLD_PERSON,oTarget)&&GetHasSpell(SPELL_REMOVE_PARALYSIS,oNPC)>0) return SPELL_REMOVE_PARALYSIS;
|
|
else if (bHasNegativeEffects&&GetHasSpell(SPELL_GREATER_RESTORATION,oNPC)>0) return SPELL_GREATER_RESTORATION;
|
|
else if (bHasNegativeEffects&&GetHasSpell(SPELL_RESTORATION,oNPC)>0) return SPELL_RESTORATION;
|
|
else if (bHasNegativeEffects&&GetHasSpell(SPELL_LESSER_RESTORATION,oNPC)>0) return SPELL_LESSER_RESTORATION;
|
|
else if (nDMG>0) return caiGetAvailableHeal(oNPC,nDMG);
|
|
return 0;
|
|
} // caiGetAvailableHealPC()
|
|
|
|
int caiGetAvailableHeal(object oNPC,int nDamageAmount,int bMUSTHEAL=FALSE)
|
|
{ // PURPOSE: Determine best healing spell available for given damage
|
|
int nRet=0;
|
|
if (nDamageAmount<4)
|
|
{ // minor
|
|
if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
if (bMUSTHEAL)
|
|
{ // need a heal spell
|
|
if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oNPC)>0) return SPELL_REGENERATE;
|
|
} // need a heal spell
|
|
} // minor
|
|
else if (nDamageAmount<9)
|
|
{ // light
|
|
if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
if (bMUSTHEAL)
|
|
{ // need a heal spell
|
|
if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oNPC)>0) return SPELL_REGENERATE;
|
|
} // need a heal spell
|
|
} // light
|
|
else if (nDamageAmount<16)
|
|
{ // moderate
|
|
if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
if (bMUSTHEAL)
|
|
{ // need a heal spell
|
|
if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oNPC)>0) return SPELL_REGENERATE;
|
|
} // need a heal spell
|
|
} // moderate
|
|
else if (nDamageAmount<31)
|
|
{ // serious
|
|
if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
if (bMUSTHEAL)
|
|
{ // need a heal spell
|
|
if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oNPC)>0) return SPELL_REGENERATE;
|
|
} // need a heal spell
|
|
} // serious
|
|
else if (nDamageAmount<51)
|
|
{ // critical
|
|
if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
if (bMUSTHEAL)
|
|
{ // need a heal spell
|
|
if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oNPC)>0) return SPELL_REGENERATE;
|
|
} // need a heal spell
|
|
} // critical
|
|
else
|
|
{ // heal
|
|
if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
if (bMUSTHEAL)
|
|
{ // need a heal spell
|
|
if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oNPC)>0) return SPELL_REGENERATE;
|
|
} // need a heal spell
|
|
} // heal
|
|
return nRet;
|
|
} // caiGetAvailableHeal()
|
|
|
|
int caiGetAvailableBuff(object oNPC,object oTarget)
|
|
{ // PURPOSE: Look for buff spells
|
|
int nRet=0;
|
|
float fCR=GetChallengeRating(oTarget);
|
|
if (GetIsPC(oTarget)) fCR=IntToFloat(GetLevelByPosition(1,oTarget)+GetLevelByPosition(2,oTarget)+GetLevelByPosition(3,oTarget));
|
|
if (fCR<2.0)
|
|
{ // lesser buffs
|
|
if(MyPRCGetRacialType(oTarget)==RACIAL_TYPE_UNDEAD)
|
|
{ // undead target
|
|
if (GetHasSpell(SPELL_STONE_BONES,oNPC)>0&&GetHasSpellEffect(SPELL_STONE_BONES,oTarget)==FALSE) return SPELL_STONE_BONES;
|
|
else if (GetHasSpell(SPELL_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
} // undead target
|
|
else
|
|
{ // not undead
|
|
if (GetHasSpell(SPELL_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oNPC)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oTarget)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_ENDURANCE,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURANCE,oTarget)==FALSE) return SPELL_ENDURANCE;
|
|
else if (GetHasSpell(SPELL_BLESS,oNPC)>0&&GetHasSpellEffect(SPELL_BLESS,oTarget)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_AID,oNPC)>0&&GetHasSpellEffect(SPELL_AID,oTarget)==FALSE) return SPELL_AID;
|
|
} // not undead
|
|
} // lesser buffs
|
|
else if (fCR<10.0)
|
|
{ // medium buffs
|
|
if(MyPRCGetRacialType(oTarget)==RACIAL_TYPE_UNDEAD)
|
|
{ // undead target
|
|
if (GetHasSpell(SPELL_STONE_BONES,oNPC)>0&&GetHasSpellEffect(SPELL_STONE_BONES,oTarget)==FALSE) return SPELL_STONE_BONES;
|
|
else if (GetHasSpell(SPELL_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oNPC)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oTarget)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_ENDURANCE,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURANCE,oTarget)==FALSE) return SPELL_ENDURANCE;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oTarget)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_FLAME_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_FLAME_WEAPON,oTarget)==FALSE) return SPELL_FLAME_WEAPON;
|
|
else if (GetHasSpell(SPELL_HASTE,oNPC)>0&&GetHasSpellEffect(SPELL_HASTE,oTarget)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oTarget)==FALSE) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_STONESKIN,oTarget)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_UNHOLY_AURA,oNPC)>0&&GetHasSpellEffect(SPELL_UNHOLY_AURA,oTarget)==FALSE) return SPELL_UNHOLY_AURA;
|
|
} // undead target
|
|
else
|
|
{ // not undead
|
|
if (GetHasSpell(SPELL_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oNPC)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oTarget)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_ENDURANCE,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURANCE,oTarget)==FALSE) return SPELL_ENDURANCE;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oTarget)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_FLAME_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_FLAME_WEAPON,oTarget)==FALSE) return SPELL_FLAME_WEAPON;
|
|
else if (GetHasSpell(SPELL_HASTE,oNPC)>0&&GetHasSpellEffect(SPELL_HASTE,oTarget)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oTarget)==FALSE) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_STONESKIN,oTarget)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_UNHOLY_AURA,oNPC)>0&&GetHasSpellEffect(SPELL_UNHOLY_AURA,oTarget)==FALSE) return SPELL_UNHOLY_AURA;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oTarget)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_GREATER_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_GREATER_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_GREATER_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_GREATER_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_FOXS_CUNNING,oNPC)>0&&GetHasSpellEffect(SPELL_FOXS_CUNNING,oTarget)==FALSE) return SPELL_FOXS_CUNNING;
|
|
else if (GetHasSpell(SPELL_EAGLE_SPLEDOR,oNPC)>0&&GetHasSpellEffect(SPELL_EAGLE_SPLEDOR,oTarget)==FALSE) return SPELL_EAGLE_SPLEDOR;
|
|
else if (GetHasSpell(SPELL_BLESS,oNPC)>0&&GetHasSpellEffect(SPELL_BLESS,oTarget)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_BLESS_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_BLESS_WEAPON,oTarget)==FALSE) return SPELL_BLESS_WEAPON;
|
|
else if (GetHasSpell(SPELL_AID,oNPC)>0&&GetHasSpellEffect(SPELL_AID,oTarget)==FALSE) return SPELL_AID;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oTarget)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
} // not undead
|
|
} // medium buffs
|
|
else
|
|
{ // big buffs
|
|
if(MyPRCGetRacialType(oTarget)==RACIAL_TYPE_UNDEAD)
|
|
{ // undead target
|
|
if (GetHasSpell(SPELL_STONE_BONES,oNPC)>0&&GetHasSpellEffect(SPELL_STONE_BONES,oTarget)==FALSE) return SPELL_STONE_BONES;
|
|
else if (GetHasSpell(SPELL_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oNPC)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oTarget)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_ENDURANCE,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURANCE,oTarget)==FALSE) return SPELL_ENDURANCE;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oTarget)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_FLAME_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_FLAME_WEAPON,oTarget)==FALSE) return SPELL_FLAME_WEAPON;
|
|
else if (GetHasSpell(SPELL_HASTE,oNPC)>0&&GetHasSpellEffect(SPELL_HASTE,oTarget)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oTarget)==FALSE) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_STONESKIN,oTarget)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_UNHOLY_AURA,oNPC)>0&&GetHasSpellEffect(SPELL_UNHOLY_AURA,oTarget)==FALSE) return SPELL_UNHOLY_AURA;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oTarget)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_GREATER_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_GREATER_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_GREATER_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_GREATER_BULLS_STRENGTH;
|
|
} // undead target
|
|
else
|
|
{ // not undead
|
|
if (GetHasSpell(SPELL_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oNPC)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oTarget)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_ENDURANCE,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURANCE,oTarget)==FALSE) return SPELL_ENDURANCE;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oTarget)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_FLAME_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_FLAME_WEAPON,oTarget)==FALSE) return SPELL_FLAME_WEAPON;
|
|
else if (GetHasSpell(SPELL_HASTE,oNPC)>0&&GetHasSpellEffect(SPELL_HASTE,oTarget)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oTarget)==FALSE) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_STONESKIN,oTarget)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_UNHOLY_AURA,oNPC)>0&&GetHasSpellEffect(SPELL_UNHOLY_AURA,oTarget)==FALSE) return SPELL_UNHOLY_AURA;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oTarget)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_GREATER_MAGIC_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_MAGIC_WEAPON,oTarget)==FALSE) return SPELL_GREATER_MAGIC_WEAPON;
|
|
else if (GetHasSpell(SPELL_GREATER_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_BULLS_STRENGTH,oTarget)==FALSE) return SPELL_GREATER_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_FOXS_CUNNING,oNPC)>0&&GetHasSpellEffect(SPELL_FOXS_CUNNING,oTarget)==FALSE) return SPELL_FOXS_CUNNING;
|
|
else if (GetHasSpell(SPELL_EAGLE_SPLEDOR,oNPC)>0&&GetHasSpellEffect(SPELL_EAGLE_SPLEDOR,oTarget)==FALSE) return SPELL_EAGLE_SPLEDOR;
|
|
else if (GetHasSpell(SPELL_BLESS,oNPC)>0&&GetHasSpellEffect(SPELL_BLESS,oTarget)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_BLESS_WEAPON,oNPC)>0&&GetHasSpellEffect(SPELL_BLESS_WEAPON,oTarget)==FALSE) return SPELL_BLESS_WEAPON;
|
|
else if (GetHasSpell(SPELL_AID,oNPC)>0&&GetHasSpellEffect(SPELL_AID,oTarget)==FALSE) return SPELL_AID;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oTarget)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_MASS_HASTE,oNPC)>0&&GetHasSpellEffect(SPELL_MASS_HASTE,oTarget)==FALSE) return SPELL_MASS_HASTE;
|
|
else if (GetHasSpell(SPELL_OWLS_WISDOM,oNPC)>0&&GetHasSpellEffect(SPELL_OWLS_WISDOM,oTarget)==FALSE) return SPELL_OWLS_WISDOM;
|
|
else if (GetHasSpell(SPELL_SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_SPELL_RESISTANCE;
|
|
} // not undead
|
|
} // big buffs
|
|
return nRet;
|
|
} // caiGetAvailableBuff()
|
|
|
|
int fnGetCharmType(object oTarget)
|
|
{ // PURPOSE: find out what type of charm target this is
|
|
int nRT=MyPRCGetRacialType(oTarget);
|
|
switch(nRT)
|
|
{
|
|
case RACIAL_TYPE_ANIMAL: { return CAI_CHARM_ANIMAL; break; }
|
|
case RACIAL_TYPE_DWARF:
|
|
case RACIAL_TYPE_ELF:
|
|
case RACIAL_TYPE_GNOME:
|
|
case RACIAL_TYPE_HALFELF:
|
|
case RACIAL_TYPE_HALFLING:
|
|
case RACIAL_TYPE_HALFORC:
|
|
case RACIAL_TYPE_HUMAN: { return CAI_CHARM_PERSON; break; }
|
|
case RACIAL_TYPE_BEAST:
|
|
case RACIAL_TYPE_DRAGON:
|
|
case RACIAL_TYPE_FEY:
|
|
case RACIAL_TYPE_GIANT:
|
|
case RACIAL_TYPE_HUMANOID_GOBLINOID:
|
|
case RACIAL_TYPE_HUMANOID_MONSTROUS:
|
|
case RACIAL_TYPE_HUMANOID_ORC:
|
|
case RACIAL_TYPE_HUMANOID_REPTILIAN:
|
|
case RACIAL_TYPE_MAGICAL_BEAST:
|
|
case RACIAL_TYPE_VERMIN: { return CAI_CHARM_MONSTER; break; }
|
|
default: break;
|
|
}
|
|
return CAI_CHARM_NONE;
|
|
} // fnGetCharmType()
|
|
|
|
int fnGetHasSpellDefense(object oTarget)
|
|
{ // PURPOSE: Returns TRUE if the target has spells on them
|
|
effect eE=GetFirstEffect(oTarget);
|
|
int nSID;
|
|
object oC;
|
|
while(GetIsEffectValid(eE))
|
|
{ // check effects
|
|
nSID=GetEffectSpellId(eE);
|
|
if (nSID!=-1)
|
|
{ // spell found
|
|
oC=GetEffectCreator(eE);
|
|
if (oC==oTarget||GetIsFriend(oC)) return TRUE;
|
|
} // spell found
|
|
eE=GetNextEffect(oTarget);
|
|
} // check effects
|
|
return FALSE;
|
|
} // fnGetHasSpellDefense()
|
|
|
|
int caiGetAvailableCombatSpell(object oNPC,object oTarget)
|
|
{ // PURPOSE RETURN: Combat spell
|
|
int nRT=MyPRCGetRacialType(oTarget);
|
|
float fCR=GetChallengeRating(oTarget);
|
|
int bGroup=FALSE;
|
|
int bAlliesNear=FALSE;
|
|
int nCT=fnGetCharmType(oTarget);
|
|
object oMe=oNPC;
|
|
object oOb=GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,oTarget,1,CREATURE_TYPE_IS_ALIVE,TRUE);
|
|
int bSC=GetLocalInt(oNPC,"bCAISPELLCASTERS");
|
|
float fD=GetDistanceBetween(oNPC,oTarget);
|
|
if (GetIsObjectValid(oOb))
|
|
{ // check to see if friends too close for area effect
|
|
if(GetDistanceBetween(oTarget,oOb)<10.0) bAlliesNear=TRUE;
|
|
} // check to see if friends too close for area effect
|
|
oOb=GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_FRIEND,oTarget,1,CREATURE_TYPE_IS_ALIVE,TRUE);
|
|
if (GetIsObjectValid(oOb))
|
|
{ // check to see if the enemy is in a group
|
|
if (GetDistanceBetween(oTarget,oOb)<6.1) bGroup=TRUE;
|
|
} // check to see if the enemy is in a group
|
|
if (GetIsPC(oTarget))
|
|
{ // PC
|
|
if (GetLocalInt(oTarget,"nIsVampire")==TRUE) nRT=RACIAL_TYPE_UNDEAD;
|
|
fCR=IntToFloat(GetLevelByPosition(1,oTarget)+GetLevelByPosition(2,oTarget)+GetLevelByPosition(3,oTarget));
|
|
} // PC
|
|
if (GetDistanceBetween(oNPC,oTarget)<10.0) bAlliesNear=TRUE;
|
|
if (fnGetHasSpellDefense(oTarget)&&d100()<26)
|
|
{ // dispelling magic
|
|
if (GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION,oNPC)>0&&d4()<3) return SPELL_MORDENKAINENS_DISJUNCTION;
|
|
else if (GetHasSpell(SPELL_GREATER_SPELL_BREACH,oNPC)>0&&d4()<3) return SPELL_GREATER_SPELL_BREACH;
|
|
else if (GetHasSpell(SPELL_GREATER_DISPELLING,oNPC)>0) return SPELL_GREATER_DISPELLING;
|
|
else if (GetHasSpell(SPELL_LESSER_SPELL_BREACH,oNPC)>0) return SPELL_LESSER_SPELL_BREACH;
|
|
else if (GetHasSpell(SPELL_DISPEL_MAGIC,oNPC)>0) return SPELL_DISPEL_MAGIC;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY_PURGE,oNPC)>0&&d4()<3) return SPELL_INVISIBILITY_PURGE;
|
|
else if (GetHasSpell(SPELL_LESSER_DISPEL,oNPC)>0) return SPELL_LESSER_DISPEL;
|
|
} // dispelling magic
|
|
if (nRT==RACIAL_TYPE_UNDEAD)
|
|
{ // undead enemies
|
|
if (bGroup==TRUE&&!bAlliesNear)
|
|
{ // okay to do area attack
|
|
if (fCR<6.1)
|
|
{ // low
|
|
if (GetHasSpell(SPELL_SPIKE_GROWTH,oNPC)>0) return SPELL_SPIKE_GROWTH;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_GREASE,oNPC)>0) return SPELL_GREASE;
|
|
else if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // low
|
|
else
|
|
{ // high
|
|
if (GetHasSpell(SPELL_EPIC_HELLBALL,oNPC)>0&&fD>9.9) return SPELL_EPIC_HELLBALL;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_EPIC_RUIN,oNPC)>0&&fD>9.9) return SPELL_EPIC_RUIN;
|
|
else if (GetHasSpell(SPELL_METEOR_SWARM,oNPC)>0&&fD>9.9) return SPELL_METEOR_SWARM;
|
|
else if (GetHasSpell(SPELL_PRISMATIC_SPRAY,oNPC)>0) return SPELL_PRISMATIC_SPRAY;
|
|
else if (GetHasSpell(SPELL_WAIL_OF_THE_BANSHEE,oNPC)>0) return SPELL_WAIL_OF_THE_BANSHEE;
|
|
else if (GetHasSpell(SPELL_SUNBURST,oNPC)>0) return SPELL_SUNBURST;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_STORM_OF_VENGEANCE,oNPC)>0) return SPELL_STORM_OF_VENGEANCE;
|
|
else if (GetHasSpell(SPELL_POWER_WORD_KILL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_POWER_WORD_KILL;
|
|
else if (GetHasSpell(SPELL_MASS_BLINDNESS_AND_DEAFNESS,oNPC)>0) return SPELL_MASS_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_INCENDIARY_CLOUD,oNPC)>0&&fD>9.9) return SPELL_INCENDIARY_CLOUD;
|
|
else if (GetHasSpell(SPELL_INFERNO,oNPC)>0) return SPELL_INFERNO;
|
|
else if (GetHasSpell(SPELL_IMPLOSION,oNPC)>0&&fD>9.9) return SPELL_IMPLOSION;
|
|
else if (GetHasSpell(SPELL_ICE_STORM,oNPC)>0&&fD>9.9) return SPELL_ICE_STORM;
|
|
else if (GetHasSpell(SPELL_GREAT_THUNDERCLAP,oNPC)>0) return SPELL_GREAT_THUNDERCLAP;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FIRE_STORM,oNPC)>0&&fD>9.9) return SPELL_FIRE_STORM;
|
|
else if (GetHasSpell(SPELL_EARTHQUAKE,oNPC)>0) return SPELL_EARTHQUAKE;
|
|
else if (GetHasSpell(SPELL_DELAYED_BLAST_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_DELAYED_BLAST_FIREBALL;
|
|
else if (GetHasSpell(SPELL_DESTRUCTION,oNPC)>0) return SPELL_DESTRUCTION;
|
|
else if (GetHasSpell(SPELL_CREEPING_DOOM,oNPC)>0) return SPELL_CREEPING_DOOM;
|
|
else if (GetHasSpell(SPELL_CRUMBLE,oNPC)>0) return SPELL_CRUMBLE;
|
|
else if (GetHasSpell(SPELL_WORD_OF_FAITH,oNPC)>0) return SPELL_WORD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_CLOUDKILL,oNPC)>0&&fD>9.9) return SPELL_CLOUDKILL;
|
|
else if (GetHasSpell(SPELL_CONE_OF_COLD,oNPC)>0) return SPELL_CONE_OF_COLD;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oNPC)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_BLADE_BARRIER,oNPC)>0) return SPELL_BLADE_BARRIER;
|
|
else if (GetHasSpell(SPELL_BALL_LIGHTNING,oNPC)>0) return SPELL_BALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_DIRGE,oNPC)>0) return SPELL_DIRGE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_EVARDS_BLACK_TENTACLES,oNPC)>0) return SPELL_EVARDS_BLACK_TENTACLES;
|
|
else if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_FLYING_DEBRIS,oNPC)>0) return SPELL_FLYING_DEBRIS;
|
|
else if (GetHasSpell(SPELL_GREASE,oNPC)>0) return SPELL_GREASE;
|
|
else if (GetHasSpell(SPELL_HAMMER_OF_THE_GODS,oNPC)>0) return SPELL_HAMMER_OF_THE_GODS;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SPIKE_GROWTH,oNPC)>0) return SPELL_SPIKE_GROWTH;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0&&fD>9.9) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // high
|
|
} // okay to do area attack
|
|
if (bGroup==FALSE&&!bAlliesNear)
|
|
{ // use non-area unless needed
|
|
if (fCR<6.1)
|
|
{ // low
|
|
if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CONTROL_UNDEAD,oNPC)>0&&GetHasSpellEffect(SPELL_CONTROL_UNDEAD,oTarget)==FALSE) return SPELL_CONTROL_UNDEAD;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_RAY_OF_ENFEEBLEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_RAY_OF_ENFEEBLEMENT,oTarget)==FALSE) return SPELL_RAY_OF_ENFEEBLEMENT;
|
|
else if (GetHasSpell(SPELL_DAZE,oNPC)>0&&d4()<3) return SPELL_DAZE;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
|
|
if (GetHasSpell(SPELL_SPIKE_GROWTH,oNPC)>0) return SPELL_SPIKE_GROWTH;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_GREASE,oNPC)>0) return SPELL_GREASE;
|
|
else if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_HEALING_CIRCLE,oNPC)>0) return SPELL_HEALING_CIRCLE;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // low
|
|
else
|
|
{ // high
|
|
if (GetHasSpell(SPELL_UNDEATH_TO_DEATH,oNPC)>0&&GetIsPC(oTarget)==FALSE) return SPELL_UNDEATH_TO_DEATH;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_FIREBRAND,oNPC)>0) return SPELL_FIREBRAND;
|
|
else if (GetHasSpell(SPELL_DOMINATE_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_DOMINATE_PERSON;
|
|
else if (GetHasSpell(SPELL_CONFUSION,oNPC)>0&&GetHasSpellEffect(SPELL_CONFUSION,oTarget)==FALSE&&GetIsPC(oTarget)==TRUE) return SPELL_CONFUSION;
|
|
else if (GetHasSpell(SPELL_HOLD_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_HOLD_PERSON;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_RAY_OF_ENFEEBLEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_RAY_OF_ENFEEBLEMENT,oTarget)==FALSE) return SPELL_RAY_OF_ENFEEBLEMENT;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
|
|
if (GetHasSpell(SPELL_EPIC_HELLBALL,oNPC)>0&&fD>9.9) return SPELL_EPIC_HELLBALL;
|
|
else if (GetHasSpell(SPELL_MASS_HEAL,oNPC)>0) return SPELL_MASS_HEAL;
|
|
else if (GetHasSpell(SPELL_EPIC_RUIN,oNPC)>0&&fD>9.9) return SPELL_EPIC_RUIN;
|
|
else if (GetHasSpell(SPELL_METEOR_SWARM,oNPC)>0&&fD>9.9) return SPELL_METEOR_SWARM;
|
|
else if (GetHasSpell(SPELL_PRISMATIC_SPRAY,oNPC)>0) return SPELL_PRISMATIC_SPRAY;
|
|
else if (GetHasSpell(SPELL_WAIL_OF_THE_BANSHEE,oNPC)>0) return SPELL_WAIL_OF_THE_BANSHEE;
|
|
else if (GetHasSpell(SPELL_SUNBURST,oNPC)>0) return SPELL_SUNBURST;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_STORM_OF_VENGEANCE,oNPC)>0) return SPELL_STORM_OF_VENGEANCE;
|
|
else if (GetHasSpell(SPELL_POWER_WORD_KILL,oNPC)>0) return SPELL_POWER_WORD_KILL;
|
|
else if (GetHasSpell(SPELL_MASS_BLINDNESS_AND_DEAFNESS,oNPC)>0) return SPELL_MASS_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_INCENDIARY_CLOUD,oNPC)>0&&fD>9.9) return SPELL_INCENDIARY_CLOUD;
|
|
else if (GetHasSpell(SPELL_INFERNO,oNPC)>0) return SPELL_INFERNO;
|
|
else if (GetHasSpell(SPELL_IMPLOSION,oNPC)>0&&fD>9.9) return SPELL_IMPLOSION;
|
|
else if (GetHasSpell(SPELL_ICE_STORM,oNPC)>0) return SPELL_ICE_STORM;
|
|
else if (GetHasSpell(SPELL_GREAT_THUNDERCLAP,oNPC)>0) return SPELL_GREAT_THUNDERCLAP;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FIRE_STORM,oNPC)>0&&fD>9.9) return SPELL_FIRE_STORM;
|
|
else if (GetHasSpell(SPELL_EARTHQUAKE,oNPC)>0) return SPELL_EARTHQUAKE;
|
|
else if (GetHasSpell(SPELL_DELAYED_BLAST_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_DELAYED_BLAST_FIREBALL;
|
|
else if (GetHasSpell(SPELL_DESTRUCTION,oNPC)>0) return SPELL_DESTRUCTION;
|
|
else if (GetHasSpell(SPELL_CREEPING_DOOM,oNPC)>0) return SPELL_CREEPING_DOOM;
|
|
else if (GetHasSpell(SPELL_CRUMBLE,oNPC)>0) return SPELL_CRUMBLE;
|
|
else if (GetHasSpell(SPELL_CLOUDKILL,oNPC)>0) return SPELL_CLOUDKILL;
|
|
else if (GetHasSpell(SPELL_CONE_OF_COLD,oNPC)>0) return SPELL_CONE_OF_COLD;
|
|
else if (GetHasSpell(SPELL_WORD_OF_FAITH,oNPC)>0) return SPELL_WORD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oNPC)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_BLADE_BARRIER,oNPC)>0) return SPELL_BLADE_BARRIER;
|
|
else if (GetHasSpell(SPELL_BALL_LIGHTNING,oNPC)>0) return SPELL_BALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_DIRGE,oNPC)>0) return SPELL_DIRGE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_EVARDS_BLACK_TENTACLES,oNPC)>0) return SPELL_EVARDS_BLACK_TENTACLES;
|
|
else if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_FLYING_DEBRIS,oNPC)>0) return SPELL_FLYING_DEBRIS;
|
|
else if (GetHasSpell(SPELL_GREASE,oNPC)>0) return SPELL_GREASE;
|
|
else if (GetHasSpell(SPELL_HAMMER_OF_THE_GODS,oNPC)>0) return SPELL_HAMMER_OF_THE_GODS;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SPIKE_GROWTH,oNPC)>0) return SPELL_SPIKE_GROWTH;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // high
|
|
} // use non-area unless needed
|
|
if (fCR<6.1)
|
|
{ // low
|
|
if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_RAY_OF_ENFEEBLEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_RAY_OF_ENFEEBLEMENT,oTarget)==FALSE) return SPELL_RAY_OF_ENFEEBLEMENT;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CONTROL_UNDEAD,oNPC)>0&&GetHasSpellEffect(SPELL_CONTROL_UNDEAD,oTarget)==FALSE) return SPELL_CONTROL_UNDEAD;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_DAZE,oNPC)>0&&d4()<3) return SPELL_DAZE;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGIC_MISSILE,oNPC)>0) return SPELL_SHADOW_CONJURATION_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW;
|
|
} // low
|
|
else
|
|
{ // high
|
|
if (GetHasSpell(SPELL_UNDEATH_TO_DEATH,oNPC)>0&&GetIsPC(oTarget)==FALSE) return SPELL_UNDEATH_TO_DEATH;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_FIREBRAND,oNPC)>0) return SPELL_FIREBRAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CRUSHING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_CRUSHING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_CRUSHING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CLENCHED_FIST,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_CLENCHED_FIST,oTarget)==FALSE) return SPELL_BIGBYS_CLENCHED_FIST;
|
|
else if (GetHasSpell(SPELL_BIGBYS_GRASPING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_GRASPING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_GRASPING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_FORCEFUL_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_FORCEFUL_HAND,oTarget)==FALSE) return SPELL_BIGBYS_FORCEFUL_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_INTERPOSING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_INTERPOSING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_INTERPOSING_HAND;
|
|
else if (GetHasSpell(SPELL_DOMINATE_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_DOMINATE_PERSON;
|
|
else if (GetHasSpell(SPELL_CONFUSION,oNPC)>0&&GetHasSpellEffect(SPELL_CONFUSION,oTarget)==FALSE&&GetIsPC(oTarget)==TRUE) return SPELL_CONFUSION;
|
|
else if (GetHasSpell(SPELL_HOLD_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_HOLD_PERSON;
|
|
else if (GetHasSpell(SPELL_HEAL,oNPC)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oNPC)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGIC_MISSILE,oNPC)>0) return SPELL_SHADOW_CONJURATION_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oNPC)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oNPC)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oNPC)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oNPC)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
} // high
|
|
} // undead enemies
|
|
else
|
|
{ // not undead enemies
|
|
if (bGroup==TRUE&&!bAlliesNear)
|
|
{ // okay to do area attack
|
|
if (fCR<2.1)
|
|
{ // very low
|
|
if (GetHasSpell(SPELL_SLEEP,oNPC)>0&&nRT!=RACIAL_TYPE_ELF&&nRT!=RACIAL_TYPE_CONSTRUCT&&GetIsImmune(oTarget,IMMUNITY_TYPE_SLEEP,oMe)==FALSE) return SPELL_SLEEP;
|
|
else if (GetHasSpell(SPELL_SCARE,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR,oMe)==FALSE) return SPELL_SCARE;
|
|
else if (GetHasSpell(SPELL_BANE,oNPC)>0&&GetHasSpellEffect(SPELL_BANE,oTarget)==FALSE) return SPELL_BANE;
|
|
else if (GetHasSpell(SPELL_STINKING_CLOUD,oNPC)>0&&fD>9.9) return SPELL_STINKING_CLOUD;
|
|
else if (GetHasSpell(SPELL_SPIKE_GROWTH,oNPC)>0&&fD>9.9) return SPELL_SPIKE_GROWTH;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_FEAR,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR,oMe)==FALSE) return SPELL_FEAR;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_CLOUD_OF_BEWILDERMENT,oNPC)>0&&fD>9.9&&GetIsImmune(oTarget,IMMUNITY_TYPE_CONFUSED,oMe)==FALSE) return SPELL_CLOUD_OF_BEWILDERMENT;
|
|
else if (GetHasSpell(SPELL_GREASE,oNPC)>0) return SPELL_GREASE;
|
|
else if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // very low
|
|
else if (fCR<6.1)
|
|
{ // low
|
|
if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SCINTILLATING_SPHERE,oNPC)>0) return SPELL_SCINTILLATING_SPHERE;
|
|
else if (GetHasSpell(SPELL_HAMMER_OF_THE_GODS,oNPC)>0) return SPELL_HAMMER_OF_THE_GODS;
|
|
else if (GetHasSpell(SPELL_STINKING_CLOUD,oNPC)>0&&fD>9.9) return SPELL_STINKING_CLOUD;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_WEIRD,oNPC)>0) return SPELL_WEIRD;
|
|
else if (GetHasSpell(SPELL_CONE_OF_COLD,oNPC)>0) return SPELL_CONE_OF_COLD;
|
|
else if (GetHasSpell(SPELL_CLOUDKILL,oNPC)>0&&fD>9.9) return SPELL_CLOUDKILL;
|
|
else if (GetHasSpell(SPELL_ACID_FOG,oNPC)>0) return SPELL_ACID_FOG;
|
|
else if (GetHasSpell(SPELL_FEAR,oNPC)>0) return SPELL_FEAR;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_CLOUD_OF_BEWILDERMENT,oNPC)>0&&fD>9.9&&GetIsImmune(oTarget,IMMUNITY_TYPE_CONFUSED,oMe)==FALSE) return SPELL_CLOUD_OF_BEWILDERMENT;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oNPC)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_EVARDS_BLACK_TENTACLES,oNPC)>0) return SPELL_EVARDS_BLACK_TENTACLES;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // low
|
|
else
|
|
{ // high
|
|
if (GetHasSpell(SPELL_EPIC_HELLBALL,oNPC)>0&&fD>9.9) return SPELL_EPIC_HELLBALL;
|
|
else if (GetHasSpell(SPELL_EPIC_RUIN,oNPC)>0&&fD>9.9) return SPELL_EPIC_RUIN;
|
|
else if (GetHasSpell(SPELL_METEOR_SWARM,oNPC)>0&&fD>9.9) return SPELL_METEOR_SWARM;
|
|
else if (GetHasSpell(SPELL_PRISMATIC_SPRAY,oNPC)>0) return SPELL_PRISMATIC_SPRAY;
|
|
else if (GetHasSpell(SPELL_WAIL_OF_THE_BANSHEE,oNPC)>0) return SPELL_WAIL_OF_THE_BANSHEE;
|
|
else if (GetHasSpell(SPELL_SUNBURST,oNPC)>0) return SPELL_SUNBURST;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_STORM_OF_VENGEANCE,oNPC)>0) return SPELL_STORM_OF_VENGEANCE;
|
|
else if (GetHasSpell(SPELL_SPHERE_OF_CHAOS,oNPC)>0) return SPELL_SPHERE_OF_CHAOS;
|
|
else if (GetHasSpell(SPELL_POWER_WORD_KILL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_POWER_WORD_KILL;
|
|
else if (GetHasSpell(SPELL_NEGATIVE_ENERGY_BURST,oNPC)>0) return SPELL_NEGATIVE_ENERGY_BURST;
|
|
else if (GetHasSpell(SPELL_MASS_BLINDNESS_AND_DEAFNESS,oNPC)>0) return SPELL_MASS_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_INCENDIARY_CLOUD,oNPC)>0&&fD>9.9) return SPELL_INCENDIARY_CLOUD;
|
|
else if (GetHasSpell(SPELL_INFERNO,oNPC)>0) return SPELL_INFERNO;
|
|
else if (GetHasSpell(SPELL_IMPLOSION,oNPC)>0&&fD>9.9) return SPELL_IMPLOSION;
|
|
else if (GetHasSpell(SPELL_ICE_STORM,oNPC)>0&&fD>9.9) return SPELL_ICE_STORM;
|
|
else if (GetHasSpell(SPELL_GREAT_THUNDERCLAP,oNPC)>0) return SPELL_GREAT_THUNDERCLAP;
|
|
else if (GetHasSpell(SPELL_WEIRD,oNPC)>0) return SPELL_WEIRD;
|
|
else if (GetHasSpell(SPELL_WORD_OF_FAITH,oNPC)>0) return SPELL_WORD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FIRE_STORM,oNPC)>0&&fD>9.9) return SPELL_FIRE_STORM;
|
|
else if (GetHasSpell(SPELL_EARTHQUAKE,oNPC)>0) return SPELL_EARTHQUAKE;
|
|
else if (GetHasSpell(SPELL_DELAYED_BLAST_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_DELAYED_BLAST_FIREBALL;
|
|
else if (GetHasSpell(SPELL_DESTRUCTION,oNPC)>0) return SPELL_DESTRUCTION;
|
|
else if (GetHasSpell(SPELL_CREEPING_DOOM,oNPC)>0) return SPELL_CREEPING_DOOM;
|
|
else if (GetHasSpell(SPELL_CRUMBLE,oNPC)>0) return SPELL_CRUMBLE;
|
|
else if (GetHasSpell(SPELL_CLOUDKILL,oNPC)>0&&fD>9.9) return SPELL_CLOUDKILL;
|
|
else if (GetHasSpell(SPELL_CONE_OF_COLD,oNPC)>0) return SPELL_CONE_OF_COLD;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oNPC)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_BLADE_BARRIER,oNPC)>0) return SPELL_BLADE_BARRIER;
|
|
else if (GetHasSpell(SPELL_BALL_LIGHTNING,oNPC)>0) return SPELL_BALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_CLOUD_OF_BEWILDERMENT,oNPC)>0&&fD>9.9&&GetIsImmune(oTarget,IMMUNITY_TYPE_CONFUSED,oMe)==FALSE) return SPELL_CLOUD_OF_BEWILDERMENT;
|
|
else if (GetHasSpell(SPELL_DARKNESS,oNPC)>0) return SPELL_DARKNESS;
|
|
else if (GetHasSpell(SPELL_DIRGE,oNPC)>0) return SPELL_DIRGE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_EVARDS_BLACK_TENTACLES,oNPC)>0) return SPELL_EVARDS_BLACK_TENTACLES;
|
|
else if (GetHasSpell(SPELL_FEAR,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR,oMe)==FALSE) return SPELL_FEAR;
|
|
else if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_FLYING_DEBRIS,oNPC)>0) return SPELL_FLYING_DEBRIS;
|
|
else if (GetHasSpell(SPELL_GREASE,oNPC)>0) return SPELL_GREASE;
|
|
else if (GetHasSpell(SPELL_HAMMER_OF_THE_GODS,oNPC)>0) return SPELL_HAMMER_OF_THE_GODS;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SPIKE_GROWTH,oNPC)>0) return SPELL_SPIKE_GROWTH;
|
|
else if (GetHasSpell(SPELL_STINKING_CLOUD,oNPC)>0&&fD>9.9) return SPELL_STINKING_CLOUD;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // high
|
|
} // okay to do area attack
|
|
if (bGroup==FALSE&&!bAlliesNear)
|
|
{ // use non-area unless needed
|
|
if (fCR<6.1)
|
|
{ // low
|
|
if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_BESTOW_CURSE,oNPC)>0&&d4()<3) return SPELL_BESTOW_CURSE;
|
|
else if (GetHasSpell(SPELL_BANE,oNPC)>0&&GetHasSpellEffect(SPELL_BANE,oTarget)==FALSE) return SPELL_BANE;
|
|
else if (GetHasSpell(SPELL_BLINDNESS_AND_DEAFNESS,oNPC)>0&&d4()<3) return SPELL_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_INFLICT_MODERATE_WOUNDS,oNPC)>0) return SPELL_INFLICT_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_RAY_OF_ENFEEBLEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_RAY_OF_ENFEEBLEMENT,oTarget)==FALSE) return SPELL_RAY_OF_ENFEEBLEMENT;
|
|
else if (GetHasSpell(SPELL_DAZE,oNPC)>0&&d4()<3) return SPELL_DAZE;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON_OR_ANIMAL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON||nCT==CAI_CHARM_ANIMAL)&&GetHasSpellEffect(SPELL_CHARM_PERSON_OR_ANIMAL,oTarget)==FALSE) return SPELL_CHARM_PERSON_OR_ANIMAL;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON)&&GetHasSpellEffect(SPELL_CHARM_PERSON,oTarget)==FALSE) return SPELL_CHARM_PERSON;
|
|
else if (GetHasSpell(SPELL_CHARM_MONSTER,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_MONSTER)&&GetHasSpellEffect(SPELL_CHARM_MONSTER,oTarget)==FALSE) return SPELL_CHARM_MONSTER;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_GHOUL_TOUCH,oNPC)>0&&d4()<3) return SPELL_GHOUL_TOUCH;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_NEGATIVE_ENERGY_RAY,oNPC)>0) return SPELL_NEGATIVE_ENERGY_RAY;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_VAMPIRIC_TOUCH,oNPC)>0&&d4()<3) return SPELL_VAMPIRIC_TOUCH;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGIC_MISSILE,oNPC)>0) return SPELL_SHADOW_CONJURATION_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_INFLICT_SERIOUS_WOUNDS,oNPC)>0) return SPELL_INFLICT_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_CRITICAL_WOUNDS,oNPC)>0) return SPELL_INFLICT_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_LIGHT_WOUNDS,oNPC)>0) return SPELL_INFLICT_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_MINOR_WOUNDS,oNPC)>0) return SPELL_INFLICT_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_POISON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_POISON,oMe)==FALSE) return SPELL_POISON;
|
|
else if (GetHasSpell(SPELL_TASHAS_HIDEOUS_LAUGHTER,oNPC)>0) return SPELL_TASHAS_HIDEOUS_LAUGHTER;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW;
|
|
|
|
if (GetHasSpell(SPELL_SLEEP,oNPC)>0&&nRT!=RACIAL_TYPE_ELF&&nRT!=RACIAL_TYPE_CONSTRUCT) return SPELL_SLEEP;
|
|
else if (GetHasSpell(SPELL_SCARE,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR,oMe)==FALSE) return SPELL_SCARE;
|
|
else if (GetHasSpell(SPELL_STINKING_CLOUD,oNPC)>0&&fD>9.9) return SPELL_STINKING_CLOUD;
|
|
else if (GetHasSpell(SPELL_SPIKE_GROWTH,oNPC)>0&&fD>9.9) return SPELL_SPIKE_GROWTH;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_FEAR,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR,oMe)==FALSE) return SPELL_FEAR;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_CLOUD_OF_BEWILDERMENT,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CONFUSED,oMe)==FALSE) return SPELL_CLOUD_OF_BEWILDERMENT;
|
|
else if (GetHasSpell(SPELL_GREASE,oNPC)>0) return SPELL_GREASE;
|
|
else if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // low
|
|
else
|
|
{ // high
|
|
if (GetHasSpell(SPELL_POWER_WORD_KILL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_POWER_WORD_KILL;
|
|
else if (GetHasSpell(SPELL_SLAY_LIVING,oNPC)>0&&d4()<3&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_SLAY_LIVING;
|
|
else if (GetHasSpell(SPELL_SILENCE,oNPC)>0&&d4()<2) return SPELL_SILENCE;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_HORRID_WILTING,oNPC)>0) return SPELL_HORRID_WILTING;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_FINGER_OF_DEATH,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_FINGER_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CRUSHING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_CRUSHING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_CRUSHING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CLENCHED_FIST,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_CLENCHED_FIST,oTarget)==FALSE) return SPELL_BIGBYS_CLENCHED_FIST;
|
|
else if (GetHasSpell(SPELL_BIGBYS_GRASPING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_GRASPING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_GRASPING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_FORCEFUL_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_FORCEFUL_HAND,oTarget)==FALSE) return SPELL_BIGBYS_FORCEFUL_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_INTERPOSING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_INTERPOSING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_INTERPOSING_HAND;
|
|
else if (GetHasSpell(SPELL_DROWN,oNPC)>0) return SPELL_DROWN;
|
|
else if (GetHasSpell(SPELL_BANISHMENT,oNPC)>0&&nRT==RACIAL_TYPE_OUTSIDER&&d4()<3) return SPELL_BANISHMENT;
|
|
else if (GetHasSpell(SPELL_DISMISSAL,oNPC)>0&&nRT==RACIAL_TYPE_OUTSIDER&&d4()<3) return SPELL_DISMISSAL;
|
|
else if (GetHasSpell(SPELL_ENERGY_DRAIN,oNPC)>0) return SPELL_ENERGY_DRAIN;
|
|
else if (GetHasSpell(SPELL_PHANTASMAL_KILLER,oNPC)>0) return SPELL_PHANTASMAL_KILLER;
|
|
else if (GetHasSpell(SPELL_ENERVATION,oNPC)>0) return SPELL_ENERVATION;
|
|
else if (GetHasSpell(SPELL_FIREBRAND,oNPC)>0) return SPELL_FIREBRAND;
|
|
else if (GetHasSpell(SPELL_INFESTATION_OF_MAGGOTS,oNPC)>0&&GetHasSpellEffect(SPELL_INFESTATION_OF_MAGGOTS,oTarget)==FALSE&&GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE,oMe)==FALSE) return SPELL_INFESTATION_OF_MAGGOTS;
|
|
else if (GetHasSpell(SPELL_CONTAGION,oNPC)>0&&GetHasSpellEffect(SPELL_CONTAGION,oTarget)==FALSE&&GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE,oMe)==FALSE) return SPELL_CONTAGION;
|
|
else if (GetHasSpell(SPELL_DOMINATE_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_DOMINATE_PERSON;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON_OR_ANIMAL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON||nCT==CAI_CHARM_ANIMAL)&&GetHasSpellEffect(SPELL_CHARM_PERSON_OR_ANIMAL,oTarget)==FALSE) return SPELL_CHARM_PERSON_OR_ANIMAL;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON)&&GetHasSpellEffect(SPELL_CHARM_PERSON,oTarget)==FALSE) return SPELL_CHARM_PERSON;
|
|
else if (GetHasSpell(SPELL_CHARM_MONSTER,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_MONSTER)&&GetHasSpellEffect(SPELL_CHARM_MONSTER,oTarget)==FALSE) return SPELL_CHARM_MONSTER;
|
|
else if (GetHasSpell(SPELL_CONFUSION,oNPC)>0&&GetHasSpellEffect(SPELL_CONFUSION,oTarget)==FALSE&&GetIsImmune(oTarget,IMMUNITY_TYPE_CONFUSED,oMe)==FALSE) return SPELL_CONFUSION;
|
|
else if (GetHasSpell(SPELL_HOLD_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_HOLD_PERSON;
|
|
else if (GetHasSpell(SPELL_HARM,oNPC)>0) return SPELL_HARM;
|
|
else if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_BESTOW_CURSE,oNPC)>0&&d4()<3) return SPELL_BESTOW_CURSE;
|
|
else if (GetHasSpell(SPELL_BLINDNESS_AND_DEAFNESS,oNPC)>0&&d4()<3) return SPELL_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_INFLICT_MODERATE_WOUNDS,oNPC)>0) return SPELL_INFLICT_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_DAZE,oNPC)>0&&d4()<3&&GetIsImmune(oTarget,IMMUNITY_TYPE_DAZED,oMe)==FALSE) return SPELL_DAZE;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON_OR_ANIMAL,oNPC)>0&&d4()<2) return SPELL_CHARM_PERSON_OR_ANIMAL;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_GHOUL_TOUCH,oNPC)>0&&d4()<3) return SPELL_GHOUL_TOUCH;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_NEGATIVE_ENERGY_RAY,oNPC)>0) return SPELL_NEGATIVE_ENERGY_RAY;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGIC_MISSILE,oNPC)>0) return SPELL_SHADOW_CONJURATION_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_VAMPIRIC_TOUCH,oNPC)>0&&d4()<3) return SPELL_VAMPIRIC_TOUCH;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_INFLICT_SERIOUS_WOUNDS,oNPC)>0) return SPELL_INFLICT_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_CRITICAL_WOUNDS,oNPC)>0) return SPELL_INFLICT_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_LIGHT_WOUNDS,oNPC)>0) return SPELL_INFLICT_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_MINOR_WOUNDS,oNPC)>0) return SPELL_INFLICT_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_POISON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_POISON,oMe)==FALSE) return SPELL_POISON;
|
|
|
|
|
|
if (GetHasSpell(SPELL_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SHADES_FIREBALL,oNPC)>0&&fD>9.9) return SPELL_SHADES_FIREBALL;
|
|
else if (GetHasSpell(SPELL_SCINTILLATING_SPHERE,oNPC)>0) return SPELL_SCINTILLATING_SPHERE;
|
|
else if (GetHasSpell(SPELL_HAMMER_OF_THE_GODS,oNPC)>0) return SPELL_HAMMER_OF_THE_GODS;
|
|
else if (GetHasSpell(SPELL_STINKING_CLOUD,oNPC)>0&&fD>9.9) return SPELL_STINKING_CLOUD;
|
|
else if (GetHasSpell(SPELL_WALL_OF_FIRE,oNPC)>0&&fD>9.9) return SPELL_WALL_OF_FIRE;
|
|
else if (GetHasSpell(SPELL_CONE_OF_COLD,oNPC)>0) return SPELL_CONE_OF_COLD;
|
|
else if (GetHasSpell(SPELL_CLOUDKILL,oNPC)>0&&fD>9.9) return SPELL_CLOUDKILL;
|
|
else if (GetHasSpell(SPELL_WEIRD,oNPC)>0) return SPELL_WEIRD;
|
|
else if (GetHasSpell(SPELL_ACID_FOG,oNPC)>0) return SPELL_ACID_FOG;
|
|
else if (GetHasSpell(SPELL_FEAR,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_FEAR,oMe)==FALSE) return SPELL_FEAR;
|
|
else if (GetHasSpell(SPELL_WORD_OF_FAITH,oNPC)>0) return SPELL_WORD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_CLOUD_OF_BEWILDERMENT,oNPC)>0&&fD>9.9&&GetIsImmune(oTarget,IMMUNITY_TYPE_CONFUSED,oMe)==FALSE) return SPELL_CLOUD_OF_BEWILDERMENT;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oNPC)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_ENTANGLE,oNPC)>0) return SPELL_ENTANGLE;
|
|
else if (GetHasSpell(SPELL_EVARDS_BLACK_TENTACLES,oNPC)>0) return SPELL_EVARDS_BLACK_TENTACLES;
|
|
else if (GetHasSpell(SPELL_WEB,oNPC)>0) return SPELL_WEB;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_WEB,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_WEB;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_DARKNESS,oNPC)>0) return SPELL_SHADOW_CONJURATION_DARKNESS;
|
|
} // high
|
|
} // use non-area unless needed
|
|
if (fCR<6.1)
|
|
{ // low
|
|
if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_BESTOW_CURSE,oNPC)>0&&d4()<3) return SPELL_BESTOW_CURSE;
|
|
else if (GetHasSpell(SPELL_BLINDNESS_AND_DEAFNESS,oNPC)>0&&d4()<3) return SPELL_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_BANE,oNPC)>0&&GetHasSpellEffect(SPELL_BANE,oTarget)==FALSE) return SPELL_BANE;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_INFLICT_MODERATE_WOUNDS,oNPC)>0) return SPELL_INFLICT_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_RAY_OF_ENFEEBLEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_RAY_OF_ENFEEBLEMENT,oTarget)==FALSE) return SPELL_RAY_OF_ENFEEBLEMENT;
|
|
else if (GetHasSpell(SPELL_DAZE,oNPC)>0&&d4()<3&&GetIsImmune(oTarget,IMMUNITY_TYPE_DAZED,oMe)==FALSE) return SPELL_DAZE;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON_OR_ANIMAL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON||nCT==CAI_CHARM_ANIMAL)&&GetHasSpellEffect(SPELL_CHARM_PERSON_OR_ANIMAL,oTarget)==FALSE) return SPELL_CHARM_PERSON_OR_ANIMAL;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON)&&GetHasSpellEffect(SPELL_CHARM_PERSON,oTarget)==FALSE) return SPELL_CHARM_PERSON;
|
|
else if (GetHasSpell(SPELL_CHARM_MONSTER,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_MONSTER)&&GetHasSpellEffect(SPELL_CHARM_MONSTER,oTarget)==FALSE) return SPELL_CHARM_MONSTER; else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_GHOUL_TOUCH,oNPC)>0&&d4()<3) return SPELL_GHOUL_TOUCH;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_NEGATIVE_ENERGY_RAY,oNPC)>0) return SPELL_NEGATIVE_ENERGY_RAY;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_VAMPIRIC_TOUCH,oNPC)>0&&d4()<3) return SPELL_VAMPIRIC_TOUCH;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGIC_MISSILE,oNPC)>0) return SPELL_SHADOW_CONJURATION_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_INFLICT_SERIOUS_WOUNDS,oNPC)>0) return SPELL_INFLICT_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_CRITICAL_WOUNDS,oNPC)>0) return SPELL_INFLICT_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_LIGHT_WOUNDS,oNPC)>0) return SPELL_INFLICT_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_MINOR_WOUNDS,oNPC)>0) return SPELL_INFLICT_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_POISON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_POISON,oMe)==FALSE) return SPELL_POISON;
|
|
else if (GetHasSpell(SPELL_TASHAS_HIDEOUS_LAUGHTER,oNPC)>0) return SPELL_TASHAS_HIDEOUS_LAUGHTER;
|
|
} // low
|
|
else
|
|
{
|
|
if (GetHasSpell(SPELL_POWER_WORD_KILL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_POWER_WORD_KILL;
|
|
else if (GetHasSpell(SPELL_SLAY_LIVING,oNPC)>0&&d4()<3&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_SLAY_LIVING;
|
|
else if (GetHasSpell(SPELL_SILENCE,oNPC)>0&&d4()<2) return SPELL_SILENCE;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_HORRID_WILTING,oNPC)>0) return SPELL_HORRID_WILTING;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_FINGER_OF_DEATH,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_DEATH,oMe)==FALSE) return SPELL_FINGER_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CRUSHING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_CRUSHING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_CRUSHING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CLENCHED_FIST,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_CLENCHED_FIST,oTarget)==FALSE) return SPELL_BIGBYS_CLENCHED_FIST;
|
|
else if (GetHasSpell(SPELL_BIGBYS_GRASPING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_GRASPING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_GRASPING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_FORCEFUL_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_FORCEFUL_HAND,oTarget)==FALSE) return SPELL_BIGBYS_FORCEFUL_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_INTERPOSING_HAND,oNPC)>0&&GetHasSpellEffect(SPELL_BIGBYS_INTERPOSING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_INTERPOSING_HAND;
|
|
else if (GetHasSpell(SPELL_FEEBLEMIND,oNPC)>0&&GetHasSpellEffect(SPELL_FEEBLEMIND,oTarget)==FALSE) return SPELL_FEEBLEMIND;
|
|
else if (GetHasSpell(SPELL_DROWN,oNPC)>0) return SPELL_DROWN;
|
|
else if (GetHasSpell(SPELL_BANISHMENT,oNPC)>0&&nRT==RACIAL_TYPE_OUTSIDER&&d4()<3) return SPELL_BANISHMENT;
|
|
else if (GetHasSpell(SPELL_DISMISSAL,oNPC)>0&&nRT==RACIAL_TYPE_OUTSIDER&&d4()<3) return SPELL_DISMISSAL;
|
|
else if (GetHasSpell(SPELL_ENERGY_DRAIN,oNPC)>0) return SPELL_ENERGY_DRAIN;
|
|
else if (GetHasSpell(SPELL_PHANTASMAL_KILLER,oNPC)>0) return SPELL_PHANTASMAL_KILLER;
|
|
else if (GetHasSpell(SPELL_ENERVATION,oNPC)>0) return SPELL_ENERVATION;
|
|
else if (GetHasSpell(SPELL_FIREBRAND,oNPC)>0) return SPELL_FIREBRAND;
|
|
else if (GetHasSpell(SPELL_INFESTATION_OF_MAGGOTS,oNPC)>0&&GetHasSpellEffect(SPELL_INFESTATION_OF_MAGGOTS,oTarget)==FALSE&&GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE,oMe)==FALSE) return SPELL_INFESTATION_OF_MAGGOTS;
|
|
else if (GetHasSpell(SPELL_CONTAGION,oNPC)>0&&GetHasSpellEffect(SPELL_CONTAGION,oTarget)==FALSE&&GetIsImmune(oTarget,IMMUNITY_TYPE_DISEASE,oMe)==FALSE) return SPELL_CONTAGION;
|
|
else if (GetHasSpell(SPELL_DOMINATE_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_DOMINATE_PERSON;
|
|
else if (GetHasSpell(SPELL_CONFUSION,oNPC)>0&&GetHasSpellEffect(SPELL_CONFUSION,oTarget)==FALSE&&GetIsImmune(oTarget,IMMUNITY_TYPE_CONFUSED,oMe)==FALSE) return SPELL_CONFUSION;
|
|
else if (GetHasSpell(SPELL_HOLD_PERSON,oNPC)>0&&GetIsPC(oTarget)&&GetHasSpellEffect(SPELL_DOMINATE_PERSON,oTarget)==FALSE) return SPELL_HOLD_PERSON;
|
|
else if (GetHasSpell(SPELL_HARM,oNPC)>0) return SPELL_HARM;
|
|
else if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oNPC)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_DOOM,oNPC)>0&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oNPC)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_BESTOW_CURSE,oNPC)>0&&d4()<3) return SPELL_BESTOW_CURSE;
|
|
else if (GetHasSpell(SPELL_BLINDNESS_AND_DEAFNESS,oNPC)>0&&d4()<3) return SPELL_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_BOMBARDMENT,oNPC)>0) return SPELL_BOMBARDMENT;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON_OR_ANIMAL,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON||nCT==CAI_CHARM_ANIMAL)&&GetHasSpellEffect(SPELL_CHARM_PERSON_OR_ANIMAL,oTarget)==FALSE) return SPELL_CHARM_PERSON_OR_ANIMAL;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_PERSON)&&GetHasSpellEffect(SPELL_CHARM_PERSON,oTarget)==FALSE) return SPELL_CHARM_PERSON;
|
|
else if (GetHasSpell(SPELL_CHARM_MONSTER,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_CHARM,oMe)==FALSE&&(nCT==CAI_CHARM_MONSTER)&&GetHasSpellEffect(SPELL_CHARM_MONSTER,oTarget)==FALSE) return SPELL_CHARM_MONSTER;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oNPC)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_CALL_LIGHTNING,oNPC)>0) return SPELL_CALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_INFLICT_MODERATE_WOUNDS,oNPC)>0) return SPELL_INFLICT_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_DAZE,oNPC)>0&&d4()<3&&GetIsImmune(oTarget,IMMUNITY_TYPE_DAZED,oMe)==FALSE) return SPELL_DAZE;
|
|
else if (GetHasSpell(SPELL_CHARM_PERSON_OR_ANIMAL,oNPC)>0&&d4()<2) return SPELL_CHARM_PERSON_OR_ANIMAL;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oNPC)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_FLAME_STRIKE,oNPC)>0) return SPELL_FLAME_STRIKE;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oNPC)>0) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_GHOUL_TOUCH,oNPC)>0&&d4()<3) return SPELL_GHOUL_TOUCH;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oNPC)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oNPC)>0) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oNPC)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGIC_MISSILE,oNPC)>0) return SPELL_SHADOW_CONJURATION_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_NEGATIVE_ENERGY_RAY,oNPC)>0) return SPELL_NEGATIVE_ENERGY_RAY;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oNPC)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oNPC)>0&&d4()<4) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oNPC)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oNPC)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_SLOW,oNPC)>0&&d4()<3) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oNPC)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_VAMPIRIC_TOUCH,oNPC)>0&&d4()<3) return SPELL_VAMPIRIC_TOUCH;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oNPC)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oNPC)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_FLAME_ARROW,oNPC)>0) return SPELL_FLAME_ARROW;
|
|
else if (GetHasSpell(SPELL_COLOR_SPRAY,oNPC)>0) return SPELL_COLOR_SPRAY;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oNPC)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_INFLICT_SERIOUS_WOUNDS,oNPC)>0) return SPELL_INFLICT_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_CRITICAL_WOUNDS,oNPC)>0) return SPELL_INFLICT_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_LIGHT_WOUNDS,oNPC)>0) return SPELL_INFLICT_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_INFLICT_MINOR_WOUNDS,oNPC)>0) return SPELL_INFLICT_MINOR_WOUNDS;
|
|
else if (GetHasSpell(SPELL_POISON,oNPC)>0&&GetIsImmune(oTarget,IMMUNITY_TYPE_POISON,oMe)==FALSE) return SPELL_POISON;
|
|
else if (GetHasSpell(SPELL_WEIRD,oNPC)>0) return SPELL_WEIRD;
|
|
} // high
|
|
} // not undead enemies
|
|
return 0;
|
|
} // caiGetAvailableCombatSpell()
|
|
|
|
int caiGetAvailableDefensiveSpell(object oNPC,object oTarget)
|
|
{ // PURPOSE: To return a defensive spell that oNPC has that is useful to oTarget.
|
|
int bSC=GetLocalInt(oNPC,"bCAISPELLCASTERS");
|
|
if (oNPC==oTarget)
|
|
{ // self
|
|
if(GetHasSpell(SPELL_ETHEREAL_VISAGE,oNPC)>0&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oTarget)==FALSE) return SPELL_ETHEREAL_VISAGE;
|
|
else if(GetHasSpell(SPELL_PREMONITION,oNPC)>0&&GetHasSpellEffect(SPELL_PREMONITION,oTarget)==FALSE) return SPELL_PREMONITION;
|
|
else if(GetHasSpell(SPELL_GREATER_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oTarget)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if(GetHasSpell(SPELL_GREATER_SPELL_MANTLE,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oTarget)==FALSE&&bSC) return SPELL_GREATER_SPELL_MANTLE;
|
|
else if(GetHasSpell(SPELL_EPIC_MAGE_ARMOR,oNPC)>0&&GetHasSpellEffect(SPELL_EPIC_MAGE_ARMOR,oTarget)==FALSE) return SPELL_EPIC_MAGE_ARMOR;
|
|
else if(GetHasSpell(SPELL_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_STONESKIN,oTarget)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oTarget)==FALSE) return SPELL_STONESKIN;
|
|
else if(GetHasSpell(SPELL_SPELL_MANTLE,oNPC)>0&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oTarget)==FALSE&&bSC&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oTarget)==FALSE) return SPELL_SPELL_MANTLE;
|
|
else if(GetHasSpell(SPELL_DEATH_WARD,oNPC)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oTarget)==FALSE) return SPELL_DEATH_WARD;
|
|
else if(GetHasSpell(SPELL_GHOSTLY_VISAGE,oNPC)>0&&GetHasSpellEffect(SPELL_GHOSTLY_VISAGE,oTarget)==FALSE&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oTarget)==FALSE) return SPELL_GHOSTLY_VISAGE;
|
|
else if(GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY,oNPC)>0&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oTarget)==FALSE&&bSC) return SPELL_GLOBE_OF_INVULNERABILITY;
|
|
else if(GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oNPC)>0&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oTarget)==FALSE&&bSC&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oTarget)==FALSE) return SPELL_MINOR_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_CLOAK_OF_CHAOS,oNPC)>0&&GetHasSpellEffect(SPELL_CLOAK_OF_CHAOS,oTarget)==FALSE) return SPELL_CLOAK_OF_CHAOS;
|
|
else if(GetHasSpell(SPELL_NEGATIVE_ENERGY_PROTECTION,oNPC)>0&&GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION,oTarget)==FALSE) return SPELL_NEGATIVE_ENERGY_PROTECTION;
|
|
else if(GetHasSpell(SPELL_MIND_BLANK,oNPC)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oTarget)==FALSE&&bSC) return SPELL_MIND_BLANK;
|
|
else if(GetHasSpell(SPELL_LESSER_MIND_BLANK,oNPC)>0&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oTarget)==FALSE&&bSC&&GetHasSpellEffect(SPELL_MIND_BLANK,oTarget)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if(GetHasSpell(SPELL_TRUE_SEEING,oNPC)>0&&GetHasSpellEffect(SPELL_TRUE_SEEING,oTarget)==FALSE&&bSC) return SPELL_TRUE_SEEING;
|
|
else if(GetHasSpell(SPELL_SEE_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oTarget)==FALSE&&GetHasSpellEffect(SPELL_TRUE_SEEING,oTarget)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if(GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT,oTarget)==FALSE&&bSC) return SPELL_FREEDOM_OF_MOVEMENT;
|
|
else if(GetHasSpell(SPELL_PRAYER,oNPC)>0&&GetHasSpellEffect(SPELL_PRAYER,oTarget)==FALSE) return SPELL_PRAYER;
|
|
else if(GetHasSpell(SPELL_IMPROVED_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oTarget)==FALSE) return SPELL_IMPROVED_INVISIBILITY;
|
|
else if(GetHasSpell(SPELL_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_INVISIBILITY,oTarget)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oTarget)==FALSE) return SPELL_INVISIBILITY;
|
|
else if(GetHasSpell(SPELL_LESSER_SPELL_MANTLE,oNPC)>0&&GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE,oTarget)==FALSE&&bSC&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oTarget)==FALSE&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oTarget)==FALSE) return SPELL_LESSER_SPELL_MANTLE;
|
|
else if(GetHasSpell(SPELL_DISPLACEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_DISPLACEMENT,oTarget)==FALSE) return SPELL_DISPLACEMENT;
|
|
else if(GetHasSpell(SPELL_ELEMENTAL_SHIELD,oNPC)>0&&GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD,oTarget)==FALSE) return SPELL_ELEMENTAL_SHIELD;
|
|
else if(GetHasSpell(SPELL_ENTROPIC_SHIELD,oNPC)>0&&GetHasSpellEffect(SPELL_ENTROPIC_SHIELD,oTarget)==FALSE) return SPELL_ENTROPIC_SHIELD;
|
|
else if(GetHasSpell(SPELL_SHIELD,oNPC)>0&&GetHasSpellEffect(SPELL_SHIELD,oTarget)==FALSE) return SPELL_SHIELD;
|
|
else if(GetHasSpell(SPELL_MAGE_ARMOR,oNPC)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oTarget)==FALSE&&GetHasSpellEffect(SPELL_EPIC_MAGE_ARMOR,oTarget)==FALSE) return SPELL_MAGE_ARMOR;
|
|
else if(GetHasSpell(SPELL_REGENERATE,oNPC)>0&&GetHasSpellEffect(SPELL_REGENERATE,oTarget)==FALSE) return SPELL_REGENERATE;
|
|
else if(GetHasSpell(SPELL_BARKSKIN,oNPC)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oTarget)==FALSE) return SPELL_BARKSKIN;
|
|
else if(GetHasSpell(SPELL_SHIELD_OF_FAITH,oNPC)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_FAITH,oTarget)==FALSE) return SPELL_SHIELD_OF_FAITH;
|
|
else if(GetHasSpell(SPELL_SHIELD_OF_LAW,oNPC)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_LAW,oTarget)==FALSE) return SPELL_SHIELD_OF_LAW;
|
|
else if(GetHasSpell(SPELL_NEGATIVE_ENERGY_PROTECTION,oNPC)>0&&GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION,oTarget)==FALSE) return SPELL_NEGATIVE_ENERGY_PROTECTION;
|
|
else if(GetHasSpell(SPELL_ENDURE_ELEMENTS,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oTarget)==FALSE&&bSC) return SPELL_ENDURE_ELEMENTS;
|
|
else if(GetHasSpell(SPELL_PROTECTION_FROM_EVIL,oNPC)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oTarget)==FALSE&&GetAlignmentGoodEvil(oTarget)!=ALIGNMENT_EVIL) return SPELL_PROTECTION_FROM_EVIL;
|
|
else if(GetHasSpell(SPELL_PROTECTION_FROM_GOOD,oNPC)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_GOOD,oTarget)==FALSE&&GetAlignmentGoodEvil(oTarget)!=ALIGNMENT_GOOD) return SPELL_PROTECTION_FROM_GOOD;
|
|
else if(GetHasSpell(SPELL_MAGIC_CIRCLE_AGAINST_EVIL,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_EVIL,oTarget)==FALSE&&GetAlignmentGoodEvil(oTarget)!=ALIGNMENT_EVIL) return SPELL_MAGIC_CIRCLE_AGAINST_EVIL;
|
|
else if(GetHasSpell(SPELL_MAGIC_CIRCLE_AGAINST_GOOD,oNPC)>0&&GetHasSpellEffect(SPELL_MAGIC_CIRCLE_AGAINST_GOOD,oTarget)==FALSE&&GetAlignmentGoodEvil(oTarget)!=ALIGNMENT_GOOD) return SPELL_MAGIC_CIRCLE_AGAINST_GOOD;
|
|
else if(GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE&&bSC) return SPELL_RESISTANCE;
|
|
else if(GetHasSpell(SPELL_BLESS,oNPC)>0&&GetHasSpellEffect(SPELL_BLESS,oTarget)==FALSE) return SPELL_BLESS;
|
|
else if(GetHasSpell(SPELL_IRONGUTS,oNPC)>0&&GetHasSpellEffect(SPELL_IRONGUTS,oTarget)==FALSE) return SPELL_IRONGUTS;
|
|
else if(GetHasSpell(SPELL_SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_CATS_GRACE,oNPC)>0&&GetHasSpellEffect(SPELL_CATS_GRACE,oTarget)==FALSE) return SPELL_CATS_GRACE;
|
|
else if (GetHasSpell(SPELL_SHADES_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oTarget)==FALSE) return SPELL_SHADES_STONESKIN;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oNPC)>0&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oTarget)==FALSE) return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oTarget)==FALSE) return SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oTarget)==FALSE) return SPELL_SHADOW_CONJURATION_INIVSIBILITY;
|
|
else if (GetHasSpell(SPELL_SHADOW_SHIELD,oNPC)&&bSC&&GetHasSpellEffect(SPELL_SHADOW_SHIELD,oTarget)==FALSE>0) return SPELL_SHADOW_SHIELD;
|
|
else if(GetHasSpell(SPELL_PROTECTION_FROM_SPELLS,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_PROTECTION_FROM_SPELLS,oTarget)==FALSE) return SPELL_PROTECTION_FROM_SPELLS;
|
|
} // self
|
|
else
|
|
{ // other
|
|
if(GetHasSpell(SPELL_GREATER_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oTarget)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if(GetHasSpell(SPELL_STONESKIN,oNPC)>0&&GetHasSpellEffect(SPELL_STONESKIN,oTarget)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oTarget)==FALSE) return SPELL_STONESKIN;
|
|
else if(GetHasSpell(SPELL_NEGATIVE_ENERGY_PROTECTION,oNPC)>0&&GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION,oTarget)==FALSE) return SPELL_NEGATIVE_ENERGY_PROTECTION;
|
|
else if(GetHasSpell(SPELL_MIND_BLANK,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_MIND_BLANK,oTarget)==FALSE) return SPELL_MIND_BLANK;
|
|
else if(GetHasSpell(SPELL_TRUE_SEEING,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_TRUE_SEEING,oTarget)==FALSE) return SPELL_TRUE_SEEING;
|
|
else if(GetHasSpell(SPELL_SEE_INVISIBILITY,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oTarget)==FALSE&&GetHasSpellEffect(SPELL_TRUE_SEEING,oTarget)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if(GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT,oTarget)==FALSE) return SPELL_FREEDOM_OF_MOVEMENT;
|
|
else if(GetHasSpell(SPELL_IMPROVED_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oTarget)==FALSE) return SPELL_IMPROVED_INVISIBILITY;
|
|
else if(GetHasSpell(SPELL_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELL_INVISIBILITY,oTarget)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oTarget)==FALSE) return SPELL_INVISIBILITY;
|
|
else if(GetHasSpell(SPELL_REGENERATE,oNPC)>0&&GetHasSpellEffect(SPELL_REGENERATE,oTarget)==FALSE) return SPELL_REGENERATE;
|
|
else if(GetHasSpell(SPELL_BARKSKIN,oNPC)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oTarget)==FALSE) return SPELL_BARKSKIN;
|
|
else if(GetHasSpell(SPELL_SHIELD_OF_FAITH,oNPC)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_FAITH,oTarget)==FALSE) return SPELL_SHIELD_OF_FAITH;
|
|
else if(GetHasSpell(SPELL_DEATH_WARD,oNPC)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oTarget)==FALSE) return SPELL_DEATH_WARD;
|
|
else if(GetHasSpell(SPELL_DISPLACEMENT,oNPC)>0&&GetHasSpellEffect(SPELL_DISPLACEMENT,oTarget)==FALSE) return SPELL_DISPLACEMENT;
|
|
else if(GetHasSpell(SPELL_ENDURE_ELEMENTS,oNPC)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oTarget)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if(GetHasSpell(SPELL_PROTECTION_FROM_EVIL,oNPC)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oTarget)==FALSE&&GetAlignmentGoodEvil(oTarget)!=ALIGNMENT_EVIL) return SPELL_PROTECTION_FROM_EVIL;
|
|
else if(GetHasSpell(SPELL_PROTECTION_FROM_GOOD,oNPC)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_GOOD,oTarget)==FALSE&&GetAlignmentGoodEvil(oTarget)!=ALIGNMENT_GOOD) return SPELL_PROTECTION_FROM_GOOD;
|
|
else if(GetHasSpell(SPELL_RESIST_ELEMENTS,oNPC)>0&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oTarget)==FALSE) return SPELL_RESIST_ELEMENTS;
|
|
else if(GetHasSpell(SPELL_RESISTANCE,oNPC)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_RESISTANCE;
|
|
else if(GetHasSpell(SPELL_BLESS,oNPC)>0&&GetHasSpellEffect(SPELL_BLESS,oTarget)==FALSE) return SPELL_BLESS;
|
|
else if(GetHasSpell(SPELL_IRONGUTS,oNPC)>0&&GetHasSpellEffect(SPELL_IRONGUTS,oTarget)==FALSE) return SPELL_IRONGUTS;
|
|
else if(GetHasSpell(SPELL_SPELL_RESISTANCE,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_SPELL_RESISTANCE,oTarget)==FALSE) return SPELL_SPELL_RESISTANCE;
|
|
else if(GetHasSpell(SPELL_PROTECTION_FROM_SPELLS,oNPC)>0&&bSC&&GetHasSpellEffect(SPELL_PROTECTION_FROM_SPELLS,oTarget)==FALSE) return SPELL_PROTECTION_FROM_SPELLS;
|
|
} // other
|
|
return 0;
|
|
} // caiGetAvailableDefensiveSpell()
|
|
|
|
int caiGetAvailableSummonSpell(object oNPC)
|
|
{ // PURPOSE: To choose a summon spell
|
|
float fCR=GetChallengeRating(oNPC);
|
|
object oMe=OBJECT_SELF;
|
|
if (GetIsPC(oNPC)) fCR=IntToFloat(GetLevelByPosition(1,oNPC)+GetLevelByPosition(2,oNPC)+GetLevelByPosition(3,oNPC));
|
|
if (fCR<2.1)
|
|
{ // low
|
|
if (GetHasSpell(SPELL_SUMMON_CREATURE_II,oMe)>0) return SPELL_SUMMON_CREATURE_II;
|
|
else if (GetHasSpell(SPELL_ANIMATE_DEAD,oMe)>0) return SPELL_ANIMATE_DEAD;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_I,oMe)>0) return SPELL_SUMMON_CREATURE_I;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_III,oMe)>0) return SPELL_SUMMON_CREATURE_III;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_IV,oMe)>0) return SPELL_SUMMON_CREATURE_IV;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_V,oMe)>0) return SPELL_SUMMON_CREATURE_V;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VI,oMe)>0) return SPELL_SUMMON_CREATURE_VI;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VII,oMe)>0) return SPELL_SUMMON_CREATURE_VII;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VIII,oMe)>0) return SPELL_SUMMON_CREATURE_VIII;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_IX,oMe)>0) return SPELL_SUMMON_CREATURE_IX;
|
|
else if (GetHasSpell(SPELL_SHELGARNS_PERSISTENT_BLADE,oNPC)>0) return SPELL_SHELGARNS_PERSISTENT_BLADE;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_SUMMON_SHADOW,oNPC)>0) return SPELL_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_SHADES_SUMMON_SHADOW,oNPC)>0) return SPELL_SHADES_SUMMON_SHADOW;
|
|
} // low
|
|
else if (fCR<6.1)
|
|
{ // mid
|
|
if (GetHasSpell(SPELL_SUMMON_CREATURE_V,oMe)>0) return SPELL_SUMMON_CREATURE_V;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_IV,oMe)>0) return SPELL_SUMMON_CREATURE_IV;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_III,oMe)>0) return SPELL_SUMMON_CREATURE_III;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VI,oMe)>0) return SPELL_SUMMON_CREATURE_VI;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VII,oMe)>0) return SPELL_SUMMON_CREATURE_VII;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VIII,oMe)>0) return SPELL_SUMMON_CREATURE_VIII;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_IX,oMe)>0) return SPELL_SUMMON_CREATURE_IX;
|
|
else if (GetHasSpell(SPELL_ANIMATE_DEAD,oMe)>0) return SPELL_ANIMATE_DEAD;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_II,oMe)>0) return SPELL_SUMMON_CREATURE_II;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_I,oMe)>0) return SPELL_SUMMON_CREATURE_I;
|
|
else if (GetHasSpell(SPELL_LESSER_PLANAR_BINDING,oMe)>0) return SPELL_LESSER_PLANAR_BINDING;
|
|
else if (GetHasSpell(SPELL_PLANAR_ALLY,oMe)>0) return SPELL_PLANAR_ALLY;
|
|
else if (GetHasSpell(SPELL_SHELGARNS_PERSISTENT_BLADE,oNPC)>0) return SPELL_SHELGARNS_PERSISTENT_BLADE;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_SUMMON_SHADOW,oNPC)>0) return SPELL_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_SHADES_SUMMON_SHADOW,oNPC)>0) return SPELL_SHADES_SUMMON_SHADOW;
|
|
} // mid
|
|
else
|
|
{ // high
|
|
if (GetHasSpell(SPELL_SUMMON_CREATURE_IX,oMe)>0) return SPELL_SUMMON_CREATURE_IX;
|
|
else if (GetHasSpell(SPELL_ELEMENTAL_SWARM,oMe)>0) return SPELL_ELEMENTAL_SWARM;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VIII,oMe)>0) return SPELL_SUMMON_CREATURE_VIII;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VII,oMe)>0) return SPELL_SUMMON_CREATURE_VII;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VI,oMe)>0) return SPELL_SUMMON_CREATURE_VI;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_V,oMe)>0) return SPELL_SUMMON_CREATURE_V;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_IV,oMe)>0) return SPELL_SUMMON_CREATURE_IV;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_III,oMe)>0) return SPELL_SUMMON_CREATURE_III;
|
|
else if (GetHasSpell(SPELL_ANIMATE_DEAD,oMe)>0) return SPELL_ANIMATE_DEAD;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_II,oMe)>0) return SPELL_SUMMON_CREATURE_II;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_I,oMe)>0) return SPELL_SUMMON_CREATURE_I;
|
|
else if (GetHasSpell(SPELL_GREATER_PLANAR_BINDING,oMe)>0) return SPELL_GREATER_PLANAR_BINDING;
|
|
else if (GetHasSpell(SPELL_CREATE_GREATER_UNDEAD,oMe)>0) return SPELL_CREATE_GREATER_UNDEAD;
|
|
else if (GetHasSpell(SPELL_CREATE_UNDEAD,oMe)>0) return SPELL_CREATE_UNDEAD;
|
|
else if (GetHasSpell(SPELL_LESSER_PLANAR_BINDING,oMe)>0) return SPELL_LESSER_PLANAR_BINDING;
|
|
else if (GetHasSpell(SPELL_SUMMON_SHADOW,oMe)>0) return SPELL_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_PLANAR_BINDING,oMe)>0) return SPELL_PLANAR_BINDING;
|
|
else if (GetHasSpell(SPELL_PLANAR_ALLY,oMe)>0) return SPELL_PLANAR_ALLY;
|
|
else if (GetHasSpell(SPELL_EPIC_DRAGON_KNIGHT,oMe)>0) return SPELL_EPIC_DRAGON_KNIGHT;
|
|
else if (GetHasSpell(SPELL_SHELGARNS_PERSISTENT_BLADE,oNPC)>0) return SPELL_SHELGARNS_PERSISTENT_BLADE;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_SUMMON_SHADOW,oNPC)>0) return SPELL_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW,oNPC)>0) return SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_SHADES_SUMMON_SHADOW,oNPC)>0) return SPELL_SHADES_SUMMON_SHADOW;
|
|
} // high
|
|
return 0;
|
|
} // caiGetAvailableSummonSpell()
|
|
|
|
int caiNaturalDefensive(object oNPC)
|
|
{ // PURPOSE: get a natural defensive ability
|
|
if (GetHasSpell(SPELLABILITY_AS_GHOSTLY_VISAGE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_AS_GHOSTLY_VISAGE,oNPC)==FALSE) return SPELLABILITY_AS_GHOSTLY_VISAGE;
|
|
else if (GetHasSpell(SPELLABILITY_AS_IMPROVED_INVISIBLITY,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_AS_IMPROVED_INVISIBLITY,oNPC)==FALSE) return SPELLABILITY_AS_IMPROVED_INVISIBLITY;
|
|
else if (GetHasSpell(SPELLABILITY_AS_INVISIBILITY,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_AS_INVISIBILITY,oNPC)==FALSE&&GetHasSpellEffect(SPELLABILITY_AS_IMPROVED_INVISIBLITY,oNPC)==FALSE) return SPELLABILITY_AS_IMPROVED_INVISIBLITY;
|
|
else if (GetHasSpell(SPELLABILITY_BATTLE_MASTERY,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BATTLE_MASTERY,oNPC)==FALSE) return SPELLABILITY_BATTLE_MASTERY;
|
|
else if (GetHasSpell(SPELLABILITY_BG_BULLS_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BG_BULLS_STRENGTH,oNPC)==FALSE) return SPELLABILITY_BG_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELLABILITY_DIVINE_PROTECTION,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DIVINE_PROTECTION,oNPC)==FALSE) return SPELLABILITY_DIVINE_PROTECTION;
|
|
else if (GetHasSpell(SPELLABILITY_DIVINE_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DIVINE_STRENGTH,oNPC)==FALSE) return SPELLABILITY_DIVINE_STRENGTH;
|
|
else if (GetHasSpell(SPELLABILITY_DIVINE_TRICKERY,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DIVINE_TRICKERY,oNPC)==FALSE) return SPELLABILITY_DIVINE_TRICKERY;
|
|
else if (GetHasSpell(SPELLABILITY_DW_DEFENSIVE_STANCE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DW_DEFENSIVE_STANCE,oNPC)==FALSE) return SPELLABILITY_DW_DEFENSIVE_STANCE;
|
|
else if (GetHasSpell(SPELLABILITY_EMPTY_BODY,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_EMPTY_BODY,oNPC)==FALSE) return SPELLABILITY_EMPTY_BODY;
|
|
else if (GetHasSpell(SPELLABILITY_EPIC_MIGHTY_RAGE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_EPIC_MIGHTY_RAGE,oNPC)==FALSE) return SPELLABILITY_EPIC_MIGHTY_RAGE;
|
|
else if (GetHasSpell(SPELLABILITY_BARBARIAN_RAGE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BARBARIAN_RAGE,oNPC)==FALSE) return SPELLABILITY_BARBARIAN_RAGE;
|
|
else if (GetHasSpell(SPELLABILITY_FEROCITY_1,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_FEROCITY_1,oNPC)==FALSE) return SPELLABILITY_FEROCITY_1;
|
|
else if (GetHasSpell(SPELLABILITY_FEROCITY_2,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_FEROCITY_2,oNPC)==FALSE) return SPELLABILITY_FEROCITY_2;
|
|
else if (GetHasSpell(SPELLABILITY_FEROCITY_3,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_FEROCITY_3,oNPC)==FALSE) return SPELLABILITY_FEROCITY_3;
|
|
else if (GetHasSpell(SPELLABILITY_INTENSITY_1,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_INTENSITY_1,oNPC)==FALSE) return SPELLABILITY_INTENSITY_1;
|
|
else if (GetHasSpell(SPELLABILITY_INTENSITY_2,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_INTENSITY_2,oNPC)==FALSE) return SPELLABILITY_INTENSITY_2;
|
|
else if (GetHasSpell(SPELLABILITY_INTENSITY_3,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_INTENSITY_3,oNPC)==FALSE) return SPELLABILITY_INTENSITY_3;
|
|
else if (GetHasSpell(SPELLABILITY_RAGE_3,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_RAGE_3,oNPC)==FALSE) return SPELLABILITY_RAGE_3;
|
|
else if (GetHasSpell(SPELLABILITY_RAGE_4,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_RAGE_4,oNPC)==FALSE) return SPELLABILITY_RAGE_4;
|
|
else if (GetHasSpell(SPELLABILITY_RAGE_5,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_RAGE_5,oNPC)==FALSE) return SPELLABILITY_RAGE_5;
|
|
else if (GetHasSpell(SPELLABILITY_ROGUES_CUNNING,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_ROGUES_CUNNING,oNPC)==FALSE) return SPELLABILITY_ROGUES_CUNNING;
|
|
else if (GetHasSpell(SPELLABILITY_TYRANT_FOG_MIST,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_TYRANT_FOG_MIST,oNPC)==FALSE) return SPELLABILITY_TYRANT_FOG_MIST;
|
|
else if (GetHasSpell(SPELLABILITY_WHOLENESS_OF_BODY,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_WHOLENESS_OF_BODY,oNPC)==FALSE) return SPELLABILITY_WHOLENESS_OF_BODY;
|
|
return 0;
|
|
} // caiNaturalDefensive()
|
|
|
|
int caiNaturalAttack(object oNPC,object oTarget)
|
|
{ // PURPOSE: Choose natural big attacks against target
|
|
int nRT=MyPRCGetRacialType(oTarget);
|
|
if (nRT==RACIAL_TYPE_UNDEAD)
|
|
{ // undead
|
|
if (GetHasSpell(SPELLABILITY_TURN_UNDEAD,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_TURN_UNDEAD,oTarget)==FALSE&&d4()<3) return SPELLABILITY_TURN_UNDEAD;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DESTROY_EVIL,oNPC)>0&&d4()<3) return SPELLABILITY_GAZE_DESTROY_EVIL;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_CONE_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_CONE_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_CONE_SONIC,oNPC)>0&&d4()<3) return SPELLABILITY_CONE_SONIC;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_ACID,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_ACID;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_GAS,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_GAS;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_LIGHTNING,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_LIGHTNING;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_PARALYZE,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_PARALYZE;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_SLOW,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_SLOW;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_WEAKEN,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_WEAKEN;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_WING_BUFFET,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_WING_BUFFET;
|
|
else if (GetHasSpell(SPELLABILITY_EPIC_CURSE_SONG,oNPC)>0&&d4()<3) return SPELLABILITY_EPIC_CURSE_SONG;
|
|
else if (GetHasSpell(SPELLABILITY_EPIC_IMPROVED_WHIRLWIND,oNPC)>0&&d4()<3) return SPELLABILITY_EPIC_IMPROVED_WHIRLWIND;
|
|
else if (GetHasSpell(SPELLABILITY_GOLEM_BREATH_GAS,oNPC)>0&&d4()<3) return SPELLABILITY_GOLEM_BREATH_GAS;
|
|
else if (GetHasSpell(SPELLABILITY_HELL_HOUND_FIREBREATH,oNPC)>0&&d4()<3) return SPELLABILITY_HELL_HOUND_FIREBREATH;
|
|
else if (GetHasSpell(SPELLABILITY_HOWL_SONIC,oNPC)>0&&d4()<3) return SPELLABILITY_HOWL_SONIC;
|
|
else if (GetHasSpell(SPELLABILITY_MANTICORE_SPIKES,oNPC)>0&&d4()<3) return SPELLABILITY_MANTICORE_SPIKES;
|
|
else if (GetHasSpell(SPELLABILITY_MEPHIT_SALT_BREATH,oNPC)>0&&d4()<3) return SPELLABILITY_MEPHIT_SALT_BREATH;
|
|
else if (GetHasSpell(SPELLABILITY_MEPHIT_STEAM_BREATH,oNPC)>0&&d4()<3) return SPELLABILITY_MEPHIT_STEAM_BREATH;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_DROWN,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_DROWN;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_HOLY,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_HOLY;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_LIGHTNING,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_LIGHTNING;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_WHIRLWIND,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_WHIRLWIND;
|
|
else if (GetHasSpell(SPELLABILITY_SMITE_EVIL,oNPC)>0&&d4()<3) return SPELLABILITY_SMITE_EVIL;
|
|
else if (GetHasSpell(SPELLABILITY_TOUCH_PETRIFY,oNPC)>0&&d4()<3) return SPELLABILITY_TOUCH_PETRIFY;
|
|
else if (GetHasSpell(SPELLABILITY_WHIRLWIND,oNPC)>0&&d4()<3) return SPELLABILITY_WHIRLWIND;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_PETRIFY,oNPC)>0&&d4()<3) return SPELLABILITY_GAZE_PETRIFY;
|
|
else if (GetHasSpell(SPELLABILITY_BREATH_PETRIFY,oNPC)>0&&d4()<3) return SPELLABILITY_BREATH_PETRIFY;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_AURA_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_ELECTRICITY,oNPC)>0&&d4()<3) return SPELLABILITY_AURA_ELECTRICITY;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_AURA_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ACID,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_ACID;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_KNOCKDOWN,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_KNOCKDOWN;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_LIGHTNING,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_LIGHTNING;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_SHARDS,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_SHARDS;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_SLOW,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_SLOW;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_WEB,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_WEB;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DOOM,oNPC)>0&&d4()<3) return SPELLABILITY_GAZE_DOOM;
|
|
} // undead
|
|
else if (nRT!=RACIAL_TYPE_CONSTRUCT)
|
|
{ // anything but, constructs
|
|
if (GetHasSpell(SPELLABILITY_GAZE_DESTROY_EVIL,oNPC)>0&&d4()<3&&GetAlignmentGoodEvil(oTarget)==ALIGNMENT_EVIL) return SPELLABILITY_GAZE_DESTROY_EVIL;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DESTROY_GOOD,oNPC)>0&&d4()<3&&GetAlignmentGoodEvil(oTarget)==ALIGNMENT_GOOD) return SPELLABILITY_GAZE_DESTROY_GOOD;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DESTROY_CHAOS,oNPC)>0&&d4()<3&&GetAlignmentLawChaos(oTarget)==ALIGNMENT_CHAOTIC) return SPELLABILITY_GAZE_DESTROY_CHAOS;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DESTROY_LAW,oNPC)>0&&d4()<3&&GetAlignmentLawChaos(oTarget)==ALIGNMENT_LAWFUL) return SPELLABILITY_GAZE_DESTROY_LAW;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DOMINATE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_GAZE_DOMINATE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_GAZE_DOMINATE;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_CHARM,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_GAZE_CHARM,oTarget)==FALSE&&d4()<3) return SPELLABILITY_GAZE_CHARM;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_CONFUSION,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_GAZE_CONFUSION,oTarget)==FALSE&&d4()<3) return SPELLABILITY_GAZE_CONFUSION;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DAZE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_GAZE_DAZE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_GAZE_DAZE;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_FEAR,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_GAZE_FEAR,oTarget)==FALSE&&d4()<3) return SPELLABILITY_GAZE_FEAR;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_PARALYSIS,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_GAZE_PARALYSIS,oTarget)==FALSE&&d4()<3) return SPELLABILITY_GAZE_PARALYSIS;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_STUNNED,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_GAZE_STUNNED,oTarget)==FALSE&&d4()<3) return SPELLABILITY_GAZE_STUNNED;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_FEAR,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DRAGON_BREATH_FEAR,oTarget)==FALSE&&d4()<3) return SPELLABILITY_DRAGON_BREATH_FEAR;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_NEGATIVE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DRAGON_BREATH_NEGATIVE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_DRAGON_BREATH_NEGATIVE;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_SLEEP,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DRAGON_BREATH_SLEEP,oTarget)==FALSE&&d4()<3) return SPELLABILITY_DRAGON_BREATH_SLEEP;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_FEAR,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_DRAGON_FEAR,oTarget)==FALSE&&d4()<3) return SPELLABILITY_DRAGON_FEAR;
|
|
else if (GetHasSpell(SPELLABILITY_CONE_DISEASE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_CONE_DISEASE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_CONE_DISEASE;
|
|
else if (GetHasSpell(SPELLABILITY_CONE_POISON,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_CONE_POISON,oTarget)==FALSE&&d4()<3) return SPELLABILITY_CONE_POISON;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_STUN,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_STUN,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_STUN;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_POISON,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_POISON,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_POISON;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_LEVEL_DRAIN,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_LEVEL_DRAIN,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_LEVEL_DRAIN;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_DOMINATE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_DOMINATE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_DOMINATE;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_DISEASE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_DISEASE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_DISEASE;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_DEATH,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_DEATH,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_DEATH;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_DAZE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_DAZE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_DAZE;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_CONFUSE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_CONFUSE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_CONFUSE;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_CHARM,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_CHARM,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_CHARM;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ABILITY_DRAIN_CHARISMA,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_ABILITY_DRAIN_CHARISMA,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_ABILITY_DRAIN_CHARISMA;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ABILITY_DRAIN_CONSTITUTION,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_ABILITY_DRAIN_CONSTITUTION,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_ABILITY_DRAIN_CONSTITUTION;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ABILITY_DRAIN_DEXTERITY,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_ABILITY_DRAIN_DEXTERITY,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_ABILITY_DRAIN_DEXTERITY;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ABILITY_DRAIN_INTELLIGENCE,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_ABILITY_DRAIN_INTELLIGENCE,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_ABILITY_DRAIN_INTELLIGENCE;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ABILITY_DRAIN_STRENGTH,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_ABILITY_DRAIN_STRENGTH,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_ABILITY_DRAIN_STRENGTH;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ABILITY_DRAIN_WISDOM,oNPC)>0&&GetHasSpellEffect(SPELLABILITY_BOLT_ABILITY_DRAIN_WISDOM,oTarget)==FALSE&&d4()<3) return SPELLABILITY_BOLT_ABILITY_DRAIN_WISDOM;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_CONE_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_CONE_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_CONE_SONIC,oNPC)>0&&d4()<3) return SPELLABILITY_CONE_SONIC;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_ACID,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_ACID;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_GAS,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_GAS;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_LIGHTNING,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_LIGHTNING;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_PARALYZE,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_PARALYZE;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_SLOW,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_SLOW;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_BREATH_WEAKEN,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_BREATH_WEAKEN;
|
|
else if (GetHasSpell(SPELLABILITY_DRAGON_WING_BUFFET,oNPC)>0&&d4()<3) return SPELLABILITY_DRAGON_WING_BUFFET;
|
|
else if (GetHasSpell(SPELLABILITY_EPIC_CURSE_SONG,oNPC)>0&&d4()<3) return SPELLABILITY_EPIC_CURSE_SONG;
|
|
else if (GetHasSpell(SPELLABILITY_EPIC_IMPROVED_WHIRLWIND,oNPC)>0&&d4()<3) return SPELLABILITY_EPIC_IMPROVED_WHIRLWIND;
|
|
else if (GetHasSpell(SPELLABILITY_GOLEM_BREATH_GAS,oNPC)>0&&d4()<3) return SPELLABILITY_GOLEM_BREATH_GAS;
|
|
else if (GetHasSpell(SPELLABILITY_HELL_HOUND_FIREBREATH,oNPC)>0&&d4()<3) return SPELLABILITY_HELL_HOUND_FIREBREATH;
|
|
else if (GetHasSpell(SPELLABILITY_HOWL_SONIC,oNPC)>0&&d4()<3) return SPELLABILITY_HOWL_SONIC;
|
|
else if (GetHasSpell(SPELLABILITY_MANTICORE_SPIKES,oNPC)>0&&d4()<3) return SPELLABILITY_MANTICORE_SPIKES;
|
|
else if (GetHasSpell(SPELLABILITY_MEPHIT_SALT_BREATH,oNPC)>0&&d4()<3) return SPELLABILITY_MEPHIT_SALT_BREATH;
|
|
else if (GetHasSpell(SPELLABILITY_MEPHIT_STEAM_BREATH,oNPC)>0&&d4()<3) return SPELLABILITY_MEPHIT_STEAM_BREATH;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_DROWN,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_DROWN;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_HOLY,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_HOLY;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_LIGHTNING,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_LIGHTNING;
|
|
else if (GetHasSpell(SPELLABILITY_PULSE_WHIRLWIND,oNPC)>0&&d4()<3) return SPELLABILITY_PULSE_WHIRLWIND;
|
|
else if (GetHasSpell(SPELLABILITY_SMITE_EVIL,oNPC)>0&&d4()<3) return SPELLABILITY_SMITE_EVIL;
|
|
else if (GetHasSpell(SPELLABILITY_TOUCH_PETRIFY,oNPC)>0&&d4()<3) return SPELLABILITY_TOUCH_PETRIFY;
|
|
else if (GetHasSpell(SPELLABILITY_WHIRLWIND,oNPC)>0&&d4()<3) return SPELLABILITY_WHIRLWIND;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_PETRIFY,oNPC)>0&&d4()<3) return SPELLABILITY_GAZE_PETRIFY;
|
|
else if (GetHasSpell(SPELLABILITY_BREATH_PETRIFY,oNPC)>0&&d4()<3) return SPELLABILITY_BREATH_PETRIFY;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_AURA_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_ELECTRICITY,oNPC)>0&&d4()<3) return SPELLABILITY_AURA_ELECTRICITY;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_FIRE,oNPC)>0&&d4()<3) return SPELLABILITY_AURA_FIRE;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_ACID,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_ACID;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_COLD,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_COLD;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_KNOCKDOWN,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_KNOCKDOWN;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_LIGHTNING,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_LIGHTNING;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_SHARDS,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_SHARDS;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_SLOW,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_SLOW;
|
|
else if (GetHasSpell(SPELLABILITY_BOLT_WEB,oNPC)>0&&d4()<3) return SPELLABILITY_BOLT_WEB;
|
|
else if (GetHasSpell(SPELLABILITY_GAZE_DOOM,oNPC)>0&&d4()<3) return SPELLABILITY_GAZE_DOOM;
|
|
} // anything but, constructs
|
|
else
|
|
{ // constructs
|
|
} // constructs
|
|
return -1;
|
|
} // caiNaturalBigAttack()
|
|
|
|
int caiProfessionalAntiStealth()
|
|
{ // PURPOSE: Return spells to counter invisibility, stealth, etc.
|
|
object oMe=OBJECT_SELF;
|
|
if (GetHasSpell(SPELL_TRUE_SEEING,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_SEEING,oMe)==FALSE) return SPELL_TRUE_SEEING;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oMe)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY_PURGE,oMe)>0) return SPELL_INVISIBILITY_PURGE;
|
|
else if (GetHasSpell(SPELL_PREMONITION,oMe)>0&&GetHasSpellEffect(SPELL_PREMONITION,oMe)==FALSE) return SPELL_PREMONITION;
|
|
else if (GetHasSpell(SPELL_DEATH_WARD,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oMe)==FALSE) return SPELL_DEATH_WARD;
|
|
else if (GetHasSpell(SPELL_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_LESSER_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oMe)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_SANCTUARY,oMe)>0&&GetHasSpellEffect(SPELL_SANCTUARY,oMe)==FALSE) return SPELL_SANCTUARY;
|
|
return 0;
|
|
} // caiProfessionalAntiStealth()
|
|
|
|
int caiProfessionalDefensive(object oTarget)
|
|
{ // PURPOSE: Return defensive spells versus specified target
|
|
object oMe=OBJECT_SELF;
|
|
int nUND=GetLocalInt(oMe,"nCAICountUND");
|
|
int nOUT=GetLocalInt(oMe,"nCAICountOUT");
|
|
int nCON=GetLocalInt(oMe,"nCAICountCON");
|
|
int nARC=GetLocalInt(oMe,"nCAICountARC");
|
|
int nDIV=GetLocalInt(oMe,"nCAICountDIV");
|
|
int nDRA=GetLocalInt(oMe,"nCAICountDRA");
|
|
int nRGD=GetLocalInt(oMe,"nCAICountRGD");
|
|
int nMEL=GetLocalInt(oMe,"nCAICountMEL");
|
|
int nRT=MyPRCGetRacialType(oTarget);
|
|
object oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTarget);
|
|
int nAGE=GetAlignmentGoodEvil(oMe);
|
|
int nALC=GetAlignmentLawChaos(oMe);
|
|
if (nDRA>0)
|
|
{ // dragons are near
|
|
if (GetHasSpell(SPELL_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_LESSER_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oMe)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_PREMONITION,oMe)>0&&GetHasSpellEffect(SPELL_PREMONITION,oMe)==FALSE) return SPELL_PREMONITION;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_RESIST_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oMe)==FALSE&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oMe)==FALSE&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oMe)==FALSE&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
} // dragons are near
|
|
if (nRGD>0)
|
|
{ // ranged
|
|
if (GetHasSpell(SPELL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD,oMe)==FALSE) return SPELL_SHIELD;
|
|
} // ranged
|
|
if (nARC>0)
|
|
{ // arcane opponents
|
|
if (GetHasSpell(SPELL_GREATER_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_GREATER_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_TIME_STOP,oMe)>0&&GetHasSpellEffect(SPELL_TIME_STOP,oMe)==FALSE&&d4()==1) return SPELL_TIME_STOP;
|
|
else if (GetHasSpell(SPELL_PREMONITION,oMe)>0&&GetHasSpellEffect(SPELL_PREMONITION,oMe)==FALSE) return SPELL_PREMONITION;
|
|
else if (GetHasSpell(SPELL_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_MIND_BLANK;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_PROTECTION,oMe)>0&&GetHasSpellEffect(SPELLABILITY_AURA_PROTECTION,oMe)==FALSE) return SPELLABILITY_AURA_PROTECTION;
|
|
else if (GetHasSpell(SPELL_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_TRUE_SEEING,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_SEEING,oMe)==FALSE) return SPELL_TRUE_SEEING;
|
|
else if (GetHasSpell(SPELL_SHADOW_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_SHIELD,oMe)==FALSE) return SPELL_SHADOW_SHIELD;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oMe)>0&&GetHasSpellEffect(SPELL_REGENERATE,oMe)==FALSE) return SPELL_REGENERATE;
|
|
else if (GetHasSpell(SPELL_AURA_OF_VITALITY,oMe)>0&&GetHasSpellEffect(SPELL_AURA_OF_VITALITY,oMe)==FALSE) return SPELL_AURA_OF_VITALITY;
|
|
else if (GetHasSpell(SPELL_ETHEREAL_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_ETHEREAL_VISAGE;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DEATH,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DEATH,oMe)==FALSE) return SPELL_CIRCLE_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_SPELL_RESISTANCE,oMe)==FALSE) return SPELL_SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_MONSTROUS_REGENERATION,oMe)>0&&GetHasSpellEffect(SPELL_MONSTROUS_REGENERATION,oMe)==FALSE) return SPELL_MONSTROUS_REGENERATION;
|
|
else if (GetHasSpell(SPELL_LESSER_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_LESSER_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_LESSER_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oMe)==FALSE&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_MINOR_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DOOM,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DOOM,oMe)==FALSE) return SPELL_CIRCLE_OF_DOOM;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_DEATH_WARD,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oMe)==FALSE) return SPELL_DEATH_WARD;
|
|
else if (GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT,oMe)>0&&GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT,oMe)==FALSE) return SPELL_FREEDOM_OF_MOVEMENT;
|
|
else if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_IMPROVED_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_MASS_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_MASS_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_DIVINE_POWER,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_POWER,oMe)==FALSE) return SPELL_DIVINE_POWER;
|
|
else if (GetHasSpell(SPELL_ELEMENTAL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD,oMe)==FALSE) return SPELL_ELEMENTAL_SHIELD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_PROTECTION_FROM_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_PRAYER,oMe)>0&&GetHasSpellEffect(SPELL_PRAYER,oMe)==FALSE) return SPELL_PRAYER;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oMe)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oMe)==FALSE&&d4()<3) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY_SPHERE,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY_SPHERE;
|
|
else if (GetHasSpell(SPELL_HASTE,oMe)>0&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_DISPLACEMENT,oMe)>0&&GetHasSpellEffect(SPELL_DISPLACEMENT,oMe)==FALSE) return SPELL_DISPLACEMENT;
|
|
else if (GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)>0&&GetHasSpellEffect(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)==FALSE&&d4()<3) return SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oMe)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_RESIST_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oMe)==FALSE) return SPELL_RESIST_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_INIVSIBILITY;
|
|
else if (GetHasSpell(SPELL_GHOSTLY_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_GHOSTLY_VISAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_GHOSTLY_VISAGE;
|
|
else if (GetHasSpell(SPELL_DEATH_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_ARMOR,oMe)==FALSE) return SPELL_DEATH_ARMOR;
|
|
else if (GetHasSpell(SPELL_SHADES_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_SHADES_STONESKIN;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oMe)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_AURAOFGLORY,oMe)>0&&GetHasSpellEffect(SPELL_AURAOFGLORY,oMe)==FALSE) return SPELL_AURAOFGLORY;
|
|
else if (GetHasSpell(SPELL_AID,oMe)>0&&GetHasSpellEffect(SPELL_AID,oMe)==FALSE) return SPELL_AID;
|
|
else if (GetHasSpell(SPELL_TRUE_STRIKE,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_STRIKE,oMe)==FALSE) return SPELL_TRUE_STRIKE;
|
|
else if (GetHasSpell(SPELL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD,oMe)==FALSE) return SPELL_SHIELD;
|
|
else if (GetHasSpell(SPELL_SHIELD_OF_FAITH,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_FAITH,oMe)==FALSE) return SPELL_SHIELD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE) return SPELL_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SANCTUARY,oMe)>0&&GetHasSpellEffect(SPELL_SANCTUARY,oMe)==FALSE&&d4()==1) return SPELL_SANCTUARY;
|
|
else if (GetHasSpell(SPELL_IRONGUTS,oMe)>0&&GetHasSpellEffect(SPELL_IRONGUTS,oMe)==FALSE) return SPELL_IRONGUTS;
|
|
else if (GetHasSpell(SPELL_EXPEDITIOUS_RETREAT,oMe)>0&&GetHasSpellEffect(SPELL_EXPEDITIOUS_RETREAT,oMe)==FALSE&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_EXPEDITIOUS_RETREAT;
|
|
else if (GetHasSpell(SPELL_ENTROPIC_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ENTROPIC_SHIELD,oMe)==FALSE) return SPELL_ENTROPIC_SHIELD;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_DIVINE_FAVOR,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_FAVOR,oMe)==FALSE) return SPELL_DIVINE_FAVOR;
|
|
else if (GetHasSpell(SPELL_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_VINE_MINE_CAMOUFLAGE;
|
|
else if (GetHasSpell(SPELL_VINE_MINE_CAMOUFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_VINE_MINE_CAMOUFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_BLESS_WEAPON,oMe)>0&&GetHasSpellEffect(SPELL_BLESS_WEAPON,oMe)==FALSE) return SPELL_BLESS_WEAPON;
|
|
else if (GetHasSpell(SPELL_BLESS,oMe)>0&&GetHasSpellEffect(SPELL_BLESS,oMe)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_EVIL,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oMe)==FALSE&&nAGE!=ALIGNMENT_EVIL) return SPELL_PROTECTION_FROM_EVIL;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_GOOD,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_GOOD,oMe)==FALSE&&nAGE!=ALIGNMENT_GOOD) return SPELL_PROTECTION_FROM_GOOD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_LAW,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_LAW,oMe)==FALSE&&nALC!=ALIGNMENT_LAWFUL) return SPELL_PROTECTION_FROM_LAW;
|
|
else if (GetHasSpell(SPELL_PROTECTION__FROM_CHAOS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION__FROM_CHAOS,oMe)==FALSE&&nALC!=ALIGNMENT_CHAOTIC) return SPELL_PROTECTION__FROM_CHAOS;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oMe)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_VIRTUE,oMe)>0&&GetHasSpellEffect(SPELL_VIRTUE,oMe)==FALSE) return SPELL_VIRTUE;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_SPELLS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_SPELLS,oMe)==FALSE) return SPELL_PROTECTION_FROM_SPELLS;
|
|
} // arcane opponents
|
|
if (nDIV>0)
|
|
{ // divine opponents
|
|
if (GetHasSpell(SPELL_GREATER_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_GREATER_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_TIME_STOP,oMe)>0&&GetHasSpellEffect(SPELL_TIME_STOP,oMe)==FALSE&&d4()==1) return SPELL_TIME_STOP;
|
|
else if (GetHasSpell(SPELL_PREMONITION,oMe)>0&&GetHasSpellEffect(SPELL_PREMONITION,oMe)==FALSE) return SPELL_PREMONITION;
|
|
else if (GetHasSpell(SPELL_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_MIND_BLANK;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_PROTECTION,oMe)>0&&GetHasSpellEffect(SPELLABILITY_AURA_PROTECTION,oMe)==FALSE) return SPELLABILITY_AURA_PROTECTION;
|
|
else if (GetHasSpell(SPELL_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_TRUE_SEEING,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_SEEING,oMe)==FALSE) return SPELL_TRUE_SEEING;
|
|
else if (GetHasSpell(SPELL_SHADOW_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_SHIELD,oMe)==FALSE) return SPELL_SHADOW_SHIELD;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oMe)>0&&GetHasSpellEffect(SPELL_REGENERATE,oMe)==FALSE) return SPELL_REGENERATE;
|
|
else if (GetHasSpell(SPELL_AURA_OF_VITALITY,oMe)>0&&GetHasSpellEffect(SPELL_AURA_OF_VITALITY,oMe)==FALSE) return SPELL_AURA_OF_VITALITY;
|
|
else if (GetHasSpell(SPELL_ETHEREAL_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_ETHEREAL_VISAGE;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DEATH,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DEATH,oMe)==FALSE) return SPELL_CIRCLE_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_SPELL_RESISTANCE,oMe)==FALSE) return SPELL_SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_MONSTROUS_REGENERATION,oMe)>0&&GetHasSpellEffect(SPELL_MONSTROUS_REGENERATION,oMe)==FALSE) return SPELL_MONSTROUS_REGENERATION;
|
|
else if (GetHasSpell(SPELL_LESSER_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_LESSER_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_LESSER_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oMe)==FALSE&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_MINOR_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DOOM,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DOOM,oMe)==FALSE) return SPELL_CIRCLE_OF_DOOM;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_DEATH_WARD,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oMe)==FALSE) return SPELL_DEATH_WARD;
|
|
else if (GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT,oMe)>0&&GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT,oMe)==FALSE) return SPELL_FREEDOM_OF_MOVEMENT;
|
|
else if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_IMPROVED_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_MASS_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_MASS_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_DIVINE_POWER,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_POWER,oMe)==FALSE) return SPELL_DIVINE_POWER;
|
|
else if (GetHasSpell(SPELL_ELEMENTAL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD,oMe)==FALSE) return SPELL_ELEMENTAL_SHIELD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_PROTECTION_FROM_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_PRAYER,oMe)>0&&GetHasSpellEffect(SPELL_PRAYER,oMe)==FALSE) return SPELL_PRAYER;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oMe)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oMe)==FALSE&&d4()<3) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY_SPHERE,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY_SPHERE;
|
|
else if (GetHasSpell(SPELL_HASTE,oMe)>0&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_DISPLACEMENT,oMe)>0&&GetHasSpellEffect(SPELL_DISPLACEMENT,oMe)==FALSE) return SPELL_DISPLACEMENT;
|
|
else if (GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)>0&&GetHasSpellEffect(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)==FALSE&&d4()<3) return SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oMe)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_RESIST_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oMe)==FALSE) return SPELL_RESIST_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_INIVSIBILITY;
|
|
else if (GetHasSpell(SPELL_GHOSTLY_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_GHOSTLY_VISAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_GHOSTLY_VISAGE;
|
|
else if (GetHasSpell(SPELL_DEATH_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_ARMOR,oMe)==FALSE) return SPELL_DEATH_ARMOR;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oMe)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oMe)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_CATS_GRACE,oMe)>0&&GetHasSpellEffect(SPELL_CATS_GRACE,oMe)==FALSE) return SPELL_CATS_GRACE;
|
|
else if (GetHasSpell(SPELL_SHADES_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_SHADES_STONESKIN;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oMe)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_AURAOFGLORY,oMe)>0&&GetHasSpellEffect(SPELL_AURAOFGLORY,oMe)==FALSE) return SPELL_AURAOFGLORY;
|
|
else if (GetHasSpell(SPELL_AID,oMe)>0&&GetHasSpellEffect(SPELL_AID,oMe)==FALSE) return SPELL_AID;
|
|
else if (GetHasSpell(SPELL_TRUE_STRIKE,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_STRIKE,oMe)==FALSE) return SPELL_TRUE_STRIKE;
|
|
else if (GetHasSpell(SPELL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD,oMe)==FALSE) return SPELL_SHIELD;
|
|
else if (GetHasSpell(SPELL_SHIELD_OF_FAITH,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_FAITH,oMe)==FALSE) return SPELL_SHIELD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE) return SPELL_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SANCTUARY,oMe)>0&&GetHasSpellEffect(SPELL_SANCTUARY,oMe)==FALSE&&d4()==1) return SPELL_SANCTUARY;
|
|
else if (GetHasSpell(SPELL_IRONGUTS,oMe)>0&&GetHasSpellEffect(SPELL_IRONGUTS,oMe)==FALSE) return SPELL_IRONGUTS;
|
|
else if (GetHasSpell(SPELL_EXPEDITIOUS_RETREAT,oMe)>0&&GetHasSpellEffect(SPELL_EXPEDITIOUS_RETREAT,oMe)==FALSE&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_EXPEDITIOUS_RETREAT;
|
|
else if (GetHasSpell(SPELL_ENTROPIC_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ENTROPIC_SHIELD,oMe)==FALSE) return SPELL_ENTROPIC_SHIELD;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_DIVINE_FAVOR,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_FAVOR,oMe)==FALSE) return SPELL_DIVINE_FAVOR;
|
|
else if (GetHasSpell(SPELL_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_VINE_MINE_CAMOUFLAGE;
|
|
else if (GetHasSpell(SPELL_VINE_MINE_CAMOUFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_VINE_MINE_CAMOUFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_BLESS_WEAPON,oMe)>0&&GetHasSpellEffect(SPELL_BLESS_WEAPON,oMe)==FALSE) return SPELL_BLESS_WEAPON;
|
|
else if (GetHasSpell(SPELL_BLESS,oMe)>0&&GetHasSpellEffect(SPELL_BLESS,oMe)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_EVIL,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oMe)==FALSE&&nAGE!=ALIGNMENT_EVIL) return SPELL_PROTECTION_FROM_EVIL;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_GOOD,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_GOOD,oMe)==FALSE&&nAGE!=ALIGNMENT_GOOD) return SPELL_PROTECTION_FROM_GOOD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_LAW,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_LAW,oMe)==FALSE&&nALC!=ALIGNMENT_LAWFUL) return SPELL_PROTECTION_FROM_LAW;
|
|
else if (GetHasSpell(SPELL_PROTECTION__FROM_CHAOS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION__FROM_CHAOS,oMe)==FALSE&&nALC!=ALIGNMENT_CHAOTIC) return SPELL_PROTECTION__FROM_CHAOS;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oMe)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_VIRTUE,oMe)>0&&GetHasSpellEffect(SPELL_VIRTUE,oMe)==FALSE) return SPELL_VIRTUE;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_SPELLS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_SPELLS,oMe)==FALSE) return SPELL_PROTECTION_FROM_SPELLS;
|
|
} // divine opponents
|
|
if (nUND>0)
|
|
{ // undead opponents
|
|
if (GetHasSpell(SPELL_PREMONITION,oMe)>0&&GetHasSpellEffect(SPELL_PREMONITION,oMe)==FALSE) return SPELL_PREMONITION;
|
|
else if (GetHasSpell(SPELL_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_MIND_BLANK;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_PROTECTION,oMe)>0&&GetHasSpellEffect(SPELLABILITY_AURA_PROTECTION,oMe)==FALSE) return SPELLABILITY_AURA_PROTECTION;
|
|
else if (GetHasSpell(SPELL_TRUE_SEEING,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_SEEING,oMe)==FALSE) return SPELL_TRUE_SEEING;
|
|
else if (GetHasSpell(SPELL_SHADOW_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_SHIELD,oMe)==FALSE) return SPELL_SHADOW_SHIELD;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oMe)>0&&GetHasSpellEffect(SPELL_REGENERATE,oMe)==FALSE) return SPELL_REGENERATE;
|
|
else if (GetHasSpell(SPELL_AURA_OF_VITALITY,oMe)>0&&GetHasSpellEffect(SPELL_AURA_OF_VITALITY,oMe)==FALSE) return SPELL_AURA_OF_VITALITY;
|
|
else if (GetHasSpell(SPELL_ETHEREAL_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_ETHEREAL_VISAGE;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DEATH,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DEATH,oMe)==FALSE) return SPELL_CIRCLE_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_MONSTROUS_REGENERATION,oMe)>0&&GetHasSpellEffect(SPELL_MONSTROUS_REGENERATION,oMe)==FALSE) return SPELL_MONSTROUS_REGENERATION;
|
|
else if (GetHasSpell(SPELL_LESSER_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oMe)==FALSE&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_MINOR_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DOOM,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DOOM,oMe)==FALSE) return SPELL_CIRCLE_OF_DOOM;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_DEATH_WARD,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oMe)==FALSE) return SPELL_DEATH_WARD;
|
|
else if (GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT,oMe)>0&&GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT,oMe)==FALSE) return SPELL_FREEDOM_OF_MOVEMENT;
|
|
else if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_IMPROVED_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_MASS_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_MASS_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_DIVINE_POWER,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_POWER,oMe)==FALSE) return SPELL_DIVINE_POWER;
|
|
else if (GetHasSpell(SPELL_ELEMENTAL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD,oMe)==FALSE) return SPELL_ELEMENTAL_SHIELD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_PROTECTION_FROM_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_PRAYER,oMe)>0&&GetHasSpellEffect(SPELL_PRAYER,oMe)==FALSE) return SPELL_PRAYER;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oMe)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oMe)==FALSE&&d4()<3) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY_SPHERE,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY_SPHERE;
|
|
else if (GetHasSpell(SPELL_HASTE,oMe)>0&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_DISPLACEMENT,oMe)>0&&GetHasSpellEffect(SPELL_DISPLACEMENT,oMe)==FALSE) return SPELL_DISPLACEMENT;
|
|
else if (GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)>0&&GetHasSpellEffect(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)==FALSE&&d4()<3) return SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oMe)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_RESIST_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oMe)==FALSE) return SPELL_RESIST_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_INIVSIBILITY;
|
|
else if (GetHasSpell(SPELL_GHOSTLY_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_GHOSTLY_VISAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_GHOSTLY_VISAGE;
|
|
else if (GetHasSpell(SPELL_DEATH_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_ARMOR,oMe)==FALSE) return SPELL_DEATH_ARMOR;
|
|
else if (GetHasSpell(SPELL_CATS_GRACE,oMe)>0&&GetHasSpellEffect(SPELL_CATS_GRACE,oMe)==FALSE) return SPELL_CATS_GRACE;
|
|
else if (GetHasSpell(SPELL_SHADES_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_SHADES_STONESKIN;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oMe)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_AURAOFGLORY,oMe)>0&&GetHasSpellEffect(SPELL_AURAOFGLORY,oMe)==FALSE) return SPELL_AURAOFGLORY;
|
|
else if (GetHasSpell(SPELL_AID,oMe)>0&&GetHasSpellEffect(SPELL_AID,oMe)==FALSE) return SPELL_AID;
|
|
else if (GetHasSpell(SPELL_TRUE_STRIKE,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_STRIKE,oMe)==FALSE) return SPELL_TRUE_STRIKE;
|
|
else if (GetHasSpell(SPELL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD,oMe)==FALSE) return SPELL_SHIELD;
|
|
else if (GetHasSpell(SPELL_SHIELD_OF_FAITH,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_FAITH,oMe)==FALSE) return SPELL_SHIELD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE) return SPELL_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SANCTUARY,oMe)>0&&GetHasSpellEffect(SPELL_SANCTUARY,oMe)==FALSE&&d4()==1) return SPELL_SANCTUARY;
|
|
else if (GetHasSpell(SPELL_IRONGUTS,oMe)>0&&GetHasSpellEffect(SPELL_IRONGUTS,oMe)==FALSE) return SPELL_IRONGUTS;
|
|
else if (GetHasSpell(SPELL_EXPEDITIOUS_RETREAT,oMe)>0&&GetHasSpellEffect(SPELL_EXPEDITIOUS_RETREAT,oMe)==FALSE&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_EXPEDITIOUS_RETREAT;
|
|
else if (GetHasSpell(SPELL_ENTROPIC_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ENTROPIC_SHIELD,oMe)==FALSE) return SPELL_ENTROPIC_SHIELD;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_DIVINE_FAVOR,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_FAVOR,oMe)==FALSE) return SPELL_DIVINE_FAVOR;
|
|
else if (GetHasSpell(SPELL_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_VINE_MINE_CAMOUFLAGE;
|
|
else if (GetHasSpell(SPELL_VINE_MINE_CAMOUFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_VINE_MINE_CAMOUFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_BLESS_WEAPON,oMe)>0&&GetHasSpellEffect(SPELL_BLESS_WEAPON,oMe)==FALSE) return SPELL_BLESS_WEAPON;
|
|
else if (GetHasSpell(SPELL_BLESS,oMe)>0&&GetHasSpellEffect(SPELL_BLESS,oMe)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_EVIL,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oMe)==FALSE&&nAGE!=ALIGNMENT_EVIL) return SPELL_PROTECTION_FROM_EVIL;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_GOOD,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_GOOD,oMe)==FALSE&&nAGE!=ALIGNMENT_GOOD) return SPELL_PROTECTION_FROM_GOOD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_LAW,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_LAW,oMe)==FALSE&&nALC!=ALIGNMENT_LAWFUL) return SPELL_PROTECTION_FROM_LAW;
|
|
else if (GetHasSpell(SPELL_PROTECTION__FROM_CHAOS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION__FROM_CHAOS,oMe)==FALSE&&nALC!=ALIGNMENT_CHAOTIC) return SPELL_PROTECTION__FROM_CHAOS;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oMe)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_VIRTUE,oMe)>0&&GetHasSpellEffect(SPELL_VIRTUE,oMe)==FALSE) return SPELL_VIRTUE;
|
|
} // undead opponents
|
|
if (nOUT>0)
|
|
{ // outsider opponents
|
|
if (GetHasSpell(SPELL_GREATER_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_GREATER_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_TIME_STOP,oMe)>0&&GetHasSpellEffect(SPELL_TIME_STOP,oMe)==FALSE&&d4()==1) return SPELL_TIME_STOP;
|
|
else if (GetHasSpell(SPELL_PREMONITION,oMe)>0&&GetHasSpellEffect(SPELL_PREMONITION,oMe)==FALSE) return SPELL_PREMONITION;
|
|
else if (GetHasSpell(SPELL_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_MIND_BLANK;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_PROTECTION,oMe)>0&&GetHasSpellEffect(SPELLABILITY_AURA_PROTECTION,oMe)==FALSE) return SPELLABILITY_AURA_PROTECTION;
|
|
else if (GetHasSpell(SPELL_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_TRUE_SEEING,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_SEEING,oMe)==FALSE) return SPELL_TRUE_SEEING;
|
|
else if (GetHasSpell(SPELL_SHADOW_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_SHIELD,oMe)==FALSE) return SPELL_SHADOW_SHIELD;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oMe)>0&&GetHasSpellEffect(SPELL_REGENERATE,oMe)==FALSE) return SPELL_REGENERATE;
|
|
else if (GetHasSpell(SPELL_AURA_OF_VITALITY,oMe)>0&&GetHasSpellEffect(SPELL_AURA_OF_VITALITY,oMe)==FALSE) return SPELL_AURA_OF_VITALITY;
|
|
else if (GetHasSpell(SPELL_ETHEREAL_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_ETHEREAL_VISAGE;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DEATH,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DEATH,oMe)==FALSE) return SPELL_CIRCLE_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_SPELL_RESISTANCE,oMe)==FALSE) return SPELL_SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_MONSTROUS_REGENERATION,oMe)>0&&GetHasSpellEffect(SPELL_MONSTROUS_REGENERATION,oMe)==FALSE) return SPELL_MONSTROUS_REGENERATION;
|
|
else if (GetHasSpell(SPELL_LESSER_SPELL_MANTLE,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_SPELL_MANTLE,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE,oMe)==FALSE) return SPELL_LESSER_SPELL_MANTLE;
|
|
else if (GetHasSpell(SPELL_LESSER_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oMe)==FALSE&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)>0&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_MINOR_GLOBE_OF_INVULNERABILITY;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MINOR_GLOBE_OF_INVULNERABILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY,oMe)==FALSE) return SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DOOM,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DOOM,oMe)==FALSE) return SPELL_CIRCLE_OF_DOOM;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_DEATH_WARD,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oMe)==FALSE) return SPELL_DEATH_WARD;
|
|
else if (GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT,oMe)>0&&GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT,oMe)==FALSE) return SPELL_FREEDOM_OF_MOVEMENT;
|
|
else if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_IMPROVED_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_MASS_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_MASS_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_DIVINE_POWER,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_POWER,oMe)==FALSE) return SPELL_DIVINE_POWER;
|
|
else if (GetHasSpell(SPELL_ELEMENTAL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD,oMe)==FALSE) return SPELL_ELEMENTAL_SHIELD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_PROTECTION_FROM_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_PRAYER,oMe)>0&&GetHasSpellEffect(SPELL_PRAYER,oMe)==FALSE) return SPELL_PRAYER;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oMe)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oMe)==FALSE&&d4()<3) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY_SPHERE,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY_SPHERE;
|
|
else if (GetHasSpell(SPELL_HASTE,oMe)>0&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_DISPLACEMENT,oMe)>0&&GetHasSpellEffect(SPELL_DISPLACEMENT,oMe)==FALSE) return SPELL_DISPLACEMENT;
|
|
else if (GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)>0&&GetHasSpellEffect(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)==FALSE&&d4()<3) return SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oMe)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_RESIST_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oMe)==FALSE) return SPELL_RESIST_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_INIVSIBILITY;
|
|
else if (GetHasSpell(SPELL_GHOSTLY_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_GHOSTLY_VISAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_GHOSTLY_VISAGE;
|
|
else if (GetHasSpell(SPELL_DEATH_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_ARMOR,oMe)==FALSE) return SPELL_DEATH_ARMOR;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oMe)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oMe)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_CATS_GRACE,oMe)>0&&GetHasSpellEffect(SPELL_CATS_GRACE,oMe)==FALSE) return SPELL_CATS_GRACE;
|
|
else if (GetHasSpell(SPELL_SHADES_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_SHADES_STONESKIN;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oMe)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_AURAOFGLORY,oMe)>0&&GetHasSpellEffect(SPELL_AURAOFGLORY,oMe)==FALSE) return SPELL_AURAOFGLORY;
|
|
else if (GetHasSpell(SPELL_AID,oMe)>0&&GetHasSpellEffect(SPELL_AID,oMe)==FALSE) return SPELL_AID;
|
|
else if (GetHasSpell(SPELL_TRUE_STRIKE,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_STRIKE,oMe)==FALSE) return SPELL_TRUE_STRIKE;
|
|
else if (GetHasSpell(SPELL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD,oMe)==FALSE) return SPELL_SHIELD;
|
|
else if (GetHasSpell(SPELL_SHIELD_OF_FAITH,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_FAITH,oMe)==FALSE) return SPELL_SHIELD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE) return SPELL_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SANCTUARY,oMe)>0&&GetHasSpellEffect(SPELL_SANCTUARY,oMe)==FALSE&&d4()==1) return SPELL_SANCTUARY;
|
|
else if (GetHasSpell(SPELL_IRONGUTS,oMe)>0&&GetHasSpellEffect(SPELL_IRONGUTS,oMe)==FALSE) return SPELL_IRONGUTS;
|
|
else if (GetHasSpell(SPELL_EXPEDITIOUS_RETREAT,oMe)>0&&GetHasSpellEffect(SPELL_EXPEDITIOUS_RETREAT,oMe)==FALSE&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_EXPEDITIOUS_RETREAT;
|
|
else if (GetHasSpell(SPELL_ENTROPIC_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ENTROPIC_SHIELD,oMe)==FALSE) return SPELL_ENTROPIC_SHIELD;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_DIVINE_FAVOR,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_FAVOR,oMe)==FALSE) return SPELL_DIVINE_FAVOR;
|
|
else if (GetHasSpell(SPELL_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_VINE_MINE_CAMOUFLAGE;
|
|
else if (GetHasSpell(SPELL_VINE_MINE_CAMOUFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_VINE_MINE_CAMOUFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_BLESS_WEAPON,oMe)>0&&GetHasSpellEffect(SPELL_BLESS_WEAPON,oMe)==FALSE) return SPELL_BLESS_WEAPON;
|
|
else if (GetHasSpell(SPELL_BLESS,oMe)>0&&GetHasSpellEffect(SPELL_BLESS,oMe)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_EVIL,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oMe)==FALSE&&nAGE!=ALIGNMENT_EVIL) return SPELL_PROTECTION_FROM_EVIL;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_GOOD,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_GOOD,oMe)==FALSE&&nAGE!=ALIGNMENT_GOOD) return SPELL_PROTECTION_FROM_GOOD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_LAW,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_LAW,oMe)==FALSE&&nALC!=ALIGNMENT_LAWFUL) return SPELL_PROTECTION_FROM_LAW;
|
|
else if (GetHasSpell(SPELL_PROTECTION__FROM_CHAOS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION__FROM_CHAOS,oMe)==FALSE&&nALC!=ALIGNMENT_CHAOTIC) return SPELL_PROTECTION__FROM_CHAOS;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oMe)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_VIRTUE,oMe)>0&&GetHasSpellEffect(SPELL_VIRTUE,oMe)==FALSE) return SPELL_VIRTUE;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_SPELLS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_SPELLS,oMe)==FALSE) return SPELL_PROTECTION_FROM_SPELLS;
|
|
} // outsider opponents
|
|
if (nRT==RACIAL_TYPE_UNDEAD)
|
|
{ // undead target
|
|
if (GetHasSpell(SPELL_NEGATIVE_ENERGY_PROTECTION,oMe)>0&&GetHasSpellEffect(SPELL_NEGATIVE_ENERGY_PROTECTION,oMe)==FALSE) return SPELL_NEGATIVE_ENERGY_PROTECTION;
|
|
} // undead target
|
|
else
|
|
{ // other target
|
|
if (GetHasSpell(SPELL_CATS_GRACE,oMe)>0&&GetHasSpellEffect(SPELL_CATS_GRACE,oMe)==FALSE) return SPELL_CATS_GRACE;
|
|
else if (GetHasSpell(SPELL_FOXS_CUNNING,oMe)>0&&GetHasSpellEffect(SPELL_FOXS_CUNNING,oMe)==FALSE) return SPELL_FOXS_CUNNING;
|
|
else if (GetHasSpell(SPELL_OWLS_WISDOM,oMe)>0&&GetHasSpellEffect(SPELL_OWLS_WISDOM,oMe)==FALSE) return SPELL_OWLS_WISDOM;
|
|
else if (GetHasSpell(SPELL_ONE_WITH_THE_LAND,oMe)>0&&GetHasSpellEffect(SPELL_ONE_WITH_THE_LAND,oMe)==FALSE) return SPELL_ONE_WITH_THE_LAND;
|
|
else if (GetHasSpell(SPELL_TIME_STOP,oMe)>0&&GetHasSpellEffect(SPELL_TIME_STOP,oMe)==FALSE&&d4()==1) return SPELL_TIME_STOP;
|
|
else if (GetHasSpell(SPELL_PREMONITION,oMe)>0&&GetHasSpellEffect(SPELL_PREMONITION,oMe)==FALSE) return SPELL_PREMONITION;
|
|
else if (GetHasSpell(SPELL_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_MIND_BLANK;
|
|
else if (GetHasSpell(SPELLABILITY_AURA_PROTECTION,oMe)>0&&GetHasSpellEffect(SPELLABILITY_AURA_PROTECTION,oMe)==FALSE) return SPELLABILITY_AURA_PROTECTION;
|
|
else if (GetHasSpell(SPELL_TRUE_SEEING,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_SEEING,oMe)==FALSE) return SPELL_TRUE_SEEING;
|
|
else if (GetHasSpell(SPELL_SHADOW_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_SHIELD,oMe)==FALSE) return SPELL_SHADOW_SHIELD;
|
|
else if (GetHasSpell(SPELL_REGENERATE,oMe)>0&&GetHasSpellEffect(SPELL_REGENERATE,oMe)==FALSE) return SPELL_REGENERATE;
|
|
else if (GetHasSpell(SPELL_AURA_OF_VITALITY,oMe)>0&&GetHasSpellEffect(SPELL_AURA_OF_VITALITY,oMe)==FALSE) return SPELL_AURA_OF_VITALITY;
|
|
else if (GetHasSpell(SPELL_ETHEREAL_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_ETHEREAL_VISAGE;
|
|
else if (GetHasSpell(SPELL_GREATER_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_GREATER_STONESKIN;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DEATH,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DEATH,oMe)==FALSE) return SPELL_CIRCLE_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_SPELL_RESISTANCE,oMe)==FALSE) return SPELL_SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_MONSTROUS_REGENERATION,oMe)>0&&GetHasSpellEffect(SPELL_MONSTROUS_REGENERATION,oMe)==FALSE) return SPELL_MONSTROUS_REGENERATION;
|
|
else if (GetHasSpell(SPELL_LESSER_MIND_BLANK,oMe)>0&&GetHasSpellEffect(SPELL_LESSER_MIND_BLANK,oMe)==FALSE&&GetHasSpellEffect(SPELL_MIND_BLANK,oMe)==FALSE) return SPELL_LESSER_MIND_BLANK;
|
|
else if (GetHasSpell(SPELL_CIRCLE_OF_DOOM,oMe)>0&&GetHasSpellEffect(SPELL_CIRCLE_OF_DOOM,oMe)==FALSE) return SPELL_CIRCLE_OF_DOOM;
|
|
else if (GetHasSpell(SPELL_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_STONESKIN;
|
|
else if (GetHasSpell(SPELL_DEATH_WARD,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_WARD,oMe)==FALSE) return SPELL_DEATH_WARD;
|
|
else if (GetHasSpell(SPELL_FREEDOM_OF_MOVEMENT,oMe)>0&&GetHasSpellEffect(SPELL_FREEDOM_OF_MOVEMENT,oMe)==FALSE) return SPELL_FREEDOM_OF_MOVEMENT;
|
|
else if (GetHasSpell(SPELL_IMPROVED_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_IMPROVED_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_MASS_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_MASS_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_DIVINE_POWER,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_POWER,oMe)==FALSE) return SPELL_DIVINE_POWER;
|
|
else if (GetHasSpell(SPELL_ELEMENTAL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ELEMENTAL_SHIELD,oMe)==FALSE) return SPELL_ELEMENTAL_SHIELD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_ELEMENTS,oMe)==FALSE) return SPELL_PROTECTION_FROM_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_PRAYER,oMe)>0&&GetHasSpellEffect(SPELL_PRAYER,oMe)==FALSE) return SPELL_PRAYER;
|
|
else if (GetHasSpell(SPELL_MAGIC_VESTMENT,oMe)>0&&GetHasSpellEffect(SPELL_MAGIC_VESTMENT,oMe)==FALSE&&d4()<3) return SPELL_MAGIC_VESTMENT;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY_SPHERE,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY_SPHERE;
|
|
else if (GetHasSpell(SPELL_HASTE,oMe)>0&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_HASTE;
|
|
else if (GetHasSpell(SPELL_DISPLACEMENT,oMe)>0&&GetHasSpellEffect(SPELL_DISPLACEMENT,oMe)==FALSE) return SPELL_DISPLACEMENT;
|
|
else if (GetHasSpell(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)>0&&GetHasSpellEffect(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oMe)==FALSE&&d4()<3) return SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE;
|
|
else if (GetHasSpell(SPELL_SEE_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SEE_INVISIBILITY,oMe)==FALSE) return SPELL_SEE_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_RESIST_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_RESIST_ELEMENTS,oMe)==FALSE) return SPELL_RESIST_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_INVISIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_INVISIBILITY;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)>0&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_INIVSIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY,oMe)==FALSE&&GetHasSpellEffect(SPELL_INVISIBILITY_SPHERE,oMe)==FALSE&&GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_INIVSIBILITY;
|
|
else if (GetHasSpell(SPELL_GHOSTLY_VISAGE,oMe)>0&&GetHasSpellEffect(SPELL_GHOSTLY_VISAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_ETHEREAL_VISAGE,oMe)==FALSE) return SPELL_GHOSTLY_VISAGE;
|
|
else if (GetHasSpell(SPELL_DEATH_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_DEATH_ARMOR,oMe)==FALSE) return SPELL_DEATH_ARMOR;
|
|
else if (GetHasSpell(SPELL_BULLS_STRENGTH,oMe)>0&&GetHasSpellEffect(SPELL_BULLS_STRENGTH,oMe)==FALSE) return SPELL_BULLS_STRENGTH;
|
|
else if (GetHasSpell(SPELL_CATS_GRACE,oMe)>0&&GetHasSpellEffect(SPELL_CATS_GRACE,oMe)==FALSE) return SPELL_CATS_GRACE;
|
|
else if (GetHasSpell(SPELL_SHADES_STONESKIN,oMe)>0&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_SHADES_STONESKIN;
|
|
else if (GetHasSpell(SPELL_BARKSKIN,oMe)>0&&GetHasSpellEffect(SPELL_BARKSKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADES_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_STONESKIN,oMe)==FALSE&&GetHasSpellEffect(SPELL_GREATER_STONESKIN,oMe)==FALSE) return SPELL_BARKSKIN;
|
|
else if (GetHasSpell(SPELL_AURAOFGLORY,oMe)>0&&GetHasSpellEffect(SPELL_AURAOFGLORY,oMe)==FALSE) return SPELL_AURAOFGLORY;
|
|
else if (GetHasSpell(SPELL_AID,oMe)>0&&GetHasSpellEffect(SPELL_AID,oMe)==FALSE) return SPELL_AID;
|
|
else if (GetHasSpell(SPELL_TRUE_STRIKE,oMe)>0&&GetHasSpellEffect(SPELL_TRUE_STRIKE,oMe)==FALSE) return SPELL_TRUE_STRIKE;
|
|
else if (GetHasSpell(SPELL_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD,oMe)==FALSE) return SPELL_SHIELD;
|
|
else if (GetHasSpell(SPELL_SHIELD_OF_FAITH,oMe)>0&&GetHasSpellEffect(SPELL_SHIELD_OF_FAITH,oMe)==FALSE) return SPELL_SHIELD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE) return SPELL_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)>0&&GetHasSpellEffect(SPELL_MAGE_ARMOR,oMe)==FALSE&&GetHasSpellEffect(SPELL_SHADOW_CONJURATION_MAGE_ARMOR,oMe)==FALSE) return SPELL_SHADOW_CONJURATION_MAGE_ARMOR;
|
|
else if (GetHasSpell(SPELL_SANCTUARY,oMe)>0&&GetHasSpellEffect(SPELL_SANCTUARY,oMe)==FALSE&&d4()==1) return SPELL_SANCTUARY;
|
|
else if (GetHasSpell(SPELL_IRONGUTS,oMe)>0&&GetHasSpellEffect(SPELL_IRONGUTS,oMe)==FALSE) return SPELL_IRONGUTS;
|
|
else if (GetHasSpell(SPELL_EXPEDITIOUS_RETREAT,oMe)>0&&GetHasSpellEffect(SPELL_EXPEDITIOUS_RETREAT,oMe)==FALSE&&GetHasSpellEffect(SPELL_HASTE,oMe)==FALSE) return SPELL_EXPEDITIOUS_RETREAT;
|
|
else if (GetHasSpell(SPELL_ENTROPIC_SHIELD,oMe)>0&&GetHasSpellEffect(SPELL_ENTROPIC_SHIELD,oMe)==FALSE) return SPELL_ENTROPIC_SHIELD;
|
|
else if (GetHasSpell(SPELL_ENDURE_ELEMENTS,oMe)>0&&GetHasSpellEffect(SPELL_ENDURE_ELEMENTS,oMe)==FALSE) return SPELL_ENDURE_ELEMENTS;
|
|
else if (GetHasSpell(SPELL_DIVINE_FAVOR,oMe)>0&&GetHasSpellEffect(SPELL_DIVINE_FAVOR,oMe)==FALSE) return SPELL_DIVINE_FAVOR;
|
|
else if (GetHasSpell(SPELL_CAMOFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_VINE_MINE_CAMOUFLAGE;
|
|
else if (GetHasSpell(SPELL_VINE_MINE_CAMOUFLAGE,oMe)>0&&GetHasSpellEffect(SPELL_VINE_MINE_CAMOUFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_CAMOFLAGE,oMe)==FALSE&&GetHasSpellEffect(SPELL_MASS_CAMOFLAGE,oMe)==FALSE) return SPELL_CAMOFLAGE;
|
|
else if (GetHasSpell(SPELL_BLESS_WEAPON,oMe)>0&&GetHasSpellEffect(SPELL_BLESS_WEAPON,oMe)==FALSE) return SPELL_BLESS_WEAPON;
|
|
else if (GetHasSpell(SPELL_BLESS,oMe)>0&&GetHasSpellEffect(SPELL_BLESS,oMe)==FALSE) return SPELL_BLESS;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_EVIL,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_EVIL,oMe)==FALSE&&nAGE!=ALIGNMENT_EVIL) return SPELL_PROTECTION_FROM_EVIL;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_GOOD,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_GOOD,oMe)==FALSE&&nAGE!=ALIGNMENT_GOOD) return SPELL_PROTECTION_FROM_GOOD;
|
|
else if (GetHasSpell(SPELL_PROTECTION_FROM_LAW,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION_FROM_LAW,oMe)==FALSE&&nALC!=ALIGNMENT_LAWFUL) return SPELL_PROTECTION_FROM_LAW;
|
|
else if (GetHasSpell(SPELL_PROTECTION__FROM_CHAOS,oMe)>0&&GetHasSpellEffect(SPELL_PROTECTION__FROM_CHAOS,oMe)==FALSE&&nALC!=ALIGNMENT_CHAOTIC) return SPELL_PROTECTION__FROM_CHAOS;
|
|
else if (GetHasSpell(SPELL_RESISTANCE,oMe)>0&&GetHasSpellEffect(SPELL_RESISTANCE,oMe)==FALSE) return SPELL_RESISTANCE;
|
|
else if (GetHasSpell(SPELL_VIRTUE,oMe)>0&&GetHasSpellEffect(SPELL_VIRTUE,oMe)==FALSE) return SPELL_VIRTUE;
|
|
} // other target
|
|
return 0;
|
|
} // caiProfessionalDefensive()
|
|
|
|
int caiProfessionalCounter(object oTarget)
|
|
{ // PURPOSE: Return counter magic to spells on target
|
|
object oMe=OBJECT_SELF;
|
|
if (GetHasSpell(SPELL_MORDENKAINENS_DISJUNCTION,oMe)>0) return SPELL_MORDENKAINENS_DISJUNCTION;
|
|
else if (GetHasSpell(SPELL_GREATER_SPELL_BREACH,oMe)>0&&d4()<3) return SPELL_GREATER_SPELL_BREACH;
|
|
else if (GetHasSpell(SPELL_GREATER_DISPELLING,oMe)>0) return SPELL_GREATER_DISPELLING;
|
|
else if (GetHasSpell(SPELL_LESSER_SPELL_BREACH,oMe)>0&&d4()<3) return SPELL_LESSER_SPELL_BREACH;
|
|
else if (GetHasSpell(SPELL_DISPEL_MAGIC,oMe)>0) return SPELL_DISPEL_MAGIC;
|
|
else if (GetHasSpell(SPELL_LESSER_DISPEL,oMe)>0) return SPELL_LESSER_DISPEL;
|
|
return 0;
|
|
} // caiProfessionalCounter()
|
|
|
|
int caiProfessionalCloseQuarters(object oTarget)
|
|
{ // PURPOSE: Return offensive close quarter spell
|
|
int nRT=MyPRCGetRacialType(oTarget);
|
|
object oMe=OBJECT_SELF;
|
|
if (GetMaster(oTarget)!=oTarget&&GetIsObjectValid(GetMaster(oTarget))&&GetAssociateType(oTarget)==ASSOCIATE_TYPE_SUMMONED)
|
|
{ // summoned
|
|
if (GetHasSpell(SPELL_BANISHMENT,oMe)>0&&d4()<3) return SPELL_BANISHMENT;
|
|
else if (GetHasSpell(SPELL_DISMISSAL,oMe)>0&&d4()<3) return SPELL_DISMISSAL;
|
|
} // summoned
|
|
if (nRT==RACIAL_TYPE_UNDEAD||GetLocalInt(oTarget,"nIsVampire")==TRUE)
|
|
{ // undead
|
|
if (GetHasSpell(SPELL_BIGBYS_CRUSHING_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_CRUSHING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_CRUSHING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CLENCHED_FIST,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_CLENCHED_FIST,oTarget)==FALSE) return SPELL_BIGBYS_CLENCHED_FIST;
|
|
else if (GetHasSpell(SPELL_WORD_OF_FAITH,oMe)>0&&d4()<3) return SPELL_WORD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_UNDEATH_TO_DEATH,oMe)>0) return SPELL_UNDEATH_TO_DEATH;
|
|
else if (GetHasSpell(SPELL_CONTROL_UNDEAD,oMe)>0&&GetHasSpellEffect(SPELL_CONTROL_UNDEAD,oTarget)==FALSE) return SPELL_BIGBYS_CRUSHING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_GRASPING_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_GRASPING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_GRASPING_HAND;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oMe)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oMe)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_HEAL,oMe)>0) return SPELL_HEAL;
|
|
else if (GetHasSpell(SPELL_BIGBYS_FORCEFUL_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_FORCEFUL_HAND,oTarget)==FALSE) return SPELL_BIGBYS_FORCEFUL_HAND;
|
|
else if (GetHasSpell(SPELL_FIREBRAND,oMe)>0) return SPELL_FIREBRAND;
|
|
else if (GetHasSpell(SPELL_BALL_LIGHTNING,oMe)>0) return SPELL_BALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_BIGBYS_INTERPOSING_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_INTERPOSING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_INTERPOSING_HAND;
|
|
else if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oMe)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_HAMMER_OF_THE_GODS,oMe)>0) return SPELL_HAMMER_OF_THE_GODS;
|
|
else if (GetHasSpell(SPELL_BESTOW_CURSE,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BESTOW_CURSE,oTarget)==FALSE) return SPELL_BESTOW_CURSE;
|
|
else if (GetHasSpell(SPELL_CURE_CRITICAL_WOUNDS,oMe)>0) return SPELL_CURE_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oMe)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oMe)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SLOW,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_SLOW,oTarget)==FALSE) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oMe)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oMe)>0&&d4()<3) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_CURE_SERIOUS_WOUNDS,oMe)>0) return SPELL_CURE_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oMe)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oMe)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_GEDLEES_ELECTRIC_LOOP,oMe)>0) return SPELL_GEDLEES_ELECTRIC_LOOP;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oMe)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_CURE_MODERATE_WOUNDS,oMe)>0) return SPELL_CURE_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_RAY_OF_ENFEEBLEMENT,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_RAY_OF_ENFEEBLEMENT,oTarget)==FALSE) return SPELL_RAY_OF_ENFEEBLEMENT;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oMe)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oMe)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_DOOM,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_CURE_LIGHT_WOUNDS,oMe)>0) return SPELL_CURE_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oMe)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_BANE,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BANE,oTarget)==FALSE) return SPELL_BANE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oMe)>0) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oMe)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oMe)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_CURE_MINOR_WOUNDS,oMe)>0) return SPELL_CURE_MINOR_WOUNDS;
|
|
} // undead
|
|
else if (nRT==RACIAL_TYPE_CONSTRUCT)
|
|
{ // construct
|
|
|
|
} // construct
|
|
else
|
|
{ // other
|
|
if (GetHasSpell(SPELL_BIGBYS_CRUSHING_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_CRUSHING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_CRUSHING_HAND;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CLENCHED_FIST,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_CLENCHED_FIST,oTarget)==FALSE) return SPELL_BIGBYS_CLENCHED_FIST;
|
|
else if (GetHasSpell(SPELL_WORD_OF_FAITH,oMe)>0&&d4()<3) return SPELL_WORD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_BIGBYS_GRASPING_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_GRASPING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_GRASPING_HAND;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oMe)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oMe)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_HARM,oMe)>0) return SPELL_HARM;
|
|
else if (GetHasSpell(SPELL_BIGBYS_FORCEFUL_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_FORCEFUL_HAND,oTarget)==FALSE) return SPELL_BIGBYS_FORCEFUL_HAND;
|
|
else if (GetHasSpell(SPELL_FIREBRAND,oMe)>0) return SPELL_FIREBRAND;
|
|
else if (GetHasSpell(SPELL_BALL_LIGHTNING,oMe)>0) return SPELL_BALL_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_BIGBYS_INTERPOSING_HAND,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BIGBYS_INTERPOSING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_INTERPOSING_HAND;
|
|
else if (GetHasSpell(SPELL_ISAACS_LESSER_MISSILE_STORM,oMe)>0) return SPELL_ISAACS_LESSER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_HAMMER_OF_THE_GODS,oMe)>0) return SPELL_HAMMER_OF_THE_GODS;
|
|
else if (GetHasSpell(SPELL_BESTOW_CURSE,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BESTOW_CURSE,oTarget)==FALSE) return SPELL_BESTOW_CURSE;
|
|
else if (GetHasSpell(SPELL_INFLICT_CRITICAL_WOUNDS,oMe)>0) return SPELL_INFLICT_CRITICAL_WOUNDS;
|
|
else if (GetHasSpell(SPELL_WOUNDING_WHISPERS,oMe)>0) return SPELL_WOUNDING_WHISPERS;
|
|
else if (GetHasSpell(SPELL_SEARING_LIGHT,oMe)>0) return SPELL_SEARING_LIGHT;
|
|
else if (GetHasSpell(SPELL_SLOW,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_SLOW,oTarget)==FALSE) return SPELL_SLOW;
|
|
else if (GetHasSpell(SPELL_QUILLFIRE,oMe)>0) return SPELL_QUILLFIRE;
|
|
else if (GetHasSpell(SPELL_LIGHTNING_BOLT,oMe)>0&&d4()<3) return SPELL_LIGHTNING_BOLT;
|
|
else if (GetHasSpell(SPELL_INFLICT_SERIOUS_WOUNDS,oMe)>0) return SPELL_INFLICT_SERIOUS_WOUNDS;
|
|
else if (GetHasSpell(SPELL_SOUND_BURST,oMe)>0) return SPELL_SOUND_BURST;
|
|
else if (GetHasSpell(SPELL_MELFS_ACID_ARROW,oMe)>0) return SPELL_MELFS_ACID_ARROW;
|
|
else if (GetHasSpell(SPELL_GEDLEES_ELECTRIC_LOOP,oMe)>0) return SPELL_GEDLEES_ELECTRIC_LOOP;
|
|
else if (GetHasSpell(SPELL_FLAME_LASH,oMe)>0) return SPELL_FLAME_LASH;
|
|
else if (GetHasSpell(SPELL_INFLICT_MODERATE_WOUNDS,oMe)>0) return SPELL_INFLICT_MODERATE_WOUNDS;
|
|
else if (GetHasSpell(SPELL_RAY_OF_ENFEEBLEMENT,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_RAY_OF_ENFEEBLEMENT,oTarget)==FALSE) return SPELL_RAY_OF_ENFEEBLEMENT;
|
|
else if (GetHasSpell(SPELL_MAGIC_MISSILE,oMe)>0) return SPELL_MAGIC_MISSILE;
|
|
else if (GetHasSpell(SPELL_ICE_DAGGER,oMe)>0) return SPELL_ICE_DAGGER;
|
|
else if (GetHasSpell(SPELL_DOOM,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_DOOM,oTarget)==FALSE) return SPELL_DOOM;
|
|
else if (GetHasSpell(SPELL_INFLICT_LIGHT_WOUNDS,oMe)>0) return SPELL_INFLICT_LIGHT_WOUNDS;
|
|
else if (GetHasSpell(SPELL_BURNING_HANDS,oMe)>0) return SPELL_BURNING_HANDS;
|
|
else if (GetHasSpell(SPELL_BANE,oMe)>0&&d4()<3&&GetHasSpellEffect(SPELL_BANE,oTarget)==FALSE) return SPELL_BANE;
|
|
else if (GetHasSpell(SPELL_RAY_OF_FROST,oMe)>0) return SPELL_RAY_OF_FROST;
|
|
else if (GetHasSpell(SPELL_ELECTRIC_JOLT,oMe)>0) return SPELL_ELECTRIC_JOLT;
|
|
else if (GetHasSpell(SPELL_ACID_SPLASH,oMe)>0) return SPELL_ACID_SPLASH;
|
|
else if (GetHasSpell(SPELL_INFLICT_MINOR_WOUNDS,oMe)>0) return SPELL_INFLICT_MINOR_WOUNDS;
|
|
} // other
|
|
return 0;
|
|
} // caiProfessionalCloseQuarters()
|
|
|
|
int caiProfessionalOffensive(object oTarget)
|
|
{ // PURPOSE: Return offensive spells versus the target
|
|
object oMe=OBJECT_SELF;
|
|
int nRT=MyPRCGetRacialType(oTarget);
|
|
object oAlly;
|
|
int bNoArea=FALSE;
|
|
int nCT=fnGetCharmType(oTarget);
|
|
if (GetDistanceBetween(oMe,oTarget)<3.1) return caiProfessionalCloseQuarters(oTarget);
|
|
oAlly=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oTarget,1,CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY);
|
|
if (GetIsObjectValid(oAlly)&&oAlly!=oMe&&GetIsFriend(oAlly)&&GetDistanceBetween(oTarget,oAlly)<6.0) bNoArea=TRUE;
|
|
if (GetMaster(oTarget)!=oTarget&&GetIsObjectValid(GetMaster(oTarget))&&GetAssociateType(oTarget)==ASSOCIATE_TYPE_SUMMONED)
|
|
{ // summoned
|
|
if (GetHasSpell(SPELL_BANISHMENT,oMe)>0&&d4()<3) return SPELL_BANISHMENT;
|
|
else if (GetHasSpell(SPELL_DISMISSAL,oMe)>0&&d4()<3) return SPELL_DISMISSAL;
|
|
} // summoned
|
|
if (nRT==RACIAL_TYPE_UNDEAD||GetLocalInt(oTarget,"nIsVampire")==TRUE)
|
|
{ // undead
|
|
if (bNoArea)
|
|
{ // no area spells
|
|
} // no area spells
|
|
else
|
|
{ // any spells
|
|
} // any spells
|
|
} // undead
|
|
else if (nRT==RACIAL_TYPE_CONSTRUCT)
|
|
{ // construct
|
|
if (bNoArea)
|
|
{ // no area spells
|
|
} // no area spells
|
|
else
|
|
{ // any spells
|
|
} // any spells
|
|
} // construct
|
|
else
|
|
{ // other
|
|
if (bNoArea)
|
|
{ // no area spells
|
|
} // no area spells
|
|
else
|
|
{ // any spells
|
|
if (GetHasSpell(SPELL_METEOR_SWARM,oMe)>0) return SPELL_METEOR_SWARM;
|
|
else if (GetHasSpell(SPELL_STORM_OF_VENGEANCE,oMe)>0) return SPELL_STORM_OF_VENGEANCE;
|
|
else if (GetHasSpell(SPELL_IMPLOSION,oMe)>0) return SPELL_IMPLOSION;
|
|
else if (GetHasSpell(SPELL_POWER_WORD_KILL,oMe)>0) return SPELL_POWER_WORD_KILL;
|
|
else if (GetHasSpell(SPELL_WAIL_OF_THE_BANSHEE,oMe)>0) return SPELL_WAIL_OF_THE_BANSHEE;
|
|
else if (GetHasSpell(SPELL_ENERGY_DRAIN,oMe)>0&&d4()<3) return SPELL_ENERGY_DRAIN;
|
|
else if (GetHasSpell(SPELL_POWER_WORD_KILL,oMe)>0) return SPELL_POWER_WORD_KILL;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CRUSHING_HAND,oMe)>0&&GetHasSpellEffect(SPELL_BIGBYS_CRUSHING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_CRUSHING_HAND;
|
|
else if (GetHasSpell(SPELL_DOMINATE_MONSTER,oMe)>0&&GetHasSpellEffect(SPELL_DOMINATE_MONSTER,oTarget)==FALSE&&nCT==CAI_CHARM_MONSTER) return SPELL_DOMINATE_MONSTER;
|
|
else if (GetHasSpell(SPELL_SUNBURST,oMe)>0) return SPELL_SUNBURST;
|
|
else if (GetHasSpell(SPELL_SUNBEAM,oMe)>0) return SPELL_SUNBEAM;
|
|
else if (GetHasSpell(SPELL_INCENDIARY_CLOUD,oMe)>0) return SPELL_INCENDIARY_CLOUD;
|
|
else if (GetHasSpell(SPELL_FIRE_STORM,oMe)>0) return SPELL_FIRE_STORM;
|
|
else if (GetHasSpell(SPELL_EARTHQUAKE,oMe)>0) return SPELL_EARTHQUAKE;
|
|
else if (GetHasSpell(SPELL_MASS_CHARM,oMe)>0&&GetHasSpellEffect(SPELL_MASS_CHARM,oTarget)==FALSE) return SPELL_MASS_CHARM;
|
|
else if (GetHasSpell(SPELL_MASS_BLINDNESS_AND_DEAFNESS,oMe)>0&&GetHasSpellEffect(SPELL_MASS_BLINDNESS_AND_DEAFNESS,oTarget)==FALSE) return SPELL_MASS_BLINDNESS_AND_DEAFNESS;
|
|
else if (GetHasSpell(SPELL_BIGBYS_CLENCHED_FIST,oMe)>0&&GetHasSpellEffect(SPELL_BIGBYS_CLENCHED_FIST,oTarget)==FALSE) return SPELL_BIGBYS_CLENCHED_FIST;
|
|
else if (GetHasSpell(SPELL_HORRID_WILTING,oMe)>0) return SPELL_HORRID_WILTING;
|
|
else if (GetHasSpell(SPELL_DELAYED_BLAST_FIREBALL,oMe)>0) return SPELL_DELAYED_BLAST_FIREBALL;
|
|
else if (GetHasSpell(SPELL_FIRE_STORM,oMe)>0) return SPELL_FIRE_STORM;
|
|
else if (GetHasSpell(SPELL_WORD_OF_FAITH,oMe)>0&&d4()<3) return SPELL_WORD_OF_FAITH;
|
|
else if (GetHasSpell(SPELL_PRISMATIC_SPRAY,oMe)>0) return SPELL_PRISMATIC_SPRAY;
|
|
else if (GetHasSpell(SPELL_POWER_WORD_STUN,oMe)>0&&d4()<3) return SPELL_POWER_WORD_STUN;
|
|
else if (GetHasSpell(SPELL_FINGER_OF_DEATH,oMe)>0) return SPELL_FINGER_OF_DEATH;
|
|
else if (GetHasSpell(SPELL_DESTRUCTION,oMe)>0) return SPELL_DESTRUCTION;
|
|
else if (GetHasSpell(SPELL_CREEPING_DOOM,oMe)>0) return SPELL_CREEPING_DOOM;
|
|
else if (GetHasSpell(SPELL_BIGBYS_GRASPING_HAND,oMe)>0&&GetHasSpellEffect(SPELL_BIGBYS_GRASPING_HAND,oTarget)==FALSE) return SPELL_BIGBYS_GRASPING_HAND;
|
|
else if (GetHasSpell(SPELL_ACID_FOG,oMe)>0) return SPELL_ACID_FOG;
|
|
else if (GetHasSpell(SPELL_BLADE_BARRIER,oMe)>0) return SPELL_BLADE_BARRIER;
|
|
else if (GetHasSpell(SPELL_ISAACS_GREATER_MISSILE_STORM,oMe)>0) return SPELL_ISAACS_GREATER_MISSILE_STORM;
|
|
else if (GetHasSpell(SPELL_CHAIN_LIGHTNING,oMe)>0) return SPELL_CHAIN_LIGHTNING;
|
|
else if (GetHasSpell(SPELL_FLESH_TO_STONE,oMe)>0&&GetHasSpellEffect(SPELL_FLESH_TO_STONE,oTarget)==FALSE) return SPELL_FLESH_TO_STONE;
|
|
else if (GetHasSpell(SPELL_BIGBYS_FORCEFUL_HAND,oMe)>0&&GetHasSpellEffect(SPELL_BIGBYS_FORCEFUL_HAND,oTarget)==FALSE) return SPELL_BIGBYS_FORCEFUL_HAND;
|
|
|
|
|
|
} // any spells
|
|
} // other
|
|
return 0;
|
|
} // caiProfessionalOffensive()
|
|
|
|
int caiProfessionalSummon(object oTarget,int nLimit)
|
|
{ // PURPOSE: Return summon spell
|
|
object oMe=OBJECT_SELF;
|
|
if (GetHasSpell(SPELL_SUMMON_CREATURE_IX,oMe)>0) return SPELL_SUMMON_CREATURE_IX;
|
|
else if (GetHasSpell(SPELL_ELEMENTAL_SWARM,oMe)>0) return SPELL_ELEMENTAL_SWARM;
|
|
else if (GetHasSpell(SPELL_GATE,oMe)>0) return SPELL_GATE;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VIII,oMe)>0) return SPELL_SUMMON_CREATURE_VIII;
|
|
else if (GetHasSpell(SPELL_GREATER_PLANAR_BINDING,oMe)>0) return SPELL_GREATER_PLANAR_BINDING;
|
|
else if (GetHasSpell(SPELL_CREATE_GREATER_UNDEAD,oMe)>0) return SPELL_CREATE_GREATER_UNDEAD;
|
|
else if (GetHasSpell(SPELL_CREATE_UNDEAD,oMe)>0) return SPELL_CREATE_UNDEAD;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VII,oMe)>0) return SPELL_SUMMON_CREATURE_VII;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_VI,oMe)>0) return SPELL_SUMMON_CREATURE_VI;
|
|
else if (GetHasSpell(SPELL_PLANAR_BINDING,oMe)>0) return SPELL_PLANAR_BINDING;
|
|
else if (GetHasSpell(SPELL_PLANAR_ALLY,oMe)>0) return SPELL_PLANAR_ALLY;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_V,oMe)>0) return SPELL_SUMMON_CREATURE_V;
|
|
else if (GetHasSpell(SPELL_LESSER_PLANAR_BINDING,oMe)>0) return SPELL_LESSER_PLANAR_BINDING;
|
|
else if (GetHasSpell(SPELL_ANIMATE_DEAD,oMe)>0) return SPELL_ANIMATE_DEAD;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_SUMMON_SHADOW,oMe)>0) return SPELL_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_IV,oMe)>0) return SPELL_SUMMON_CREATURE_IV;
|
|
else if (GetHasSpell(SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW,oMe)>0) return SPELL_GREATER_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_III,oMe)>0) return SPELL_SUMMON_CREATURE_III;
|
|
else if (GetHasSpell(SPELL_SHADOW_CONJURATION_SUMMON_SHADOW,oMe)>0) return SPELL_SHADOW_CONJURATION_SUMMON_SHADOW;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_II,oMe)>0) return SPELL_SUMMON_CREATURE_II;
|
|
else if (GetHasSpell(SPELL_SUMMON_CREATURE_I,oMe)>0) return SPELL_SUMMON_CREATURE_I;
|
|
else if (GetHasSpell(SPELL_SHELGARNS_PERSISTENT_BLADE,oMe)>0) return SPELL_SHELGARNS_PERSISTENT_BLADE;
|
|
return 0;
|
|
} // caiProfessionalSummon()
|
|
|
|
int caiProfessionalAssocBuff(object oAssociate)
|
|
{ // PURPOSE: Return a buff spell for associates
|
|
return 0;
|
|
} // caiProfessionalAssocBuff()
|
|
|
|
object caiProfessionalItem(object oTarget)
|
|
{ // PURPOSE: Returns Grenades, Wands, Staves, and other useful items
|
|
return OBJECT_INVALID;
|
|
} // caiProfessionalItems()
|
|
|
|
|
|
|
|
//void main(){}
|