aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2011_12_10_00_world_spell_proc_event.sql2
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp6
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp7
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp28
-rwxr-xr-xsrc/server/game/Guilds/Guild.cpp1
-rwxr-xr-xsrc/server/game/Maps/Map.cpp31
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp15
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/CharacterHandler.cpp6
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/QueryHandler.cpp3
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp39
11 files changed, 71 insertions, 69 deletions
diff --git a/sql/updates/world/2011_12_10_00_world_spell_proc_event.sql b/sql/updates/world/2011_12_10_00_world_spell_proc_event.sql
new file mode 100644
index 00000000000..957a2e76b70
--- /dev/null
+++ b/sql/updates/world/2011_12_10_00_world_spell_proc_event.sql
@@ -0,0 +1,2 @@
+-- Bloodsurge
+UPDATE `spell_proc_event` SET `procEx` = 0x0040000 WHERE `entry` = 46915;
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 c845f6110d6..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());
}
}
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 978d9accb64..d4723cbec42 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 298f9c60af8..659ebef92af 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 59c107bd40f..94fcbbdda25 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 13a47633b53..f9b79b4f195 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/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
index 2f8a27740be..0deaa6b984d 100755
--- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
@@ -115,6 +115,8 @@ void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction)
//this void creates new auction and adds auction to some auctionhouse
void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recieved CMSG_AUCTION_SELL_ITEM");
+
uint64 auctioneer, item;
uint32 etime, bid, buyout, count;
recv_data >> auctioneer;
@@ -253,6 +255,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
//this function is called when client bids or buys out auction
void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recieved CMSG_AUCTION_PLACE_BID");
+
uint64 auctioneer;
uint32 auctionId;
uint32 price;
@@ -374,6 +378,8 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
//this void is called when auction_owner cancels his auction
void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recieved CMSG_AUCTION_REMOVE_ITEM");
+
uint64 auctioneer;
uint32 auctionId;
recv_data >> auctioneer;
@@ -452,6 +458,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
//called when player lists his bids
void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recieved CMSG_AUCTION_LIST_BIDDER_ITEMS");
+
uint64 guid; //NPC guid
uint32 listfrom; //page of auctions
uint32 outbiddedCount; //count of outbidded auctions
@@ -469,6 +477,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;
}
@@ -506,6 +515,8 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
//this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recieved CMSG_AUCTION_LIST_OWNER_ITEMS");
+
uint32 listfrom;
uint64 guid;
@@ -541,6 +552,8 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
//this void is called when player clicks on search button
void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
{
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recieved CMSG_AUCTION_LIST_ITEMS");
+
std::string searchedname;
uint8 levelmin, levelmax, usable;
uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality;
@@ -606,7 +619,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
void WorldSession::HandleAuctionListPendingSales(WorldPacket & recv_data)
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_LIST_PENDING_SALES");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recieved CMSG_AUCTION_LIST_PENDING_SALES");
recv_data.read_skip<uint64>();
diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
index 83b9ab048ad..aea6466924b 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<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);
}
diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp
index bf951619e63..042b1242a95 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
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index e42294f59ae..4eb514c5869 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2093,12 +2093,12 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- Player* _player = unitTarget->ToPlayer();
+ Player* player = unitTarget->ToPlayer();
uint32 spellToUnlearn = m_spellInfo->Effects[effIndex].TriggerSpell;
- _player->removeSpell(spellToUnlearn);
+ player->removeSpell(spellToUnlearn);
- sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has unlearned spell %u from NpcGUID: %u", _player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has unlearned spell %u from NpcGUID: %u", player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow());
}
void Spell::EffectPowerDrain(SpellEffIndex effIndex)
@@ -5875,16 +5875,15 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
return;
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ Player* player = m_caster->ToPlayer();
+ if (!player)
return;
- Player* _player = m_caster->ToPlayer();
-
Item* foodItem = itemTarget;
if (!foodItem)
return;
- Pet* pet = _player->GetPet();
+ Pet* pet = player->GetPet();
if (!pet)
return;
@@ -5898,7 +5897,7 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
ExecuteLogEffectDestroyItem(effIndex, foodItem->GetEntry());
uint32 count = 1;
- _player->DestroyItemCount(foodItem, count, true);
+ player->DestroyItemCount(foodItem, count, true);
// TODO: fix crash when a spell has two effects, both pointed at the same item target
m_caster->CastCustomSpell(pet, m_spellInfo->Effects[effIndex].TriggerSpell, &benefit, NULL, NULL, true);
@@ -6097,7 +6096,7 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- Player* _player = unitTarget->ToPlayer();
+ Player* player = unitTarget->ToPlayer();
int32 rep_change = damage;
@@ -6114,10 +6113,10 @@ void Spell::EffectReputation(SpellEffIndex effIndex)
}
// Bonus from spells that increase reputation gain
- float bonus = rep_change * _player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10%
+ float bonus = rep_change * player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN) / 100.0f; // 10%
rep_change += (int32)bonus;
- _player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
+ player->GetReputationMgr().ModifyReputation(factionEntry, rep_change);
}
void Spell::EffectQuestComplete(SpellEffIndex effIndex)
@@ -6432,20 +6431,20 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
return;
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
- Player* _player = m_caster->ToPlayer();
- Pet* pet = _player->GetPet();
- if (!pet)
+ Player* player = m_caster->ToPlayer();
+ if (!player)
return;
- if (pet->isAlive())
+
+ Pet* pet = player->GetPet();
+ if (!pet || pet->isAlive())
return;
+
if (damage < 0)
return;
float x, y, z;
- _player->GetPosition(x, y, z);
- _player->GetMap()->CreatureRelocation(pet, x, y, z, _player->GetOrientation());
+ player->GetPosition(x, y, z);
+ player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation());
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE);
pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
@@ -6454,7 +6453,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
//pet->AIM_Initialize();
- //_player->PetSpellInitialize();
+ //player->PetSpellInitialize();
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
}