2025/09/06 Update
Fixed damaged baseitems.2da Updated PEPS. Full compile.
This commit is contained in:
@@ -24,12 +24,38 @@ void main()
|
||||
nMaxLevel = ai_GetAssociateTalentMaxLevel(oCreature, nDifficulty);
|
||||
}
|
||||
// Skill, Class, Offensive AOE's, and Defensive talents.
|
||||
object oTarget = OBJECT_INVALID;
|
||||
// Get the Spell Level we should still cast before turning into our polymorph form.
|
||||
int nSpellLevel = ai_GetHasPolymorphSelfFeat(oCreature);
|
||||
int nMaxTalentLevel;
|
||||
if(AI_DEBUG) ai_Debug("ai_a_druid", "31", "nSpellLevel: " + IntToString(nSpellLevel));
|
||||
if(nDifficulty >= AI_COMBAT_MODERATE)
|
||||
{
|
||||
// *************************** SPELL TALENTS ***************************
|
||||
if(!ai_GetMagicMode(oCreature, AI_MAGIC_DEFENSIVE_CASTING))
|
||||
{
|
||||
if(ai_UseCreatureTalent(oCreature, AI_TALENT_INDISCRIMINANT_AOE, nInMelee, nMaxLevel)) return;
|
||||
if(ai_UseCreatureTalent(oCreature, AI_TALENT_DISCRIMINANT_AOE, nInMelee, nMaxLevel)) return;
|
||||
}
|
||||
// ************************** CLASS FEATURES ***************************
|
||||
if(ai_TrySummonAnimalCompanionTalent(oCreature)) return;
|
||||
// *************************** SPELL TALENTS ***************************
|
||||
if(ai_CheckForAssociateSpellTalent(oCreature, nInMelee, nMaxLevel)) return;
|
||||
//************************** DEFENSIVE TALENTS ***************************
|
||||
if(!ai_GetMagicMode(oCreature, AI_MAGIC_OFFENSIVE_CASTING))
|
||||
{
|
||||
if(ai_GetMagicMode(oCreature, AI_MAGIC_BUFF_MASTER)) oTarget = GetMaster(oCreature);
|
||||
nMaxTalentLevel = GetLocalInt(oCreature, AI_MAX_TALENT + AI_TALENT_SUMMON);
|
||||
if(AI_DEBUG) ai_Debug("ai_a_druid", "47", "nMaxTalentLevel 'S' " + IntToString(nMaxTalentLevel));
|
||||
if(nSpellLevel < nMaxTalentLevel &&
|
||||
ai_UseCreatureTalent(oCreature, AI_TALENT_SUMMON, nInMelee, nMaxLevel, oTarget)) return;
|
||||
nMaxTalentLevel = GetLocalInt(oCreature, AI_MAX_TALENT + AI_TALENT_PROTECTION);
|
||||
if(AI_DEBUG) ai_Debug("ai_a_druid", "51", "nMaxTalentLevel 'P' " + IntToString(nMaxTalentLevel));
|
||||
if(nSpellLevel < nMaxTalentLevel &&
|
||||
ai_UseCreatureTalent(oCreature, AI_TALENT_PROTECTION, nInMelee, nMaxLevel, oTarget)) return;
|
||||
nMaxTalentLevel = GetLocalInt(oCreature, AI_MAX_TALENT + AI_TALENT_ENHANCEMENT);
|
||||
if(AI_DEBUG) ai_Debug("ai_a_druid", "55", "nMaxTalentLevel 'E' " + IntToString(nMaxTalentLevel));
|
||||
if(nSpellLevel < nMaxTalentLevel &&
|
||||
ai_UseCreatureTalent(oCreature, AI_TALENT_ENHANCEMENT, nInMelee, nMaxLevel, oTarget)) return;
|
||||
}
|
||||
}
|
||||
// Offensive single target talents.
|
||||
if(nDifficulty >= AI_COMBAT_EFFORTLESS)
|
||||
@@ -37,16 +63,24 @@ void main()
|
||||
// *************************** SPELL TALENTS ***************************
|
||||
if(!ai_GetMagicMode(oCreature, AI_MAGIC_DEFENSIVE_CASTING))
|
||||
{
|
||||
if(nInMelee > 0 && ai_UseCreatureTalent(oCreature, AI_TALENT_TOUCH, nInMelee, nMaxLevel)) return;
|
||||
if(ai_UseCreatureTalent(oCreature, AI_TALENT_RANGED, nInMelee, nMaxLevel)) return;
|
||||
if(nInMelee > 0)
|
||||
{
|
||||
nMaxTalentLevel = GetLocalInt(oCreature, AI_MAX_TALENT + AI_TALENT_TOUCH);
|
||||
if(AI_DEBUG) ai_Debug("ai_druid", "69", "nMaxTalentLevel 'T' " + IntToString(nMaxTalentLevel));
|
||||
if(nSpellLevel < nMaxTalentLevel &&
|
||||
ai_UseCreatureTalent(oCreature, AI_TALENT_TOUCH, nInMelee, nMaxLevel)) return;
|
||||
}
|
||||
nMaxTalentLevel = GetLocalInt(oCreature, AI_MAX_TALENT + AI_TALENT_RANGED);
|
||||
if(AI_DEBUG) ai_Debug("ai_druid", "74", "nMaxTalentLevel 'R' " + IntToString(nMaxTalentLevel));
|
||||
if(nSpellLevel < nMaxTalentLevel &&
|
||||
ai_UseCreatureTalent(oCreature, AI_TALENT_RANGED, nInMelee, nMaxLevel)) return;
|
||||
}
|
||||
if(nDifficulty >= AI_COMBAT_MODERATE && ai_TryPolymorphSelfFeat(oCreature)) return;
|
||||
}
|
||||
if(nDifficulty >= AI_COMBAT_MODERATE && ai_TryPolymorphSelfFeat(oCreature)) return;
|
||||
//************************** SKILL FEATURES **************************
|
||||
if(ai_TryAnimalEmpathy(oCreature)) return;
|
||||
// PHYSICAL ATTACKS - Either we don't have talents or we are saving them.
|
||||
// ************************** Ranged feat attacks **************************
|
||||
object oTarget;
|
||||
if(!ai_GetAIMode(oCreature, AI_MODE_STOP_RANGED) && ai_CanIUseRangedWeapon(oCreature, nInMelee))
|
||||
{
|
||||
if(ai_HasRangedWeaponWithAmmo(oCreature))
|
||||
@@ -56,12 +90,12 @@ void main()
|
||||
if(oTarget == OBJECT_INVALID)
|
||||
{
|
||||
// Lets pick off the weakest targets.
|
||||
if(!nInMelee) oTarget = ai_GetLowestCRTarget(oCreature);
|
||||
else oTarget = ai_GetLowestCRTarget(oCreature, AI_RANGE_MELEE);
|
||||
if(!nInMelee) oTarget = ai_GetLowestCRPhysicalTarget(oCreature);
|
||||
else oTarget = ai_GetLowestCRPhysicalTarget(oCreature, AI_RANGE_MELEE);
|
||||
}
|
||||
if(oTarget != OBJECT_INVALID)
|
||||
{
|
||||
if(ai_TryRapidShotFeat(oCreature, oTarget, nInMelee)) return;
|
||||
if(ai_TryRangedTalents(oCreature, oTarget, nInMelee)) return;
|
||||
ai_ActionAttack(oCreature, AI_LAST_ACTION_RANGED_ATK, oTarget, nInMelee, TRUE);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user