diff options
Diffstat (limited to 'src')
7 files changed, 28 insertions, 9 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3ad48d1421f..7809ded8e78 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1455,6 +1455,18 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u break; } + case SMART_ACTION_SEND_GO_CUSTOM_ANIM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsGameObject((*itr))) + (*itr)->ToGameObject()->SendCustomAnim(e.action.sendGoCustomAnim.anim); + + break; + } default: sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); break; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index a25b52aa30b..127994648cc 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -769,6 +769,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) case SMART_ACTION_SET_UNIT_FIELD_BYTES_1: case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1: case SMART_ACTION_INTERRUPT_SPELL: + case SMART_ACTION_SEND_GO_CUSTOM_ANIM: break; default: sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 51f31e401ad..ec02d44b607 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -445,12 +445,13 @@ enum SMART_ACTION SMART_ACTION_RANDOM_MOVE = 89, // maxDist SMART_ACTION_SET_UNIT_FIELD_BYTES_1 = 90, // bytes, target - SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1 = 91, // bytes, target SMART_ACTION_INTERRUPT_SPELL = 92, - SMART_ACTION_END = 93, + SMART_ACTION_SEND_GO_CUSTOM_ANIM = 93, // anim id + + SMART_ACTION_END = 94, }; struct SmartAction @@ -829,6 +830,11 @@ struct SmartAction uint32 spell_id; bool withInstant; } interruptSpellCasting; + + struct + { + uint32 anim; + } sendGoCustomAnim; struct { uint32 param1; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 6bbb1784ee1..3c5521f6b87 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -306,7 +306,7 @@ void GameObject::Update(uint32 diff) udata.BuildPacket(&packet); caster->ToPlayer()->GetSession()->SendPacket(&packet); - SendCustomAnim(); + SendCustomAnim(GetGoAnimProgress()); } m_lootState = GO_READY; // can be successfully open with some chance @@ -1212,7 +1212,7 @@ void GameObject::Use(Unit* user) // this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389) if (time_to_restore && info->goober.customAnim) - SendCustomAnim(); + SendCustomAnim(GetGoAnimProgress()); else SetGoState(GO_STATE_ACTIVE); @@ -1637,11 +1637,11 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) //trigger->RemoveCorpse(); } -void GameObject::SendCustomAnim() +void GameObject::SendCustomAnim(uint32 anim) { WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); data << GetGUID(); - data << uint32(GetGoAnimProgress()); + data << uint32(anim); SendMessageToSet(&data, true); } diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index c913c317772..6254666fdf6 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -748,7 +748,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> GameObject* LookupFishingHoleAround(float range); void CastSpell(Unit *target, uint32 spell); - void SendCustomAnim(); + void SendCustomAnim(uint32 anim); bool IsInRange(float x, float y, float z, float radius) const; void TakenDamage(uint32 damage, Unit* who = NULL); void Rebuild(); diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index cabd08dd856..2c4eeee8df8 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -114,7 +114,7 @@ public: { //THIS GOB IS A TRAP - What shall i do? =( //Cast it spell? Copyed Heigan method - pFloorEruption->SendCustomAnim(); + pFloorEruption->SendCustomAnim(pFloorEruption->GetGoAnimProgress()); pFloorEruption->CastSpell(NULL, Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId //Get all immediatly nearby floors diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 4a3cdb92a17..4c08746e534 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -335,7 +335,7 @@ public: { if (GameObject* pHeiganEruption = instance->GetGameObject(*itr)) { - pHeiganEruption->SendCustomAnim(); + pHeiganEruption->SendCustomAnim(pHeiganEruption->GetGoAnimProgress()); pHeiganEruption->CastSpell(NULL, SPELL_ERUPTION); } } |