diff options
21 files changed, 201 insertions, 105 deletions
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 00000000000..f6195d9d66e --- /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); diff --git a/sql/updates/world/2011_12_08_00_world_player_factionchange_achievement.sql b/sql/updates/world/2011_12_08_00_world_player_factionchange_achievement.sql new file mode 100644 index 00000000000..7a19fa2cad0 --- /dev/null +++ b/sql/updates/world/2011_12_08_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); 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 00000000000..e8a464146e0 --- /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'); diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index afa7e9c2932..fde660e483e 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 ffe21536de4..9755055cd6e 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()); } } @@ -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 b9d4949b75c..041d0f3f6da 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -863,7 +863,7 @@ struct SmartAction struct { uint32 gossipMenuId; - uint32 gossipOptionId; + uint32 gossipNpcTextId; } sendGossipMenu; struct diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index ce10a821ea4..c5db71784c2 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1600,7 +1600,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)) @@ -1633,9 +1633,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; @@ -1976,7 +1976,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 d1e9d812668..63ba5c5b843 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6062,6 +6062,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; } @@ -6490,6 +6500,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) @@ -15629,29 +15649,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/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 82532e6ae29..8b545548946 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 a3a5996a7d9..0eaf9c17a67 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -533,7 +533,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; } @@ -567,7 +567,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)); @@ -577,13 +577,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; } @@ -1573,9 +1573,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); } } @@ -1589,9 +1587,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); } } @@ -1882,9 +1878,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); } } @@ -1898,9 +1892,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 44e2588ef81..a9c0bf88769 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 56c6410e6d7..cc5e3f5158a 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); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 1d5395b8ad1..e422cf1e152 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 4b21f1c7d7d..34bc5f141f2 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 : "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/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 2f8a27740be..8c45b030603 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 7f9017605a0..cdcacb18aab 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -1184,15 +1184,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<uint8>(); // 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<uint8>(); // unknown, bool? _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK); } @@ -2009,4 +2011,4 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recv_data) data << uint8(128); // unk1 data << *GetRandomCharacterName(race, gender); SendPacket(&data); -}
\ No newline at end of file +} diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index 48caa4f36d5..f89ec5ab7ee 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -420,7 +420,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 diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 60e51a7c2ed..f7b49ebadd4 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4793,6 +4793,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 @@ -4940,6 +4944,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; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 55e71fe42d1..e6812eb8b27 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -6378,14 +6378,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; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 64f4e40c32b..891d8602cae 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1395,7 +1395,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() diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index a690f3cbd9b..ec7f9a8e070 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 { |