mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +00:00
Add bots to UseSpellImpliedTargeting
This commit is contained in:
+3
-3
@@ -182,14 +182,14 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
}
|
||||
|
||||
//Goal of Spells:UseSpellImpliedTargeting is to replicate the EQ2 feature where spells will 'pass through' invalid targets to target's target to try to find a valid target.
|
||||
if (RuleB(Spells,UseSpellImpliedTargeting) && IsClient()) {
|
||||
if (RuleB(Spells,UseSpellImpliedTargeting) && IsOfClientBot()) {
|
||||
Mob* spell_target = entity_list.GetMobID(target_id);
|
||||
if (spell_target) {
|
||||
Mob* targets_target = spell_target->GetTarget();
|
||||
if (targets_target) {
|
||||
// If either this is beneficial and the target is not a player or player's pet or vis versa
|
||||
if ((IsBeneficialSpell(spell_id) && (!(spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient()))))
|
||||
|| (IsDetrimentalSpell(spell_id) && (spell_target->IsClient() || (spell_target->HasOwner() && spell_target->GetOwner()->IsClient())))) {
|
||||
if ((IsBeneficialSpell(spell_id) && (!(spell_target->IsOfClientBot() || (spell_target->HasOwner() && spell_target->GetOwner()->IsOfClientBot()))))
|
||||
|| (IsDetrimentalSpell(spell_id) && (spell_target->IsOfClientBot() || (spell_target->HasOwner() && spell_target->GetOwner()->IsOfClientBot())))) {
|
||||
//Check if the target's target is a valid target; we can use DoCastingChecksOnTarget() here because we can let it handle the failure as vanilla would
|
||||
if (DoCastingChecksOnTarget(true, spell_id, targets_target)) {
|
||||
target_id = targets_target->GetID();
|
||||
|
||||
Reference in New Issue
Block a user