Updated scripts to use MyPRCGetRacialType

Updated scripts to use MyPRCGetRacialType.  Full compile.
This commit is contained in:
Jaysyn904
2022-09-28 21:36:29 -04:00
parent 8994c41256
commit 0b86a6485c
81 changed files with 142 additions and 74 deletions

View File

@@ -1729,7 +1729,7 @@ int AI_EquipAndAttack()
// Monk levels
nMonkLevels = GetLevelByClass(CLASS_TYPE_MONK);
if(!nMonkLevels) nMonkLevels = 1;
nTargetCreatureRace = GetRacialType(GlobalMeleeTarget);//done later.
nTargetCreatureRace = MyPRCGetRacialType(GlobalMeleeTarget);//done later.
nTargetAlignment = GetAlignmentGoodEvil(GlobalMeleeTarget);
// Now, monk, can it be done...
if((!GetIsObjectValid(oEquipped) ||
@@ -2637,7 +2637,7 @@ int AI_AttemptGrenadeThrowing(object oTarget)
// We have a valid item grenade. We then throw it (or attempt to!)
// - Check holy grenade not firing Versus non-undead
if(ItemHostRanged == SPELL_GRENADE_HOLY &&
GetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
MyPRCGetRacialType(oTarget) != RACIAL_TYPE_UNDEAD)
{
// Stop as they are not undead
return FALSE;
@@ -4487,7 +4487,7 @@ int AI_AttemptHealingSelf()
// Determine what we should heal at...
int nPercent = GetBoundriedAIInteger(AI_HEALING_US_PERCENT, 50, 100, 1);
int nRace = GetRacialType(OBJECT_SELF);
int nRace = MyPRCGetRacialType(OBJECT_SELF);
// What % are we at? It is GlobalOurPercentHP
// Are we under the right %?
@@ -4654,7 +4654,7 @@ int AI_AttemptCureCondition()
while(GetIsObjectValid(oHeal) && GetDistanceToObject(oHeal) <= 20.0)
{
// Don't target undead
if(GetRacialType(oHeal) != RACIAL_TYPE_UNDEAD)
if(MyPRCGetRacialType(oHeal) != RACIAL_TYPE_UNDEAD)
{
// Go through possible effects in priority order.
nEffectHex = GetLocalInt(oHeal, AI_EFFECT_HEX);
@@ -4985,7 +4985,7 @@ int AI_AttemptHealingAlly()
oLoopTarget = GetLocalObject(OBJECT_SELF, ARRAY_ALLIES_RANGE_SEEN + IntToString(nCnt));
while(GetIsObjectValid(oLoopTarget))
{
if(GetRacialType(oLoopTarget) != RACIAL_TYPE_CONSTRUCT &&
if(MyPRCGetRacialType(oLoopTarget) != RACIAL_TYPE_CONSTRUCT &&
(GetAssociateType(oLoopTarget) == ASSOCIATE_TYPE_NONE || bSummonHeal == TRUE))
{
// We do actually not ALWAYS use the nearest dead person, nor
@@ -5013,7 +5013,7 @@ int AI_AttemptHealingAlly()
// Did we find someone to heal?
if(nChosenPercentHitPoints > 0)
{
int nAllyHealRace = GetRacialType(oAllyToHeal);
int nAllyHealRace = MyPRCGetRacialType(oAllyToHeal);
// Undead - negative energy heals!
if(nAllyHealRace == RACIAL_TYPE_UNDEAD)
{
@@ -5817,7 +5817,7 @@ int AI_AttemptFeatTurning()
if(!GetIsFriend(oTarget))
{
nHD = GetHitDice(oTarget) + GetTurnResistanceHD(oTarget);
nRacial = GetRacialType(oTarget);
nRacial = MyPRCGetRacialType(oTarget);
// Planar creatures add spell resistance (don't bother if can't turn them)
if(nRacial == RACIAL_TYPE_OUTSIDER && bOutsider)
{
@@ -7386,7 +7386,7 @@ H [Crumble] - Constructs only.
{
// If we are undead, we make sure we leave at least 1 for our own healing.
if(GlobalNormalSpellsNoEffectLevel < 6 &&
(GetRacialType(OBJECT_SELF) != RACIAL_TYPE_UNDEAD ||
(MyPRCGetRacialType(OBJECT_SELF) != RACIAL_TYPE_UNDEAD ||
GetHasSpell(SPELL_HARM) >= 2))
{
// Harm
@@ -10077,12 +10077,12 @@ H X [Aura of Glory] - +4 Char, and allies get +4 VS Fear effects.
{
// This is natural AC, and only for undead. Cast it on ourselves, or
// our summoned undead monster.
if(GetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)
if(MyPRCGetRacialType(OBJECT_SELF) == RACIAL_TYPE_UNDEAD)
{
// Stone bones - cast if we do not have a natural armor AC spell.
if(AI_ActionCastSpell(SPELL_STONE_BONES, OBJECT_SELF, 12, FALSE)) return TRUE;
}
else if(GetRacialType(GlobalBuffAlly) == RACIAL_TYPE_UNDEAD)
else if(MyPRCGetRacialType(GlobalBuffAlly) == RACIAL_TYPE_UNDEAD)
{
// Stone bones - cast if we do not have a natural armor AC spell.
if(AI_ActionCastSpell(SPELL_STONE_BONES, GlobalBuffAlly, 12, FALSE)) return TRUE;
@@ -13712,7 +13712,7 @@ int AI_SetUpAllObjects(object oInputBackup)
GlobalSpellTargetCurrentHitPoints = GetCurrentHitPoints(GlobalSpellTarget);
// This is one of the most important.
GlobalSeenSpell = GetObjectSeen(GlobalSpellTarget);
GlobalSpellTargetRace = GetRacialType(GlobalSpellTarget);
GlobalSpellTargetRace = MyPRCGetRacialType(GlobalSpellTarget);
// Range
GlobalSpellTargetRange = GetDistanceToObject(GlobalSpellTarget);
@@ -13879,7 +13879,7 @@ int AI_AttemptHostileSkills()
GetSpawnInCondition(AI_FLAG_OTHER_COMBAT_FORCE_EMPATHY, AI_OTHER_COMBAT_MASTER))
{
iEmpathyDC = 20;
iRace = GetRacialType(GlobalMeleeTarget);
iRace = MyPRCGetRacialType(GlobalMeleeTarget);
// we add 4 (to make DC 24 + HD) if a special animal. R_T_ANIMAL is DC 20
if(iRace == RACIAL_TYPE_BEAST || iRace == RACIAL_TYPE_MAGICAL_BEAST)
{
@@ -14034,7 +14034,7 @@ int AI_AttemptFeatCombatHostile()
if(!GetItemHasItemProperty(oPrimaryWeapon, ITEM_PROPERTY_ON_HIT_PROPERTIES))
{
// Bless weapon
if(GetRacialType(GlobalMeleeTarget) == RACIAL_TYPE_UNDEAD)
if(MyPRCGetRacialType(GlobalMeleeTarget) == RACIAL_TYPE_UNDEAD)
{
// Bless weapon. Level 1 (Paladin). +1 Attack Bonus, +2d6 Damage to melee weapon VS undead
if(AI_ActionCastSpell(SPELL_BLESS_WEAPON, oPrimaryWeapon, 11, FALSE)) return TRUE;