[11973] Various Cleanups

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
stfx 2012-04-22 19:41:24 +02:00 committed by Schmoozerd
parent c243c42c3c
commit f3f3349661
50 changed files with 153 additions and 134 deletions

View file

@ -313,7 +313,7 @@ void ArenaTeam::DelMember(ObjectGuid guid)
} }
} }
if(Player *player = sObjectMgr.GetPlayer(guid)) if (Player* player = sObjectMgr.GetPlayer(guid))
{ {
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0); player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team // delete all info regarding this team

View file

@ -160,7 +160,6 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction)
RemoveAItem(auction->itemGuidLow); // we have to remove the item, before we delete it !! RemoveAItem(auction->itemGuidLow); // we have to remove the item, before we delete it !!
auction->itemGuidLow = 0; // pending list will not use guid data auction->itemGuidLow = 0; // pending list will not use guid data
// will delete item or place to receiver mail list // will delete item or place to receiver mail list
MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str()) MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str())
.AddItem(pItem) .AddItem(pItem)
@ -908,11 +907,13 @@ AuctionEntry* AuctionHouseObject::AddAuction(AuctionHouseEntry const* auctionHou
sAuctionMgr.AddAItem(newItem); sAuctionMgr.AddAItem(newItem);
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
newItem->SaveToDB(); newItem->SaveToDB();
AH->SaveToDB(); AH->SaveToDB();
if (pl) if (pl)
pl->SaveInventoryAndGoldToDB(); pl->SaveInventoryAndGoldToDB();
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
return AH; return AH;
@ -1019,7 +1020,6 @@ bool AuctionEntry::UpdateBid(uint32 newbid, Player* newbidder /*=NULL*/)
if ((newbid < buyout) || (buyout == 0)) // bid if ((newbid < buyout) || (buyout == 0)) // bid
{ {
if (auction_owner) if (auction_owner)
auction_owner->GetSession()->SendAuctionOwnerNotification(this); auction_owner->GetSession()->SendAuctionOwnerNotification(this);

View file

@ -81,7 +81,6 @@ struct AuctionEntry
void SaveToDB() const; void SaveToDB() const;
void AuctionBidWinning(Player* bidder = NULL); void AuctionBidWinning(Player* bidder = NULL);
// -1,0,+1 order result // -1,0,+1 order result
int CompareAuctionEntry(uint32 column, const AuctionEntry *auc, Player* viewPlayer) const; int CompareAuctionEntry(uint32 column, const AuctionEntry *auc, Player* viewPlayer) const;

View file

@ -104,7 +104,6 @@ enum BattleGroundSpells
enum BattleGroundTimeIntervals enum BattleGroundTimeIntervals
{ {
RESURRECTION_INTERVAL = 30000, // ms RESURRECTION_INTERVAL = 30000, // ms
//REMIND_INTERVAL = 10000, // ms
INVITATION_REMIND_TIME = 20000, // ms INVITATION_REMIND_TIME = 20000, // ms
INVITE_ACCEPT_WAIT_TIME = 40000, // ms INVITE_ACCEPT_WAIT_TIME = 40000, // ms
TIME_TO_AUTOREMOVE = 120000, // ms TIME_TO_AUTOREMOVE = 120000, // ms

View file

@ -236,6 +236,7 @@ void BattleGroundAV::UpdateScore(BattleGroundTeamIndex teamIdx, int32 points )
void BattleGroundAV::Update(uint32 diff) void BattleGroundAV::Update(uint32 diff)
{ {
BattleGround::Update(diff); BattleGround::Update(diff);
if (GetStatus() != STATUS_IN_PROGRESS) if (GetStatus() != STATUS_IN_PROGRESS)
return; return;

View file

@ -39,7 +39,6 @@ BattleGroundBE::BattleGroundBE()
BattleGroundBE::~BattleGroundBE() BattleGroundBE::~BattleGroundBE()
{ {
} }
void BattleGroundBE::Update(uint32 diff) void BattleGroundBE::Update(uint32 diff)

View file

@ -515,6 +515,7 @@ void WorldSession::HandleBattlefieldStatusOpcode( WorldPacket & /*recv_data*/ )
BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i); BattleGroundQueueTypeId bgQueueTypeId = _player->GetBattleGroundQueueTypeId(i);
if (!bgQueueTypeId) if (!bgQueueTypeId)
continue; continue;
BattleGroundTypeId bgTypeId = BattleGroundMgr::BGTemplateId(bgQueueTypeId); BattleGroundTypeId bgTypeId = BattleGroundMgr::BGTemplateId(bgQueueTypeId);
ArenaType arenaType = BattleGroundMgr::BGArenaType(bgQueueTypeId); ArenaType arenaType = BattleGroundMgr::BGArenaType(bgQueueTypeId);
if (bgTypeId == _player->GetBattleGroundTypeId()) if (bgTypeId == _player->GetBattleGroundTypeId())

View file

@ -1581,7 +1581,7 @@ uint32 BattleGroundMgr::CreateBattleGround(BattleGroundTypeId bgTypeId, bool IsA
case BATTLEGROUND_RV: bg = new BattleGroundRV; break; case BATTLEGROUND_RV: bg = new BattleGroundRV; break;
case BATTLEGROUND_IC: bg = new BattleGroundIC; break; case BATTLEGROUND_IC: bg = new BattleGroundIC; break;
case BATTLEGROUND_RB: bg = new BattleGroundRB; break; case BATTLEGROUND_RB: bg = new BattleGroundRB; break;
default:bg = new BattleGround; break; // placeholder for non implemented BG default: bg = new BattleGround; break; // placeholder for non implemented BG
} }
bg->SetMapId(MapID); bg->SetMapId(MapID);

View file

@ -39,7 +39,6 @@ BattleGroundRL::BattleGroundRL()
BattleGroundRL::~BattleGroundRL() BattleGroundRL::~BattleGroundRL()
{ {
} }
void BattleGroundRL::Update(uint32 diff) void BattleGroundRL::Update(uint32 diff)

View file

@ -90,6 +90,7 @@ void WorldSession::HandleChannelSetOwnerOpcode(WorldPacket& recvPacket)
{ {
DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); DEBUG_LOG("Opcode %u", recvPacket.GetOpcode());
//recvPacket.hexlike(); //recvPacket.hexlike();
std::string channelname, newp; std::string channelname, newp;
recvPacket >> channelname; recvPacket >> channelname;

View file

@ -259,8 +259,9 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
WorldPacket data; WorldPacket data;
ChatHandler::FillMessageData(&data, this, type, lang, msg.c_str()); ChatHandler::FillMessageData(&data, this, type, lang, msg.c_str());
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetObjectGuid())); group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetObjectGuid()));
} break;
break;
}
case CHAT_MSG_GUILD: case CHAT_MSG_GUILD:
{ {
std::string msg; std::string msg;
@ -281,8 +282,9 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if (GetPlayer()->GetGuildId()) if (GetPlayer()->GetGuildId())
if (Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId())) if (Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId()))
guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
} break;
break;
}
case CHAT_MSG_OFFICER: case CHAT_MSG_OFFICER:
{ {
std::string msg; std::string msg;
@ -303,8 +305,9 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if (GetPlayer()->GetGuildId()) if (GetPlayer()->GetGuildId())
if (Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId())) if (Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId()))
guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); guild->BroadcastToOfficers(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
} break;
break;
}
case CHAT_MSG_RAID: case CHAT_MSG_RAID:
{ {
std::string msg; std::string msg;

View file

@ -132,7 +132,7 @@ void GameEventMgr::LoadFromDB()
uint16 event_id = fields[0].GetUInt16(); uint16 event_id = fields[0].GetUInt16();
if (event_id == 0) if (event_id == 0)
{ {
sLog.outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id); sLog.outErrorDb("`game_event` game event id (%i) is reserved and can't be used.", event_id);
continue; continue;
} }
@ -145,7 +145,6 @@ void GameEventMgr::LoadFromDB()
pGameEvent.length = fields[4].GetUInt32(); pGameEvent.length = fields[4].GetUInt32();
pGameEvent.holiday_id = HolidayIds(fields[5].GetUInt32()); pGameEvent.holiday_id = HolidayIds(fields[5].GetUInt32());
if (pGameEvent.length == 0) // length>0 is validity check if (pGameEvent.length == 0) // length>0 is validity check
{ {
sLog.outErrorDb("`game_event` game event id (%i) have length 0 and can't be used.", event_id); sLog.outErrorDb("`game_event` game event id (%i) have length 0 and can't be used.", event_id);
@ -173,7 +172,7 @@ void GameEventMgr::LoadFromDB()
delete result; delete result;
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %u game events", count ); sLog.outString(">> Loaded %u game events", count);
} }
std::map<uint16,int16> pool2event; // for check unique spawn event associated with pool std::map<uint16,int16> pool2event; // for check unique spawn event associated with pool

View file

@ -1169,7 +1169,6 @@ void GameObject::Use(Unit* user)
} }
player->RewardPlayerAndGroupAtCast(this); player->RewardPlayerAndGroupAtCast(this);
} }
if (scriptReturnValue) if (scriptReturnValue)

