diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/npc/npc_escortAI.h | 2 | ||||
-rw-r--r-- | src/game/CreatureAI.h | 1 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 36 | ||||
-rw-r--r-- | src/game/Unit.cpp | 7 |
4 files changed, 43 insertions, 3 deletions
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.h b/src/bindings/scripts/scripts/npc/npc_escortAI.h index 3431e84c6f8..fe352b6e277 100644 --- a/src/bindings/scripts/scripts/npc/npc_escortAI.h +++ b/src/bindings/scripts/scripts/npc/npc_escortAI.h @@ -61,6 +61,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; } float GetMaxPlayerDistance() { return MaxPlayerDistance; } + bool IsEscorted() {return IsBeingEscorted;} + void SetCanMelee(bool usemelee) { CanMelee = usemelee; } void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; } void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; } diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 91fabe30448..061b3d273c2 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -115,6 +115,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc) //virtual void AttackedBy(Unit* attacker); + virtual bool IsEscorted () {return false;} // Called when creature is spawned or respawned (for reseting variables) virtual void JustRespawned() { Reset(); } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 4f84364c303..0e0fb39613d 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3193,6 +3193,42 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun sLog.outError("Auras: Unknown Shapeshift Type: %u", GetMiscValue()); } + Unit::AuraEffectList const& mDummy = m_target->GetAurasByType(SPELL_AURA_DUMMY); + for(Unit::AuraEffectList::const_iterator i = mDummy.begin(); i != mDummy.end(); ++i) + { + int32 mastervalue = 0; + uint32 trigg_id = 0; + + if ((*i)->GetSpellProto()->Id == 48411 || (*i)->GetSpellProto()->Id == 48412) + { + mastervalue = (*i)->GetAmount(); + + switch (form) + { + case FORM_BEAR: + case FORM_DIREBEAR: + trigg_id = 48418; + break; + case FORM_CAT: + trigg_id = 48420; + break; + case FORM_MOONKIN: + trigg_id = 48421; + break; + case FORM_TREE: + trigg_id = 48422; + break; + default: + break; + } + + if (trigg_id) + m_target->CastCustomSpell(m_target, trigg_id, &mastervalue, NULL, NULL, true); + + break; + } + } + // remove polymorph before changing display id to keep new display id switch ( form ) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e55b54996f0..eede4b4bed2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10536,9 +10536,10 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) if(GetTypeId() != TYPEID_PLAYER) { - //if(GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != IDLE_MOTION_TYPE) - //if (((Creature *)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - //((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); + // Set home position at place of engaging combat for escorted creatures + if(((Creature*)this)->IsAIEnabled) + if (((Creature *)this)->AI()->IsEscorted()) + ((Creature*)this)->SetHomePosition(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); if(enemy) { if(((Creature*)this)->IsAIEnabled) |