diff options
-rw-r--r-- | sql/updates/world/2014_02_01_01_world_creature_formations.sql | 3 | ||||
-rw-r--r-- | src/server/game/Handlers/ChatHandler.cpp | 8 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Outland/zone_nagrand.cpp | 65 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 1 |
5 files changed, 54 insertions, 25 deletions
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'; diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 7c946542d7c..abc628eda78 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -99,6 +99,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("misc", "CHAT: packet received. type %u, lang %u", type, lang); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7f3b44a6f9d..49bab7946a1 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2810,7 +2810,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); 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<npc_maghar_captiveAI*>(creature->AI())) + if (npc_maghar_captiveAI* EscortAI = dynamic_cast<npc_maghar_captiveAI*>(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 (me->HasUnitState(UNIT_STATE_CASTING)) return; - if (m_uiChainLightningTimer <= uiDiff) + 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<npc_kurenai_captiveAI*>(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; diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index d08623888b3..3fb74bddee0 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -25,6 +25,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "Containers.h" enum DeathKnightSpells { |