View file

@ -146,6 +146,7 @@ bool Group::Create(ObjectGuid guid, const char * name)
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM groups WHERE groupId ='%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM groups WHERE groupId ='%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM group_member WHERE groupId ='%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM group_member WHERE groupId ='%u'", m_Id);
CharacterDatabase.PExecute("INSERT INTO groups (groupId,leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,groupType,difficulty,raiddifficulty) " CharacterDatabase.PExecute("INSERT INTO groups (groupId,leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,groupType,difficulty,raiddifficulty) "
"VALUES ('%u','%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')", "VALUES ('%u','%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')",
m_Id, m_leaderGuid.GetCounter(), m_mainTankGuid.GetCounter(), m_mainAssistantGuid.GetCounter(), uint32(m_lootMethod), m_Id, m_leaderGuid.GetCounter(), m_mainTankGuid.GetCounter(), m_mainAssistantGuid.GetCounter(), uint32(m_lootMethod),

View file

@ -602,7 +602,7 @@ struct ItemPrototype
uint32 GemProperties; // id from GemProperties.dbc uint32 GemProperties; // id from GemProperties.dbc
int32 RequiredDisenchantSkill; int32 RequiredDisenchantSkill;
float ArmorDamageModifier; float ArmorDamageModifier;
uint32 Duration; // negative = realtime, positive = ingame time uint32 Duration;
uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc
uint32 HolidayId; // id from Holidays.dbc uint32 HolidayId; // id from Holidays.dbc
uint32 ScriptId; uint32 ScriptId;

View file

@ -788,9 +788,7 @@ enum MangosStrings
LANG_BG_AV_H_NEAR_LOSE = 788, LANG_BG_AV_H_NEAR_LOSE = 788,
LANG_BG_AV_H_GENERAL_DEAD = 789, LANG_BG_AV_H_GENERAL_DEAD = 789,
LANG_BG_AV_A_GENERAL_DEAD = 790, LANG_BG_AV_A_GENERAL_DEAD = 790,
// Room for battleground/arena strings 791-799 not used
// Room for batleground/arena strings 791-799 not used
// in game strings // in game strings
// = 800, not used // = 800, not used

View file

@ -245,8 +245,6 @@ bool ChatHandler::HandleGMVisibleCommand(char* args)
return true; return true;
} }
bool ChatHandler::HandleGPSCommand(char* args) bool ChatHandler::HandleGPSCommand(char* args)
{ {
WorldObject *obj = NULL; WorldObject *obj = NULL;

View file

@ -2221,10 +2221,11 @@ bool ChatHandler::HandleNpcUnFollowCommand(char* /*args*/)
bool ChatHandler::HandleNpcTameCommand(char* /*args*/) bool ChatHandler::HandleNpcTameCommand(char* /*args*/)
{ {
Creature *creatureTarget = getSelectedCreature (); Creature *creatureTarget = getSelectedCreature ();
if (!creatureTarget || creatureTarget->IsPet ())
if (!creatureTarget || creatureTarget->IsPet())
{ {
PSendSysMessage (LANG_SELECT_CREATURE); PSendSysMessage(LANG_SELECT_CREATURE);
SetSentErrorMessage (true); SetSentErrorMessage(true);
return false; return false;
} }

View file

@ -4365,7 +4365,7 @@ bool ChatHandler::HandleExploreCheatCommand(char* args)
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING,GetNameLink().c_str()); ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING,GetNameLink().c_str());
} }
for (uint8 i=0; i<PLAYER_EXPLORED_ZONES_SIZE; ++i) for (uint8 i=0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
{ {
if (flag != 0) if (flag != 0)
{ {
@ -4515,7 +4515,7 @@ bool ChatHandler::HandleShowAreaCommand(char* args)
int offset = area / 32; int offset = area / 32;
uint32 val = (uint32)(1 << (area % 32)); uint32 val = (uint32)(1 << (area % 32));
if(area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE) if (area < 0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
{ {
SendSysMessage(LANG_BAD_VALUE); SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true); SetSentErrorMessage(true);
@ -5076,6 +5076,7 @@ bool ChatHandler::HandleResetSpecsCommand(char* args)
{ {
target->resetTalents(true,true); target->resetTalents(true,true);
target->SendTalentsInfoData(false); target->SendTalentsInfoData(false);
ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS);
if (!m_session || m_session->GetPlayer() != target) if (!m_session || m_session->GetPlayer() != target)
PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(target).c_str()); PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(target).c_str());
@ -6119,6 +6120,7 @@ bool ChatHandler::HandleMovegensCommand(char* /*args*/)
case RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_RANDOM); break; case RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_RANDOM); break;
case WAYPOINT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_WAYPOINT); break; case WAYPOINT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_WAYPOINT); break;
case CONFUSED_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_CONFUSED); break; case CONFUSED_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_CONFUSED); break;
case CHASE_MOTION_TYPE: case CHASE_MOTION_TYPE:
{ {
Unit* target = NULL; Unit* target = NULL;
@ -6510,7 +6512,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(char* args)
++itr; ++itr;
continue; continue;
} }
if(itr->first != player->GetMapId()) if (itr->first != player->GetMapId())
{ {
DungeonPersistentState *save = itr->second.state; DungeonPersistentState *save = itr->second.state;
std::string timeleft = secsToTimeString(save->GetResetTime() - time(NULL), true); std::string timeleft = secsToTimeString(save->GetResetTime() - time(NULL), true);
@ -6531,6 +6533,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(char* args)
} }
} }
PSendSysMessage("instances unbound: %d", counter); PSendSysMessage("instances unbound: %d", counter);
return true; return true;
} }

