diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2017-11-22 20:11:22 +0100 |
|---|---|---|
| committer | ccrs <ccrs@users.noreply.github.com> | 2017-11-22 20:11:22 +0100 |
| commit | 299323ce5d2e478f2eb7fcd6572c5fbf87b98c6e (patch) | |
| tree | e746fde33a7cb9dbda04bd978f38e15aed64bcca /src/server/game | |
| parent | c4846d94615dcce1d408afe6ff6594188a4be367 (diff) | |
Scripts/World: update guard scripts
Also remove deprecated method from Creature
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/AI/CoreAI/GuardAI.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 95 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 3 |
3 files changed, 1 insertions, 101 deletions
diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index 7f65af41d63..acc2e69ee06 100644 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -67,9 +67,7 @@ void GuardAI::EnterEvadeMode(EvadeReason /*why*/) me->GetThreatManager().ClearAllThreat(); me->CombatStop(true); - // Remove ChaseMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) - me->GetMotionMaster()->MoveTargetedHome(); + me->GetMotionMaster()->MoveTargetedHome(); } void GuardAI::JustDied(Unit* killer) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 27ea877ca08..52abe50e470 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2098,101 +2098,6 @@ bool Creature::isWorldBoss() const return (GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_BOSS_MOB) != 0; } -SpellInfo const* Creature::reachWithSpellAttack(Unit* victim) -{ - if (!victim) - return nullptr; - - for (uint32 i=0; i < MAX_CREATURE_SPELLS; ++i) - { - if (!m_spells[i]) - continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]); - if (!spellInfo) - { - TC_LOG_ERROR("entities.unit", "WORLD: unknown spell id %i", m_spells[i]); - continue; - } - - bool bcontinue = true; - for (uint32 j = 0; j < MAX_SPELL_EFFECTS; j++) - { - if ((spellInfo->Effects[j].Effect == SPELL_EFFECT_SCHOOL_DAMAGE) || - (spellInfo->Effects[j].Effect == SPELL_EFFECT_INSTAKILL) || - (spellInfo->Effects[j].Effect == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE) || - (spellInfo->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH) - ) - { - bcontinue = false; - break; - } - } - if (bcontinue) - continue; - - if (spellInfo->ManaCost > GetPower(POWER_MANA)) - continue; - float range = spellInfo->GetMaxRange(false); - float minrange = spellInfo->GetMinRange(false); - float dist = GetDistance(victim); - if (dist > range || dist < minrange) - continue; - if (spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) - continue; - if (spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) - continue; - return spellInfo; - } - return nullptr; -} - -SpellInfo const* Creature::reachWithSpellCure(Unit* victim) -{ - if (!victim) - return nullptr; - - for (uint32 i=0; i < MAX_CREATURE_SPELLS; ++i) - { - if (!m_spells[i]) - continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]); - if (!spellInfo) - { - TC_LOG_ERROR("entities.unit", "WORLD: unknown spell id %i", m_spells[i]); - continue; - } - - bool bcontinue = true; - for (uint32 j = 0; j < MAX_SPELL_EFFECTS; j++) - { - if ((spellInfo->Effects[j].Effect == SPELL_EFFECT_HEAL)) - { - bcontinue = false; - break; - } - } - if (bcontinue) - continue; - - if (spellInfo->ManaCost > GetPower(POWER_MANA)) - continue; - - float range = spellInfo->GetMaxRange(true); - float minrange = spellInfo->GetMinRange(true); - float dist = GetDistance(victim); - //if (!isInFront(victim, range) && spellInfo->AttributesEx) - // continue; - if (dist > range || dist < minrange) - continue; - if (spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) - continue; - if (spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) - continue; - return spellInfo; - } - return nullptr; -} - // select nearest hostile unit within the given distance (regardless of threat list). Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) const { diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 4a7c3362f30..051d0bf6f22 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -203,9 +203,6 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; } void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; } - SpellInfo const* reachWithSpellAttack(Unit* victim); - SpellInfo const* reachWithSpellCure(Unit* victim); - uint32 m_spells[MAX_CREATURE_SPELLS]; bool CanStartAttack(Unit const* u, bool force) const; |
