From c0224dd7ca9a39034518bd7e6285702636749929 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sat, 1 Feb 2014 13:27:16 +0100 Subject: [PATCH 1/4] Core/Chat: Fix an exploit where it was possible to speak in universal language in say/yell/emote by sending CMSG_MESSAGECHAT using cheats. --- src/server/game/Handlers/ChatHandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 17b5974d1ca..b8856bd6559 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -55,6 +55,14 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) return; } + if (lang == LANG_UNIVERSAL) + { + TC_LOG_ERROR("network", "CMSG_MESSAGECHAT: Possible hacking-attempt: %s tried to send a message in universal language", GetPlayerInfo().c_str()); + SendNotification(LANG_UNKNOWN_LANGUAGE); + recvData.rfinish(); + return; + } + Player* sender = GetPlayer(); //TC_LOG_DEBUG("CHAT: packet received. type %u, lang %u", type, lang); From 822092ea15d39157eeff0adfbac10f510424476f Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 1 Feb 2014 18:04:54 +0100 Subject: [PATCH 2/4] DB/Creature: Fix warnings with creature_formations loading --- sql/updates/world/2014_02_01_01_world_creature_formations.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2014_02_01_01_world_creature_formations.sql diff --git a/sql/updates/world/2014_02_01_01_world_creature_formations.sql b/sql/updates/world/2014_02_01_01_world_creature_formations.sql new file mode 100644 index 00000000000..2e94aac45c4 --- /dev/null +++ b/sql/updates/world/2014_02_01_01_world_creature_formations.sql @@ -0,0 +1,3 @@ +ALTER TABLE `creature_formations` + CHANGE `point_1` `point_1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0', + CHANGE `point_2` `point_2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'; From 2df3fe3a00499cb08856870d3b57377b78b09fbe Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sat, 1 Feb 2014 19:07:48 +0200 Subject: [PATCH 3/4] Core/Scripts: Fix quest The Totem of Kar'dash alliance version. Remove some hungarian notation for horde side version. Closes #11035 --- src/server/scripts/Outland/zone_nagrand.cpp | 65 +++++++++++++-------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 8d5c81d1c01..9b7a3f8aa2a 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -182,13 +182,11 @@ public: { if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_H) { - if (npc_maghar_captiveAI* pEscortAI = dynamic_cast(creature->AI())) + if (npc_maghar_captiveAI* EscortAI = dynamic_cast(creature->AI())) { creature->SetStandState(UNIT_STAND_STATE_STAND); creature->setFaction(232); - - pEscortAI->Start(true, false, player->GetGUID(), quest); - + EscortAI->Start(true, false, player->GetGUID(), quest); creature->AI()->Talk(SAY_MAG_START); creature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0]+2.5f, m_afAmbushA[1]-2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); @@ -208,15 +206,15 @@ public: { npc_maghar_captiveAI(Creature* creature) : npc_escortAI(creature) { Reset(); } - uint32 m_uiChainLightningTimer; - uint32 m_uiHealTimer; - uint32 m_uiFrostShockTimer; + uint32 ChainLightningTimer; + uint32 HealTimer; + uint32 FrostShockTimer; void Reset() OVERRIDE { - m_uiChainLightningTimer = 1000; - m_uiHealTimer = 0; - m_uiFrostShockTimer = 6000; + ChainLightningTimer = 1000; + HealTimer = 0; + FrostShockTimer = 6000; } void EnterCombat(Unit* /*who*/) OVERRIDE @@ -224,6 +222,18 @@ public: DoCast(me, SPELL_EARTHBIND_TOTEM, false); } + void JustDied(Unit* /*killer*/) OVERRIDE + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + if (Player* player = GetPlayerForEscort()) + { + if (player->GetQuestStatus(QUEST_TOTEM_KARDASH_H) != QUEST_STATUS_COMPLETE) + player->FailQuest(QUEST_TOTEM_KARDASH_H); + } + } + void WaypointReached(uint32 waypointId) OVERRIDE { switch (waypointId) @@ -263,9 +273,9 @@ public: } - void SpellHitTarget(Unit* /*target*/, const SpellInfo* pSpell) OVERRIDE + void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) OVERRIDE { - if (pSpell->Id == SPELL_CHAIN_LIGHTNING) + if (spell->Id == SPELL_CHAIN_LIGHTNING) { if (rand()%10) return; @@ -274,38 +284,42 @@ public: } } - void UpdateAI(uint32 uiDiff) OVERRIDE + void UpdateAI(uint32 diff) OVERRIDE { - npc_escortAI::UpdateAI(uiDiff); - if (!me->GetVictim()) + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) return; - if (m_uiChainLightningTimer <= uiDiff) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + if (ChainLightningTimer <= diff) { DoCastVictim(SPELL_CHAIN_LIGHTNING); - m_uiChainLightningTimer = urand(7000, 14000); + ChainLightningTimer = urand(7000, 14000); } else - m_uiChainLightningTimer -= uiDiff; + ChainLightningTimer -= diff; if (HealthBelowPct(30)) { - if (m_uiHealTimer <= uiDiff) + if (HealTimer <= diff) { DoCast(me, SPELL_HEALING_WAVE); - m_uiHealTimer = 5000; + HealTimer = 5000; } else - m_uiHealTimer -= uiDiff; + HealTimer -= diff; } - if (m_uiFrostShockTimer <= uiDiff) + if (FrostShockTimer <= diff) { DoCastVictim(SPELL_FROST_SHOCK); - m_uiFrostShockTimer = urand(7500, 15000); + FrostShockTimer = urand(7500, 15000); } else - m_uiFrostShockTimer -= uiDiff; + FrostShockTimer -= diff; DoMeleeAttackIfReady(); } @@ -517,6 +531,7 @@ public: if (npc_kurenai_captiveAI* EscortAI = dynamic_cast(creature->AI())) { creature->SetStandState(UNIT_STAND_STATE_STAND); + creature->setFaction(231); EscortAI->Start(true, false, player->GetGUID(), quest); creature->AI()->Talk(SAY_KUR_START); @@ -629,6 +644,8 @@ public: void UpdateAI(uint32 diff) OVERRIDE { + npc_escortAI::UpdateAI(diff); + if (!UpdateVictim()) return; From 11b48569c807be6019fb364187ef6ddae74b5ef6 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sat, 1 Feb 2014 19:23:20 +0100 Subject: [PATCH 4/4] Core/Spells: fix crash when loading custom spell attr with invalid spellid --- src/server/game/Spells/SpellMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index eccb7863460..93f264d2d61 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2731,7 +2731,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes() uint32 spellId = fields[0].GetUInt32(); uint32 attributes = fields[1].GetUInt32(); - spellInfo = mSpellInfoMap[spellId]; + spellInfo = _GetSpellInfo(spellId); if (!spellInfo) { TC_LOG_ERROR("sql.sql", "Table `spell_custom_attr` has wrong spell (entry: %u), ignored.", spellId);