View file

@ -556,6 +556,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data )
else else
pl->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_EQUIP_ERROR, msg); pl->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_EQUIP_ERROR, msg);
} }
/** /**
* Handles the packet sent by the client when taking money from the mail. * Handles the packet sent by the client when taking money from the mail.
*/ */

View file

@ -319,7 +319,6 @@ class DungeonResetScheduler
private: // fields private: // fields
MapPersistentStateManager& m_InstanceSaves; MapPersistentStateManager& m_InstanceSaves;
// fast lookup for reset times (always use existing functions for access/set) // fast lookup for reset times (always use existing functions for access/set)
typedef UNORDERED_MAP<uint32 /*PAIR32(map,difficulty)*/,time_t /*resetTime*/> ResetTimeByMapDifficultyMap; typedef UNORDERED_MAP<uint32 /*PAIR32(map,difficulty)*/,time_t /*resetTime*/> ResetTimeByMapDifficultyMap;
ResetTimeByMapDifficultyMap m_resetTimeByMapDifficulty; ResetTimeByMapDifficultyMap m_resetTimeByMapDifficulty;

View file

@ -296,6 +296,7 @@ void WorldSession::HandleForceSpeedChangeAckOpcodes(WorldPacket &recv_data)
{ {
uint32 opcode = recv_data.GetOpcode(); uint32 opcode = recv_data.GetOpcode();
DEBUG_LOG("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); DEBUG_LOG("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode);
/* extract packet */ /* extract packet */
ObjectGuid guid; ObjectGuid guid;
MovementInfo movementInfo; MovementInfo movementInfo;

View file

@ -122,6 +122,7 @@ void WorldSession::SendTrainerList(ObjectGuid guid)
static void SendTrainerSpellHelper(WorldPacket& data, TrainerSpell const* tSpell, TrainerSpellState state, float fDiscountMod, bool can_learn_primary_prof, uint32 reqLevel) static void SendTrainerSpellHelper(WorldPacket& data, TrainerSpell const* tSpell, TrainerSpellState state, float fDiscountMod, bool can_learn_primary_prof, uint32 reqLevel)
{ {
bool primary_prof_first_rank = sSpellMgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell); bool primary_prof_first_rank = sSpellMgr.IsPrimaryProfessionFirstRankSpell(tSpell->learnedSpell);
SpellChainNode const* chain_node = sSpellMgr.GetSpellChainNode(tSpell->learnedSpell); SpellChainNode const* chain_node = sSpellMgr.GetSpellChainNode(tSpell->learnedSpell);
data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case) data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case)

View file

@ -959,7 +959,7 @@ void WorldObject::Relocate(float x, float y, float z, float orientation)
m_position.z = z; m_position.z = z;
m_position.o = orientation; m_position.o = orientation;
if(isType(TYPEMASK_UNIT)) if (isType(TYPEMASK_UNIT))
((Unit*)this)->m_movementInfo.ChangePosition(x, y, z, orientation); ((Unit*)this)->m_movementInfo.ChangePosition(x, y, z, orientation);
} }
@ -969,7 +969,7 @@ void WorldObject::Relocate(float x, float y, float z)
m_position.y = y; m_position.y = y;
m_position.z = z; m_position.z = z;
if(isType(TYPEMASK_UNIT)) if (isType(TYPEMASK_UNIT))
((Unit*)this)->m_movementInfo.ChangePosition(x, y, z, GetOrientation()); ((Unit*)this)->m_movementInfo.ChangePosition(x, y, z, GetOrientation());
} }
@ -977,7 +977,7 @@ void WorldObject::SetOrientation(float orientation)
{ {
m_position.o = orientation; m_position.o = orientation;
if(isType(TYPEMASK_UNIT)) if (isType(TYPEMASK_UNIT))
((Unit*)this)->m_movementInfo.ChangeOrientation(orientation); ((Unit*)this)->m_movementInfo.ChangeOrientation(orientation);
} }

View file

@ -207,7 +207,7 @@ ObjectAccessor::ConvertCorpseForPlayer(ObjectGuid player_guid, bool insignia)
// remove resurrectable corpse from grid object registry (loaded state checked into call) // remove resurrectable corpse from grid object registry (loaded state checked into call)
// do not load the map if it's not loaded // do not load the map if it's not loaded
Map *map = sMapMgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId()); Map *map = sMapMgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId());
if(map) if (map)
map->Remove(corpse, false); map->Remove(corpse, false);
// remove corpse from DB // remove corpse from DB

View file

