From 2e116cf21737b09348244121ddabeb4ca9877f35 Mon Sep 17 00:00:00 2001 From: kandera Date: Mon, 5 Dec 2011 06:18:25 -0500 Subject: [PATCH 01/13] Core/Spells: Fix Glyph of Succubus (wasn't working at all before) --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2e2f5591a5..3df766345f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6054,6 +6054,16 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 37378; break; } + // Glyph of Succubus + case 56250: + { + if(!target) + return false; + target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, 0, target->GetAura(32409)); // SW:D shall not be removed. + target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); + target->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); + return true; + } } break; } From 18aaeaa6be2f6fe2e66123ce6928b62e29685c6b Mon Sep 17 00:00:00 2001 From: kandera Date: Mon, 5 Dec 2011 13:46:40 -0500 Subject: [PATCH 02/13] Core/Spells: Tricks of the Trade (fix entier spell. aggro now removed after buff dissapears, correct buffs are placed on both the rogue and the target, both 15% buff and the second threat modifier buff are working as intended) --- src/server/game/Entities/Unit/Unit.cpp | 10 ++++++++++ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2e2f5591a5..022c5d2544 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6482,6 +6482,16 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 32747; break; } + case 57934: // Tricks of the Trade + { + Unit* redirectTarget = GetMisdirectionTarget(); + RemoveAura(57934); + if (!redirectTarget) + break; + redirectTarget->CastSpell(this,59628,true); + CastSpell(redirectTarget,57933,true); + break; + } } switch (dummySpell->SpellIconID) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c4487fbd95..b690a811fb 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4803,6 +4803,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool case 71563: if (Aura* newAura = target->AddAura(71564, target)) newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount); + break; + case 59628: // Tricks of the Trade + target->SetReducedThreatPercent(100,caster->GetGUID()); + break; } } // AT REMOVE @@ -4950,6 +4954,15 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (GetId() == 61777) target->CastSpell(target, GetAmount(), true); break; + case SPELLFAMILY_ROGUE: + // Tricks of the trade + switch(GetId()) + { + case 59628: + case 57934: + target->SetReducedThreatPercent(0,0); + break; + } default: break; } From f5b3553bb3e6cf9d055cfdc7f230e3ddaeea559b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Tue, 6 Dec 2011 12:37:05 +0100 Subject: [PATCH 03/13] Core/SAI: Typo in second param of SMART_ACTION_SEND_GOSSIP_MENU. This is npc_text_id, not gossip_option_id. Wiki needs to be updated accordingly. Thanks to Prodigy for pointing out. --- src/server/game/AI/SmartScripts/SmartScript.cpp | 6 +++--- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index ffe21536de..c845f6110d 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1786,8 +1786,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!GetBaseObject()) return; - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossip_option_id %d", - e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipOptionId); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d", + e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId); ObjectList* targets = GetTargets(e, unit); if (!targets) @@ -1801,7 +1801,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u else player->PlayerTalkClass->ClearMenus(); - player->SEND_GOSSIP_MENU(e.action.sendGossipMenu.gossipOptionId, GetBaseObject()->GetGUID()); + player->SEND_GOSSIP_MENU(e.action.sendGossipMenu.gossipNpcTextId, GetBaseObject()->GetGUID()); } delete targets; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index ba986ae310..e80da52ccd 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -862,7 +862,7 @@ struct SmartAction struct { uint32 gossipMenuId; - uint32 gossipOptionId; + uint32 gossipNpcTextId; } sendGossipMenu; struct From 6a648c01a46e45a38bbbfc9b5bfa0a8aa114a16c Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 7 Dec 2011 13:02:44 -0500 Subject: [PATCH 04/13] Some clean up of grid system. --- src/server/game/Globals/ObjectAccessor.cpp | 8 ++---- src/server/game/Globals/ObjectMgr.cpp | 16 +++--------- src/server/game/Grids/GridDefines.h | 5 ++++ src/server/game/Grids/ObjectGridLoader.cpp | 30 ++++++---------------- 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 82532e6ae2..8b54554894 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -225,9 +225,7 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse) // build mapid*cellid -> guid_set map CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY()); - uint32 cell_id = (cellCoord.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - sObjectMgr->DeleteCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID())); + sObjectMgr->DeleteCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), GUID_LOPART(corpse->GetOwnerGUID())); i_player2corpse.erase(iter); } @@ -246,9 +244,7 @@ void ObjectAccessor::AddCorpse(Corpse* corpse) // build mapid*cellid -> guid_set map CellCoord cellCoord = Trinity::ComputeCellCoord(corpse->GetPositionX(), corpse->GetPositionY()); - uint32 cell_id = (cellCoord.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - sObjectMgr->AddCorpseCellData(corpse->GetMapId(), cell_id, GUID_LOPART(corpse->GetOwnerGUID()), corpse->GetInstanceId()); + sObjectMgr->AddCorpseCellData(corpse->GetMapId(), cellCoord.GetId(), GUID_LOPART(corpse->GetOwnerGUID()), corpse->GetInstanceId()); } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3b62a4217b..be61a9bbe5 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1569,9 +1569,7 @@ void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data) if (mask & 1) { CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()]; cell_guids.creatures.insert(guid); } } @@ -1585,9 +1583,7 @@ void ObjectMgr::RemoveCreatureFromGrid(uint32 guid, CreatureData const* data) if (mask & 1) { CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()]; cell_guids.creatures.erase(guid); } } @@ -1878,9 +1874,7 @@ void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data) if (mask & 1) { CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()]; cell_guids.gameobjects.insert(guid); } } @@ -1894,9 +1888,7 @@ void ObjectMgr::RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data if (mask & 1) { CellCoord cellCoord = Trinity::ComputeCellCoord(data->posX, data->posY); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cellCoord.GetId()]; cell_guids.gameobjects.erase(guid); } } diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 44e2588ef8..a9c0bf8876 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -135,6 +135,11 @@ struct CoordPair return *this; } + uint32 GetId() const + { + return y_coord * LIMIT + x_coord; + } + uint32 x_coord; uint32 y_coord; }; diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 56c6410e6d..cc5e3f5158 100755 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -44,6 +44,7 @@ void ObjectGridEvacuator::Visit(CreatureMapType &m) } // for loading world object at grid loading (Corpses) +//TODO: to implement npc on transport, also need to load npcs at grid loading class ObjectWorldLoader { public: @@ -138,38 +139,23 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord &cell, CorpseMapTyp void ObjectGridLoader::Visit(GameObjectMapType &m) { - uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); - uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellCoord cellCoord(x, y); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); - + CellCoord cellCoord = i_cell.GetCellCoord(); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cellCoord.GetId()); LoadHelper(cell_guids.gameobjects, cellCoord, m, i_gameObjects, i_map); } -void -ObjectGridLoader::Visit(CreatureMapType &m) +void ObjectGridLoader::Visit(CreatureMapType &m) { - uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); - uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellCoord cellCoord(x, y); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - - CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); - + CellCoord cellCoord = i_cell.GetCellCoord(); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cellCoord.GetId()); LoadHelper(cell_guids.creatures, cellCoord, m, i_creatures, i_map); } void ObjectWorldLoader::Visit(CorpseMapType &m) { - uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); - uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellCoord cellCoord(x, y); - uint32 cell_id = (cellCoord.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cellCoord.x_coord; - + CellCoord cellCoord = i_cell.GetCellCoord(); // corpses are always added to spawn mode 0 and they are spawned by their instance id - CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), 0, cell_id); + CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), 0, cellCoord.GetId()); LoadHelper(cell_guids.corpses, cellCoord, m, i_corpses, i_map); } From 9c65d26e466d8c9646b5797d37f1db7a522e4b4d Mon Sep 17 00:00:00 2001 From: LaserJet Date: Wed, 7 Dec 2011 22:05:57 +0100 Subject: [PATCH 05/13] Core/Loading: Fix some copy&paste mistakes in creature_(template_)addon --- src/server/game/Globals/ObjectMgr.cpp | 8 ++++---- src/server/game/World/World.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index be61a9bbe5..7557336724 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -535,7 +535,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!result) { - sLog->outString(">> Loaded 0 creature template addon definitions. DB table `creature_addon` is empty."); + sLog->outString(">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty."); sLog->outString(); return; } @@ -569,7 +569,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(uint32(atol(*itr))); if (!AdditionalSpellInfo) { - sLog->outErrorDb("Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", entry, uint32(atol(*itr))); + sLog->outErrorDb("Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr))); continue; } creatureAddon.auras[i++] = uint32(atol(*itr)); @@ -579,13 +579,13 @@ void ObjectMgr::LoadCreatureTemplateAddons() { if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount)) { - sLog->outErrorDb("Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", entry, creatureAddon.mount); + sLog->outErrorDb("Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.mount); creatureAddon.mount = 0; } } if (!sEmotesStore.LookupEntry(creatureAddon.emote)) - sLog->outErrorDb("Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote); + sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_template_addon`.", entry, creatureAddon.emote); ++count; } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 8aca4563b9..a139c50fb3 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1387,7 +1387,7 @@ void World::SetInitialWorldSettings() sLog->outString("Loading pet default spells additional to levelup spells..."); sSpellMgr->LoadPetDefaultSpells(); - sLog->outString("Loading Creature Template Addon Data..."); + sLog->outString("Loading Creature Addon Data..."); sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() sLog->outString("Loading Creature Respawn Data..."); // must be after PackInstances() From 17f8245d392ad787d6c206a03326ccd9899fa421 Mon Sep 17 00:00:00 2001 From: LaserJet Date: Wed, 7 Dec 2011 22:36:22 +0100 Subject: [PATCH 06/13] DB/Factionchange: Added missing data in player_factionchange_achievement table. --- ...world_player_factionchange_achievement.sql | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sql/updates/world/2011_12_07_00_world_player_factionchange_achievement.sql diff --git a/sql/updates/world/2011_12_07_00_world_player_factionchange_achievement.sql b/sql/updates/world/2011_12_07_00_world_player_factionchange_achievement.sql new file mode 100644 index 0000000000..7a19fa2cad --- /dev/null +++ b/sql/updates/world/2011_12_07_00_world_player_factionchange_achievement.sql @@ -0,0 +1,71 @@ +-- Missing achievement data (checked via DBC files) +DELETE FROM `player_factionchange_achievement` WHERE `alliance_id` IN (35,41,58,202,206,220,225,230,246,388,433,434,435,436,437,438,439,440,441,442,470,471,472,473,707,764,907,908,1167,1169,1172,1262,1466,1563,1681,1737,1752,1757,1762,1782,2016,2194,2536,2760,2761,2762,2763,2764,2770,2777,2778,2779,2780,2781,2782,2817,3356,3478,3676,3846,3851,3856,3857,4156,4296,4298,4784,4786); +INSERT INTO `player_factionchange_achievement` (`alliance_id`,`horde_id`) VALUES +(35,1359), +(41,1360), +(58,593), +(202,1502), +(206,1252), +(220,873), +(225,1164), +(230,1175), +(246,1005), +(388,1006), +(433,443), +(434,445), +(435,444), +(436,447), +(437,448), +(438,469), +(439,451), +(440,452), +(441,450), +(442,454), +(470,468), +(471,453), +(472,449), +(473,446), +(707,706), +(764,763), +(907,714), +(908,909), +(1167,1168), +(1169,1170), +(1172,1173), +(1262,1274), +(1466,926), +(1563,1784), +(1681,1682), +(1737,2476), +(1752,2776), +(1757,2200), +(1762,2192), +(1782,1783), +(2016,2017), +(2194,2195), +(2536,2537), +(2760,2768), +(2761,2767), +(2762,2766), +(2763,2769), +(2764,2765), +(2770,2771), +(2777,2786), +(2778,2785), +(2779,2784), +(2780,2787), +(2781,2783), +(2782,2788), +(2817,2816), +(3356,3357), +(3478,3656), +(3676,3677), +(3846,4176), +(3851,4177), +(3856,4256), +(3857,3957), +(4156,4079), +(4296,3778), +(4298,4297), +(4784,4785), +(4786,4790); From b05317650b470fe618c0b15a3d20656a074f76c5 Mon Sep 17 00:00:00 2001 From: Shocker Date: Thu, 8 Dec 2011 19:56:50 +0200 Subject: [PATCH 07/13] Core/Misc: Small changes after recent pulls --- ...=> 2011_12_08_00_world_player_factionchange_achievement.sql} | 0 src/server/game/Entities/Unit/Unit.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename sql/updates/world/{2011_12_07_00_world_player_factionchange_achievement.sql => 2011_12_08_00_world_player_factionchange_achievement.sql} (100%) diff --git a/sql/updates/world/2011_12_07_00_world_player_factionchange_achievement.sql b/sql/updates/world/2011_12_08_00_world_player_factionchange_achievement.sql similarity index 100% rename from sql/updates/world/2011_12_07_00_world_player_factionchange_achievement.sql rename to sql/updates/world/2011_12_08_00_world_player_factionchange_achievement.sql diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3cbcaf069a..298f9c60af 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6057,7 +6057,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Glyph of Succubus case 56250: { - if(!target) + if (!target) return false; target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, 0, target->GetAura(32409)); // SW:D shall not be removed. target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); From c87d4a0b64499a6a8564e9c0ed44b2e7ceece569 Mon Sep 17 00:00:00 2001 From: Shocker Date: Thu, 8 Dec 2011 20:12:57 +0200 Subject: [PATCH 08/13] Scripts/Trial of the Crusader: Fix Twin Empathy (thanks to Amit86) Closes #3654 --- .../2011_12_08_01_world_creature_template_addon.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2011_12_08_01_world_creature_template_addon.sql diff --git a/sql/updates/world/2011_12_08_01_world_creature_template_addon.sql b/sql/updates/world/2011_12_08_01_world_creature_template_addon.sql new file mode 100644 index 0000000000..e8a464146e --- /dev/null +++ b/sql/updates/world/2011_12_08_01_world_creature_template_addon.sql @@ -0,0 +1,11 @@ +-- Fix the HP sharing of Twin Valkyr - All Modes +DELETE FROM `creature_template_addon` WHERE `entry` IN (34497,35350,35351,35352,34496,35347,35348,35349); +INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES +(34497,'66133'), +(35350,'66133'), +(35351,'66133'), +(35352,'66133'), +(34496,'66132'), +(35347,'66132'), +(35348,'66132'), +(35349,'66132'); From 04862de237d4fb9138c96653d29a5f043254f49e Mon Sep 17 00:00:00 2001 From: durotar Date: Fri, 9 Dec 2011 12:15:19 +0000 Subject: [PATCH 09/13] DB/Gossips: Correct a duplicated gossip id (2011_10_23_04_world_sai.sql vs 2011_10_23_07_world_sai.sql) --- sql/updates/world/2011_12_08_00_world_gossip.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sql/updates/world/2011_12_08_00_world_gossip.sql diff --git a/sql/updates/world/2011_12_08_00_world_gossip.sql b/sql/updates/world/2011_12_08_00_world_gossip.sql new file mode 100644 index 0000000000..f6195d9d66 --- /dev/null +++ b/sql/updates/world/2011_12_08_00_world_gossip.sql @@ -0,0 +1,12 @@ +-- fixing conflict in number of gossip_menu_option.menu_id -- compare 2011_10_23_04_world_sai.sql with 2011_10_23_07_world_sai.sql +SET @ENTRY := 18417; +SET @OLDGOSSIP := 21304; +SET @NEWGOSSIP := 21312; +SET @QUEST_PUPIL := 10646; +-- Fixing smart_scripts +UPDATE `smart_scripts` SET `event_param1`=@NEWGOSSIP WHERE `entryorguid`=@ENTRY AND `source_type`=0 AND `id`=2 AND `action_param1`=@QUEST_PUPIL; +-- Fixing gossip_menu_option +UPDATE `gossip_menu_option` SET `action_menu_id`=@NEWGOSSIP WHERE `menu_id`=@OLDGOSSIP+5; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@NEWGOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES +(@NEWGOSSIP,0,0,"There was something else I wanted to ask you, Altruis.",1,3,@OLDGOSSIP+0); From d95a0aee764cfbbf796b0459c71c4e3145fc653e Mon Sep 17 00:00:00 2001 From: Aokromes Date: Fri, 9 Dec 2011 20:54:20 +0100 Subject: [PATCH 10/13] Add missing %s to 2 emotes. --- src/server/scripts/Outland/BlackTemple/boss_illidan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index a690f3cbd9..ec7f9a8e07 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -364,8 +364,8 @@ static const Animation DemonTransformation[10]= {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true} }; -#define EMOTE_SETS_GAZE_ON "sets its gaze on $N!" -#define EMOTE_UNABLE_TO_SUMMON "is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter." +#define EMOTE_SETS_GAZE_ON "%s sets its gaze on $N!" +#define EMOTE_UNABLE_TO_SUMMON "%s is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter." class mob_flame_of_azzinoth : public CreatureScript { From 100bcd6aec70f4ee228e51075ad7c3b764e4b2d5 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 10 Dec 2011 13:42:22 +0100 Subject: [PATCH 11/13] Core/Protocol: Fixed unprocessed tail data for opcodes CMSG_QUEST_POI_QUERY, CMSG_SHOWING_HELM, CMSG_SHOWING_CLOAK and CMSG_AUCTION_LIST_BIDDER_ITEMS. --- .../game/Server/Protocol/Handlers/AuctionHouseHandler.cpp | 1 + .../game/Server/Protocol/Handlers/CharacterHandler.cpp | 6 ++++-- src/server/game/Server/Protocol/Handlers/QueryHandler.cpp | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 2f8a27740b..8c45b03060 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -469,6 +469,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) if (!creature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + recv_data.rfinish(); return; } diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 83b9ab048a..aea6466924 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -1085,15 +1085,17 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data) _player->GetReputationMgr().SetInactive(replistid, inactive); } -void WorldSession::HandleShowingHelmOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleShowingHelmOpcode(WorldPacket& recv_data) { sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName()); + recv_data.read_skip(); // unknown, bool? _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM); } -void WorldSession::HandleShowingCloakOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleShowingCloakOpcode(WorldPacket& recv_data) { sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName()); + recv_data.read_skip(); // unknown, bool? _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK); } diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index bf951619e6..042b1242a9 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -413,7 +413,10 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) recv_data >> count; // quest count, max=25 if (count >= MAX_QUEST_LOG_SIZE) + { + recv_data.rfinish(); return; + } WorldPacket data(SMSG_QUEST_POI_QUERY_RESPONSE, 4+(4+4)*count); data << uint32(count); // count From b10477a166d0eea33272ee25b63a49e9bca57b9a Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 10 Dec 2011 13:44:06 +0100 Subject: [PATCH 12/13] Core/SmartAI: Fixed crashes when using timed actionlist for gameobjects. --- src/server/game/AI/SmartScripts/SmartAI.cpp | 2 +- src/server/game/AI/SmartScripts/SmartScript.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index afa7e9c293..fde660e483 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -707,7 +707,7 @@ void SmartAI::SetRun(bool run) me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); else me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - me->SendMovementFlagUpdate(); + mRun = run; } diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index c845f6110d..9755055cd6 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1493,7 +1493,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u else if (GameObject* goTarget = (*itr)->ToGameObject()) { if (IsSmartGO(goTarget)) - CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); + CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); } } @@ -1610,7 +1610,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u else if (GameObject* goTarget = (*itr)->ToGameObject()) { if (IsSmartGO(goTarget)) - CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, GetLastInvoker()); + CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker()); } } @@ -1640,7 +1640,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u else if (GameObject* goTarget = (*itr)->ToGameObject()) { if (IsSmartGO(goTarget)) - CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, GetLastInvoker()); + CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker()); } } From 11fb0beaf0cb877b14f24aa88f19832e0aa3dc88 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 10 Dec 2011 13:48:41 +0100 Subject: [PATCH 13/13] Core/Misc: Fixed some duplicate checks for player typeid in Unit::Kill and Spell::EffectSummonDeadPet. Also some random cleanup --- src/server/game/Entities/Object/Object.cpp | 7 +++-- src/server/game/Entities/Unit/Unit.cpp | 28 ++++++------------- src/server/game/Guilds/Guild.cpp | 1 + src/server/game/Maps/Map.cpp | 31 +++++++++------------- src/server/game/Spells/SpellEffects.cpp | 11 ++++---- 5 files changed, 31 insertions(+), 47 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 978d9accb6..d4723cbec4 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1642,7 +1642,7 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo bool corpseVisibility = false; if (distanceCheck) { - if (const Player* thisPlayer = ToPlayer()) + if (Player const* thisPlayer = ToPlayer()) { if (thisPlayer->isDead() && thisPlayer->GetHealth() > 0 && // Cheap way to check for ghost state !(obj->m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & GHOST_VISIBILITY_GHOST)) @@ -1675,9 +1675,9 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo if (!corpseVisibility && !(obj->m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GHOST) & m_serverSideVisibilityDetect.GetValue(SERVERSIDE_VISIBILITY_GHOST))) { // Alive players can see dead players in some cases, but other objects can't do that - if (const Player* thisPlayer = ToPlayer()) + if (Player const* thisPlayer = ToPlayer()) { - if (const Player* objPlayer = obj->ToPlayer()) + if (Player const* objPlayer = obj->ToPlayer()) { if (thisPlayer->GetTeam() != objPlayer->GetTeam() || !thisPlayer->IsGroupVisibleFor(objPlayer)) return false; @@ -2018,7 +2018,6 @@ void WorldObject::SendMessageToSet(WorldPacket* data, bool self) SendMessageToSetInRange(data, GetVisibilityRange(), self); } - void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/) { Trinity::MessageDistDeliverer notifier(this, data, dist); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 298f9c60af..659ebef92a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15593,29 +15593,17 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) } // Hook for OnPVPKill Event - if (GetTypeId() == TYPEID_PLAYER) + if (Player* killerPlr = ToPlayer()) { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - Player* killer = ToPlayer(); - Player* killed = victim->ToPlayer(); - sScriptMgr->OnPVPKill(killer, killed); - } - else if (victim->GetTypeId() == TYPEID_UNIT) - { - Player* killer = ToPlayer(); - Creature* killed = victim->ToCreature(); - sScriptMgr->OnCreatureKill(killer, killed); - } + if (Player* killedPlr = victim->ToPlayer()) + sScriptMgr->OnPVPKill(killerPlr, killedPlr); + else if (Creature* killedCre = victim->ToCreature()) + sScriptMgr->OnCreatureKill(killerPlr, killedCre); } - else if (GetTypeId() == TYPEID_UNIT) + else if (Creature* killerCre = ToCreature()) { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - Creature* killer = ToCreature(); - Player* killed = victim->ToPlayer(); - sScriptMgr->OnPlayerKilledByCreature(killer, killed); - } + if (Player* killed = victim->ToPlayer()) + sScriptMgr->OnPlayerKilledByCreature(killerCre, killed); } if (victim->GetVehicle()) diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 59c107bd40..94fcbbdda2 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1993,6 +1993,7 @@ bool Guild::Validate() } } } + if (broken_ranks) { m_ranks.clear(); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 13a47633b5..f9b79b4f19 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -685,8 +685,7 @@ void Map::RemoveFromMap(T *obj, bool remove) } } -void -Map::PlayerRelocation(Player* player, float x, float y, float z, float orientation) +void Map::PlayerRelocation(Player* player, float x, float y, float z, float orientation) { ASSERT(player); @@ -710,8 +709,7 @@ Map::PlayerRelocation(Player* player, float x, float y, float z, float orientati player->UpdateObjectVisibility(false); } -void -Map::CreatureRelocation(Creature* creature, float x, float y, float z, float ang, bool respawnRelocationOnFail) +void Map::CreatureRelocation(Creature* creature, float x, float y, float z, float ang, bool respawnRelocationOnFail) { ASSERT(CheckGridIntegrity(creature, false)); @@ -1161,7 +1159,7 @@ bool GridMap::loadHeihgtData(FILE* in, uint32 offset, uint32 /*size*/) return true; } -bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/) +bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/) { map_liquidHeader header; fseek(in, offset, SEEK_SET); @@ -1203,12 +1201,12 @@ uint16 GridMap::getArea(float x, float y) return m_area_map[lx*16 + ly]; } -float GridMap::getHeightFromFlat(float /*x*/, float /*y*/) const +float GridMap::getHeightFromFlat(float /*x*/, float /*y*/) const { return m_gridHeight; } -float GridMap::getHeightFromFloat(float x, float y) const +float GridMap::getHeightFromFloat(float x, float y) const { if (!m_V8 || !m_V9) return m_gridHeight; @@ -1290,7 +1288,7 @@ float GridMap::getHeightFromFloat(float x, float y) const return a * x + b * y + c; } -float GridMap::getHeightFromUint8(float x, float y) const +float GridMap::getHeightFromUint8(float x, float y) const { if (!m_uint8_V8 || !m_uint8_V9) return m_gridHeight; @@ -1357,7 +1355,7 @@ float GridMap::getHeightFromUint8(float x, float y) const return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight; } -float GridMap::getHeightFromUint16(float x, float y) const +float GridMap::getHeightFromUint16(float x, float y) const { if (!m_uint16_V8 || !m_uint16_V9) return m_gridHeight; @@ -1424,7 +1422,7 @@ float GridMap::getHeightFromUint16(float x, float y) const return (float)((a * x) + (b * y) + c)*m_gridIntHeightMultiplier + m_gridHeight; } -float GridMap::getLiquidLevel(float x, float y) +float GridMap::getLiquidLevel(float x, float y) { if (!m_liquid_map) return m_liquidLevel; @@ -1443,7 +1441,7 @@ float GridMap::getLiquidLevel(float x, float y) return m_liquid_map[cx_int*m_liquid_width + cy_int]; } -uint8 GridMap::getTerrainType(float x, float y) +uint8 GridMap::getTerrainType(float x, float y) { if (!m_liquid_type) return 0; @@ -1826,7 +1824,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const return true; } -const char* Map::GetMapName() const +char const* Map::GetMapName() const { return i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; } @@ -2623,20 +2621,17 @@ void BattlegroundMap::RemoveAllPlayers() player->TeleportTo(player->GetBattlegroundEntryPoint()); } -Creature* -Map::GetCreature(uint64 guid) +Creature* Map::GetCreature(uint64 guid) { return ObjectAccessor::GetObjectInMap(guid, this, (Creature*)NULL); } -GameObject* -Map::GetGameObject(uint64 guid) +GameObject* Map::GetGameObject(uint64 guid) { return ObjectAccessor::GetObjectInMap(guid, this, (GameObject*)NULL); } -DynamicObject* -Map::GetDynamicObject(uint64 guid) +DynamicObject* Map::GetDynamicObject(uint64 guid) { return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)NULL); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e42294f59a..72a7c79dc6 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -6432,14 +6432,15 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - if (m_caster->GetTypeId() != TYPEID_PLAYER) + Player* _player = m_caster->ToPlayer() + + if (!_player) return; - Player* _player = m_caster->ToPlayer(); + Pet* pet = _player->GetPet(); - if (!pet) - return; - if (pet->isAlive()) + if (!pet || pet->isAlive()) return; + if (damage < 0) return;