diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp | 35 | ||||
-rw-r--r-- | src/game/GameObject.cpp | 4 | ||||
-rw-r--r-- | src/game/UpdateData.cpp | 4 |
3 files changed, 38 insertions, 5 deletions
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp index 0c08804b868..560d9196d95 100644 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp @@ -598,6 +598,36 @@ CreatureAI* GetAI_npc_ros_dark_rider(Creature *_Creature) return new npc_ros_dark_riderAI(_Creature); } +struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI +{ + npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if(who->GetEntry() == 28845 && me->IsWithinDistInMap(who, 10.0f)) + { + if(Unit *owner = who->GetOwner()) + { + if(owner->GetTypeId() == TYPEID_PLAYER) + { + if(CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) + { + CAST_PLR(owner)->KilledMonster(28845, me->GetGUID()); + who->setDeathState(DEAD); + } + } + } + } + } +}; + +CreatureAI* GetAI_npc_dkc1_gothik(Creature *_Creature) +{ + return new npc_dkc1_gothikAI(_Creature); +} + void AddSC_the_scarlet_enclave() { Script *newscript; @@ -633,4 +663,9 @@ void AddSC_the_scarlet_enclave() newscript->Name="npc_ros_dark_rider"; newscript->GetAI = &GetAI_npc_ros_dark_rider; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_dkc1_gothik"; + newscript->GetAI = &GetAI_npc_dkc1_gothik; + newscript->RegisterSelf(); }
\ No newline at end of file diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index c8021c8bb8b..239fe826087 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -324,8 +324,6 @@ void GameObject::Update(uint32 /*p_time*/) return; } - bool NeedDespawn = (goInfo->trap.charges != 0); - // Note: this hack with search required until GO casting not implemented // search unfriendly creature if(owner) // hunter trap @@ -359,7 +357,7 @@ void GameObject::Update(uint32 /*p_time*/) else m_cooldownTime = time(NULL) + 4; // 4 seconds - if(NeedDespawn) + if(owner) SetLootState(GO_JUST_DEACTIVATED); // can be despawned or destroyed if(IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) diff --git a/src/game/UpdateData.cpp b/src/game/UpdateData.cpp index 34547040cda..9273944b76c 100644 --- a/src/game/UpdateData.cpp +++ b/src/game/UpdateData.cpp @@ -105,7 +105,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) bool UpdateData::BuildPacket(WorldPacket *packet) { - ByteBuffer buf(m_data.size()); + ByteBuffer buf(m_data.size() + 10 + m_outOfRangeGUIDs.size()*8); buf << (uint32) (!m_outOfRangeGUIDs.empty() ? m_blockCount + 1 : m_blockCount); @@ -128,7 +128,7 @@ bool UpdateData::BuildPacket(WorldPacket *packet) if (pSize > 100 ) // compress large packets { - packet->resize(pSize); + packet->resize(pSize * 1.1f + 16); packet->put<uint32>(0, pSize); |