@ -441,7 +441,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
delete result; delete result;
sLog.outString(); sLog.outString();
sLog.outString( ">> Loaded %lu points_of_interest locale strings", (unsigned long)mPointOfInterestLocaleMap.size() ); sLog.outString(">> Loaded " SIZEFMTD " points_of_interest locale strings", mPointOfInterestLocaleMap.size());
} }
struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader> struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
@ -853,7 +853,6 @@ void ObjectMgr::LoadEquipmentTemplates()
continue; continue;
ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]); ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
if (!dbcitem) if (!dbcitem)
{ {
sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i); sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i);
@ -877,6 +876,7 @@ void ObjectMgr::LoadEquipmentTemplates()
} }
} }
} }
sLog.outString( ">> Loaded %u equipment template", sEquipmentStorage.RecordCount ); sLog.outString( ">> Loaded %u equipment template", sEquipmentStorage.RecordCount );
sLog.outString(); sLog.outString();
} }
@ -5667,14 +5667,14 @@ void ObjectMgr::PackGroupIds()
void ObjectMgr::SetHighestGuids() void ObjectMgr::SetHighestGuids()
{ {
QueryResult *result = CharacterDatabase.Query( "SELECT MAX(guid) FROM characters" ); QueryResult *result = CharacterDatabase.Query("SELECT MAX(guid) FROM characters");
if( result ) if( result )
{ {
m_CharGuids.Set((*result)[0].GetUInt32()+1); m_CharGuids.Set((*result)[0].GetUInt32()+1);
delete result; delete result;
} }
result = WorldDatabase.Query( "SELECT MAX(guid) FROM creature" ); result = WorldDatabase.Query("SELECT MAX(guid) FROM creature");
if( result ) if( result )
{ {
m_FirstTemporaryCreatureGuid = (*result)[0].GetUInt32()+1; m_FirstTemporaryCreatureGuid = (*result)[0].GetUInt32()+1;

View file

@ -25,7 +25,7 @@
/// Correspondence between opcodes and their names /// Correspondence between opcodes and their names
OpcodeHandler opcodeTable[NUM_MSG_TYPES] = OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
{ /*thread-safe*/ {
/*0x000*/ { "MSG_NULL_ACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x000*/ { "MSG_NULL_ACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x001*/ { "CMSG_BOOTME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x001*/ { "CMSG_BOOTME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
/*0x002*/ { "CMSG_DBLOOKUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x002*/ { "CMSG_DBLOOKUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },

View file

@ -440,7 +440,6 @@ void Pet::SavePetToDB(PetSaveMode mode)
savePet.Execute(); savePet.Execute();
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
} }
// delete
else else
{ {
RemoveAllAuras(AURA_REMOVE_BY_DELETE); RemoveAllAuras(AURA_REMOVE_BY_DELETE);
@ -1692,7 +1691,6 @@ bool Pet::removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
return true; return true;
} }
void Pet::CleanupActionBar() void Pet::CleanupActionBar()
{ {
for(int i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i) for(int i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)

View file

@ -460,6 +460,7 @@ Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this), m
m_MirrorTimerFlags = UNDERWATER_NONE; m_MirrorTimerFlags = UNDERWATER_NONE;
m_MirrorTimerFlagsLast = UNDERWATER_NONE; m_MirrorTimerFlagsLast = UNDERWATER_NONE;
m_isInWater = false; m_isInWater = false;
m_drunkTimer = 0; m_drunkTimer = 0;
m_drunk = 0; m_drunk = 0;
@ -1011,7 +1012,7 @@ void Player::HandleDrowning(uint32 time_diff)
m_MirrorTimer[BREATH_TIMER] = getMaxTimer(BREATH_TIMER); m_MirrorTimer[BREATH_TIMER] = getMaxTimer(BREATH_TIMER);
SendMirrorTimer(BREATH_TIMER, m_MirrorTimer[BREATH_TIMER], m_MirrorTimer[BREATH_TIMER], -1); SendMirrorTimer(BREATH_TIMER, m_MirrorTimer[BREATH_TIMER], m_MirrorTimer[BREATH_TIMER], -1);
} }
else // If activated - do tick else
{ {
m_MirrorTimer[BREATH_TIMER]-=time_diff; m_MirrorTimer[BREATH_TIMER]-=time_diff;
// Timer limit - need deal damage // Timer limit - need deal damage
@ -9767,7 +9768,7 @@ InventoryResult Player::_CanStoreItem_InBag( uint8 bag, ItemPosCountVec &dest, I
if (res != EQUIP_ERR_OK) if (res != EQUIP_ERR_OK)
continue; continue;
// descrease at current stacksize // decrease at current stacksize
need_space -= pItem2->GetCount(); need_space -= pItem2->GetCount();
} }
@ -11102,6 +11103,7 @@ Item* Player::StoreItem( ItemPosCountVec const& dest, Item* pItem, bool update )
Item* lastItem = pItem; Item* lastItem = pItem;
uint32 entry = pItem->GetEntry(); uint32 entry = pItem->GetEntry();
for(ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ) for(ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); )
{ {
uint16 pos = itr->pos; uint16 pos = itr->pos;
@ -11117,6 +11119,7 @@ Item* Player::StoreItem( ItemPosCountVec const& dest, Item* pItem, bool update )
lastItem = _StoreItem(pos,pItem,count,true,update); lastItem = _StoreItem(pos,pItem,count,true,update);
} }
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, entry); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, entry);
return lastItem; return lastItem;
} }
@ -12599,6 +12602,7 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(enchant_amount), apply); HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(enchant_amount), apply);
break; break;
case ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL: case ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL:
{
if (enchant_spell_id) if (enchant_spell_id)
{ {
if (apply) if (apply)
@ -12631,6 +12635,7 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
RemoveAurasDueToItemSpell(item, enchant_spell_id); RemoveAurasDueToItemSpell(item, enchant_spell_id);
} }
break; break;
}
case ITEM_ENCHANTMENT_TYPE_RESISTANCE: case ITEM_ENCHANTMENT_TYPE_RESISTANCE:
if (!enchant_amount) if (!enchant_amount)
{ {
@ -13248,6 +13253,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me
PlayerTalkClass->CloseGossip(); PlayerTalkClass->CloseGossip();
TalkedToCreature(pSource->GetEntry(), pSource->GetObjectGuid()); TalkedToCreature(pSource->GetEntry(), pSource->GetObjectGuid());
} }
break; break;
} }
case GOSSIP_OPTION_SPIRITHEALER: case GOSSIP_OPTION_SPIRITHEALER:
@ -14831,6 +14837,7 @@ void Player::KilledMonsterCredit( uint32 entry, ObjectGuid guid )
{ {
uint32 addkillcount = 1; uint32 addkillcount = 1;
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount);
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i ) for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{ {
uint32 questid = GetQuestSlotQuestId(i); uint32 questid = GetQuestSlotQuestId(i);
@ -19490,7 +19497,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellEntry const* spellInfo, uint32 it
{ {
if (ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemId)) if (ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemId))
{ {
for(int idx = 0; idx < 5; ++idx) for(int idx = 0; idx < MAX_ITEM_PROTO_SPELLS; ++idx)
{ {
if (proto->Spells[idx].SpellId == spellInfo->Id) if (proto->Spells[idx].SpellId == spellInfo->Id)
{ {

View file

@ -702,6 +702,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
break; break;
} }
case DTT_EQSET_TABLE: case DTT_EQSET_TABLE:
{
if (!changenth(line, 1, newguid)) // character_equipmentsets.guid update if (!changenth(line, 1, newguid)) // character_equipmentsets.guid update
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
if (!changeGuid(line, 2, eqsets, sObjectMgr.m_EquipmentSetIds.GetNextAfterMaxUsed())) if (!changeGuid(line, 2, eqsets, sObjectMgr.m_EquipmentSetIds.GetNextAfterMaxUsed()))
@ -710,7 +711,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
if(!changeGuid(line, 6+i, items, sObjectMgr.m_ItemGuids.GetNextAfterMaxUsed())) if(!changeGuid(line, 6+i, items, sObjectMgr.m_ItemGuids.GetNextAfterMaxUsed()))
ROLLBACK(DUMP_FILE_BROKEN); ROLLBACK(DUMP_FILE_BROKEN);
break; break;
}
default: default:
sLog.outError("Unknown dump table type: %u",type); sLog.outError("Unknown dump table type: %u",type);
break; break;

View file

@ -657,7 +657,7 @@ void Spell::FillTargetMap()
} }
break; break;
} }
} // End new target combination fill }
if (m_caster->GetTypeId() == TYPEID_PLAYER) if (m_caster->GetTypeId() == TYPEID_PLAYER)
{ {
@ -834,7 +834,7 @@ void Spell::AddUnitTarget(Unit* pVictim, SpellEffectIndex effIndex)
if (targetGUID == ihit->targetGUID) // Found in list if (targetGUID == ihit->targetGUID) // Found in list
{ {
if (!immuned) if (!immuned)
ihit->effectMask |= (1 << effIndex); // Add only effect mask if not immuned ihit->effectMask |= 1 << effIndex; // Add only effect mask if not immuned
return; return;
} }
} }
@ -1997,6 +1997,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
MaNGOS::UnitListSearcher<MaNGOS::AnyAoEVisibleTargetUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check); MaNGOS::UnitListSearcher<MaNGOS::AnyAoEVisibleTargetUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
Cell::VisitAllObjects(m_caster, searcher, max_range); Cell::VisitAllObjects(m_caster, searcher, max_range);
} }
if (tempTargetUnitMap.empty()) if (tempTargetUnitMap.empty())
break; break;
@ -2012,18 +2013,21 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
while (t && next != tempTargetUnitMap.end()) while (t && next != tempTargetUnitMap.end())
{ {
if (!prev->IsWithinDist (*next,CHAIN_SPELL_JUMP_RADIUS)) if (!prev->IsWithinDist(*next,CHAIN_SPELL_JUMP_RADIUS))
break; break;
if (!prev->IsWithinLOSInMap (*next))
if (!prev->IsWithinLOSInMap(*next))
{ {
++next; ++next;
continue; continue;
} }
prev = *next; prev = *next;
targetUnitMap.push_back(prev); targetUnitMap.push_back(prev);
tempTargetUnitMap.erase(next); tempTargetUnitMap.erase(next);
tempTargetUnitMap.sort(TargetDistanceOrderNear(prev)); tempTargetUnitMap.sort(TargetDistanceOrderNear(prev));
next = tempTargetUnitMap.begin(); next = tempTargetUnitMap.begin();
--t; --t;
} }
} }
@ -2906,7 +2910,6 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
targetUnitMap.push_back(owner); targetUnitMap.push_back(owner);
} }
break; break;
default: default:
break; break;
} }
@ -4066,7 +4069,7 @@ void Spell::WriteAmmoToPacket(WorldPacket* data)
break; break;
} }
if(ammoDisplayID) if (ammoDisplayID)
break; break;
} }
} }
@ -4549,7 +4552,7 @@ void Spell::TakeReagents()
return; return;
Player* p_caster = (Player*)m_caster; Player* p_caster = (Player*)m_caster;
if (p_caster->CanNoReagentCast(m_spellInfo) ) if (p_caster->CanNoReagentCast(m_spellInfo))
return; return;
for(uint32 x = 0; x < MAX_SPELL_REAGENTS; ++x) for(uint32 x = 0; x < MAX_SPELL_REAGENTS; ++x)
@ -6296,6 +6299,7 @@ SpellCastResult Spell::CheckPower()
return SPELL_FAILED_CASTER_AURASTATE; return SPELL_FAILED_CASTER_AURASTATE;
return SPELL_CAST_OK; return SPELL_CAST_OK;
} }
// Check valid power type // Check valid power type
if (m_spellInfo->powerType >= MAX_POWERS) if (m_spellInfo->powerType >= MAX_POWERS)
{ {

View file

@ -343,7 +343,6 @@ class Spell
void EffectKillCreditGroup(SpellEffectIndex eff_idx); void EffectKillCreditGroup(SpellEffectIndex eff_idx);
void EffectQuestFail(SpellEffectIndex eff_idx); void EffectQuestFail(SpellEffectIndex eff_idx);
void EffectActivateRune(SpellEffectIndex eff_idx); void EffectActivateRune(SpellEffectIndex eff_idx);
void EffectTeachTaxiNode(SpellEffectIndex eff_idx); void EffectTeachTaxiNode(SpellEffectIndex eff_idx);
void EffectTitanGrip(SpellEffectIndex eff_idx); void EffectTitanGrip(SpellEffectIndex eff_idx);
void EffectEnchantItemPrismatic(SpellEffectIndex eff_idx); void EffectEnchantItemPrismatic(SpellEffectIndex eff_idx);

View file

@ -1047,6 +1047,7 @@ void Aura::HandleAddModifier(bool apply, bool Real)
entry->EffectSpellClassMask[GetEffIndex()].Flags = UI64LIT(0x0000000000200000); entry->EffectSpellClassMask[GetEffIndex()].Flags = UI64LIT(0x0000000000200000);
} }
} }
((Player*)GetTarget())->AddSpellMod(this, apply); ((Player*)GetTarget())->AddSpellMod(this, apply);
ReapplyAffectedPassiveAuras(); ReapplyAffectedPassiveAuras();
@ -3067,6 +3068,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
break; break;
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
{
switch(GetId()) switch(GetId())
{ {
case 34477: // Misdirection, main spell case 34477: // Misdirection, main spell
@ -3083,6 +3085,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
} }
break; break;
}
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
switch(GetId()) switch(GetId())
{ {
@ -4935,7 +4938,7 @@ void Aura::HandleAuraModDecreaseSpeed(bool apply, bool Real)
if(!Real) if(!Real)
return; return;
Unit *target = GetTarget(); Unit* target = GetTarget();
if (apply) if (apply)
{ {
@ -5437,10 +5440,10 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
// Rip // Rip
if (spellProto->SpellFamilyFlags & UI64LIT(0x000000000000800000)) if (spellProto->SpellFamilyFlags & UI64LIT(0x000000000000800000))
{ {
// 0.01*$AP*cp
if (caster->GetTypeId() != TYPEID_PLAYER) if (caster->GetTypeId() != TYPEID_PLAYER)
break; break;
// 0.01*$AP*cp
uint8 cp = ((Player*)caster)->GetComboPoints(); uint8 cp = ((Player*)caster)->GetComboPoints();
// Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs // Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs
@ -8865,7 +8868,8 @@ void SpellAuraHolder::_RemoveSpellAuraHolder()
break; break;
} }
} }
// this was last holder
// this has been last aura
if(!found) if(!found)
m_target->ModifyAuraState(AuraState(removeState), false); m_target->ModifyAuraState(AuraState(removeState), false);
} }

View file

@ -243,7 +243,6 @@ class MANGOS_DLL_SPEC Aura
void HandleAuraFeatherFall(bool Apply, bool Real); void HandleAuraFeatherFall(bool Apply, bool Real);
void HandleAuraHover(bool Apply, bool Real); void HandleAuraHover(bool Apply, bool Real);
void HandleAddModifier(bool Apply, bool Real); void HandleAddModifier(bool Apply, bool Real);
void HandleAuraModStun(bool Apply, bool Real); void HandleAuraModStun(bool Apply, bool Real);
void HandleModDamageDone(bool Apply, bool Real); void HandleModDamageDone(bool Apply, bool Real);
void HandleAuraUntrackable(bool Apply, bool Real); void HandleAuraUntrackable(bool Apply, bool Real);

View file

@ -590,6 +590,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
// Lookup for Deadly poison (only attacker applied) // Lookup for Deadly poison (only attacker applied)
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
{
if ((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE && if ((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x10000)) && ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x10000)) &&
(*itr)->GetCasterGuid() == m_caster->GetObjectGuid()) (*itr)->GetCasterGuid() == m_caster->GetObjectGuid())
@ -597,6 +598,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx)
poison = *itr; poison = *itr;
break; break;
} }
}
// count consumed deadly poison doses at target // count consumed deadly poison doses at target
if (poison) if (poison)
{ {
@ -2699,7 +2701,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
{ {
if (!unitTarget) if (!unitTarget)
return; return;
m_caster->CastSpell(unitTarget, 21887, true);// spell mod m_caster->CastSpell(unitTarget, 21887, true); // spell mod
return; return;
} }
// Last Stand // Last Stand
@ -3175,6 +3177,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
{ {
if (!unitTarget || unitTarget->getPowerType() != POWER_MANA) if (!unitTarget || unitTarget->getPowerType() != POWER_MANA)
return; return;
// Glyph of Mana Tide // Glyph of Mana Tide
if (Unit *owner = m_caster->GetOwner()) if (Unit *owner = m_caster->GetOwner())
if (Aura *dummy = owner->GetDummyAura(55441)) if (Aura *dummy = owner->GetDummyAura(55441))
@ -4204,10 +4207,10 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype)
ItemPosCountVec dest; ItemPosCountVec dest;
uint32 no_space = 0; uint32 no_space = 0;
InventoryResult msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, newitemid, num_to_add, &no_space ); InventoryResult msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, newitemid, num_to_add, &no_space );
if( msg != EQUIP_ERR_OK ) if (msg != EQUIP_ERR_OK)
{ {
// convert to possible store amount // convert to possible store amount
if( msg == EQUIP_ERR_INVENTORY_FULL || msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS ) if (msg == EQUIP_ERR_INVENTORY_FULL || msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
num_to_add -= no_space; num_to_add -= no_space;
else else
{ {
@ -4234,7 +4237,7 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype)
} }
// set the "Crafted by ..." property of the item // set the "Crafted by ..." property of the item
if( pItem->GetProto()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetProto()->Class != ITEM_CLASS_QUEST) if (pItem->GetProto()->Class != ITEM_CLASS_CONSUMABLE && pItem->GetProto()->Class != ITEM_CLASS_QUEST)
pItem->SetGuidValue(ITEM_FIELD_CREATOR, player->GetObjectGuid()); pItem->SetGuidValue(ITEM_FIELD_CREATOR, player->GetObjectGuid());
// send info to the client // send info to the client
@ -6544,7 +6547,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
// check presence // check presence
for(int j = 0; j < 4; ++j) for(int j = 0; j < 4; ++j)
if(unitTarget->HasAura(spells[j], EFFECT_INDEX_0)) if (unitTarget->HasAura(spells[j], EFFECT_INDEX_0))
return; return;
// cast // cast
@ -7946,6 +7949,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
return; return;
} }
break;
} }
case SPELLFAMILY_POTION: case SPELLFAMILY_POTION:
{ {
@ -8593,10 +8597,10 @@ void Spell::EffectLeapForward(SpellEffectIndex eff_idx)
void Spell::EffectLeapBack(SpellEffectIndex eff_idx) void Spell::EffectLeapBack(SpellEffectIndex eff_idx)
{ {
if(unitTarget->IsTaxiFlying()) if (unitTarget->IsTaxiFlying())
return; return;
m_caster->KnockBackFrom(unitTarget,float(m_spellInfo->EffectMiscValue[eff_idx])/10,float(damage)/10); m_caster->KnockBackFrom(unitTarget, float(m_spellInfo->EffectMiscValue[eff_idx])/10, float(damage)/10);
} }
void Spell::EffectReputation(SpellEffectIndex eff_idx) void Spell::EffectReputation(SpellEffectIndex eff_idx)
@ -8827,10 +8831,10 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
void Spell::EffectKnockBack(SpellEffectIndex eff_idx) void Spell::EffectKnockBack(SpellEffectIndex eff_idx)
{ {
if(!unitTarget) if (!unitTarget)
return; return;
unitTarget->KnockBackFrom(m_caster,float(m_spellInfo->EffectMiscValue[eff_idx])/10,float(damage)/10); unitTarget->KnockBackFrom(m_caster, float(m_spellInfo->EffectMiscValue[eff_idx])/10, float(damage)/10);
} }
void Spell::EffectSendTaxi(SpellEffectIndex eff_idx) void Spell::EffectSendTaxi(SpellEffectIndex eff_idx)
@ -8843,14 +8847,14 @@ void Spell::EffectSendTaxi(SpellEffectIndex eff_idx)
void Spell::EffectPlayerPull(SpellEffectIndex eff_idx) void Spell::EffectPlayerPull(SpellEffectIndex eff_idx)
{ {
if(!unitTarget) if (!unitTarget)
return; return;
float dist = unitTarget->GetDistance2d(m_caster); float dist = unitTarget->GetDistance2d(m_caster);
if (damage && dist > damage) if (damage && dist > damage)
dist = float(damage); dist = float(damage);
unitTarget->KnockBackFrom(m_caster,-dist,float(m_spellInfo->EffectMiscValue[eff_idx])/10); unitTarget->KnockBackFrom(m_caster, -dist, float(m_spellInfo->EffectMiscValue[eff_idx])/10);
} }
void Spell::EffectDispelMechanic(SpellEffectIndex eff_idx) void Spell::EffectDispelMechanic(SpellEffectIndex eff_idx)

View file

@ -285,7 +285,6 @@ void WorldSession::HandleGameObjectUseOpcode( WorldPacket & recv_data )
return; return;
GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid); GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid);
if(!obj) if(!obj)
return; return;

View file

@ -1309,7 +1309,7 @@ void SpellMgr::LoadSpellProcEvents()
spe.schoolMask = fields[1].GetUInt32(); spe.schoolMask = fields[1].GetUInt32();
spe.spellFamilyName = fields[2].GetUInt32(); spe.spellFamilyName = fields[2].GetUInt32();
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{ {
spe.spellFamilyMask[i] = ClassFamilyMask( spe.spellFamilyMask[i] = ClassFamilyMask(
(uint64)fields[i+3].GetUInt32() | ((uint64)fields[i+6].GetUInt32()<<32), (uint64)fields[i+3].GetUInt32() | ((uint64)fields[i+6].GetUInt32()<<32),
@ -1594,7 +1594,7 @@ void SpellMgr::LoadSpellBonuses()
// also add to high ranks // also add to high ranks
DoSpellBonuses worker(mSpellBonusMap, sbe); DoSpellBonuses worker(mSpellBonusMap, sbe);
doForHighRanks(entry,worker); doForHighRanks(entry, worker);
++count; ++count;
@ -1920,7 +1920,6 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if (spellInfo_1->SpellIconID == 3176 && spellInfo_2->SpellIconID == 3176) if (spellInfo_1->SpellIconID == 3176 && spellInfo_2->SpellIconID == 3176)
return false; return false;
// Brood Affliction: Bronze // Brood Affliction: Bronze
if ((spellInfo_1->Id == 23170 && spellInfo_2->Id == 23171) || if ((spellInfo_1->Id == 23170 && spellInfo_2->Id == 23171) ||
(spellInfo_2->Id == 23170 && spellInfo_1->Id == 23171)) (spellInfo_2->Id == 23170 && spellInfo_1->Id == 23171))
@ -2175,6 +2174,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000))) || if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000))) ||
((spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000)))) ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000))))
return false; return false;
// Dispersion // Dispersion
if ((spellInfo_1->Id == 47585 && spellInfo_2->Id == 60069) || if ((spellInfo_1->Id == 47585 && spellInfo_2->Id == 60069) ||
(spellInfo_2->Id == 47585 && spellInfo_1->Id == 60069)) (spellInfo_2->Id == 47585 && spellInfo_1->Id == 60069))

View file

@ -1420,8 +1420,8 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
// Add melee damage bonus // Add melee damage bonus
damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType); damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType);
damage = damageInfo->target->MeleeDamageBonusTaken(this, damage, damageInfo->attackType); damage = damageInfo->target->MeleeDamageBonusTaken(this, damage, damageInfo->attackType);
// Calculate armor reduction
// Calculate armor reduction
uint32 armor_affected_damage = CalcNotIgnoreDamageReduction(damage, damageInfo->damageSchoolMask); uint32 armor_affected_damage = CalcNotIgnoreDamageReduction(damage, damageInfo->damageSchoolMask);
damageInfo->damage = damage - armor_affected_damage + CalcArmorReducedDamage(damageInfo->target, armor_affected_damage); damageInfo->damage = damage - armor_affected_damage + CalcArmorReducedDamage(damageInfo->target, armor_affected_damage);
damageInfo->cleanDamage += damage - damageInfo->damage; damageInfo->cleanDamage += damage - damageInfo->damage;
@ -2226,7 +2226,6 @@ void Unit::CalculateDamageAbsorbAndResist(Unit *pCaster, SpellSchoolMask schoolM
reflectTriggeredBy->SetInUse(false); // free lock from deletion reflectTriggeredBy->SetInUse(false); // free lock from deletion
} }
// absorb by mana cost // absorb by mana cost
AuraList const& vManaShield = GetAurasByType(SPELL_AURA_MANA_SHIELD); AuraList const& vManaShield = GetAurasByType(SPELL_AURA_MANA_SHIELD);
for(AuraList::const_iterator i = vManaShield.begin(), next; i != vManaShield.end() && RemainingDamage > 0; i = next) for(AuraList::const_iterator i = vManaShield.begin(), next; i != vManaShield.end() && RemainingDamage > 0; i = next)
@ -4052,7 +4051,6 @@ bool Unit::AddSpellAuraHolder(SpellAuraHolder *holder)
if(stop) if(stop)
break; break;
} }
} }
@ -4365,7 +4363,7 @@ void Unit::RemoveAuraHolderDueToSpellByDispel(uint32 spellId, uint32 stackAmount
{ {
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId);
// Custom dispel cases // Custom dispel case
// Unstable Affliction // Unstable Affliction
if(spellEntry->SpellFamilyName == SPELLFAMILY_WARLOCK && (spellEntry->SpellFamilyFlags & UI64LIT(0x010000000000))) if(spellEntry->SpellFamilyName == SPELLFAMILY_WARLOCK && (spellEntry->SpellFamilyFlags & UI64LIT(0x010000000000)))
{ {
@ -6250,13 +6248,13 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u
AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
{ {
if( ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) && if (((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) &&
(*i)->GetSpellProto()->EquippedItemClass == -1 && (*i)->GetSpellProto()->EquippedItemClass == -1 &&
// -1 == any item class (not wand then) // -1 == any item class (not wand then)
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 ) (*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0)
// 0 == any inventory type (not wand then) // 0 == any inventory type (not wand then)
{ {
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
} }
} }
@ -7170,13 +7168,13 @@ int32 Unit::SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask)
bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask) bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask)
{ {
//If m_immuneToSchool type contain this school type, IMMUNE damage. // If m_immuneToSchool type contain this school type, IMMUNE damage.
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr) for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
if (itr->type & shoolMask) if (itr->type & shoolMask)
return true; return true;
//If m_immuneToDamage type contain magic, IMMUNE damage. // If m_immuneToDamage type contain magic, IMMUNE damage.
SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE]; SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr) for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
if (itr->type & shoolMask) if (itr->type & shoolMask)
@ -7233,7 +7231,7 @@ bool Unit::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex i
if (itr->type == effect) if (itr->type == effect)
return true; return true;
if(uint32 mechanic = spellInfo->EffectMechanic[index]) if (uint32 mechanic = spellInfo->EffectMechanic[index])
{ {
SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
@ -7246,7 +7244,7 @@ bool Unit::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex i
return true; return true;
} }
if(uint32 aura = spellInfo->EffectApplyAuraName[index]) if (uint32 aura = spellInfo->EffectApplyAuraName[index])
{ {
SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE]; SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE];
for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr) for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
@ -8749,6 +8747,7 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProt
case 0: // not used case 0: // not used
case 1: basePoints += 1; break; // range 1..1 case 1: basePoints += 1; break; // range 1..1
default: default:
{
// range can have positive (1..rand) and negative (rand..1) values, so order its for irand // range can have positive (1..rand) and negative (rand..1) values, so order its for irand
int32 randvalue = (randomPoints >= 1) int32 randvalue = (randomPoints >= 1)
? irand(1, randomPoints) ? irand(1, randomPoints)
@ -8757,6 +8756,7 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProt
basePoints += randvalue; basePoints += randvalue;
break; break;
} }
}
int32 value = basePoints; int32 value = basePoints;
@ -10216,6 +10216,7 @@ void Unit::ClearAllReactives()
ModifyAuraState(AURA_STATE_DEFENSE, false); ModifyAuraState(AURA_STATE_DEFENSE, false);
if (getClass() == CLASS_HUNTER && HasAuraState( AURA_STATE_HUNTER_PARRY)) if (getClass() == CLASS_HUNTER && HasAuraState( AURA_STATE_HUNTER_PARRY))
ModifyAuraState(AURA_STATE_HUNTER_PARRY, false); ModifyAuraState(AURA_STATE_HUNTER_PARRY, false);
if(getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER) if(getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER)
((Player*)this)->ClearComboPoints(); ((Player*)this)->ClearComboPoints();
} }
@ -10304,6 +10305,7 @@ Unit* Unit::SelectRandomFriendlyTarget(Unit* except /*= NULL*/, float radius /*=
MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check); MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
Cell::VisitAllObjects(this, searcher, radius); Cell::VisitAllObjects(this, searcher, radius);
// remove current target // remove current target
if(except) if(except)
targets.remove(except); targets.remove(except);

View file

@ -815,7 +815,7 @@ struct CalcDamageInfo
uint32 blocked_amount; uint32 blocked_amount;
uint32 HitInfo; uint32 HitInfo;
uint32 TargetState; uint32 TargetState;
// Helper // Helper
WeaponAttackType attackType; // WeaponAttackType attackType; //
uint32 procAttacker; uint32 procAttacker;
uint32 procVictim; uint32 procVictim;
@ -1089,7 +1089,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
typedef std::map<uint8, uint32> VisibleAuraMap; typedef std::map<uint8, uint32> VisibleAuraMap;
typedef std::map<SpellEntry const*, ObjectGuid> SingleCastSpellTargetMap; typedef std::map<SpellEntry const*, ObjectGuid> SingleCastSpellTargetMap;
virtual ~Unit ( ); virtual ~Unit ( );
void AddToWorld(); void AddToWorld();

View file

@ -2851,6 +2851,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
CastSpell(pVictim, 27526, true, castItem, triggeredByAura); CastSpell(pVictim, 27526, true, castItem, triggeredByAura);
return SPELL_AURA_PROC_OK; return SPELL_AURA_PROC_OK;
case 31255: // Deadly Swiftness (Rank 1) case 31255: // Deadly Swiftness (Rank 1)
{
// whenever you deal damage to a target who is below 20% health. // whenever you deal damage to a target who is below 20% health.
if (pVictim->GetHealth() > pVictim->GetMaxHealth() / 5) if (pVictim->GetHealth() > pVictim->GetMaxHealth() / 5)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
@ -2858,6 +2859,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
target = this; target = this;
trigger_spell_id = 22588; trigger_spell_id = 22588;
break; break;
}
//case 33207: break; // Gossip NPC Periodic - Fidget //case 33207: break; // Gossip NPC Periodic - Fidget
case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher)
trigger_spell_id = 33898; trigger_spell_id = 33898;
@ -3696,21 +3698,21 @@ SpellAuraProcResult Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint3
{ {
case 836: // Improved Blizzard (Rank 1) case 836: // Improved Blizzard (Rank 1)
{ {
if (!procSpell || procSpell->SpellVisual[0]!=9487) if (!procSpell || procSpell->SpellVisual[0] != 9487)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
triggered_spell_id = 12484; triggered_spell_id = 12484;
break; break;
} }
case 988: // Improved Blizzard (Rank 2) case 988: // Improved Blizzard (Rank 2)
{ {
if (!procSpell || procSpell->SpellVisual[0]!=9487) if (!procSpell || procSpell->SpellVisual[0] != 9487)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
triggered_spell_id = 12485; triggered_spell_id = 12485;
break; break;
} }
case 989: // Improved Blizzard (Rank 3) case 989: // Improved Blizzard (Rank 3)
{ {
if (!procSpell || procSpell->SpellVisual[0]!=9487) if (!procSpell || procSpell->SpellVisual[0] != 9487)
return SPELL_AURA_PROC_FAILED; return SPELL_AURA_PROC_FAILED;
triggered_spell_id = 12486; triggered_spell_id = 12486;
break; break;

View file

@ -628,7 +628,6 @@ class World
uint32 m_maxActiveSessionCount; uint32 m_maxActiveSessionCount;
uint32 m_maxQueuedSessionCount; uint32 m_maxQueuedSessionCount;
uint32 m_configUint32Values[CONFIG_UINT32_VALUE_COUNT]; uint32 m_configUint32Values[CONFIG_UINT32_VALUE_COUNT];
int32 m_configInt32Values[CONFIG_INT32_VALUE_COUNT]; int32 m_configInt32Values[CONFIG_INT32_VALUE_COUNT];
float m_configFloatValues[CONFIG_FLOAT_VALUE_COUNT]; float m_configFloatValues[CONFIG_FLOAT_VALUE_COUNT];

View file

@ -283,7 +283,7 @@ bool WorldSession::Update(PacketFilter& updater)
packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG)) if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
{ {
sLog.outDebug("Dumping error causing packet:"); DEBUG_LOG("Dumping error causing packet:");
packet->hexlike(); packet->hexlike();
} }

View file

@ -823,7 +823,6 @@ class MANGOS_DLL_SPEC WorldSession
void HandleGuildBankDepositMoney(WorldPacket& recv_data); void HandleGuildBankDepositMoney(WorldPacket& recv_data);
void HandleGuildBankWithdrawMoney(WorldPacket& recv_data); void HandleGuildBankWithdrawMoney(WorldPacket& recv_data);
void HandleGuildBankSwapItems(WorldPacket& recv_data); void HandleGuildBankSwapItems(WorldPacket& recv_data);
void HandleGuildBankUpdateTab(WorldPacket& recv_data); void HandleGuildBankUpdateTab(WorldPacket& recv_data);
void HandleGuildBankBuyTab(WorldPacket& recv_data); void HandleGuildBankBuyTab(WorldPacket& recv_data);
void HandleQueryGuildBankTabText(WorldPacket& recv_data); void HandleQueryGuildBankTabText(WorldPacket& recv_data);

View file

@ -721,7 +721,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1); opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1);
if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG)) if (sLog.HasLogLevelOrHigher(LOG_LVL_DEBUG))
{ {
sLog.outDebug("Dumping error-causing packet:"); DEBUG_LOG("Dumping error-causing packet:");
new_pct->hexlike(); new_pct->hexlike();
} }
@ -983,7 +983,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
if (m_Session && m_Session->GetSecurity () == SEC_PLAYER) if (m_Session && m_Session->GetSecurity () == SEC_PLAYER)
{ {
sLog.outError ("WorldSocket::HandlePing: Player kicked for " sLog.outError ("WorldSocket::HandlePing: Player kicked for "
"over-speed pings address = %s", "overspeeded pings address = %s",
GetRemoteAddress ().c_str ()); GetRemoteAddress ().c_str ());
return -1; return -1;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11972" #define REVISION_NR "11973"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__