Code Style (game + scripts only):
"==" --> " == " (when needed) --HG-- branch : trunk
This commit is contained in:
+23
-23
@@ -127,13 +127,13 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
criteria->ID, criteria->requiredType,dataType);
|
||||
return false;
|
||||
}
|
||||
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE)==0)
|
||||
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) have not existed class in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,dataType,classRace.class_id);
|
||||
return false;
|
||||
}
|
||||
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE)==0)
|
||||
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) have not existed race in value2 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,dataType,classRace.race_id);
|
||||
@@ -163,19 +163,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
if (!spellEntry)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) have wrong spell id in value1 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,(dataType==ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id);
|
||||
criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id);
|
||||
return false;
|
||||
}
|
||||
if (aura.effect_idx >= 3)
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) have wrong spell effect index in value2 (%u), ignore.",
|
||||
criteria->ID, criteria->requiredType,(dataType==ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.effect_idx);
|
||||
criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.effect_idx);
|
||||
return false;
|
||||
}
|
||||
if (!spellEntry->EffectApplyAuraName[aura.effect_idx])
|
||||
{
|
||||
sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) have non-aura spell effect (ID: %u Effect: %u), ignore.",
|
||||
criteria->ID, criteria->requiredType,(dataType==ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id,aura.effect_idx);
|
||||
criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id,aura.effect_idx);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -294,7 +294,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
{
|
||||
uint32 zone_id,area_id;
|
||||
source->GetZoneAndAreaId(zone_id,area_id);
|
||||
return area.id==zone_id || area.id==area_id;
|
||||
return area.id == zone_id || area.id == area_id;
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA:
|
||||
return target && target->HasAuraEffect(aura.spell_id,aura.effect_idx);
|
||||
@@ -311,7 +311,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_DISABLED:
|
||||
return false; // always fail
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
|
||||
return source->GetMap()->GetSpawnMode()==difficulty.difficulty;
|
||||
return source->GetMap()->GetSpawnMode() == difficulty.difficulty;
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
|
||||
return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount;
|
||||
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM:
|
||||
@@ -327,7 +327,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
|
||||
BattleGround* bg = source->GetBattleGround();
|
||||
if (!bg)
|
||||
return false;
|
||||
return bg->IsTeamScoreInRange(source->GetTeam()==ALLIANCE ? HORDE : ALLIANCE,bg_loss_team_score.min_score,bg_loss_team_score.max_score);
|
||||
return bg->IsTeamScoreInRange(source->GetTeam() == ALLIANCE ? HORDE : ALLIANCE,bg_loss_team_score.min_score,bg_loss_team_score.max_score);
|
||||
}
|
||||
case ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT:
|
||||
{
|
||||
@@ -404,7 +404,7 @@ void AchievementMgr::Reset()
|
||||
|
||||
void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2)
|
||||
{
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0)
|
||||
sLog.outDetail("AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2);
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
@@ -613,7 +613,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
||||
return;
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0)
|
||||
sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID);
|
||||
#endif
|
||||
|
||||
@@ -701,7 +701,7 @@ static const uint32 achievIdForDangeon[][4] =
|
||||
*/
|
||||
void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time)
|
||||
{
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0)
|
||||
sLog.outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time);
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
@@ -944,7 +944,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (!achievIdForDangeon[j][2])
|
||||
break; // for
|
||||
}
|
||||
else if (GetPlayer()->GetDungeonDifficulty()==DUNGEON_DIFFICULTY_NORMAL)
|
||||
else if (GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL)
|
||||
{
|
||||
// dungeon in normal mode accepted
|
||||
if (!achievIdForDangeon[j][1])
|
||||
@@ -964,7 +964,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
if (!found)
|
||||
continue;
|
||||
|
||||
//FIXME: work only for instances where max==min for players
|
||||
//FIXME: work only for instances where max == min for players
|
||||
if (((InstanceMap*)map)->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit)
|
||||
continue;
|
||||
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
|
||||
@@ -985,7 +985,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// if team check required: must kill by opposition faction
|
||||
if (achievement->ID==318 && miscvalue2==GetPlayer()->GetTeam())
|
||||
if (achievement->ID == 318 && miscvalue2 == GetPlayer()->GetTeam())
|
||||
continue;
|
||||
|
||||
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
|
||||
@@ -1102,7 +1102,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// zone specific
|
||||
if (achievementCriteria->loot_type.lootTypeCount==1)
|
||||
if (achievementCriteria->loot_type.lootTypeCount == 1)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
@@ -1125,7 +1125,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
// additional requirements
|
||||
if (achievementCriteria->win_rated_arena.flag==ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
|
||||
if (achievementCriteria->win_rated_arena.flag == ACHIEVEMENT_CRITERIA_CONDITION_NO_LOOSE)
|
||||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = achievementmgr.GetCriteriaDataSet(achievementCriteria);
|
||||
@@ -1688,7 +1688,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
|
||||
}
|
||||
|
||||
// all criterias completed requirement
|
||||
if (completed_all && achievmentForTestCount==0)
|
||||
if (completed_all && achievmentForTestCount == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1696,7 +1696,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
|
||||
|
||||
void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype)
|
||||
{
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0)
|
||||
sLog.outDetail("AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow());
|
||||
|
||||
CriteriaProgress *progress = NULL;
|
||||
@@ -1935,7 +1935,7 @@ AchievementCriteriaEntryList const& AchievementGlobalMgr::GetAchievementCriteria
|
||||
|
||||
void AchievementGlobalMgr::LoadAchievementCriteriaList()
|
||||
{
|
||||
if (sAchievementCriteriaStore.GetNumRows()==0)
|
||||
if (sAchievementCriteriaStore.GetNumRows() == 0)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
bar.step();
|
||||
@@ -1964,7 +1964,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
|
||||
|
||||
void AchievementGlobalMgr::LoadAchievementReferenceList()
|
||||
{
|
||||
if (sAchievementStore.GetNumRows()==0)
|
||||
if (sAchievementStore.GetNumRows() == 0)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
bar.step();
|
||||
@@ -2093,11 +2093,11 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: // any cases
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: // need skip generic cases
|
||||
if (criteria->do_emote.count==0)
|
||||
if (criteria->do_emote.count == 0)
|
||||
continue;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: // skip statistics
|
||||
if (criteria->win_duel.duelCount==0)
|
||||
if (criteria->win_duel.duelCount == 0)
|
||||
continue;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: // any cases
|
||||
@@ -2292,7 +2292,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
|
||||
if (m_achievementRewards.find(entry)==m_achievementRewards.end())
|
||||
if (m_achievementRewards.find(entry) == m_achievementRewards.end())
|
||||
{
|
||||
sLog.outErrorDb("Table `locales_achievement_reward` (Entry: %u) has locale strings for not existed achievement reward .", entry);
|
||||
continue;
|
||||
|
||||
@@ -46,7 +46,7 @@ enum AchievementCriteriaDataType
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE = 1, // creature_id 0
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE = 2, // class_id race_id
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH= 3, // health_percent 0
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD = 4, // own_team 0 not corpse (not released body), own_team==false if enemy team expected
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD = 4, // own_team 0 not corpse (not released body), own_team == false if enemy team expected
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA = 5, // spell_id effect_idx
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA = 6, // area id 0
|
||||
ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7, // spell_id effect_idx
|
||||
|
||||
@@ -313,12 +313,12 @@ void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
|
||||
|
||||
// Node icons
|
||||
for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
|
||||
data << uint32(BG_AB_OP_NODEICONS[node]) << uint32((m_Nodes[node]==0)?1:0);
|
||||
data << uint32(BG_AB_OP_NODEICONS[node]) << uint32((m_Nodes[node] == 0)?1:0);
|
||||
|
||||
// Node occupied states
|
||||
for (uint8 node = 0; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
|
||||
for (uint8 i = 1; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
data << uint32(BG_AB_OP_NODESTATES[node] + plusArray[i]) << uint32((m_Nodes[node]==i)?1:0);
|
||||
data << uint32(BG_AB_OP_NODESTATES[node] + plusArray[i]) << uint32((m_Nodes[node] == i)?1:0);
|
||||
|
||||
// How many bases each team owns
|
||||
uint8 ally = 0, horde = 0;
|
||||
|
||||
+36
-36
@@ -230,17 +230,17 @@ void BattleGroundAV::UpdateScore(uint16 team, int16 points)
|
||||
uint8 teamindex = GetTeamIndexByTeamId(team); //0=ally 1=horde
|
||||
m_Team_Scores[teamindex] += points;
|
||||
|
||||
UpdateWorldState(((teamindex==BG_TEAM_HORDE)?AV_Horde_Score:AV_Alliance_Score), m_Team_Scores[teamindex]);
|
||||
UpdateWorldState(((teamindex == BG_TEAM_HORDE)?AV_Horde_Score:AV_Alliance_Score), m_Team_Scores[teamindex]);
|
||||
if (points < 0)
|
||||
{
|
||||
if (m_Team_Scores[teamindex] < 1)
|
||||
{
|
||||
m_Team_Scores[teamindex]=0;
|
||||
EndBattleGround(((teamindex==BG_TEAM_HORDE)?ALLIANCE:HORDE));
|
||||
EndBattleGround(((teamindex == BG_TEAM_HORDE)?ALLIANCE:HORDE));
|
||||
}
|
||||
else if (!m_IsInformedNearVictory[teamindex] && m_Team_Scores[teamindex] < SEND_MSG_NEAR_LOSE)
|
||||
{
|
||||
SendMessageToAll(teamindex==BG_TEAM_HORDE?LANG_BG_AV_H_NEAR_LOSE:LANG_BG_AV_A_NEAR_LOSE, teamindex==BG_TEAM_HORDE ? CHAT_MSG_BG_SYSTEM_HORDE : CHAT_MSG_BG_SYSTEM_ALLIANCE);
|
||||
SendMessageToAll(teamindex == BG_TEAM_HORDE?LANG_BG_AV_H_NEAR_LOSE:LANG_BG_AV_A_NEAR_LOSE, teamindex == BG_TEAM_HORDE ? CHAT_MSG_BG_SYSTEM_HORDE : CHAT_MSG_BG_SYSTEM_ALLIANCE);
|
||||
PlaySoundToAll(AV_SOUND_NEAR_VICTORY);
|
||||
m_IsInformedNearVictory[teamindex] = true;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ void BattleGroundAV::Update(uint32 diff)
|
||||
m_CaptainBuffTimer[i] -= diff;
|
||||
else
|
||||
{
|
||||
if (i==0)
|
||||
if (i == 0)
|
||||
{
|
||||
CastSpellOnTeam(AV_BUFF_A_CAPTAIN,ALLIANCE);
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_MAX + 61);
|
||||
@@ -386,7 +386,7 @@ void BattleGroundAV::AddPlayer(Player *plr)
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundAVScore* sc = new BattleGroundAVScore;
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
if (m_MaxLevel==0)
|
||||
if (m_MaxLevel == 0)
|
||||
m_MaxLevel=(plr->getLevel()%10 == 0)? plr->getLevel() : (plr->getLevel()-(plr->getLevel()%10))+10; //TODO: just look at the code \^_^/ --but queue-info should provide this information..
|
||||
|
||||
}
|
||||
@@ -564,8 +564,8 @@ void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
SpawnBGObject(((owner==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(((owner==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -588,7 +588,7 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
if (team != ALLIANCE && team != HORDE)
|
||||
team = AV_NEUTRAL_TEAM;
|
||||
else
|
||||
PlaySoundToAll((team==ALLIANCE)?AV_SOUND_ALLIANCE_GOOD:AV_SOUND_HORDE_GOOD);
|
||||
PlaySoundToAll((team == ALLIANCE)?AV_SOUND_ALLIANCE_GOOD:AV_SOUND_HORDE_GOOD);
|
||||
|
||||
if (m_Mine_Owner[mine] == team && !initial)
|
||||
return;
|
||||
@@ -598,11 +598,11 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
if (!initial)
|
||||
{
|
||||
sLog.outDebug("bg_av depopulating mine %i (0=north,1=south)",mine);
|
||||
if (mine==AV_SOUTH_MINE)
|
||||
if (mine == AV_SOUTH_MINE)
|
||||
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
if (m_BgCreatures[i])
|
||||
DelCreature(i); //TODO just set the respawntime to 999999
|
||||
for (uint16 i=((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3); i++)
|
||||
for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3); i++)
|
||||
if (m_BgCreatures[i])
|
||||
DelCreature(i); //TODO here also
|
||||
}
|
||||
@@ -611,7 +611,7 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
sLog.outDebug("bg_av populating mine %i (0=north,1=south)",mine);
|
||||
uint16 miner;
|
||||
//also neutral team exists.. after a big time, the neutral team tries to conquer the mine
|
||||
if (mine==AV_NORTH_MINE)
|
||||
if (mine == AV_NORTH_MINE)
|
||||
{
|
||||
if (team == ALLIANCE)
|
||||
miner = AV_NPC_N_MINE_A_1;
|
||||
@@ -640,14 +640,14 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
AddAVCreature(cinfo,i);
|
||||
}
|
||||
for (uint16 i=((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MAX:AV_CPLACE_MINE_S_1_MAX); i++)
|
||||
for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MAX:AV_CPLACE_MINE_S_1_MAX); i++)
|
||||
AddAVCreature(miner,i);
|
||||
//the next chooses randomly between 2 cretures
|
||||
for (uint16 i=((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MIN:AV_CPLACE_MINE_S_2_MIN); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MAX:AV_CPLACE_MINE_S_2_MAX); i++)
|
||||
for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MIN:AV_CPLACE_MINE_S_2_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MAX:AV_CPLACE_MINE_S_2_MAX); i++)
|
||||
AddAVCreature(miner+(urand(1,2)),i);
|
||||
AddAVCreature(miner+3,(mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3);
|
||||
AddAVCreature(miner+3,(mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3);
|
||||
//because the gameobjects in this mine have changed, update all surrounding players:
|
||||
// for (uint16 i = ((mine==AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MIN:BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i <= ((mine==AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MAX:BG_AV_OBJECT_MINE_SUPPLY_N_MAX); i++)
|
||||
// for (uint16 i = ((mine == AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MIN:BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i <= ((mine == AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MAX:BG_AV_OBJECT_MINE_SUPPLY_N_MAX); i++)
|
||||
// {
|
||||
//TODO: add gameobject-update code
|
||||
// }
|
||||
@@ -662,7 +662,7 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mine==AV_SOUTH_MINE) //i think this gets called all the time
|
||||
if (mine == AV_SOUTH_MINE) //i think this gets called all the time
|
||||
{
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_MINE_S_3);
|
||||
YellToAll(creature,LANG_BG_AV_S_MINE_BOSS_CLAIMS,LANG_UNIVERSAL);
|
||||
@@ -674,9 +674,9 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
bool BattleGroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team)
|
||||
{
|
||||
if (GOId == BG_AV_OBJECTID_MINE_N)
|
||||
return (m_Mine_Owner[AV_NORTH_MINE]==team);
|
||||
return (m_Mine_Owner[AV_NORTH_MINE] == team);
|
||||
if (GOId == BG_AV_OBJECTID_MINE_S)
|
||||
return (m_Mine_Owner[AV_SOUTH_MINE]==team);
|
||||
return (m_Mine_Owner[AV_SOUTH_MINE] == team);
|
||||
return true; //cause it's no mine'object it is ok if this is true
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node);
|
||||
uint32 creatureid;
|
||||
if (IsTower(node))
|
||||
creatureid=(owner==ALLIANCE)?AV_NPC_A_TOWERDEFENSE:AV_NPC_H_TOWERDEFENSE;
|
||||
creatureid=(owner == ALLIANCE)?AV_NPC_A_TOWERDEFENSE:AV_NPC_H_TOWERDEFENSE;
|
||||
else
|
||||
{
|
||||
uint8 team2 = GetTeamIndexByTeamId(owner);
|
||||
@@ -864,8 +864,8 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
SpawnBGObject(((owner==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(((team==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(((team == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
}
|
||||
//send a nice message to all :)
|
||||
@@ -879,7 +879,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
if (IsTower(node))
|
||||
PlaySoundToAll(AV_SOUND_BOTH_TOWER_DEFEND);
|
||||
else
|
||||
PlaySoundToAll((team==ALLIANCE)?AV_SOUND_ALLIANCE_GOOD:AV_SOUND_HORDE_GOOD);
|
||||
PlaySoundToAll((team == ALLIANCE)?AV_SOUND_ALLIANCE_GOOD:AV_SOUND_HORDE_GOOD);
|
||||
}
|
||||
|
||||
void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
@@ -941,10 +941,10 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
SpawnBGObject(object+22, RESPAWN_IMMEDIATELY);
|
||||
if (IsTower(node))
|
||||
{ //spawning/despawning of bigflag+aura
|
||||
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team==ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team==HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team==ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team==HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -985,7 +985,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
YellToAll(creature,buf,LANG_UNIVERSAL);
|
||||
//update the statistic for the assaulting player
|
||||
UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_ASSAULTED : SCORE_GRAVEYARDS_ASSAULTED, 1);
|
||||
PlaySoundToAll((team==ALLIANCE)?AV_SOUND_ALLIANCE_ASSAULTS:AV_SOUND_HORDE_ASSAULTS);
|
||||
PlaySoundToAll((team == ALLIANCE)?AV_SOUND_ALLIANCE_ASSAULTS:AV_SOUND_HORDE_ASSAULTS);
|
||||
}
|
||||
|
||||
void BattleGroundAV::FillInitialWorldStates(WorldPacket& data)
|
||||
@@ -1006,7 +1006,7 @@ void BattleGroundAV::FillInitialWorldStates(WorldPacket& data)
|
||||
for (uint8 i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_MAX; i++)
|
||||
for (uint8 j =1; j <= 3; j+=2)
|
||||
{//j=1=assaulted j=3=controled //i dont have j=2=destroyed cause destroyed is the same like enemy-team controll
|
||||
stateok = (m_Nodes[i].State == j || (m_Nodes[i].State == POINT_DESTROYED && j==3));
|
||||
stateok = (m_Nodes[i].State == j || (m_Nodes[i].State == POINT_DESTROYED && j == 3));
|
||||
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0);
|
||||
data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0);
|
||||
}
|
||||
@@ -1034,16 +1034,16 @@ const uint8 BattleGroundAV::GetWorldStateType(uint8 state, uint16 team) //this i
|
||||
//a_c a_a h_c h_a the positions in worldstate-array
|
||||
if (team == ALLIANCE)
|
||||
{
|
||||
if (state==POINT_CONTROLED || state==POINT_DESTROYED)
|
||||
if (state == POINT_CONTROLED || state == POINT_DESTROYED)
|
||||
return 0;
|
||||
if (state==POINT_ASSAULTED)
|
||||
if (state == POINT_ASSAULTED)
|
||||
return 1;
|
||||
}
|
||||
if (team == HORDE)
|
||||
{
|
||||
if (state==POINT_DESTROYED || state==POINT_CONTROLED)
|
||||
if (state == POINT_DESTROYED || state == POINT_CONTROLED)
|
||||
return 2;
|
||||
if (state==POINT_ASSAULTED)
|
||||
if (state == POINT_ASSAULTED)
|
||||
return 3;
|
||||
}
|
||||
sLog.outError("BG_AV: should update a strange worldstate state:%i team:%i",state,team);
|
||||
@@ -1061,13 +1061,13 @@ void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
|
||||
|
||||
void BattleGroundAV::SendMineWorldStates(uint32 mine)
|
||||
{
|
||||
assert(mine == AV_NORTH_MINE || mine==AV_SOUTH_MINE);
|
||||
assert(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
|
||||
// currently i'm sure, that this works (:
|
||||
// assert(m_Mine_PrevOwner[mine] == ALLIANCE || m_Mine_PrevOwner[mine] == HORDE || m_Mine_PrevOwner[mine] == AV_NEUTRAL_TEAM);
|
||||
// assert(m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE || m_Mine_Owner[mine] == AV_NEUTRAL_TEAM);
|
||||
|
||||
uint8 owner,prevowner,mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array
|
||||
mine2 = (mine==AV_NORTH_MINE)?0:1;
|
||||
mine2 = (mine == AV_NORTH_MINE)?0:1;
|
||||
if (m_Mine_PrevOwner[mine] == ALLIANCE)
|
||||
prevowner = 0;
|
||||
else if (m_Mine_PrevOwner[mine] == HORDE)
|
||||
@@ -1344,7 +1344,7 @@ void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
|
||||
sLog.outCrash("Assault on an not assaulted node with total owner");
|
||||
assert (false);
|
||||
}
|
||||
//the timer gets another time, if the previous owner was 0==Neutral
|
||||
//the timer gets another time, if the previous owner was 0 == Neutral
|
||||
m_Nodes[node].Timer = (m_Nodes[node].PrevOwner)? BG_AV_CAPTIME : BG_AV_SNOWFALL_FIRSTCAP;
|
||||
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
|
||||
m_Nodes[node].Owner = team;
|
||||
@@ -1390,7 +1390,7 @@ void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint16 team)
|
||||
void BattleGroundAV::ResetBGSubclass()
|
||||
{
|
||||
m_MaxLevel=0;
|
||||
for (uint8 i=0; i<2; i++) //forloop for both teams (it just make 0==alliance and 1==horde also for both mines 0=north 1=south
|
||||
for (uint8 i=0; i<2; i++) //forloop for both teams (it just make 0 == alliance and 1 == horde also for both mines 0=north 1=south
|
||||
{
|
||||
for (uint8 j=0; j<9; j++)
|
||||
m_Team_QuestStatus[i][j]=0;
|
||||
|
||||
@@ -886,7 +886,7 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
|
||||
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
if (m_PointOwnedByTeam[i]==player->GetTeam() && m_PointState[i]==EY_POINT_UNDER_CONTROL)
|
||||
if (m_PointOwnedByTeam[i] == player->GetTeam() && m_PointState[i] == EY_POINT_UNDER_CONTROL)
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
|
||||
if (!entry)
|
||||
|
||||
@@ -1890,7 +1890,7 @@ void BattleGroundMgr::SendToBattleGround(Player *pl, uint32 instanceId, BattleGr
|
||||
uint32 mapid = bg->GetMapId();
|
||||
float x, y, z, O;
|
||||
uint32 team = pl->GetBGTeam();
|
||||
if (team==0)
|
||||
if (team == 0)
|
||||
team = pl->GetTeam();
|
||||
bg->GetTeamStartLoc(team, x, y, z, O);
|
||||
|
||||
|
||||
+2
-2
@@ -146,8 +146,8 @@ struct Cell
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const Cell &cell) const { return (data.All == cell.data.All); }
|
||||
bool operator!=(const Cell &cell) const { return !operator==(cell); }
|
||||
bool operator == (const Cell &cell) const { return (data.All == cell.data.All); }
|
||||
bool operator!=(const Cell &cell) const { return !operator == (cell); }
|
||||
union
|
||||
{
|
||||
struct
|
||||
|
||||
@@ -309,7 +309,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
|
||||
// speedup check for heroic class disabled case
|
||||
uint32 heroic_free_slots = sWorld.getConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM);
|
||||
if (heroic_free_slots==0 && GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
if (heroic_free_slots == 0 && GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||
SendPacket(&data);
|
||||
@@ -318,7 +318,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
|
||||
// speedup check for heroic class disabled case
|
||||
uint32 req_level_for_heroic = sWorld.getConfig(CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING);
|
||||
if (GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
|
||||
SendPacket(&data);
|
||||
@@ -331,7 +331,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
bool have_same_race = false;
|
||||
|
||||
// if 0 then allowed creating without any characters
|
||||
bool have_req_level_for_heroic = (req_level_for_heroic==0);
|
||||
bool have_req_level_for_heroic = (req_level_for_heroic == 0);
|
||||
|
||||
if (!AllowTwoSideAccounts || skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
@@ -344,7 +344,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
Field* field = result2->Fetch();
|
||||
uint8 acc_race = field[1].GetUInt32();
|
||||
|
||||
if (GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
uint8 acc_class = field[2].GetUInt32();
|
||||
if (acc_class == CLASS_DEATH_KNIGHT)
|
||||
@@ -352,7 +352,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
if (heroic_free_slots > 0)
|
||||
--heroic_free_slots;
|
||||
|
||||
if (heroic_free_slots==0)
|
||||
if (heroic_free_slots == 0)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||
SendPacket(&data);
|
||||
@@ -397,7 +397,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
if (!have_same_race)
|
||||
have_same_race = race_ == acc_race;
|
||||
|
||||
if (GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
uint8 acc_class = field[2].GetUInt32();
|
||||
if (acc_class == CLASS_DEATH_KNIGHT)
|
||||
@@ -405,7 +405,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
if (heroic_free_slots > 0)
|
||||
--heroic_free_slots;
|
||||
|
||||
if (heroic_free_slots==0)
|
||||
if (heroic_free_slots == 0)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||
SendPacket(&data);
|
||||
@@ -424,7 +424,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
}
|
||||
|
||||
if (GetSecurity()==SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && !have_req_level_for_heroic)
|
||||
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && !have_req_level_for_heroic)
|
||||
{
|
||||
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
|
||||
SendPacket(&data);
|
||||
@@ -572,7 +572,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
// for send server info and strings (config)
|
||||
ChatHandler chH = ChatHandler(pCurrChar);
|
||||
|
||||
// "GetAccountId()==db stored account id" checked in LoadFromDB (prevent login not own character using cheating tools)
|
||||
// "GetAccountId() == db stored account id" checked in LoadFromDB (prevent login not own character using cheating tools)
|
||||
if (!pCurrChar->LoadFromDB(GUID_LOPART(playerGuid), holder))
|
||||
{
|
||||
KickPlayer(); // disconnect client, player no set to session and it will not deleted or saved at kick
|
||||
|
||||
+8
-8
@@ -827,7 +827,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
||||
else if (target_account)
|
||||
target_sec = accmgr.GetSecurity(target_account);
|
||||
else
|
||||
return true; // caller must report error for (target==NULL && target_account==0)
|
||||
return true; // caller must report error for (target == NULL && target_account == 0)
|
||||
|
||||
if (m_session->GetSecurity() < target_sec || (strong && m_session->GetSecurity() <= target_sec))
|
||||
{
|
||||
@@ -1058,7 +1058,7 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text,
|
||||
// in case "" command let process by caller
|
||||
if (!cmd.empty())
|
||||
{
|
||||
if (table==getCommandTable())
|
||||
if (table == getCommandTable())
|
||||
sLog.outErrorDb("Table `command` have not existed command '%s', skip.",cmd.c_str());
|
||||
else
|
||||
sLog.outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str());
|
||||
@@ -1347,7 +1347,7 @@ valid examples:
|
||||
}
|
||||
|
||||
// ignore other integers
|
||||
while ((c >='0' && c <='9') || c==':')
|
||||
while ((c >='0' && c <='9') || c == ':')
|
||||
{
|
||||
reader.ignore(1);
|
||||
c = reader.peek();
|
||||
@@ -1724,7 +1724,7 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand *table, char const* cmd, ch
|
||||
if (list.empty())
|
||||
return false;
|
||||
|
||||
if (table==getCommandTable())
|
||||
if (table == getCommandTable())
|
||||
{
|
||||
SendSysMessage(LANG_AVIABLE_CMD);
|
||||
PSendSysMessage("%s",list.c_str());
|
||||
@@ -1927,7 +1927,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
|
||||
return NULL;
|
||||
|
||||
// skip spaces
|
||||
while (*text==' '||*text=='\t'||*text=='\b')
|
||||
while (*text == ' '||*text == '\t'||*text == '\b')
|
||||
++text;
|
||||
|
||||
if (!*text)
|
||||
@@ -1975,7 +1975,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
|
||||
return NULL;
|
||||
|
||||
// skip spaces
|
||||
while (*text==' '||*text=='\t'||*text=='\b')
|
||||
while (*text == ' '||*text == '\t'||*text == '\b')
|
||||
++text;
|
||||
|
||||
if (!*text)
|
||||
@@ -1993,7 +1993,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
|
||||
|
||||
char* tail;
|
||||
|
||||
if (text[1]=='c')
|
||||
if (text[1] == 'c')
|
||||
{
|
||||
char* check = strtok(text, "|"); // skip color
|
||||
if (!check)
|
||||
@@ -2347,7 +2347,7 @@ char* ChatHandler::extractQuotedArg(char* args)
|
||||
if (!*args)
|
||||
return NULL;
|
||||
|
||||
if (*args=='"')
|
||||
if (*args == '"')
|
||||
return strtok(args+1, "\"");
|
||||
else
|
||||
{
|
||||
|
||||
+14
-14
@@ -64,7 +64,7 @@ bool VendorItemData::RemoveItem(uint32 item_id)
|
||||
{
|
||||
for (VendorItemList::iterator i = m_items.begin(); i != m_items.end(); ++i)
|
||||
{
|
||||
if ((*i)->item==item_id)
|
||||
if ((*i)->item == item_id)
|
||||
{
|
||||
m_items.erase(i);
|
||||
return true;
|
||||
@@ -76,7 +76,7 @@ bool VendorItemData::RemoveItem(uint32 item_id)
|
||||
size_t VendorItemData::FindItemSlot(uint32 item_id) const
|
||||
{
|
||||
for (size_t i = 0; i < m_items.size(); ++i)
|
||||
if (m_items[i]->item==item_id)
|
||||
if (m_items[i]->item == item_id)
|
||||
return i;
|
||||
return m_items.size();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ size_t VendorItemData::FindItemSlot(uint32 item_id) const
|
||||
VendorItem const* VendorItemData::FindItem(uint32 item_id) const
|
||||
{
|
||||
for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i)
|
||||
if ((*i)->item==item_id)
|
||||
if ((*i)->item == item_id)
|
||||
return *i;
|
||||
return NULL;
|
||||
}
|
||||
@@ -350,7 +350,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data)
|
||||
|
||||
// checked at loading
|
||||
m_defaultMovementType = MovementGeneratorType(cinfo->MovementType);
|
||||
if (!m_respawnradius && m_defaultMovementType==RANDOM_MOTION_TYPE)
|
||||
if (!m_respawnradius && m_defaultMovementType == RANDOM_MOTION_TYPE)
|
||||
m_defaultMovementType = IDLE_MOTION_TYPE;
|
||||
|
||||
for (uint8 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
@@ -1051,13 +1051,13 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
data.orientation = GetOrientation();
|
||||
data.spawntimesecs = m_respawnDelay;
|
||||
// prevent add data integrity problems
|
||||
data.spawndist = GetDefaultMovementType()==IDLE_MOTION_TYPE ? 0 : m_respawnradius;
|
||||
data.spawndist = GetDefaultMovementType() == IDLE_MOTION_TYPE ? 0 : m_respawnradius;
|
||||
data.currentwaypoint = 0;
|
||||
data.curhealth = GetHealth();
|
||||
data.curmana = GetPower(POWER_MANA);
|
||||
data.is_dead = m_isDeadByDefault;
|
||||
// prevent add data integrity problems
|
||||
data.movementType = !m_respawnradius && GetDefaultMovementType()==RANDOM_MOTION_TYPE
|
||||
data.movementType = !m_respawnradius && GetDefaultMovementType() == RANDOM_MOTION_TYPE
|
||||
? IDLE_MOTION_TYPE : GetDefaultMovementType();
|
||||
data.spawnMask = spawnMask;
|
||||
|
||||
@@ -1320,7 +1320,7 @@ bool Creature::hasQuest(uint32 quest_id) const
|
||||
QuestRelations const& qr = objmgr.mCreatureQuestRelations;
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if (itr->second==quest_id)
|
||||
if (itr->second == quest_id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1331,7 +1331,7 @@ bool Creature::hasInvolvedQuest(uint32 quest_id) const
|
||||
QuestRelations const& qr = objmgr.mCreatureQuestInvolvedRelations;
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if (itr->second==quest_id)
|
||||
if (itr->second == quest_id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1436,7 +1436,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
|
||||
float Creature::GetAttackDistance(Unit const* pl) const
|
||||
{
|
||||
float aggroRate = sWorld.getRate(RATE_CREATURE_AGGRO);
|
||||
if (aggroRate==0)
|
||||
if (aggroRate == 0)
|
||||
return 0.0f;
|
||||
|
||||
uint32 playerlevel = pl->getLevelForTarget(this);
|
||||
@@ -1565,7 +1565,7 @@ void Creature::Respawn(bool force)
|
||||
|
||||
RemoveCorpse();
|
||||
|
||||
if (getDeathState()==DEAD)
|
||||
if (getDeathState() == DEAD)
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
@@ -1759,7 +1759,7 @@ bool Creature::IsVisibleInGridForPlayer(Player const* pl) const
|
||||
{
|
||||
if (GetEntry() == VISUAL_WAYPOINT)
|
||||
return false;
|
||||
return (isAlive() || m_deathTimer > 0 || (m_isDeadByDefault && m_deathState==CORPSE));
|
||||
return (isAlive() || m_deathTimer > 0 || (m_isDeadByDefault && m_deathState == CORPSE));
|
||||
}
|
||||
|
||||
// Dead player see live creatures near own corpse
|
||||
@@ -2075,7 +2075,7 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker)
|
||||
|
||||
WorldPacket data(SMSG_ZONE_UNDER_ATTACK,4);
|
||||
data << (uint32)GetAreaId();
|
||||
sWorld.SendGlobalMessage(&data,NULL,(enemy_team==ALLIANCE ? HORDE : ALLIANCE));
|
||||
sWorld.SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE));
|
||||
}
|
||||
|
||||
void Creature::SetInCombatWithZone()
|
||||
@@ -2272,7 +2272,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
||||
|
||||
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||
if (itr->itemId==vItem->item)
|
||||
if (itr->itemId == vItem->item)
|
||||
break;
|
||||
|
||||
if (itr == m_vendorItemCounts.end())
|
||||
@@ -2307,7 +2307,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
||||
|
||||
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||
if (itr->itemId==vItem->item)
|
||||
if (itr->itemId == vItem->item)
|
||||
break;
|
||||
|
||||
if (itr == m_vendorItemCounts.end())
|
||||
|
||||
+2
-2
@@ -158,11 +158,11 @@ struct CreatureInfo
|
||||
|
||||
bool isTameable(bool exotic) const
|
||||
{
|
||||
if (type != CREATURE_TYPE_BEAST || family == 0 || (type_flags & CREATURE_TYPEFLAGS_TAMEABLE)==0)
|
||||
if (type != CREATURE_TYPE_BEAST || family == 0 || (type_flags & CREATURE_TYPEFLAGS_TAMEABLE) == 0)
|
||||
return false;
|
||||
|
||||
// if can tame exotic then can tame any temable
|
||||
return exotic || (type_flags & CREATURE_TYPEFLAGS_EXOTIC)==0;
|
||||
return exotic || (type_flags & CREATURE_TYPEFLAGS_EXOTIC) == 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class CreatureAI : public UnitAI
|
||||
|
||||
virtual ~CreatureAI() {}
|
||||
|
||||
///== Reactions At =================================
|
||||
/// == Reactions At =================================
|
||||
|
||||
// Called if IsVisible(Unit *who) is true at each *who move, reaction at visibility zone enter
|
||||
void MoveInLineOfSight_Safe(Unit *who);
|
||||
@@ -146,7 +146,7 @@ class CreatureAI : public UnitAI
|
||||
// Called at text emote receive from player
|
||||
virtual void ReceiveEmote(Player* pPlayer, uint32 text_emote) {}
|
||||
|
||||
///== Triggered Actions Requested ==================
|
||||
/// == Triggered Actions Requested ==================
|
||||
|
||||
// Called when creature attack expected (if creature can and no have current victim)
|
||||
// Note: for reaction at hostile action must be called AttackedBy function.
|
||||
@@ -155,7 +155,7 @@ class CreatureAI : public UnitAI
|
||||
// Called at World update tick
|
||||
//virtual void UpdateAI(const uint32 diff) {}
|
||||
|
||||
///== State checks =================================
|
||||
/// == State checks =================================
|
||||
|
||||
// Is unit visible for MoveInLineOfSight
|
||||
//virtual bool IsVisible(Unit *) const { return false; }
|
||||
@@ -166,7 +166,7 @@ class CreatureAI : public UnitAI
|
||||
// Called when victim entered water and creature can not enter water
|
||||
//virtual bool canReachByRangeAttack(Unit*) { return false; }
|
||||
|
||||
///== Fields =======================================
|
||||
/// == Fields =======================================
|
||||
|
||||
// Pointer to controlled by AI creature
|
||||
//Creature* const m_creature;
|
||||
|
||||
@@ -567,7 +567,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
break;
|
||||
case ACTION_T_COMBAT_MOVEMENT:
|
||||
// ignore no affect case
|
||||
if (CombatMovementEnabled==(action.combat_movement.state!=0))
|
||||
if (CombatMovementEnabled == (action.combat_movement.state!=0))
|
||||
return;
|
||||
|
||||
CombatMovementEnabled = action.combat_movement.state != 0;
|
||||
|
||||
@@ -452,7 +452,7 @@ struct CreatureEventAI_Event
|
||||
struct
|
||||
{
|
||||
uint32 spellId;
|
||||
uint32 schoolMask; // -1 (==0xffffffff) is ok value for full mask, or must be more limited mask like (0 < 1) = 1 for normal/physical school
|
||||
uint32 schoolMask; // -1 ( == 0xffffffff) is ok value for full mask, or must be more limited mask like (0 < 1) = 1 for normal/physical school
|
||||
uint32 repeatMin;
|
||||
uint32 repeatMax;
|
||||
} spell_hit;
|
||||
|
||||
@@ -236,7 +236,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID),area->exploreFlag));
|
||||
|
||||
// fill MapId->DBC records (skip sub zones and continents)
|
||||
if (area->zone==0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 && area->mapid != 571)
|
||||
if (area->zone == 0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 && area->mapid != 571)
|
||||
sAreaFlagByMapID.insert(AreaFlagByMapID::value_type(area->mapid,area->exploreFlag));
|
||||
}
|
||||
}
|
||||
@@ -418,7 +418,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
continue;
|
||||
|
||||
// prevent memory corruption; otherwise cls will become 12 below
|
||||
if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE)==0)
|
||||
if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) == 0)
|
||||
continue;
|
||||
|
||||
// store class talent tab pages
|
||||
@@ -465,7 +465,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
for (uint32 i = 1; i < sSpellStore.GetNumRows (); ++i)
|
||||
if (SpellEntry const* sInfo = sSpellStore.LookupEntry (i))
|
||||
for (int j=0; j < 3; ++j)
|
||||
if (sInfo->Effect[j]==123 /*SPELL_EFFECT_SEND_TAXI*/)
|
||||
if (sInfo->Effect[j] == 123 /*SPELL_EFFECT_SEND_TAXI*/)
|
||||
spellPaths.insert(sInfo->EffectMiscValue[j]);
|
||||
|
||||
memset(sTaxiNodesMask,0,sizeof(sTaxiNodesMask));
|
||||
@@ -483,7 +483,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i)
|
||||
{
|
||||
// not spell path
|
||||
if (spellPaths.find(dest_i->second.ID)==spellPaths.end())
|
||||
if (spellPaths.find(dest_i->second.ID) == spellPaths.end())
|
||||
{
|
||||
ok = true;
|
||||
break;
|
||||
@@ -583,7 +583,7 @@ char* GetPetName(uint32 petfamily, uint32 dbclang)
|
||||
TalentSpellPos const* GetTalentSpellPos(uint32 spellId)
|
||||
{
|
||||
TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId);
|
||||
if (itr==sTalentSpellPosMap.end())
|
||||
if (itr == sTalentSpellPosMap.end())
|
||||
return NULL;
|
||||
|
||||
return &itr->second;
|
||||
@@ -678,9 +678,9 @@ ChatChannelsEntry const* GetChannelEntryFor(uint32 channel_id)
|
||||
|
||||
bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
|
||||
{
|
||||
if (requiredTotemCategoryId==0)
|
||||
if (requiredTotemCategoryId == 0)
|
||||
return true;
|
||||
if (itemTotemCategoryId==0)
|
||||
if (itemTotemCategoryId == 0)
|
||||
return false;
|
||||
|
||||
TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
|
||||
@@ -693,7 +693,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT
|
||||
if (itemEntry->categoryType!=reqEntry->categoryType)
|
||||
return false;
|
||||
|
||||
return (itemEntry->categoryMask & reqEntry->categoryMask)==reqEntry->categoryMask;
|
||||
return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask;
|
||||
}
|
||||
|
||||
void Zone2MapCoordinates(float& x,float& y,uint32 zone)
|
||||
|
||||
@@ -49,7 +49,7 @@ bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
|
||||
return false;
|
||||
|
||||
uint8 failnum = (uint8)atoi(px);
|
||||
if (failnum==0 && *px!='0')
|
||||
if (failnum == 0 && *px!='0')
|
||||
return false;
|
||||
|
||||
char* p1 = strtok(NULL, " ");
|
||||
|
||||
@@ -230,7 +230,7 @@ void GameEventMgr::LoadFromDB()
|
||||
bar.step();
|
||||
|
||||
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);
|
||||
continue;
|
||||
@@ -248,7 +248,7 @@ void GameEventMgr::LoadFromDB()
|
||||
pGameEvent.state = (GameEventState)(fields[7].GetUInt8());
|
||||
pGameEvent.nextstart = 0;
|
||||
|
||||
if (pGameEvent.length==0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
|
||||
if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
|
||||
{
|
||||
sLog.outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id);
|
||||
continue;
|
||||
|
||||
@@ -732,7 +732,7 @@ bool GameObject::hasQuest(uint32 quest_id) const
|
||||
QuestRelations const& qr = objmgr.mGOQuestRelations;
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if (itr->second==quest_id)
|
||||
if (itr->second == quest_id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -743,7 +743,7 @@ bool GameObject::hasInvolvedQuest(uint32 quest_id) const
|
||||
QuestRelations const& qr = objmgr.mGOQuestInvolvedRelations;
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if (itr->second==quest_id)
|
||||
if (itr->second == quest_id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1293,7 +1293,7 @@ void GameObject::Use(Unit* user)
|
||||
return;
|
||||
|
||||
// accept only use by player from same group for caster except caster itself
|
||||
if (caster->ToPlayer()==player || !caster->ToPlayer()->IsInSameRaidWith(player))
|
||||
if (caster->ToPlayer() == player || !caster->ToPlayer()->IsInSameRaidWith(player))
|
||||
return;
|
||||
|
||||
AddUniqueUse(player);
|
||||
@@ -1309,7 +1309,7 @@ void GameObject::Use(Unit* user)
|
||||
return;
|
||||
|
||||
spellId = info->summoningRitual.spellId;
|
||||
if (spellId==62330) // GO store not existed spell, replace by expected
|
||||
if (spellId == 62330) // GO store not existed spell, replace by expected
|
||||
{
|
||||
// spell have reagent and mana cost but it not expected use its
|
||||
// it triggered spell in fact casted at currently channeled GO
|
||||
@@ -1372,7 +1372,7 @@ void GameObject::Use(Unit* user)
|
||||
if (level < info->meetingstone.minLevel)
|
||||
return;
|
||||
|
||||
if (info->id==194097)
|
||||
if (info->id == 194097)
|
||||
spellId = 61994; // Ritual of Summoning
|
||||
else
|
||||
spellId = 59782; // Summoning Stone Effect
|
||||
|
||||
@@ -372,7 +372,7 @@ bool QuestMenu::HasItem(uint32 questid)
|
||||
{
|
||||
for (QuestMenuItemList::const_iterator i = m_qItems.begin(); i != m_qItems.end(); ++i)
|
||||
{
|
||||
if (i->m_qId==questid)
|
||||
if (i->m_qId == questid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID,
|
||||
// rewarded honor points. Multiply with 10 to satisfy client
|
||||
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
||||
data << float(0); // new 3.3.0, honor multiplier?
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
|
||||
data << int32(pQuest->GetRewSpellCast()); // casted spell
|
||||
data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
|
||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||
@@ -577,7 +577,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest)
|
||||
WorldPacket data(SMSG_QUEST_QUERY_RESPONSE, 100); // guess size
|
||||
|
||||
data << uint32(pQuest->GetQuestId()); // quest id
|
||||
data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0==IsAutoComplete() (skip objectives/details)
|
||||
data << uint32(pQuest->GetQuestMethod()); // Accepted values: 0, 1 or 2. 0 == IsAutoComplete() (skip objectives/details)
|
||||
data << uint32(pQuest->GetQuestLevel()); // may be -1, static data, in other cases must be used dynamic level: Player::GetQuestLevel (0 is not known, but assuming this is no longer valid for quest intended for client)
|
||||
data << uint32(pQuest->GetMinLevel()); // min level
|
||||
data << uint32(pQuest->GetZoneOrSort()); // zone or sort to display in quest log
|
||||
@@ -600,7 +600,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest)
|
||||
data << uint32(pQuest->GetRewOrReqMoney()); // reward money (below max lvl)
|
||||
|
||||
data << uint32(pQuest->GetRewMoneyMaxLevel()); // used in XP calculation at client
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
|
||||
data << int32(pQuest->GetRewSpellCast()); // casted spell
|
||||
|
||||
// rewarded honor points
|
||||
@@ -765,7 +765,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID,
|
||||
data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills()));
|
||||
data << float(0); // unk, honor multiplier?
|
||||
data << uint32(0x08); // unused by client?
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)
|
||||
data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
|
||||
data << int32(pQuest->GetRewSpellCast()); // casted spell
|
||||
data << uint32(0); // unknown
|
||||
data << uint32(pQuest->GetBonusTalents()); // bonus talents
|
||||
|
||||
@@ -78,8 +78,8 @@ struct CoordPair
|
||||
{
|
||||
CoordPair(uint32 x=0, uint32 y=0) : x_coord(x), y_coord(y) {}
|
||||
CoordPair(const CoordPair<LIMIT> &obj) : x_coord(obj.x_coord), y_coord(obj.y_coord) {}
|
||||
bool operator==(const CoordPair<LIMIT> &obj) const { return (obj.x_coord == x_coord && obj.y_coord == y_coord); }
|
||||
bool operator!=(const CoordPair<LIMIT> &obj) const { return !operator==(obj); }
|
||||
bool operator == (const CoordPair<LIMIT> &obj) const { return (obj.x_coord == x_coord && obj.y_coord == y_coord); }
|
||||
bool operator!=(const CoordPair<LIMIT> &obj) const { return !operator == (obj); }
|
||||
CoordPair<LIMIT>& operator=(const CoordPair<LIMIT> &obj)
|
||||
{
|
||||
x_coord = obj.x_coord;
|
||||
|
||||
@@ -335,7 +335,7 @@ ObjectUpdater::Visit(GridRefManager<T> &m)
|
||||
bool CannibalizeObjectCheck::operator()(Corpse* u)
|
||||
{
|
||||
// ignore bones
|
||||
if (u->GetType()==CORPSE_BONES)
|
||||
if (u->GetType() == CORPSE_BONES)
|
||||
return false;
|
||||
|
||||
Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGUID());
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace Trinity
|
||||
{
|
||||
if (i_funit->GetTypeId() != TYPEID_PLAYER || !((Player*)i_funit)->isHonorOrXPTarget(u) ||
|
||||
u->getDeathState() != CORPSE || u->isDeadByDefault() || u->isInFlight() ||
|
||||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1)))==0 ||
|
||||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0 ||
|
||||
(u->GetDisplayId() != u->GetNativeDisplayId()))
|
||||
return false;
|
||||
|
||||
@@ -551,7 +551,7 @@ namespace Trinity
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if (i_funit->IsFriendlyTo(u) || u->isAlive() || u->isInFlight() ||
|
||||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD)==0)
|
||||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0)
|
||||
return false;
|
||||
|
||||
return i_funit->IsWithinDistInMap(u, i_range);
|
||||
@@ -935,7 +935,7 @@ namespace Trinity
|
||||
|
||||
struct AnyStealthedCheck
|
||||
{
|
||||
bool operator()(Unit* u) { return u->GetVisibility()==VISIBILITY_GROUP_STEALTH; }
|
||||
bool operator()(Unit* u) { return u->GetVisibility() == VISIBILITY_GROUP_STEALTH; }
|
||||
};
|
||||
|
||||
// Creature checks
|
||||
|
||||
+5
-5
@@ -384,7 +384,7 @@ void Group::ChangeLeader(const uint64 &guid)
|
||||
{
|
||||
member_citerator slot = _getMemberCSlot(guid);
|
||||
|
||||
if (slot==m_memberSlots.end())
|
||||
if (slot == m_memberSlots.end())
|
||||
return;
|
||||
|
||||
_setLeader(guid);
|
||||
@@ -1072,7 +1072,7 @@ void Group::BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int
|
||||
if (!pl || (ignore != 0 && pl->GetGUID() == ignore) || (ignorePlayersInBGRaid && pl->GetGroup() != this))
|
||||
continue;
|
||||
|
||||
if (pl->GetSession() && (group==-1 || itr->getSubGroup()==group))
|
||||
if (pl->GetSession() && (group == -1 || itr->getSubGroup() == group))
|
||||
pl->GetSession()->SendPacket(packet);
|
||||
}
|
||||
}
|
||||
@@ -1222,7 +1222,7 @@ bool Group::_removeMember(const uint64 &guid)
|
||||
void Group::_setLeader(const uint64 &guid)
|
||||
{
|
||||
member_witerator slot = _getMemberWSlot(guid);
|
||||
if (slot==m_memberSlots.end())
|
||||
if (slot == m_memberSlots.end())
|
||||
return;
|
||||
|
||||
if (!isBGGroup())
|
||||
@@ -1301,7 +1301,7 @@ void Group::_removeRolls(const uint64 &guid)
|
||||
bool Group::_setMembersGroup(const uint64 &guid, const uint8 &group)
|
||||
{
|
||||
member_witerator slot = _getMemberWSlot(guid);
|
||||
if (slot==m_memberSlots.end())
|
||||
if (slot == m_memberSlots.end())
|
||||
return false;
|
||||
|
||||
slot->group = group;
|
||||
@@ -1537,7 +1537,7 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGround const* bgOrTemplate, BattleG
|
||||
}
|
||||
|
||||
//===================================================
|
||||
//============== Roll ===============================
|
||||
//============== Roll ===============================
|
||||
//===================================================
|
||||
|
||||
void Roll::targetObjectBuildLink()
|
||||
|
||||
+7
-7
@@ -189,8 +189,8 @@ class Group
|
||||
void Disband(bool hideDestroy=false);
|
||||
|
||||
// properties accessories
|
||||
bool IsFull() const { return (m_groupType==GROUPTYPE_NORMAL) ? (m_memberSlots.size()>=MAXGROUPSIZE) : (m_memberSlots.size()>=MAXRAIDSIZE); }
|
||||
bool isRaidGroup() const { return m_groupType==GROUPTYPE_RAID; }
|
||||
bool IsFull() const { return (m_groupType == GROUPTYPE_NORMAL) ? (m_memberSlots.size()>=MAXGROUPSIZE) : (m_memberSlots.size()>=MAXRAIDSIZE); }
|
||||
bool isRaidGroup() const { return m_groupType == GROUPTYPE_RAID; }
|
||||
bool isBGGroup() const { return m_bgGroup != NULL; }
|
||||
bool IsCreated() const { return GetMembersCount() > 0; }
|
||||
const uint64& GetLeaderGUID() const { return m_leaderGuid; }
|
||||
@@ -216,7 +216,7 @@ class Group
|
||||
bool IsAssistant(uint64 guid) const
|
||||
{
|
||||
member_citerator mslot = _getMemberCSlot(guid);
|
||||
if (mslot==m_memberSlots.end())
|
||||
if (mslot == m_memberSlots.end())
|
||||
return false;
|
||||
|
||||
return mslot->flags & MEMBER_FLAG_ASSISTANT;
|
||||
@@ -227,7 +227,7 @@ class Group
|
||||
bool SameSubGroup(uint64 guid1,const uint64& guid2) const
|
||||
{
|
||||
member_citerator mslot2 = _getMemberCSlot(guid2);
|
||||
if (mslot2==m_memberSlots.end())
|
||||
if (mslot2 == m_memberSlots.end())
|
||||
return false;
|
||||
|
||||
return SameSubGroup(guid1,&*mslot2);
|
||||
@@ -236,10 +236,10 @@ class Group
|
||||
bool SameSubGroup(uint64 guid1, MemberSlot const* slot2) const
|
||||
{
|
||||
member_citerator mslot1 = _getMemberCSlot(guid1);
|
||||
if (mslot1==m_memberSlots.end() || !slot2)
|
||||
if (mslot1 == m_memberSlots.end() || !slot2)
|
||||
return false;
|
||||
|
||||
return (mslot1->group==slot2->group);
|
||||
return (mslot1->group == slot2->group);
|
||||
}
|
||||
|
||||
bool HasFreeSlotSubGroup(uint8 subgroup) const
|
||||
@@ -256,7 +256,7 @@ class Group
|
||||
uint8 GetMemberGroup(uint64 guid) const
|
||||
{
|
||||
member_citerator mslot = _getMemberCSlot(guid);
|
||||
if (mslot==m_memberSlots.end())
|
||||
if (mslot == m_memberSlots.end())
|
||||
return (MAXRAIDSIZE/MAXGROUPSIZE+1);
|
||||
|
||||
return mslot->group;
|
||||
|
||||
+1
-1
@@ -1994,7 +1994,7 @@ void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankT
|
||||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
}
|
||||
DisplayGuildBankContentUpdate(BankTab,BankTabSlot,BankTab==BankTabDst ? BankTabSlotDst : -1);
|
||||
DisplayGuildBankContentUpdate(BankTab,BankTabSlot,BankTab == BankTabDst ? BankTabSlotDst : -1);
|
||||
if (BankTab != BankTabDst)
|
||||
DisplayGuildBankContentUpdate(BankTabDst,BankTabSlotDst);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff
|
||||
owner.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
|
||||
// restore orientation of not moving creature at returning to home
|
||||
if (owner.GetDefaultMovementType()==IDLE_MOTION_TYPE)
|
||||
if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE)
|
||||
{
|
||||
//sLog.outDebug("Entering HomeMovement::GetDestination(z,y,z)");
|
||||
owner.SetOrientation(ori);
|
||||
|
||||
@@ -272,8 +272,8 @@ void InstanceData::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
if (GameObject* pGo = instance->GetGameObject(uiGuid))
|
||||
{
|
||||
//not expect any of these should ever be handled
|
||||
if (pGo->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || pGo->GetGoType()==GAMEOBJECT_TYPE_DOOR ||
|
||||
pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON || pGo->GetGoType()==GAMEOBJECT_TYPE_TRAP)
|
||||
if (pGo->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE || pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
|
||||
pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON || pGo->GetGoType() == GAMEOBJECT_TYPE_TRAP)
|
||||
return;
|
||||
|
||||
if (pGo->isSpawned())
|
||||
|
||||
+11
-11
@@ -83,7 +83,7 @@ void AddItemsSetItem(Player*player,Item *item)
|
||||
|
||||
uint32 z=0;
|
||||
for (; z<8; z++)
|
||||
if (eff->spells[z] && eff->spells[z]->Id==set->spells[x])
|
||||
if (eff->spells[z] && eff->spells[z]->Id == set->spells[x])
|
||||
break;
|
||||
|
||||
if (z < 8)
|
||||
@@ -150,7 +150,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
|
||||
|
||||
for (uint32 z=0; z<8; z++)
|
||||
{
|
||||
if (eff->spells[z] && eff->spells[z]->Id==set->spells[x])
|
||||
if (eff->spells[z] && eff->spells[z]->Id == set->spells[x])
|
||||
{
|
||||
// spell can be not active if not fit form requirement
|
||||
player->ApplyEquipSpell(eff->spells[z],NULL,false);
|
||||
@@ -406,7 +406,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult_AutoPtr result
|
||||
}
|
||||
|
||||
// update duration if need, and remove if not need
|
||||
if ((proto->Duration==0) != (GetUInt32Value(ITEM_FIELD_DURATION)==0))
|
||||
if ((proto->Duration == 0) != (GetUInt32Value(ITEM_FIELD_DURATION) == 0))
|
||||
{
|
||||
SetUInt32Value(ITEM_FIELD_DURATION,abs(proto->Duration));
|
||||
need_save = true;
|
||||
@@ -544,7 +544,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
|
||||
// item can have not null only one from field values
|
||||
if ((itemProto->RandomProperty) && (itemProto->RandomSuffix))
|
||||
{
|
||||
sLog.outErrorDb("Item template %u have RandomProperty==%u and RandomSuffix==%u, but must have one from field =0",itemProto->ItemId,itemProto->RandomProperty,itemProto->RandomSuffix);
|
||||
sLog.outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0",itemProto->ItemId,itemProto->RandomProperty,itemProto->RandomSuffix);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
|
||||
bool Item::UpdateItemSuffixFactor()
|
||||
{
|
||||
uint32 suffixFactor = GenerateEnchSuffixFactor(GetEntry());
|
||||
if (GetItemSuffixFactor()==suffixFactor)
|
||||
if (GetItemSuffixFactor() == suffixFactor)
|
||||
return false;
|
||||
SetUInt32Value(ITEM_FIELD_PROPERTY_SEED,suffixFactor);
|
||||
return true;
|
||||
@@ -712,7 +712,7 @@ bool Item::CanBeTraded(bool mail) const
|
||||
{
|
||||
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK)
|
||||
return false;
|
||||
if (owner->GetLootGUID()==GetGUID())
|
||||
if (owner->GetLootGUID() == GetGUID())
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -770,8 +770,8 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
|
||||
if (spellInfo->EquippedItemClass != -1) // -1 == any item class
|
||||
{
|
||||
// Special case - accept vellum for armor/weapon requirements
|
||||
if ((spellInfo->EquippedItemClass==ITEM_CLASS_ARMOR && proto->IsArmorVellum())
|
||||
||(spellInfo->EquippedItemClass==ITEM_CLASS_WEAPON && proto->IsWeaponVellum()))
|
||||
if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum())
|
||||
||(spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum()))
|
||||
if (spellmgr.IsSkillTypeSpell(spellInfo->Id, SKILL_ENCHANTING)) // only for enchanting spells
|
||||
return true;
|
||||
|
||||
@@ -933,7 +933,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
|
||||
if (!gemProto)
|
||||
continue;
|
||||
|
||||
if (gemProto->ItemLimitCategory==limitCategory)
|
||||
if (gemProto->ItemLimitCategory == limitCategory)
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
@@ -970,7 +970,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
|
||||
if (count > pProto->GetMaxStackSize())
|
||||
count = pProto->GetMaxStackSize();
|
||||
|
||||
assert(count !=0 && "pProto->Stackable==0 but checked at loading already");
|
||||
assert(count !=0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
|
||||
Item *pItem = NewItemOrBag(pProto);
|
||||
if (pItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), item, player))
|
||||
@@ -1007,7 +1007,7 @@ bool Item::IsBindedNotWith(Player const* player) const
|
||||
return false;
|
||||
|
||||
// own item
|
||||
if (GetOwnerGUID()== player->GetGUID())
|
||||
if (GetOwnerGUID() == player->GetGUID())
|
||||
return false;
|
||||
|
||||
// not BOA item case
|
||||
|
||||
+11
-11
@@ -41,10 +41,10 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data)
|
||||
uint16 src = ((srcbag << 8) | srcslot);
|
||||
uint16 dst = ((dstbag << 8) | dstslot);
|
||||
|
||||
if (src==dst)
|
||||
if (src == dst)
|
||||
return;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return; //check count - if zero it's fake packet
|
||||
|
||||
if (!_player->IsValidPos(srcbag,srcslot))
|
||||
@@ -71,7 +71,7 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data)
|
||||
//sLog.outDebug("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot);
|
||||
|
||||
// prevent attempt swap same item to current position generated by client at special checting sequence
|
||||
if (srcslot==dstslot)
|
||||
if (srcslot == dstslot)
|
||||
return;
|
||||
|
||||
if (!_player->IsValidPos(INVENTORY_SLOT_BAG_0,srcslot))
|
||||
@@ -123,7 +123,7 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data)
|
||||
uint16 dst = ((dstbag << 8) | dstslot);
|
||||
|
||||
// prevent attempt swap same item to current position generated by client at special checting sequence
|
||||
if (src==dst)
|
||||
if (src == dst)
|
||||
return;
|
||||
|
||||
if (!_player->IsValidPos(srcbag,srcslot))
|
||||
@@ -169,7 +169,7 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
uint16 src = pSrcItem->GetPos();
|
||||
if (dest==src) // prevent equip in same slot, only at cheat
|
||||
if (dest == src) // prevent equip in same slot, only at cheat
|
||||
return;
|
||||
|
||||
Item *pDstItem = _player->GetItemByPos(dest);
|
||||
@@ -529,14 +529,14 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// prevent sell currently looted item
|
||||
if (_player->GetLootGUID()==pItem->GetGUID())
|
||||
if (_player->GetLootGUID() == pItem->GetGUID())
|
||||
{
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// special case at auto sell (sell all)
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
count = pItem->GetCount();
|
||||
}
|
||||
@@ -817,7 +817,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
// no-op: placed in same slot
|
||||
if (dest.size()==1 && dest[0].pos==src)
|
||||
if (dest.size() == 1 && dest[0].pos == src)
|
||||
{
|
||||
// just remove grey item state
|
||||
_player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
|
||||
@@ -1049,7 +1049,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (item==gift) // not possable with pacjket from real client
|
||||
if (item == gift) // not possable with pacjket from real client
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL);
|
||||
return;
|
||||
@@ -1109,7 +1109,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
|
||||
item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED);
|
||||
item->SetState(ITEM_CHANGED, _player);
|
||||
|
||||
if (item->GetState()==ITEM_NEW) // save new item, to have alway for `character_gifts` record in `item_instance`
|
||||
if (item->GetState() == ITEM_NEW) // save new item, to have alway for `character_gifts` record in `item_instance`
|
||||
{
|
||||
// after save it will be impossible to remove the item from the queue
|
||||
item->RemoveFromUpdateQueueOf(_player);
|
||||
@@ -1209,7 +1209,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
|
||||
{
|
||||
if (i==j) // skip self
|
||||
if (i == j) // skip self
|
||||
continue;
|
||||
|
||||
if (Gems[j])
|
||||
|
||||
@@ -110,7 +110,7 @@ enum ITEM_FLAGS
|
||||
ITEM_FLAGS_CONJURED = 0x00000002,
|
||||
ITEM_FLAGS_OPENABLE = 0x00000004,
|
||||
ITEM_FLAGS_WRAPPED = 0x00000008,
|
||||
ITEM_FLAGS_BROKEN = 0x00000010, // appears red icon (like when item durability==0)
|
||||
ITEM_FLAGS_BROKEN = 0x00000010, // appears red icon (like when item durability == 0)
|
||||
ITEM_FLAGS_TOTEM = 0x00000020, // ?
|
||||
ITEM_FLAGS_USABLE = 0x00000040, // ?
|
||||
ITEM_FLAGS_WRAPPER = 0x00000200, // used or not used wrapper
|
||||
@@ -640,9 +640,9 @@ struct ItemPrototype
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool IsPotion() const { return Class==ITEM_CLASS_CONSUMABLE && SubClass==ITEM_SUBCLASS_POTION; }
|
||||
bool IsWeaponVellum() const { return Class==ITEM_CLASS_TRADE_GOODS && SubClass==ITEM_SUBCLASS_WEAPON_ENCHANTMENT; }
|
||||
bool IsArmorVellum() const { return Class==ITEM_CLASS_TRADE_GOODS && SubClass==ITEM_SUBCLASS_ARMOR_ENCHANTMENT; }
|
||||
bool IsPotion() const { return Class == ITEM_CLASS_CONSUMABLE && SubClass == ITEM_SUBCLASS_POTION; }
|
||||
bool IsWeaponVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT; }
|
||||
bool IsArmorVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ARMOR_ENCHANTMENT; }
|
||||
bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAGS_CONJURED); }
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ static void AttemptJoin(Player* _player)
|
||||
Player *plr = iter->second;
|
||||
|
||||
// skip enemies and self
|
||||
if (!plr || plr==_player || plr->GetTeam() != _player->GetTeam())
|
||||
if (!plr || plr == _player || plr->GetTeam() != _player->GetTeam())
|
||||
continue;
|
||||
|
||||
//skip players not in world
|
||||
@@ -99,7 +99,7 @@ static void AttemptAddMore(Player* _player)
|
||||
Player *plr = iter->second;
|
||||
|
||||
// skip enemies and self
|
||||
if (!plr || plr==_player || plr->GetTeam() != _player->GetTeam())
|
||||
if (!plr || plr == _player || plr->GetTeam() != _player->GetTeam())
|
||||
continue;
|
||||
|
||||
if (!plr->IsInWorld())
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
|
||||
|
||||
// save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning
|
||||
uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||
if ((save_interval==0 || save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS))
|
||||
if ((save_interval == 0 || save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS))
|
||||
player->SaveToDB();
|
||||
|
||||
return true;
|
||||
|
||||
+5
-5
@@ -2254,7 +2254,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale ())
|
||||
if (loc == GetSessionDbcLocale ())
|
||||
continue;
|
||||
|
||||
name = areaEntry->area_name[loc];
|
||||
@@ -2460,7 +2460,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args)
|
||||
|
||||
std::string chrNameLink = playerLink(target_name);
|
||||
|
||||
if (target->IsBeingTeleported()==true)
|
||||
if (target->IsBeingTeleported() == true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
@@ -2623,7 +2623,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||
{
|
||||
Player *pl = itr->getSource();
|
||||
|
||||
if (!pl || pl==m_session->GetPlayer() || !pl->GetSession())
|
||||
if (!pl || pl == m_session->GetPlayer() || !pl->GetSession())
|
||||
continue;
|
||||
|
||||
// check online security
|
||||
@@ -2632,7 +2632,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||
|
||||
std::string plNameLink = GetNameLink(pl);
|
||||
|
||||
if (pl->IsBeingTeleported()==true)
|
||||
if (pl->IsBeingTeleported() == true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
@@ -2835,7 +2835,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
|
||||
float y = (float)atof(py);
|
||||
|
||||
// prevent accept wrong numeric args
|
||||
if ((x==0.0f && *px!='0') || (y==0.0f && *py!='0'))
|
||||
if ((x == 0.0f && *px!='0') || (y == 0.0f && *py!='0'))
|
||||
return false;
|
||||
|
||||
uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId();
|
||||
|
||||
+12
-12
@@ -933,7 +933,7 @@ bool ChatHandler::HandleModifyRepCommand(const char * args)
|
||||
|
||||
wstrToLower(wrank);
|
||||
|
||||
if (wrank.substr(0,wrankStr.size())==wrankStr)
|
||||
if (wrank.substr(0,wrankStr.size()) == wrankStr)
|
||||
{
|
||||
char *deltaTxt = strtok(NULL, " ");
|
||||
if (deltaTxt)
|
||||
@@ -1194,7 +1194,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(const char* args)
|
||||
|
||||
if (pCreature->isPet())
|
||||
{
|
||||
if (((Pet*)pCreature)->getPetType()==HUNTER_PET)
|
||||
if (((Pet*)pCreature)->getPetType() == HUNTER_PET)
|
||||
{
|
||||
pCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(lvl)/4);
|
||||
pCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
@@ -1933,7 +1933,7 @@ bool ChatHandler::HandleItemMoveCommand(const char* args)
|
||||
srcslot = (uint8)atoi(pParam1);
|
||||
dstslot = (uint8)atoi(pParam2);
|
||||
|
||||
if (srcslot==dstslot)
|
||||
if (srcslot == dstslot)
|
||||
return true;
|
||||
|
||||
if (!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0,srcslot))
|
||||
@@ -2009,7 +2009,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player==m_session->GetPlayer())
|
||||
if (player == m_session->GetPlayer())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_KICKSELF);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -2041,7 +2041,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_session && name==m_session->GetPlayer()->GetName())
|
||||
if (m_session && name == m_session->GetPlayer()->GetName())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_KICKSELF);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -2086,7 +2086,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
return false;
|
||||
|
||||
if (m_session && target==m_session->GetPlayer())
|
||||
if (m_session && target == m_session->GetPlayer())
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_KICKSELF);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -3447,7 +3447,7 @@ bool ChatHandler::HandleEventActiveListCommand(const char* args)
|
||||
++counter;
|
||||
}
|
||||
|
||||
if (counter==0)
|
||||
if (counter == 0)
|
||||
SendSysMessage(LANG_NOEVENTFOUND);
|
||||
|
||||
return true;
|
||||
@@ -3703,7 +3703,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = skillInfo->name[loc];
|
||||
@@ -3823,7 +3823,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult_AutoPtr result, int32 li
|
||||
}
|
||||
} while (result->NextRow());
|
||||
|
||||
if (i==0) // empty accounts only
|
||||
if (i == 0) // empty accounts only
|
||||
{
|
||||
PSendSysMessage(LANG_NO_PLAYERS_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -4264,7 +4264,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = titleInfo->name[loc];
|
||||
@@ -4280,7 +4280,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
|
||||
{
|
||||
char const* knownStr = target && target->HasTitle(titleInfo) ? GetTrinityString(LANG_KNOWN) : "";
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE)==titleInfo->bit_index
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
? GetTrinityString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
@@ -4465,7 +4465,7 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE)==titleInfo->bit_index
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
|
||||
? GetTrinityString(LANG_ACTIVE)
|
||||
: "";
|
||||
|
||||
|
||||
+29
-29
@@ -1696,13 +1696,13 @@ bool ChatHandler::HandleCooldownCommand(const char *args)
|
||||
|
||||
if (!sSpellStore.LookupEntry(spell_id))
|
||||
{
|
||||
PSendSysMessage(LANG_UNKNOWN_SPELL, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
|
||||
PSendSysMessage(LANG_UNKNOWN_SPELL, target == m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
target->RemoveSpellCooldown(spell_id,true);
|
||||
PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target==m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
|
||||
PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target == m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -2393,7 +2393,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
|
||||
continue;
|
||||
|
||||
// skip server-side/triggered spells
|
||||
if (spellInfo->spellLevel==0)
|
||||
if (spellInfo->spellLevel == 0)
|
||||
continue;
|
||||
|
||||
// skip wrong class/race skills
|
||||
@@ -2513,7 +2513,7 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/)
|
||||
continue;
|
||||
|
||||
// prevent learn talent for different family (cheating)
|
||||
if (((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)==0)
|
||||
if (((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask) == 0)
|
||||
continue;
|
||||
|
||||
// search highest talent rank
|
||||
@@ -2624,7 +2624,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
|
||||
uint32 itemId = 0;
|
||||
|
||||
if (args[0]=='[') // [name] manual form
|
||||
if (args[0] == '[') // [name] manual form
|
||||
{
|
||||
char* citemName = strtok((char*)args, "]");
|
||||
|
||||
@@ -2704,7 +2704,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
Item* item = plTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
|
||||
// remove binding (let GM give it to another player later)
|
||||
if (pl==plTarget)
|
||||
if (pl == plTarget)
|
||||
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
|
||||
if (Item* item1 = pl->GetItemByPos(itr->pos))
|
||||
item1->SetBinding(false);
|
||||
@@ -2765,7 +2765,7 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args)
|
||||
Item* item = plTarget->StoreNewItem(dest, pProto->ItemId, true);
|
||||
|
||||
// remove binding (let GM give it to another player later)
|
||||
if (pl==plTarget)
|
||||
if (pl == plTarget)
|
||||
item->SetBinding(false);
|
||||
|
||||
pl->SendNewItem(item,1,false,true);
|
||||
@@ -3299,7 +3299,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char *args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = set->name[loc];
|
||||
@@ -3364,7 +3364,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char *args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = skillInfo->name[loc];
|
||||
@@ -3443,7 +3443,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = spellInfo->SpellName[loc];
|
||||
@@ -3791,7 +3791,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = factionEntry->name[loc];
|
||||
@@ -3881,7 +3881,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)
|
||||
loc = 0;
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = nodeEntry->name[loc];
|
||||
@@ -4410,9 +4410,9 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args)
|
||||
|
||||
if (!px2)
|
||||
g_team = 0;
|
||||
else if (strncmp(px2,"horde",6)==0)
|
||||
else if (strncmp(px2,"horde",6) == 0)
|
||||
g_team = HORDE;
|
||||
else if (strncmp(px2,"alliance",9)==0)
|
||||
else if (strncmp(px2,"alliance",9) == 0)
|
||||
g_team = ALLIANCE;
|
||||
else
|
||||
return false;
|
||||
@@ -4454,9 +4454,9 @@ bool ChatHandler::HandleNearGraveCommand(const char *args)
|
||||
|
||||
if (!*args)
|
||||
g_team = 0;
|
||||
else if (strncmp((char*)args,"horde",argslen)==0)
|
||||
else if (strncmp((char*)args,"horde",argslen) == 0)
|
||||
g_team = HORDE;
|
||||
else if (strncmp((char*)args,"alliance",argslen)==0)
|
||||
else if (strncmp((char*)args,"alliance",argslen) == 0)
|
||||
g_team = ALLIANCE;
|
||||
else
|
||||
return false;
|
||||
@@ -4810,7 +4810,7 @@ bool ChatHandler::HandleCharacterLevelCommand(const char *args)
|
||||
|
||||
HandleCharacterLevel(target,target_guid,oldlevel,newlevel);
|
||||
|
||||
if (!m_session || m_session->GetPlayer() != target) // including player==NULL
|
||||
if (!m_session || m_session->GetPlayer() != target) // including player == NULL
|
||||
{
|
||||
std::string nameLink = playerLink(target_name);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_LVL,nameLink.c_str(),newlevel);
|
||||
@@ -4850,7 +4850,7 @@ bool ChatHandler::HandleLevelUpCommand(const char *args)
|
||||
|
||||
HandleCharacterLevel(target,target_guid,oldlevel,newlevel);
|
||||
|
||||
if (!m_session || m_session->GetPlayer() != target) // including chr==NULL
|
||||
if (!m_session || m_session->GetPlayer() != target) // including chr == NULL
|
||||
{
|
||||
std::string nameLink = playerLink(target_name);
|
||||
PSendSysMessage(LANG_YOU_CHANGE_LVL,nameLink.c_str(),newlevel);
|
||||
@@ -5181,7 +5181,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
|
||||
player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powertype << 24)));
|
||||
|
||||
// reset only if player not in some form;
|
||||
if (player->m_form==FORM_NONE)
|
||||
if (player->m_form == FORM_NONE)
|
||||
player->InitDisplayIds();
|
||||
|
||||
player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
|
||||
@@ -5339,14 +5339,14 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
|
||||
AtLoginFlags atLogin;
|
||||
|
||||
// Command specially created as single command to prevent using short case names
|
||||
if (casename=="spells")
|
||||
if (casename == "spells")
|
||||
{
|
||||
atLogin = AT_LOGIN_RESET_SPELLS;
|
||||
sWorld.SendWorldText(LANG_RESETALL_SPELLS);
|
||||
if (!m_session)
|
||||
SendSysMessage(LANG_RESETALL_SPELLS);
|
||||
}
|
||||
else if (casename=="talents")
|
||||
else if (casename == "talents")
|
||||
{
|
||||
atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS);
|
||||
sWorld.SendWorldText(LANG_RESETALL_TALENTS);
|
||||
@@ -5601,7 +5601,7 @@ bool ChatHandler::HandleQuestRemove(const char *args)
|
||||
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
|
||||
{
|
||||
uint32 quest = player->GetQuestSlotQuestId(slot);
|
||||
if (quest==entry)
|
||||
if (quest == entry)
|
||||
{
|
||||
player->SetQuestSlot(slot,0);
|
||||
|
||||
@@ -6045,7 +6045,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult_AutoPtr result)
|
||||
else
|
||||
{
|
||||
SendSysMessage(LANG_BANLIST_ACCOUNTS);
|
||||
SendSysMessage("===============================================================================");
|
||||
SendSysMessage(" ===============================================================================");
|
||||
SendSysMessage(LANG_BANLIST_ACCOUNTS_HEADER);
|
||||
do
|
||||
{
|
||||
@@ -6090,7 +6090,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult_AutoPtr result)
|
||||
}while (banInfo->NextRow());
|
||||
}
|
||||
}while (result->NextRow());
|
||||
SendSysMessage("===============================================================================");
|
||||
SendSysMessage(" ===============================================================================");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -6138,7 +6138,7 @@ bool ChatHandler::HandleBanListIPCommand(const char *args)
|
||||
else
|
||||
{
|
||||
SendSysMessage(LANG_BANLIST_IPS);
|
||||
SendSysMessage("===============================================================================");
|
||||
SendSysMessage(" ===============================================================================");
|
||||
SendSysMessage(LANG_BANLIST_IPS_HEADER);
|
||||
do
|
||||
{
|
||||
@@ -6162,7 +6162,7 @@ bool ChatHandler::HandleBanListIPCommand(const char *args)
|
||||
fields[3].GetString(), fields[4].GetString());
|
||||
}
|
||||
}while (result->NextRow());
|
||||
SendSysMessage("===============================================================================");
|
||||
SendSysMessage(" ===============================================================================");
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -6871,9 +6871,9 @@ bool ChatHandler::HandleGMListFullCommand(const char* /*args*/)
|
||||
if (result)
|
||||
{
|
||||
SendSysMessage(LANG_GMLIST);
|
||||
SendSysMessage("========================");
|
||||
SendSysMessage(" ======================== ");
|
||||
SendSysMessage(LANG_GMLIST_HEADER);
|
||||
SendSysMessage("========================");
|
||||
SendSysMessage(" ======================== ");
|
||||
|
||||
///- Circle through them. Display username and GM level
|
||||
do
|
||||
@@ -6882,7 +6882,7 @@ bool ChatHandler::HandleGMListFullCommand(const char* /*args*/)
|
||||
PSendSysMessage("|%15s|%6s|", fields[0].GetString(),fields[1].GetString());
|
||||
}while (result->NextRow());
|
||||
|
||||
PSendSysMessage("========================");
|
||||
PSendSysMessage(" ======================== ");
|
||||
}
|
||||
else
|
||||
PSendSysMessage(LANG_GMLIST_EMPTY);
|
||||
|
||||
@@ -81,7 +81,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass()==CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
|
||||
if (!ok_loot || !pCreature->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
|
||||
{
|
||||
@@ -176,7 +176,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
|
||||
GameObject *pGameObject = GetPlayer()->GetMap()->GetGameObject(guid);
|
||||
|
||||
// not check distance for GO in case owned GO (fishing bobber case, for example)
|
||||
if (pGameObject && ((pGameObject->GetOwnerGUID()==_player->GetGUID() || pGameObject->IsWithinDistInMap(_player,INTERACTION_DISTANCE))))
|
||||
if (pGameObject && ((pGameObject->GetOwnerGUID() == _player->GetGUID() || pGameObject->IsWithinDistInMap(_player,INTERACTION_DISTANCE))))
|
||||
pLoot = &pGameObject->loot;
|
||||
|
||||
break;
|
||||
@@ -200,7 +200,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
|
||||
{
|
||||
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass()==CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
|
||||
if (ok_loot && pCreature->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
|
||||
pLoot = &pCreature->loot ;
|
||||
@@ -430,7 +430,7 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
{
|
||||
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass()==CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
if (!ok_loot || !pCreature->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
|
||||
return;
|
||||
|
||||
|
||||
@@ -639,7 +639,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem **qite
|
||||
if (itr != PlayerFFAItems.end())
|
||||
{
|
||||
for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
if (iter->index==lootSlot)
|
||||
if (iter->index == lootSlot)
|
||||
{
|
||||
QuestItem *ffaitem2 = (QuestItem*)&(*iter);
|
||||
if (ffaitem)
|
||||
@@ -656,7 +656,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem **qite
|
||||
{
|
||||
for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
{
|
||||
if (iter->index==lootSlot)
|
||||
if (iter->index == lootSlot)
|
||||
{
|
||||
QuestItem *conditem2 = (QuestItem*)&(*iter);
|
||||
if (conditem)
|
||||
@@ -820,7 +820,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
|
||||
case ALL_PERMISSION:
|
||||
case MASTER_PERMISSION:
|
||||
{
|
||||
uint8 slot_type = (lv.permission==MASTER_PERMISSION) ? LOOT_SLOT_TYPE_MASTER : LOOT_SLOT_TYPE_ALLOW_LOOT;
|
||||
uint8 slot_type = (lv.permission == MASTER_PERMISSION) ? LOOT_SLOT_TYPE_MASTER : LOOT_SLOT_TYPE_ALLOW_LOOT;
|
||||
for (uint8 i = 0; i < l.items.size(); ++i)
|
||||
{
|
||||
if (!l.items[i].is_looted && !l.items[i].freeforall && !l.items[i].conditionId && l.items[i].AllowedForPlayer(lv.viewer))
|
||||
@@ -1192,7 +1192,7 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con
|
||||
if (i->mincountOrRef < 0) // References
|
||||
{
|
||||
LootTemplateMap::const_iterator Referenced = store.find(-i->mincountOrRef);
|
||||
if (Referenced ==store.end())
|
||||
if (Referenced == store.end())
|
||||
continue; // Error message [should be] already printed at loading stage
|
||||
if (Referenced->second->HasQuestDrop(store, i->group))
|
||||
return true;
|
||||
|
||||
+18
-18
@@ -987,7 +987,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
|
||||
if (old_cell.DiffCell(new_cell))
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0)
|
||||
sLog.outDebug("Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY());
|
||||
#endif
|
||||
|
||||
@@ -997,7 +997,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
|
||||
else
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0)
|
||||
sLog.outDebug("Creature (GUID: %u Entry: %u) move in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY());
|
||||
#endif
|
||||
}
|
||||
@@ -1011,7 +1011,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
|
||||
EnsureGridLoadedAtEnter(new_cell);
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0)
|
||||
sLog.outDebug("Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
|
||||
#endif
|
||||
|
||||
@@ -1025,7 +1025,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
|
||||
if (loaded(GridPair(new_cell.GridX(), new_cell.GridY())))
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0)
|
||||
sLog.outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
|
||||
#endif
|
||||
|
||||
@@ -1056,7 +1056,7 @@ bool Map::CreatureRespawnRelocation(Creature *c)
|
||||
c->GetMotionMaster()->Clear();
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0)
|
||||
sLog.outDebug("Creature (GUID: %u Entry: %u) will moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY());
|
||||
#endif
|
||||
|
||||
@@ -2152,7 +2152,7 @@ void Map::SendInitTransports(Player * player)
|
||||
for (MapManager::TransportSet::const_iterator i = tset.begin(); i != tset.end(); ++i)
|
||||
{
|
||||
// send data for current transport in other place
|
||||
if ((*i) != player->GetTransport() && (*i)->GetMapId()==GetId())
|
||||
if ((*i) != player->GetTransport() && (*i)->GetMapId() == GetId())
|
||||
{
|
||||
(*i)->BuildCreateUpdateBlockForPlayer(&transData, player);
|
||||
}
|
||||
@@ -2217,7 +2217,7 @@ void Map::DelayedUpdate(const uint32 t_diff)
|
||||
|
||||
void Map::AddObjectToRemoveList(WorldObject *obj)
|
||||
{
|
||||
assert(obj->GetMapId()==GetId() && obj->GetInstanceId()==GetInstanceId());
|
||||
assert(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId());
|
||||
|
||||
obj->CleanupsBeforeDelete(false); // remove or simplify at least cross referenced links
|
||||
|
||||
@@ -2227,7 +2227,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj)
|
||||
|
||||
void Map::AddObjectToSwitchList(WorldObject *obj, bool on)
|
||||
{
|
||||
assert(obj->GetMapId()==GetId() && obj->GetInstanceId()==GetInstanceId());
|
||||
assert(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId());
|
||||
|
||||
std::map<WorldObject*, bool>::iterator itr = i_objectsToSwitch.find(obj);
|
||||
if (itr == i_objectsToSwitch.end())
|
||||
@@ -2848,7 +2848,7 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O
|
||||
// prepare static data
|
||||
uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source
|
||||
uint64 targetGUID = target ? target->GetGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId()==TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
|
||||
|
||||
///- Schedule script execution for all scripts in the script map
|
||||
ScriptMap const *s2 = &(s->second);
|
||||
@@ -2883,7 +2883,7 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
|
||||
// prepare static data
|
||||
uint64 sourceGUID = source ? source->GetGUID() : (uint64)0;
|
||||
uint64 targetGUID = target ? target->GetGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId()==TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
|
||||
uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
|
||||
|
||||
ScriptAction sa;
|
||||
sa.sourceGUID = sourceGUID;
|
||||
@@ -2924,7 +2924,7 @@ void Map::ScriptsProcess()
|
||||
switch(GUID_HIPART(step.sourceGUID))
|
||||
{
|
||||
case HIGHGUID_ITEM:
|
||||
// case HIGHGUID_CONTAINER: ==HIGHGUID_ITEM
|
||||
// case HIGHGUID_CONTAINER: == HIGHGUID_ITEM
|
||||
{
|
||||
Player* player = HashMapHolder<Player>::Find(step.ownerGUID);
|
||||
if (player)
|
||||
@@ -3260,10 +3260,10 @@ void Map::ScriptsProcess()
|
||||
break;
|
||||
}
|
||||
|
||||
if (go->GetGoType()==GAMEOBJECT_TYPE_FISHINGNODE ||
|
||||
go->GetGoType()==GAMEOBJECT_TYPE_DOOR ||
|
||||
go->GetGoType()==GAMEOBJECT_TYPE_BUTTON ||
|
||||
go->GetGoType()==GAMEOBJECT_TYPE_TRAP)
|
||||
if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE ||
|
||||
go->GetGoType() == GAMEOBJECT_TYPE_DOOR ||
|
||||
go->GetGoType() == GAMEOBJECT_TYPE_BUTTON ||
|
||||
go->GetGoType() == GAMEOBJECT_TYPE_TRAP)
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT can not be used with gameobject of type %u (guid: %u).", uint32(go->GetGoType()), step.script->datalong);
|
||||
break;
|
||||
@@ -3329,7 +3329,7 @@ void Map::ScriptsProcess()
|
||||
|
||||
door->UseDoorOrButton(time_to_close);
|
||||
|
||||
if (target && target->isType(TYPEMASK_GAMEOBJECT) && ((GameObject*)target)->GetGoType()==GAMEOBJECT_TYPE_BUTTON)
|
||||
if (target && target->isType(TYPEMASK_GAMEOBJECT) && ((GameObject*)target)->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
|
||||
((GameObject*)target)->UseDoorOrButton(time_to_close);
|
||||
break;
|
||||
}
|
||||
@@ -3384,7 +3384,7 @@ void Map::ScriptsProcess()
|
||||
|
||||
door->UseDoorOrButton(time_to_open);
|
||||
|
||||
if (target && target->isType(TYPEMASK_GAMEOBJECT) && ((GameObject*)target)->GetGoType()==GAMEOBJECT_TYPE_BUTTON)
|
||||
if (target && target->isType(TYPEMASK_GAMEOBJECT) && ((GameObject*)target)->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
|
||||
((GameObject*)target)->UseDoorOrButton(time_to_open);
|
||||
|
||||
break;
|
||||
@@ -3438,7 +3438,7 @@ void Map::ScriptsProcess()
|
||||
|
||||
// quest id and flags checked at script loading
|
||||
if ((worldObject->GetTypeId()!=TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
|
||||
(step.script->datalong2==0 || worldObject->IsWithinDistInMap(player,float(step.script->datalong2))))
|
||||
(step.script->datalong2 == 0 || worldObject->IsWithinDistInMap(player,float(step.script->datalong2))))
|
||||
player->AreaExploredOrEventHappens(step.script->datalong);
|
||||
else
|
||||
player->FailQuest(step.script->datalong);
|
||||
|
||||
+1
-1
@@ -543,7 +543,7 @@ class Map : public GridRefManager<NGridType>, public Trinity::ObjectLevelLockabl
|
||||
ActiveNonPlayers::iterator itr = m_activeNonPlayers.find(obj);
|
||||
if (itr == m_activeNonPlayers.end())
|
||||
return;
|
||||
if (itr==m_activeNonPlayersIter)
|
||||
if (itr == m_activeNonPlayersIter)
|
||||
++m_activeNonPlayersIter;
|
||||
m_activeNonPlayers.erase(itr);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
|
||||
uint32 instance_map = corpse->GetMapId();
|
||||
do
|
||||
{
|
||||
if (instance_map==mapid)
|
||||
if (instance_map == mapid)
|
||||
break;
|
||||
|
||||
InstanceTemplate const* instance = objmgr.GetInstanceTemplate(instance_map);
|
||||
|
||||
@@ -561,7 +561,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, uin
|
||||
{
|
||||
if (friendGuid)
|
||||
{
|
||||
if (friendGuid==session->GetPlayer()->GetGUID())
|
||||
if (friendGuid == session->GetPlayer()->GetGUID())
|
||||
friendResult = FRIEND_SELF;
|
||||
else if (session->GetPlayer()->GetTeam() != team && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && session->GetSecurity() < SEC_MODERATOR)
|
||||
friendResult = FRIEND_ENEMY;
|
||||
@@ -643,7 +643,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult_AutoPtr result, uin
|
||||
|
||||
if (IgnoreGuid)
|
||||
{
|
||||
if (IgnoreGuid==session->GetPlayer()->GetGUID()) //not add yourself
|
||||
if (IgnoreGuid == session->GetPlayer()->GetGUID()) //not add yourself
|
||||
ignoreResult = FRIEND_IGNORE_SELF;
|
||||
else if (session->GetPlayer()->GetSocial()->HasIgnore(GUID_LOPART(IgnoreGuid)))
|
||||
ignoreResult = FRIEND_IGNORE_ALREADY;
|
||||
@@ -729,7 +729,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
|
||||
return;
|
||||
|
||||
// prevent resurrect before 30-sec delay after body release not finished
|
||||
if (corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType()==CORPSE_RESURRECTABLE_PVP) > time(NULL))
|
||||
if (corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP) > time(NULL))
|
||||
return;
|
||||
|
||||
if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
|
||||
|
||||
@@ -648,7 +648,7 @@ void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data)
|
||||
|
||||
void WorldSession::HandleEjectPasenger(WorldPacket &data)
|
||||
{
|
||||
if (data.GetOpcode()==CMSG_EJECT_PASSENGER)
|
||||
if (data.GetOpcode() == CMSG_EJECT_PASSENGER)
|
||||
{
|
||||
if (Vehicle* Vv= _player->GetVehicleKit())
|
||||
{
|
||||
|
||||
@@ -178,7 +178,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
|
||||
TrainerSpellState state = _player->GetTrainerSpellState(tSpell);
|
||||
|
||||
data << uint32(tSpell->spell); // learned spell (or cast-spell in profession case)
|
||||
data << uint8(state==TRAINER_SPELL_GREEN_DISABLED ? TRAINER_SPELL_GREEN : state);
|
||||
data << uint8(state == TRAINER_SPELL_GREEN_DISABLED ? TRAINER_SPELL_GREEN : state);
|
||||
data << uint32(floor(tSpell->spellCost * fDiscountMod));
|
||||
|
||||
data << uint32(primary_prof_first_rank && can_learn_primary_prof ? 1 : 0);
|
||||
@@ -545,7 +545,7 @@ void WorldSession::SendStablePet(uint64 guid)
|
||||
uint8 num = 0; // counter for place holder
|
||||
|
||||
// not let move dead pet in slot
|
||||
if (pet && pet->isAlive() && pet->getPetType()==HUNTER_PET)
|
||||
if (pet && pet->isAlive() && pet->getPetType() == HUNTER_PET)
|
||||
{
|
||||
data << uint32(pet->GetCharmInfo()->GetPetNumber());
|
||||
data << uint32(pet->GetEntry());
|
||||
|
||||
+7
-7
@@ -53,7 +53,7 @@ uint32 GuidHigh2TypeId(uint32 guid_hi)
|
||||
switch(guid_hi)
|
||||
{
|
||||
case HIGHGUID_ITEM: return TYPEID_ITEM;
|
||||
//case HIGHGUID_CONTAINER: return TYPEID_CONTAINER; HIGHGUID_CONTAINER==HIGHGUID_ITEM currently
|
||||
//case HIGHGUID_CONTAINER: return TYPEID_CONTAINER; HIGHGUID_CONTAINER == HIGHGUID_ITEM currently
|
||||
case HIGHGUID_UNIT: return TYPEID_UNIT;
|
||||
case HIGHGUID_PET: return TYPEID_UNIT;
|
||||
case HIGHGUID_PLAYER: return TYPEID_PLAYER;
|
||||
@@ -1584,7 +1584,7 @@ void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 Target
|
||||
|
||||
Map::PlayerList const& pList = GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
if (itr->getSource()->GetZoneId()==zoneid)
|
||||
if (itr->getSource()->GetZoneId() == zoneid)
|
||||
say_do(itr->getSource());
|
||||
}
|
||||
|
||||
@@ -1823,7 +1823,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr!=auraClassScripts.end();)
|
||||
{
|
||||
if ((*itr)->GetMiscValue()==2228)
|
||||
if ((*itr)->GetMiscValue() == 2228)
|
||||
{
|
||||
RemoveAurasDueToSpell((*itr)->GetId());
|
||||
itr = auraClassScripts.begin();
|
||||
@@ -1838,7 +1838,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// petentry==0 for hunter "call pet" (current pet summoned if any)
|
||||
// petentry == 0 for hunter "call pet" (current pet summoned if any)
|
||||
if (!entry)
|
||||
{
|
||||
delete pet;
|
||||
@@ -1904,7 +1904,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
Unit::AuraEffectList const& auraClassScripts = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr!=auraClassScripts.end();)
|
||||
{
|
||||
if ((*itr)->GetMiscValue()==2228)
|
||||
if ((*itr)->GetMiscValue() == 2228)
|
||||
{
|
||||
RemoveAurasDueToSpell((*itr)->GetId());
|
||||
itr = auraClassScripts.begin();
|
||||
@@ -2030,7 +2030,7 @@ namespace Trinity
|
||||
void operator()(Creature* c) const
|
||||
{
|
||||
// skip self or target
|
||||
if (c==i_searcher || c==&i_object)
|
||||
if (c == i_searcher || c == &i_object)
|
||||
return;
|
||||
|
||||
float x,y,z;
|
||||
@@ -2049,7 +2049,7 @@ namespace Trinity
|
||||
void operator()(T* u) const
|
||||
{
|
||||
// skip self or target
|
||||
if (u==i_searcher || u==&i_object)
|
||||
if (u == i_searcher || u == &i_object)
|
||||
return;
|
||||
|
||||
float x,y;
|
||||
|
||||
+44
-44
@@ -939,7 +939,7 @@ void ObjectMgr::LoadCreatureAddons()
|
||||
// check entry ids
|
||||
for (uint32 i = 1; i < sCreatureDataAddonStorage.MaxEntry; ++i)
|
||||
if (CreatureDataAddon const* addon = sCreatureDataAddonStorage.LookupEntry<CreatureDataAddon>(i))
|
||||
if (mCreatureDataMap.find(addon->guidOrEntry)==mCreatureDataMap.end())
|
||||
if (mCreatureDataMap.find(addon->guidOrEntry) == mCreatureDataMap.end())
|
||||
sLog.outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`",addon->guidOrEntry);
|
||||
}
|
||||
|
||||
@@ -1336,7 +1336,7 @@ void ObjectMgr::LoadCreatures()
|
||||
}
|
||||
}
|
||||
|
||||
if (data.phaseMask==0)
|
||||
if (data.phaseMask == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id);
|
||||
data.phaseMask = 1;
|
||||
@@ -1356,7 +1356,7 @@ void ObjectMgr::LoadCreatures()
|
||||
gameeventmgr.mGameEventCreatureGuids[51+50].push_back(guid2);
|
||||
}*/
|
||||
|
||||
if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system
|
||||
if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system
|
||||
AddCreatureToGrid(guid, &data);
|
||||
|
||||
++count;
|
||||
@@ -1623,7 +1623,7 @@ void ObjectMgr::LoadGameobjects()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data.spawntimesecs==0 && gInfo->IsDespawnAtAction())
|
||||
if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction())
|
||||
{
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but gameobejct marked as despawnable at action.",guid,data.id);
|
||||
}
|
||||
@@ -1666,13 +1666,13 @@ void ObjectMgr::LoadGameobjects()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data.phaseMask==0)
|
||||
if (data.phaseMask == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `gameobject` have gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id);
|
||||
data.phaseMask = 1;
|
||||
}
|
||||
|
||||
if (gameEvent==0 && PoolId==0) // if not this is to be managed by GameEvent System or Pool system
|
||||
if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system
|
||||
AddGameobjectToGrid(guid, &data);
|
||||
++count;
|
||||
|
||||
@@ -2183,7 +2183,7 @@ void ObjectMgr::LoadItemPrototypes()
|
||||
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
||||
}
|
||||
// allowed only in special format
|
||||
else if ((proto->Spells[1].SpellId==483) || (proto->Spells[1].SpellId == 55884))
|
||||
else if ((proto->Spells[1].SpellId == 483) || (proto->Spells[1].SpellId == 55884))
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%u)",i,1+1,proto->Spells[1].SpellId);
|
||||
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
||||
@@ -2283,7 +2283,7 @@ void ObjectMgr::LoadItemPrototypes()
|
||||
for (uint32 j = 0; j < sizeof(proto->BagFamily)*8; ++j)
|
||||
{
|
||||
uint32 mask = 1 << j;
|
||||
if ((proto->BagFamily & mask)==0)
|
||||
if ((proto->BagFamily & mask) == 0)
|
||||
continue;
|
||||
|
||||
ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(j+1);
|
||||
@@ -2569,7 +2569,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
|
||||
PetLevelInfo*& pInfoMapEntry = petInfo[creature_id];
|
||||
|
||||
if (pInfoMapEntry==NULL)
|
||||
if (pInfoMapEntry == NULL)
|
||||
pInfoMapEntry = new PetLevelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
|
||||
// data for level 1 stored in [0] array element, ...
|
||||
@@ -2773,7 +2773,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
|
||||
if (!amount)
|
||||
{
|
||||
sLog.outErrorDb("Item id %u (class %u race %u) have amount==0 in `playercreateinfo_item` table, ignoring.",item_id,current_race,current_class);
|
||||
sLog.outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.",item_id,current_race,current_class);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3196,7 +3196,7 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, Play
|
||||
return;
|
||||
|
||||
PlayerInfo const* pInfo = &playerInfo[race][class_];
|
||||
if (pInfo->displayId_m==0 || pInfo->displayId_f==0)
|
||||
if (pInfo->displayId_m == 0 || pInfo->displayId_f == 0)
|
||||
return;
|
||||
|
||||
if (level <= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
@@ -3849,7 +3849,7 @@ void ObjectMgr::LoadQuests()
|
||||
qinfo->GetQuestId(),qinfo->SrcItemId,qinfo->SrcItemId);
|
||||
qinfo->SrcItemId = 0; // quest can't be done for this requirement
|
||||
}
|
||||
else if (qinfo->SrcItemCount==0)
|
||||
else if (qinfo->SrcItemCount == 0)
|
||||
{
|
||||
sLog.outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.",
|
||||
qinfo->GetQuestId(),qinfo->SrcItemId);
|
||||
@@ -3885,7 +3885,7 @@ void ObjectMgr::LoadQuests()
|
||||
uint32 id = qinfo->ReqItemId[j];
|
||||
if (id)
|
||||
{
|
||||
if (qinfo->ReqItemCount[j]==0)
|
||||
if (qinfo->ReqItemCount[j] == 0)
|
||||
{
|
||||
sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.",
|
||||
qinfo->GetQuestId(),j+1,id,j+1);
|
||||
@@ -4439,7 +4439,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||
sLog.outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.datalong,tmp.id);
|
||||
continue;
|
||||
}
|
||||
if (tmp.dataint==0)
|
||||
if (tmp.dataint == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.dataint,tmp.id);
|
||||
continue;
|
||||
@@ -4522,11 +4522,11 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (info->type==GAMEOBJECT_TYPE_FISHINGNODE ||
|
||||
info->type==GAMEOBJECT_TYPE_FISHINGHOLE ||
|
||||
info->type==GAMEOBJECT_TYPE_DOOR ||
|
||||
info->type==GAMEOBJECT_TYPE_BUTTON ||
|
||||
info->type==GAMEOBJECT_TYPE_TRAP)
|
||||
if (info->type == GAMEOBJECT_TYPE_FISHINGNODE ||
|
||||
info->type == GAMEOBJECT_TYPE_FISHINGHOLE ||
|
||||
info->type == GAMEOBJECT_TYPE_DOOR ||
|
||||
info->type == GAMEOBJECT_TYPE_BUTTON ||
|
||||
info->type == GAMEOBJECT_TYPE_TRAP)
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",tablename,info->id,tmp.id);
|
||||
continue;
|
||||
@@ -4539,20 +4539,20 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||
GameObjectData const* data = GetGOData(tmp.datalong);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",tablename,tmp.datalong,(tmp.command==SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id);
|
||||
sLog.outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",tablename,tmp.datalong,(tmp.command == SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id);
|
||||
continue;
|
||||
}
|
||||
|
||||
GameObjectInfo const* info = GetGameObjectInfo(data->id);
|
||||
if (!info)
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",tablename,tmp.datalong,data->id,(tmp.command==SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id);
|
||||
sLog.outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",tablename,tmp.datalong,data->id,(tmp.command == SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (info->type!=GAMEOBJECT_TYPE_DOOR)
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u",tablename,info->id,(tmp.command==SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id);
|
||||
sLog.outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u",tablename,info->id,(tmp.command == SCRIPT_COMMAND_OPEN_DOOR ? "SCRIPT_COMMAND_OPEN_DOOR" : "SCRIPT_COMMAND_CLOSE_DOOR"),tmp.id);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -5347,7 +5347,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
|
||||
uint32 submask = 1<<((i-1)%32);
|
||||
|
||||
// skip not taxi network nodes
|
||||
if ((sTaxiNodesMask[field] & submask)==0)
|
||||
if ((sTaxiNodesMask[field] & submask) == 0)
|
||||
continue;
|
||||
|
||||
float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z);
|
||||
@@ -5373,7 +5373,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
|
||||
void ObjectMgr::GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uint32 &cost)
|
||||
{
|
||||
TaxiPathSetBySource::iterator src_i = sTaxiPathSetBySource.find(source);
|
||||
if (src_i==sTaxiPathSetBySource.end())
|
||||
if (src_i == sTaxiPathSetBySource.end())
|
||||
{
|
||||
path = 0;
|
||||
cost = 0;
|
||||
@@ -5383,7 +5383,7 @@ void ObjectMgr::GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uin
|
||||
TaxiPathSetForSource& pathSet = src_i->second;
|
||||
|
||||
TaxiPathSetForSource::iterator dest_i = pathSet.find(destination);
|
||||
if (dest_i==pathSet.end())
|
||||
if (dest_i == pathSet.end())
|
||||
{
|
||||
path = 0;
|
||||
cost = 0;
|
||||
@@ -5556,7 +5556,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
|
||||
MapEntry const* map = sMapStore.LookupEntry(MapId);
|
||||
// not need to check validity of map object; MapId _MUST_ be valid here
|
||||
|
||||
if (graveLow==graveUp && !map->IsBattleArena())
|
||||
if (graveLow == graveUp && !map->IsBattleArena())
|
||||
{
|
||||
//sLog.outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team);
|
||||
return NULL;
|
||||
@@ -5662,7 +5662,7 @@ GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId)
|
||||
|
||||
for (GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr)
|
||||
{
|
||||
if (itr->second.safeLocId==id)
|
||||
if (itr->second.safeLocId == id)
|
||||
return &itr->second;
|
||||
}
|
||||
|
||||
@@ -5695,7 +5695,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
|
||||
{
|
||||
GraveYardMap::iterator graveLow = mGraveYardMap.lower_bound(zoneId);
|
||||
GraveYardMap::iterator graveUp = mGraveYardMap.upper_bound(zoneId);
|
||||
if (graveLow==graveUp)
|
||||
if (graveLow == graveUp)
|
||||
{
|
||||
//sLog.outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team);
|
||||
return;
|
||||
@@ -5793,7 +5793,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (at.target_X==0 && at.target_Y==0 && at.target_Z==0)
|
||||
if (at.target_X == 0 && at.target_Y == 0 && at.target_Z == 0)
|
||||
{
|
||||
sLog.outErrorDb("Area trigger (ID:%u) target coordinates not provided.",Trigger_ID);
|
||||
continue;
|
||||
@@ -7015,7 +7015,7 @@ void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance)
|
||||
next = itr;
|
||||
++next;
|
||||
|
||||
if (GUID_HIPART(itr->first)==instance)
|
||||
if (GUID_HIPART(itr->first) == instance)
|
||||
mGORespawnTimes.erase(itr);
|
||||
}
|
||||
|
||||
@@ -7024,7 +7024,7 @@ void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance)
|
||||
next = itr;
|
||||
++next;
|
||||
|
||||
if (GUID_HIPART(itr->first)==instance)
|
||||
if (GUID_HIPART(itr->first) == instance)
|
||||
mCreatureRespawnTimes.erase(itr);
|
||||
}
|
||||
|
||||
@@ -7250,7 +7250,7 @@ static LanguageType GetRealmLanguageType(bool create)
|
||||
|
||||
bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bool create = false)
|
||||
{
|
||||
if (strictMask==0) // any language, ignore realm
|
||||
if (strictMask == 0) // any language, ignore realm
|
||||
{
|
||||
if (isExtendedLatinString(wstr,numericOrSpace))
|
||||
return true;
|
||||
@@ -7344,11 +7344,11 @@ PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name)
|
||||
|
||||
int ObjectMgr::GetIndexForLocale(LocaleConstant loc)
|
||||
{
|
||||
if (loc==LOCALE_enUS)
|
||||
if (loc == LOCALE_enUS)
|
||||
return -1;
|
||||
|
||||
for (size_t i=0; i < m_LocalForIndex.size(); ++i)
|
||||
if (m_LocalForIndex[i]==loc)
|
||||
if (m_LocalForIndex[i] == loc)
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
@@ -7364,11 +7364,11 @@ LocaleConstant ObjectMgr::GetLocaleForIndex(int i)
|
||||
|
||||
int ObjectMgr::GetOrNewIndexForLocale(LocaleConstant loc)
|
||||
{
|
||||
if (loc==LOCALE_enUS)
|
||||
if (loc == LOCALE_enUS)
|
||||
return -1;
|
||||
|
||||
for (size_t i=0; i < m_LocalForIndex.size(); ++i)
|
||||
if (m_LocalForIndex[i]==loc)
|
||||
if (m_LocalForIndex[i] == loc)
|
||||
return i;
|
||||
|
||||
m_LocalForIndex.push_back(loc);
|
||||
@@ -7495,7 +7495,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi
|
||||
|
||||
int32 entry = fields[0].GetInt32();
|
||||
|
||||
if (entry==0)
|
||||
if (entry == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` contain reserved entry 0, ignored.",table);
|
||||
continue;
|
||||
@@ -7549,7 +7549,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi
|
||||
|
||||
const char *ObjectMgr::GetTrinityString(int32 entry, int locale_idx) const
|
||||
{
|
||||
// locale_idx==-1 -> default, locale_idx >= 0 in to idx+1
|
||||
// locale_idx == -1 -> default, locale_idx >= 0 in to idx+1
|
||||
// Content[0] always exist if exist TrinityStringLocale
|
||||
if (TrinityStringLocale const *msl = GetTrinityStringLocale(entry))
|
||||
{
|
||||
@@ -7752,7 +7752,7 @@ bool PlayerCondition::Meets(Player const * player) const
|
||||
{
|
||||
Unit::AuraApplicationMap const& auras = player->GetAppliedAuras();
|
||||
for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
if ((itr->second->GetBase()->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetBase()->GetSpellProto()->SpellVisual[0]==3580)
|
||||
if ((itr->second->GetBase()->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetBase()->GetSpellProto()->SpellVisual[0] == 3580)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -8180,7 +8180,7 @@ bool ObjectMgr::AddSpellToTrainer(int32 entry, int32 spell, Field *fields, std::
|
||||
|
||||
if (GetTalentSpellCost(spell))
|
||||
{
|
||||
if (talentIds->count(spell)==0)
|
||||
if (talentIds->count(spell) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Table `npc_trainer` has talent as learning spell %u, ignore", spell);
|
||||
talentIds->insert(spell);
|
||||
@@ -8700,7 +8700,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
|
||||
if (!((cInfo->npcflag | ORnpcflag) & UNIT_NPC_FLAG_VENDOR))
|
||||
{
|
||||
if (!skip_vendors || skip_vendors->count(vendor_entry)==0)
|
||||
if (!skip_vendors || skip_vendors->count(vendor_entry) == 0)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
|
||||
@@ -8734,15 +8734,15 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
|
||||
if (maxcount > 0 && incrtime == 0)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage("MaxCount!=0 (%u) but IncrTime==0", maxcount);
|
||||
ChatHandler(pl).PSendSysMessage("MaxCount!=0 (%u) but IncrTime == 0", maxcount);
|
||||
else
|
||||
sLog.outErrorDb("Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
|
||||
return false;
|
||||
}
|
||||
else if (maxcount==0 && incrtime > 0)
|
||||
else if (maxcount == 0 && incrtime > 0)
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage("MaxCount==0 but IncrTime<>=0");
|
||||
ChatHandler(pl).PSendSysMessage("MaxCount == 0 but IncrTime<>=0");
|
||||
else
|
||||
sLog.outErrorDb("Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
|
||||
return false;
|
||||
|
||||
+13
-13
@@ -489,7 +489,7 @@ class ObjectMgr
|
||||
if (race >= MAX_RACES) return NULL;
|
||||
if (class_ >= MAX_CLASSES) return NULL;
|
||||
PlayerInfo const* info = &playerInfo[race][class_];
|
||||
if (info->displayId_m==0 || info->displayId_f==0) return NULL;
|
||||
if (info->displayId_m == 0 || info->displayId_f == 0) return NULL;
|
||||
return info;
|
||||
}
|
||||
void GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const;
|
||||
@@ -763,7 +763,7 @@ class ObjectMgr
|
||||
CreatureData const* GetCreatureData(uint32 guid) const
|
||||
{
|
||||
CreatureDataMap::const_iterator itr = mCreatureDataMap.find(guid);
|
||||
if (itr==mCreatureDataMap.end()) return NULL;
|
||||
if (itr == mCreatureDataMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
CreatureData& NewOrExistCreatureData(uint32 guid) { return mCreatureDataMap[guid]; }
|
||||
@@ -777,49 +777,49 @@ class ObjectMgr
|
||||
CreatureLocale const* GetCreatureLocale(uint32 entry) const
|
||||
{
|
||||
CreatureLocaleMap::const_iterator itr = mCreatureLocaleMap.find(entry);
|
||||
if (itr==mCreatureLocaleMap.end()) return NULL;
|
||||
if (itr == mCreatureLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
GameObjectLocale const* GetGameObjectLocale(uint32 entry) const
|
||||
{
|
||||
GameObjectLocaleMap::const_iterator itr = mGameObjectLocaleMap.find(entry);
|
||||
if (itr==mGameObjectLocaleMap.end()) return NULL;
|
||||
if (itr == mGameObjectLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
ItemLocale const* GetItemLocale(uint32 entry) const
|
||||
{
|
||||
ItemLocaleMap::const_iterator itr = mItemLocaleMap.find(entry);
|
||||
if (itr==mItemLocaleMap.end()) return NULL;
|
||||
if (itr == mItemLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestLocale const* GetQuestLocale(uint32 entry) const
|
||||
{
|
||||
QuestLocaleMap::const_iterator itr = mQuestLocaleMap.find(entry);
|
||||
if (itr==mQuestLocaleMap.end()) return NULL;
|
||||
if (itr == mQuestLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
NpcTextLocale const* GetNpcTextLocale(uint32 entry) const
|
||||
{
|
||||
NpcTextLocaleMap::const_iterator itr = mNpcTextLocaleMap.find(entry);
|
||||
if (itr==mNpcTextLocaleMap.end()) return NULL;
|
||||
if (itr == mNpcTextLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
PageTextLocale const* GetPageTextLocale(uint32 entry) const
|
||||
{
|
||||
PageTextLocaleMap::const_iterator itr = mPageTextLocaleMap.find(entry);
|
||||
if (itr==mPageTextLocaleMap.end()) return NULL;
|
||||
if (itr == mPageTextLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
GossipMenuItemsLocale const* GetGossipMenuItemsLocale(uint32 entry) const
|
||||
{
|
||||
GossipMenuItemsLocaleMap::const_iterator itr = mGossipMenuItemsLocaleMap.find(entry);
|
||||
if (itr==mGossipMenuItemsLocaleMap.end()) return NULL;
|
||||
if (itr == mGossipMenuItemsLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const
|
||||
{
|
||||
PointOfInterestLocaleMap::const_iterator itr = mPointOfInterestLocaleMap.find(poi_id);
|
||||
if (itr==mPointOfInterestLocaleMap.end()) return NULL;
|
||||
if (itr == mPointOfInterestLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
|
||||
@@ -835,7 +835,7 @@ class ObjectMgr
|
||||
GameObjectData const* GetGOData(uint32 guid) const
|
||||
{
|
||||
GameObjectDataMap::const_iterator itr = mGameObjectDataMap.find(guid);
|
||||
if (itr==mGameObjectDataMap.end()) return NULL;
|
||||
if (itr == mGameObjectDataMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
GameObjectData& NewGOData(uint32 guid) { return mGameObjectDataMap[guid]; }
|
||||
@@ -844,7 +844,7 @@ class ObjectMgr
|
||||
TrinityStringLocale const* GetTrinityStringLocale(int32 entry) const
|
||||
{
|
||||
TrinityStringLocaleMap::const_iterator itr = mTrinityStringLocaleMap.find(entry);
|
||||
if (itr==mTrinityStringLocaleMap.end()) return NULL;
|
||||
if (itr == mTrinityStringLocaleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
const char *GetTrinityString(int32 entry, int locale_idx) const;
|
||||
@@ -901,7 +901,7 @@ class ObjectMgr
|
||||
GameTele const* GetGameTele(uint32 id) const
|
||||
{
|
||||
GameTeleMap::const_iterator itr = m_GameTeleMap.find(id);
|
||||
if (itr==m_GameTeleMap.end()) return NULL;
|
||||
if (itr == m_GameTeleMap.end()) return NULL;
|
||||
return &itr->second;
|
||||
}
|
||||
GameTele const* GetGameTele(const std::string& name) const;
|
||||
|
||||
+3
-3
@@ -904,7 +904,7 @@ enum Opcodes
|
||||
SMSG_LFG_PROPOSAL_DECLINED = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for (uint8) {uint32,uint8,uint8,uint8,uint8}
|
||||
CMSG_LFG_PROPOSAL_RESULT = 0x362, // CMSG AcceptProposal, RejectProposal
|
||||
SMSG_LFG_ROLE_CHECK = 0x363, // SMSG uint32, uint8, for (uint8) uint32, uint8, for (uint8) { uint64, uint8, uint32, uint8, }
|
||||
SMSG_LFG_ROLE_CHECK_FAILED_RESULT = 0x364, // SMSG uint32 unk, uint32, if (unk==6) { uint8 count, for (count) uint64 }
|
||||
SMSG_LFG_ROLE_CHECK_FAILED_RESULT = 0x364, // SMSG uint32 unk, uint32, if (unk == 6) { uint8 count, for (count) uint64 }
|
||||
SMSG_LFG_QUEUE_STATUS_UPDATE = 0x365, // SMSG uint32 dungeon, uint32 lfgtype, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8
|
||||
CMSG_SET_LFG_COMMENT = 0x366, // CMSG SetLFGComment
|
||||
SMSG_LFG_LFG_PROPOSAL_INFO = 0x367, // SMSG uint8, if (uint8) { uint8, uint8, uint8, uint8, if (uint8) for (uint8) uint32, string}
|
||||
@@ -1329,10 +1329,10 @@ enum Opcodes
|
||||
/// Player state
|
||||
enum SessionStatus
|
||||
{
|
||||
STATUS_AUTHED = 0, ///< Player authenticated (_player==NULL, m_playerRecentlyLogout = false or will be reset before handler call, m_GUID have garbage)
|
||||
STATUS_AUTHED = 0, ///< Player authenticated (_player == NULL, m_playerRecentlyLogout = false or will be reset before handler call, m_GUID have garbage)
|
||||
STATUS_LOGGEDIN, ///< Player in game (_player!=NULL, m_GUID == _player->GetGUID(), inWorld())
|
||||
STATUS_TRANSFER, ///< Player transferring to another map (_player!=NULL, m_GUID == _player->GetGUID(), !inWorld())
|
||||
STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, ///< _player!= NULL or _player==NULL && m_playerRecentlyLogout, m_GUID store last _player guid)
|
||||
STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, ///< _player!= NULL or _player == NULL && m_playerRecentlyLogout, m_GUID store last _player guid)
|
||||
STATUS_NEVER ///< Opcode not accepted from client (deprecated or server side only)
|
||||
};
|
||||
|
||||
|
||||
+8
-8
@@ -153,7 +153,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
return false;
|
||||
|
||||
PetType pet_type = PetType(fields[18].GetUInt8());
|
||||
if (pet_type==HUNTER_PET)
|
||||
if (pet_type == HUNTER_PET)
|
||||
{
|
||||
CreatureInfo const* creatureInfo = objmgr.GetCreatureTemplate(petentry);
|
||||
if (!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets()))
|
||||
@@ -368,7 +368,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
pOwner->GetTemporaryUnsummonedPetNumber() != m_charmInfo->GetPetNumber())
|
||||
{
|
||||
// pet will lost anyway at restore temporary unsummoned
|
||||
if (getPetType()==HUNTER_PET)
|
||||
if (getPetType() == HUNTER_PET)
|
||||
return;
|
||||
|
||||
// for warlock case
|
||||
@@ -404,7 +404,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
PET_SAVE_NOT_IN_SLOT, owner, uint32(mode));
|
||||
|
||||
// prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT
|
||||
if (getPetType()==HUNTER_PET && (mode==PET_SAVE_AS_CURRENT||mode > PET_SAVE_LAST_STABLE_SLOT))
|
||||
if (getPetType() == HUNTER_PET && (mode == PET_SAVE_AS_CURRENT||mode > PET_SAVE_LAST_STABLE_SLOT))
|
||||
CharacterDatabase.PExecute("DELETE FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u')",
|
||||
owner,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT);
|
||||
// save pet
|
||||
@@ -461,7 +461,7 @@ void Pet::DeleteFromDB(uint32 guidlow)
|
||||
void Pet::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState and Unit::setDeathState
|
||||
{
|
||||
Creature::setDeathState(s);
|
||||
if (getDeathState()==CORPSE)
|
||||
if (getDeathState() == CORPSE)
|
||||
{
|
||||
if (getPetType() == HUNTER_PET)
|
||||
{
|
||||
@@ -477,7 +477,7 @@ void Pet::setDeathState(DeathState s) // overwrite virtual
|
||||
//SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
}
|
||||
}
|
||||
else if (getDeathState()==ALIVE)
|
||||
else if (getDeathState() == ALIVE)
|
||||
{
|
||||
//RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
CastPetAuras(true);
|
||||
@@ -519,7 +519,7 @@ void Pet::Update(uint32 diff)
|
||||
if (owner->GetPetGUID() != GetGUID())
|
||||
{
|
||||
sLog.outError("Pet %u is not pet of owner %u, removed", GetEntry(), m_owner->GetName());
|
||||
Remove(getPetType()==HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
|
||||
Remove(getPetType() == HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -833,7 +833,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
|
||||
//scale
|
||||
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family);
|
||||
if (cFamily && cFamily->minScale > 0.0f && petType==HUNTER_PET)
|
||||
if (cFamily && cFamily->minScale > 0.0f && petType == HUNTER_PET)
|
||||
{
|
||||
float scale;
|
||||
if (getLevel() >= cFamily->maxScaleLevel)
|
||||
@@ -1348,7 +1348,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
|
||||
{
|
||||
// skip learning spell and no rank spell case
|
||||
uint32 rankSpellId = talentInfo->RankID[i];
|
||||
if (!rankSpellId || rankSpellId==spell_id)
|
||||
if (!rankSpellId || rankSpellId == spell_id)
|
||||
continue;
|
||||
|
||||
// skip unknown ranks
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ class Pet : public Guardian
|
||||
|
||||
PetType getPetType() const { return m_petType; }
|
||||
void setPetType(PetType type) { m_petType = type; }
|
||||
bool isControlled() const { return getPetType()==SUMMON_PET || getPetType()==HUNTER_PET; }
|
||||
bool isControlled() const { return getPetType() == SUMMON_PET || getPetType() == HUNTER_PET; }
|
||||
bool isTemporarySummoned() const { return m_duration > 0; }
|
||||
|
||||
bool IsPermanentPetFor(Player* owner); // pet have tab in character windows and set UNIT_FIELD_PETNUMBER
|
||||
|
||||
@@ -430,7 +430,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
// in the normal case, command and reaction buttons can only be moved, not removed
|
||||
// at moving count ==2, at removing count == 1
|
||||
// at moving count == 2, at removing count == 1
|
||||
// ignore attempt to remove command|reaction buttons (not possible at normal case)
|
||||
if (act_state == ACT_COMMAND || act_state == ACT_REACTION)
|
||||
{
|
||||
|
||||
@@ -256,12 +256,12 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data)
|
||||
uint32 type = fields[0].GetUInt32();
|
||||
|
||||
// if guild petition and has guild => error, return;
|
||||
if (type==9 && _player->GetGuildId())
|
||||
if (type == 9 && _player->GetGuildId())
|
||||
return;
|
||||
|
||||
result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", petitionguid_low);
|
||||
|
||||
// result==NULL also correct in case no sign yet
|
||||
// result == NULL also correct in case no sign yet
|
||||
if (result)
|
||||
signs = result->GetRowCount();
|
||||
|
||||
@@ -662,7 +662,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
|
||||
// result==NULL also correct charter without signs
|
||||
// result == NULL also correct charter without signs
|
||||
if (result)
|
||||
signs = result->GetRowCount();
|
||||
|
||||
|
||||
+113
-113
@@ -134,7 +134,7 @@ enum CharacterCustomizeFlags
|
||||
|
||||
static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 };
|
||||
|
||||
//== PlayerTaxi ================================================
|
||||
// == PlayerTaxi ================================================
|
||||
|
||||
PlayerTaxi::PlayerTaxi()
|
||||
{
|
||||
@@ -280,7 +280,7 @@ std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi)
|
||||
return ss;
|
||||
}
|
||||
|
||||
//== Player ====================================================
|
||||
// == Player ====================================================
|
||||
|
||||
UpdateMask Player::updateVisualBits;
|
||||
|
||||
@@ -711,7 +711,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||
// apply original stats mods before spell loading or item equipment that call before equip _RemoveStatsMods()
|
||||
UpdateMaxHealth(); // Update max Health (for add bonus from stamina)
|
||||
SetHealth(GetMaxHealth());
|
||||
if (getPowerType()==POWER_MANA)
|
||||
if (getPowerType() == POWER_MANA)
|
||||
{
|
||||
UpdateMaxPower(POWER_MANA); // Update max Mana (for add bonus from intellect)
|
||||
SetPower(POWER_MANA,GetMaxPower(POWER_MANA));
|
||||
@@ -764,12 +764,12 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||
uint32 count = iProto->BuyCount;
|
||||
|
||||
// special amount for food/drink
|
||||
if (iProto->Class==ITEM_CLASS_CONSUMABLE && iProto->SubClass==ITEM_SUBCLASS_FOOD)
|
||||
if (iProto->Class == ITEM_CLASS_CONSUMABLE && iProto->SubClass == ITEM_SUBCLASS_FOOD)
|
||||
{
|
||||
switch(iProto->Spells[0].SpellCategory)
|
||||
{
|
||||
case SPELL_CATEGORY_FOOD: // food
|
||||
count = getClass()==CLASS_DEATH_KNIGHT ? 10 : 4;
|
||||
count = getClass() == CLASS_DEATH_KNIGHT ? 10 : 4;
|
||||
break;
|
||||
case SPELL_CATEGORY_DRINK: // drink
|
||||
count = 2;
|
||||
@@ -779,7 +779,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
||||
count = iProto->Stackable;
|
||||
}
|
||||
// special amount for daggers
|
||||
else if (iProto->Class==ITEM_CLASS_WEAPON && iProto->SubClass==ITEM_SUBCLASS_WEAPON_DAGGER)
|
||||
else if (iProto->Class == ITEM_CLASS_WEAPON && iProto->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER)
|
||||
{
|
||||
count = 2; // will placed to 2 slots
|
||||
}
|
||||
@@ -919,7 +919,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
|
||||
|
||||
if (!isAlive())
|
||||
{
|
||||
if (type==DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
|
||||
if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
|
||||
{
|
||||
DEBUG_LOG("We are fall to death, loosing 10 percents durability");
|
||||
DurabilityLossAll(0.10f,false);
|
||||
@@ -2319,7 +2319,7 @@ bool Player::IsUnderWater() const
|
||||
|
||||
void Player::SetInWater(bool apply)
|
||||
{
|
||||
if (m_isInWater==apply)
|
||||
if (m_isInWater == apply)
|
||||
return;
|
||||
|
||||
//define player in water by opcodes
|
||||
@@ -2417,13 +2417,13 @@ bool Player::IsGroupVisibleFor(Player* p) const
|
||||
{
|
||||
default: return IsInSameGroupWith(p);
|
||||
case 1: return IsInSameRaidWith(p);
|
||||
case 2: return GetTeam()==p->GetTeam();
|
||||
case 2: return GetTeam() == p->GetTeam();
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::IsInSameGroupWith(Player const* p) const
|
||||
{
|
||||
return (p==this || (GetGroup() != NULL &&
|
||||
return (p == this || (GetGroup() != NULL &&
|
||||
GetGroup() == p->GetGroup() &&
|
||||
GetGroup()->SameSubGroup((Player*)this, (Player*)p)));
|
||||
}
|
||||
@@ -3319,7 +3319,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
||||
|
||||
if (_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
|
||||
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
|
||||
((pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0))
|
||||
((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0))
|
||||
{
|
||||
switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask!=0))
|
||||
{
|
||||
@@ -3560,7 +3560,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
||||
((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0))
|
||||
{
|
||||
// not reset skills for professions and racial abilities
|
||||
if ((pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) &&
|
||||
if ((pSkill->categoryId == SKILL_CATEGORY_SECONDARY || pSkill->categoryId == SKILL_CATEGORY_PROFESSION) &&
|
||||
(IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask!=0))
|
||||
continue;
|
||||
|
||||
@@ -3887,7 +3887,7 @@ bool Player::resetTalents(bool no_cost)
|
||||
/* when prev line will dropped use next line
|
||||
if (Pet* pet = GetPet())
|
||||
{
|
||||
if (pet->getPetType()==HUNTER_PET && !pet->GetCreatureInfo()->isTameable(CanTameExoticPets()))
|
||||
if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureInfo()->isTameable(CanTameExoticPets()))
|
||||
RemovePet(NULL,PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
*/
|
||||
@@ -4784,12 +4784,12 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
|
||||
|
||||
costs = uint32(costs * discountMod) * sWorld.getRate(RATE_REPAIRCOST);
|
||||
|
||||
if (costs==0) //fix for ITEM_QUALITY_ARTIFACT
|
||||
if (costs == 0) //fix for ITEM_QUALITY_ARTIFACT
|
||||
costs = 1;
|
||||
|
||||
if (guildBank)
|
||||
{
|
||||
if (GetGuildId()==0)
|
||||
if (GetGuildId() == 0)
|
||||
{
|
||||
DEBUG_LOG("You are not member of a guild");
|
||||
return TotalCost;
|
||||
@@ -5409,7 +5409,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
|
||||
|
||||
// Alchemy Discoveries here
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellid);
|
||||
if (spellEntry && spellEntry->Mechanic==MECHANIC_DISCOVERY)
|
||||
if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY)
|
||||
{
|
||||
if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this))
|
||||
learnSpell(discoveredSpell,false);
|
||||
@@ -5442,12 +5442,12 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
|
||||
case SKILL_INSCRIPTION:
|
||||
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
||||
case SKILL_SKINNING:
|
||||
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)==0)
|
||||
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0)
|
||||
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
||||
else
|
||||
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain);
|
||||
case SKILL_MINING:
|
||||
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)==0)
|
||||
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0)
|
||||
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
||||
else
|
||||
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain);
|
||||
@@ -5973,7 +5973,7 @@ void Player::removeActionButton(uint8 button)
|
||||
buttonItr->second.canRemoveByClient = true;
|
||||
return;
|
||||
}
|
||||
if (buttonItr->second.uState==ACTIONBUTTON_NEW)
|
||||
if (buttonItr->second.uState == ACTIONBUTTON_NEW)
|
||||
m_actionButtons.erase(buttonItr); // new and not saved
|
||||
else
|
||||
buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save
|
||||
@@ -6093,7 +6093,7 @@ void Player::CheckExploreSystem()
|
||||
}
|
||||
|
||||
uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ());
|
||||
if (areaFlag==0xffff)
|
||||
if (areaFlag == 0xffff)
|
||||
return;
|
||||
int offset = areaFlag / 32;
|
||||
|
||||
@@ -6901,14 +6901,14 @@ void Player::DuelComplete(DuelCompleteType type)
|
||||
}
|
||||
|
||||
// cleanup combo points
|
||||
if (GetComboTarget()==duel->opponent->GetGUID())
|
||||
if (GetComboTarget() == duel->opponent->GetGUID())
|
||||
ClearComboPoints();
|
||||
else if (GetComboTarget()==duel->opponent->GetPetGUID())
|
||||
else if (GetComboTarget() == duel->opponent->GetPetGUID())
|
||||
ClearComboPoints();
|
||||
|
||||
if (duel->opponent->GetComboTarget()==GetGUID())
|
||||
if (duel->opponent->GetComboTarget() == GetGUID())
|
||||
duel->opponent->ClearComboPoints();
|
||||
else if (duel->opponent->GetComboTarget()==GetPetGUID())
|
||||
else if (duel->opponent->GetComboTarget() == GetPetGUID())
|
||||
duel->opponent->ClearComboPoints();
|
||||
|
||||
// Honor points after duel (the winner) - ImpConfig
|
||||
@@ -6959,7 +6959,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply)
|
||||
|
||||
_ApplyItemBonuses(proto,slot,apply);
|
||||
|
||||
if (slot==EQUIPMENT_SLOT_RANGED)
|
||||
if (slot == EQUIPMENT_SLOT_RANGED)
|
||||
_ApplyAmmoBonuses();
|
||||
|
||||
ApplyItemEquipSpell(item,apply);
|
||||
@@ -7224,7 +7224,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
||||
{
|
||||
attType = RANGED_ATTACK;
|
||||
}
|
||||
else if (slot==EQUIPMENT_SLOT_OFFHAND)
|
||||
else if (slot == EQUIPMENT_SLOT_OFFHAND)
|
||||
{
|
||||
attType = OFF_ATTACK;
|
||||
}
|
||||
@@ -7276,9 +7276,9 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
|
||||
{
|
||||
if (slot == EQUIPMENT_SLOT_RANGED)
|
||||
SetAttackTime(RANGED_ATTACK, apply ? proto->Delay: BASE_ATTACK_TIME);
|
||||
else if (slot==EQUIPMENT_SLOT_MAINHAND)
|
||||
else if (slot == EQUIPMENT_SLOT_MAINHAND)
|
||||
SetAttackTime(BASE_ATTACK, apply ? proto->Delay: BASE_ATTACK_TIME);
|
||||
else if (slot==EQUIPMENT_SLOT_OFFHAND)
|
||||
else if (slot == EQUIPMENT_SLOT_OFFHAND)
|
||||
SetAttackTime(OFF_ATTACK, apply ? proto->Delay: BASE_ATTACK_TIME);
|
||||
}
|
||||
|
||||
@@ -7417,7 +7417,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
|
||||
if (form_change) // check aura compatibility
|
||||
{
|
||||
// Cannot be used in this stance/form
|
||||
if (GetErrorAtShapeshiftedCast(spellInfo, m_form)==SPELL_CAST_OK)
|
||||
if (GetErrorAtShapeshiftedCast(spellInfo, m_form) == SPELL_CAST_OK)
|
||||
return; // and remove only not compatible at form change
|
||||
}
|
||||
|
||||
@@ -9710,7 +9710,7 @@ uint8 Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVe
|
||||
Item* pItem2 = GetItemByPos(bag, slot);
|
||||
|
||||
// ignore move item (this slot will be empty at move)
|
||||
if (pItem2==pSrcItem)
|
||||
if (pItem2 == pSrcItem)
|
||||
pItem2 = NULL;
|
||||
|
||||
uint32 need_space;
|
||||
@@ -9782,7 +9782,7 @@ uint8 Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVe
|
||||
uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototype const *pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const
|
||||
{
|
||||
// skip specific bag already processed in first called _CanStoreItem_InBag
|
||||
if (bag==skip_bag)
|
||||
if (bag == skip_bag)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
|
||||
Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag);
|
||||
@@ -9803,13 +9803,13 @@ uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototyp
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
{
|
||||
// skip specific slot already processed in first called _CanStoreItem_InSpecificSlot
|
||||
if (j==skip_slot)
|
||||
if (j == skip_slot)
|
||||
continue;
|
||||
|
||||
Item* pItem2 = GetItemByPos(bag, j);
|
||||
|
||||
// ignore move item (this slot will be empty at move)
|
||||
if (pItem2==pSrcItem)
|
||||
if (pItem2 == pSrcItem)
|
||||
pItem2 = NULL;
|
||||
|
||||
// if merge skip empty, if !merge skip non-empty
|
||||
@@ -9830,7 +9830,7 @@ uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototyp
|
||||
dest.push_back(newPosition);
|
||||
count -= need_space;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -9847,7 +9847,7 @@ uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototyp
|
||||
dest.push_back(newPosition);
|
||||
count -= need_space;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -9860,13 +9860,13 @@ uint8 Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, I
|
||||
for (uint32 j = slot_begin; j < slot_end; j++)
|
||||
{
|
||||
// skip specific slot already processed in first called _CanStoreItem_InSpecificSlot
|
||||
if (INVENTORY_SLOT_BAG_0==skip_bag && j==skip_slot)
|
||||
if (INVENTORY_SLOT_BAG_0 == skip_bag && j == skip_slot)
|
||||
continue;
|
||||
|
||||
Item* pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, j);
|
||||
|
||||
// ignore move item (this slot will be empty at move)
|
||||
if (pItem2==pSrcItem)
|
||||
if (pItem2 == pSrcItem)
|
||||
pItem2 = NULL;
|
||||
|
||||
// if merge skip empty, if !merge skip non-empty
|
||||
@@ -9886,7 +9886,7 @@ uint8 Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, I
|
||||
dest.push_back(newPosition);
|
||||
count -= need_space;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -9903,7 +9903,7 @@ uint8 Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, I
|
||||
dest.push_back(newPosition);
|
||||
count -= need_space;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -9935,7 +9935,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
uint8 res = _CanTakeMoreSimilarItems(entry,count,pItem,&no_similar_count);
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
{
|
||||
if (count==no_similar_count)
|
||||
if (count == no_similar_count)
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = no_similar_count;
|
||||
@@ -9955,9 +9955,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -9984,9 +9984,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10002,9 +10002,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10026,9 +10026,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10053,9 +10053,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10071,9 +10071,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10091,9 +10091,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10110,9 +10110,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10133,9 +10133,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10158,9 +10158,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10176,9 +10176,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10194,9 +10194,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10212,9 +10212,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10238,9 +10238,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10258,9 +10258,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10275,9 +10275,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10296,9 +10296,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
return res;
|
||||
}
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10312,9 +10312,9 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
{
|
||||
if (no_similar_count==0)
|
||||
if (no_similar_count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
if (no_space_count)
|
||||
@@ -10674,7 +10674,7 @@ uint8 Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, boo
|
||||
{
|
||||
if (ItemPrototype const* pBagProto = pBag->GetProto())
|
||||
{
|
||||
if (pBagProto->Class==pProto->Class && (!swap || pBag->GetSlot() != eslot))
|
||||
if (pBagProto->Class == pProto->Class && (!swap || pBag->GetSlot() != eslot))
|
||||
return (pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH)
|
||||
? EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH
|
||||
: EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER;
|
||||
@@ -10815,7 +10815,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
return res;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -10840,7 +10840,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
return res;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
else
|
||||
@@ -10852,7 +10852,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
return res;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -10864,7 +10864,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
return res;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
else
|
||||
@@ -10903,7 +10903,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -10914,7 +10914,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -10928,7 +10928,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
}
|
||||
@@ -10938,7 +10938,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
return res;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++)
|
||||
@@ -10947,7 +10947,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI
|
||||
if (res!=EQUIP_ERR_OK)
|
||||
continue;
|
||||
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
return EQUIP_ERR_BANK_FULL;
|
||||
@@ -11586,7 +11586,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
|
||||
sLog.outDebug("STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry());
|
||||
|
||||
// start from destroy contained items (only equipped bag can have its)
|
||||
if (pItem->IsBag() && pItem->IsEquipped()) // this also prevent infinity loop if empty bag stored in bag==slot
|
||||
if (pItem->IsBag() && pItem->IsEquipped()) // this also prevent infinity loop if empty bag stored in bag == slot
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
DestroyItem(slot, i, update);
|
||||
@@ -11868,7 +11868,7 @@ Item* Player::GetItemByEntry(uint32 entry) const
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); ++j)
|
||||
{
|
||||
if (Item* pItem = pBag->GetItemByPos(j))
|
||||
if (pItem->GetEntry()==entry)
|
||||
if (pItem->GetEntry() == entry)
|
||||
return pItem;
|
||||
}
|
||||
}
|
||||
@@ -11878,7 +11878,7 @@ Item* Player::GetItemByEntry(uint32 entry) const
|
||||
for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
if (pItem->GetEntry()==entry)
|
||||
if (pItem->GetEntry() == entry)
|
||||
return pItem;
|
||||
}
|
||||
|
||||
@@ -13880,7 +13880,7 @@ void Player::AddQuest(Quest const *pQuest, Object *questGiver)
|
||||
|
||||
uint32 quest_id = pQuest->GetQuestId();
|
||||
|
||||
// if not exist then created with set uState==NEW and rewarded=false
|
||||
// if not exist then created with set uState == NEW and rewarded=false
|
||||
QuestStatusData& questStatusData = mQuestStatus[quest_id];
|
||||
|
||||
// check for repeatable quests status reset
|
||||
@@ -14530,7 +14530,7 @@ bool Player::SatisfyQuestDay(Quest const* qInfo, bool msg)
|
||||
for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
|
||||
{
|
||||
uint32 id = GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx);
|
||||
if (qInfo->GetQuestId()==id)
|
||||
if (qInfo->GetQuestId() == id)
|
||||
return false;
|
||||
|
||||
if (!id)
|
||||
@@ -18719,7 +18719,7 @@ void Player::SendProficiency(uint8 pr1, uint32 pr2)
|
||||
void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
|
||||
{
|
||||
QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL);
|
||||
if (type==10)
|
||||
if (type == 10)
|
||||
result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid));
|
||||
else
|
||||
result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type);
|
||||
@@ -18738,7 +18738,7 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
|
||||
|
||||
} while (result->NextRow());
|
||||
|
||||
if (type==10)
|
||||
if (type == 10)
|
||||
CharacterDatabase.PExecute("DELETE FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid));
|
||||
else
|
||||
CharacterDatabase.PExecute("DELETE FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type);
|
||||
@@ -18812,7 +18812,7 @@ void Player::HandleStealthedUnitsDetection()
|
||||
|
||||
for (std::list<Unit*>::const_iterator i = stealthedUnits.begin(); i != stealthedUnits.end(); ++i)
|
||||
{
|
||||
if ((*i)==this)
|
||||
if ((*i) == this)
|
||||
continue;
|
||||
|
||||
bool hasAtClient = HaveAtClient((*i));
|
||||
@@ -18826,7 +18826,7 @@ void Player::HandleStealthedUnitsDetection()
|
||||
m_clientGUIDs.insert((*i)->GetGUID());
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0)
|
||||
sLog.outDebug("Object %u (Type: %u) is detected in stealth by player %u. Distance = %f",(*i)->GetGUIDLow(),(*i)->GetTypeId(),GetGUIDLow(),GetDistance(*i));
|
||||
#endif
|
||||
|
||||
@@ -18995,7 +18995,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
|
||||
prevnode = lastnode;
|
||||
}
|
||||
|
||||
// get mount model (in case non taximaster (npc==NULL) allow more wide lookup)
|
||||
// get mount model (in case non taximaster (npc == NULL) allow more wide lookup)
|
||||
//
|
||||
// Hack-Fix for Alliance not being able to use Acherus taxi. There is
|
||||
// only one mount ID for both sides. Probably not good to use 315 in case DBC nodes
|
||||
@@ -19985,7 +19985,7 @@ void Player::ReportedAfkBy(Player* reporter)
|
||||
return;
|
||||
|
||||
// check if player has 'Idle' or 'Inactive' debuff
|
||||
if (m_bgData.bgAfkReporter.find(reporter->GetGUIDLow())==m_bgData.bgAfkReporter.end() && !HasAura(43680) && !HasAura(43681) && reporter->CanReportAfkDueToLimit())
|
||||
if (m_bgData.bgAfkReporter.find(reporter->GetGUIDLow()) == m_bgData.bgAfkReporter.end() && !HasAura(43680) && !HasAura(43681) && reporter->CanReportAfkDueToLimit())
|
||||
{
|
||||
m_bgData.bgAfkReporter.insert(reporter->GetGUIDLow());
|
||||
// 3 players have to complain to apply debuff
|
||||
@@ -20177,7 +20177,7 @@ bool Player::IsVisibleGloballyFor(Player* u) const
|
||||
return false;
|
||||
|
||||
// Always can see self
|
||||
if (u==this)
|
||||
if (u == this)
|
||||
return true;
|
||||
|
||||
// Visible units, always are visible for all players
|
||||
@@ -20231,7 +20231,7 @@ inline void BeforeVisibilityDestroy(T* /*t*/, Player* /*p*/)
|
||||
template<>
|
||||
inline void BeforeVisibilityDestroy<Creature>(Creature* t, Player* p)
|
||||
{
|
||||
if (p->GetPetGUID()==t->GetGUID() && t->ToCreature()->isPet())
|
||||
if (p->GetPetGUID() == t->GetGUID() && t->ToCreature()->isPet())
|
||||
((Pet*)t)->Remove(PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
|
||||
@@ -20241,14 +20241,14 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
{
|
||||
if (!target->isVisibleForInState(this, true))
|
||||
{
|
||||
if (target->GetTypeId()==TYPEID_UNIT)
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
BeforeVisibilityDestroy<Creature>(target->ToCreature(),this);
|
||||
|
||||
target->DestroyForPlayer(this);
|
||||
m_clientGUIDs.erase(target->GetGUID());
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0)
|
||||
sLog.outDebug("Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target));
|
||||
#endif
|
||||
}
|
||||
@@ -20264,7 +20264,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
m_clientGUIDs.insert(target->GetGUID());
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0)
|
||||
sLog.outDebug("Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target));
|
||||
#endif
|
||||
|
||||
@@ -20301,7 +20301,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& vi
|
||||
m_clientGUIDs.erase(target->GetGUID());
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0)
|
||||
sLog.outDebug("Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target));
|
||||
#endif
|
||||
}
|
||||
@@ -20317,7 +20317,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& vi
|
||||
UpdateVisibilityOf_helper(m_clientGUIDs,target,visibleNow);
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0)
|
||||
sLog.outDebug("Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target));
|
||||
#endif
|
||||
}
|
||||
@@ -20767,12 +20767,12 @@ void Player::learnQuestRewardedSpells(Quest const* quest)
|
||||
uint32 profSpell = itr2->second;
|
||||
|
||||
// specialization
|
||||
if (learnedInfo->Effect[0]==SPELL_EFFECT_TRADE_SKILL && learnedInfo->Effect[1]==0 && profSpell)
|
||||
if (learnedInfo->Effect[0] == SPELL_EFFECT_TRADE_SKILL && learnedInfo->Effect[1] == 0 && profSpell)
|
||||
{
|
||||
// search other specialization for same prof
|
||||
for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr)
|
||||
{
|
||||
if (itr->second->state == PLAYERSPELL_REMOVED || itr->first==learned_0)
|
||||
if (itr->second->state == PLAYERSPELL_REMOVED || itr->first == learned_0)
|
||||
continue;
|
||||
|
||||
SpellEntry const *itrInfo = sSpellStore.LookupEntry(itr->first);
|
||||
@@ -20906,7 +20906,7 @@ void Player::ResetDailyQuestStatus()
|
||||
|
||||
BattleGround* Player::GetBattleGround() const
|
||||
{
|
||||
if (GetBattleGroundId()==0)
|
||||
if (GetBattleGroundId() == 0)
|
||||
return NULL;
|
||||
|
||||
return sBattleGroundMgr.GetBattleGround(GetBattleGroundId(), m_bgData.bgTypeID);
|
||||
@@ -20958,7 +20958,7 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const
|
||||
uint32 classmask = getClassMask();
|
||||
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spell_id);
|
||||
if (bounds.first==bounds.second)
|
||||
if (bounds.first == bounds.second)
|
||||
return true;
|
||||
|
||||
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
|
||||
@@ -21260,7 +21260,7 @@ uint32 Player::GetResurrectionSpellId()
|
||||
prio = 3;
|
||||
}
|
||||
// Twisting Nether // prio: 2 (max)
|
||||
else if ((*itr)->GetId()==23701 && roll_chance_i(10))
|
||||
else if ((*itr)->GetId() == 23701 && roll_chance_i(10))
|
||||
{
|
||||
prio = 2;
|
||||
spell_id = 23700;
|
||||
@@ -21332,7 +21332,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
|
||||
continue; // member (alive or dead) or his corpse at req. distance
|
||||
|
||||
// honor can be in PvP and !PvP (racial leader) cases (for alive)
|
||||
if (pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim,count, -1, true) && pGroupGuy==this)
|
||||
if (pGroupGuy->isAlive() && pGroupGuy->RewardHonor(pVictim,count, -1, true) && pGroupGuy == this)
|
||||
honored_kill = true;
|
||||
|
||||
// xp and reputation only in !PvP case
|
||||
@@ -21752,7 +21752,7 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
|
||||
|
||||
void Player::SetCanParry(bool value)
|
||||
{
|
||||
if (m_canParry==value)
|
||||
if (m_canParry == value)
|
||||
return;
|
||||
|
||||
m_canParry = value;
|
||||
@@ -21761,7 +21761,7 @@ void Player::SetCanParry(bool value)
|
||||
|
||||
void Player::SetCanBlock(bool value)
|
||||
{
|
||||
if (m_canBlock==value)
|
||||
if (m_canBlock == value)
|
||||
return;
|
||||
|
||||
m_canBlock = value;
|
||||
@@ -22960,7 +22960,7 @@ void Player::SendEquipmentSetList()
|
||||
data << uint32(count); // count placeholder
|
||||
for (EquipmentSets::iterator itr = m_EquipmentSets.begin(); itr != m_EquipmentSets.end(); ++itr)
|
||||
{
|
||||
if (itr->second.state==EQUIPMENT_SET_DELETED)
|
||||
if (itr->second.state == EQUIPMENT_SET_DELETED)
|
||||
continue;
|
||||
data.appendPackGUID(itr->second.Guid);
|
||||
data << uint32(itr->first);
|
||||
|
||||
+3
-3
@@ -1693,7 +1693,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
|
||||
bool IsGroupVisibleFor(Player* p) const;
|
||||
bool IsInSameGroupWith(Player const* p) const;
|
||||
bool IsInSameRaidWith(Player const* p) const { return p==this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); }
|
||||
bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); }
|
||||
void UninviteFromGroup();
|
||||
static void RemoveFromGroup(Group* group, uint64 guid);
|
||||
void RemoveFromGroup() { RemoveFromGroup(GetGroup(),GetGUID()); }
|
||||
@@ -2185,7 +2185,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
typedef std::set<uint64> ClientGUIDs;
|
||||
ClientGUIDs m_clientGUIDs;
|
||||
|
||||
bool HaveAtClient(WorldObject const* u) const { return u==this || m_clientGUIDs.find(u->GetGUID())!=m_clientGUIDs.end(); }
|
||||
bool HaveAtClient(WorldObject const* u) const { return u == this || m_clientGUIDs.find(u->GetGUID())!=m_clientGUIDs.end(); }
|
||||
|
||||
bool canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList = false, bool is3dDistance = true) const;
|
||||
bool IsVisibleInGridForPlayer(Player const* pl) const;
|
||||
@@ -2650,7 +2650,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
|
||||
continue;
|
||||
|
||||
// special case (skip >10sec spell casts for instant cast setting)
|
||||
if (mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
|
||||
if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
|
||||
continue;
|
||||
|
||||
totalmul *= 1.0f + (float)mod->value / 100.0f;
|
||||
|
||||
@@ -349,7 +349,7 @@ std::string PlayerDumpWriter::GetDump(uint32 guid)
|
||||
std::string reqName;
|
||||
for (QueryFieldNames::const_iterator itr = namesMap.begin(); itr != namesMap.end(); ++itr)
|
||||
{
|
||||
if (itr->substr(0,9)=="required_")
|
||||
if (itr->substr(0,9) == "required_")
|
||||
{
|
||||
reqName = *itr;
|
||||
break;
|
||||
@@ -472,16 +472,16 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
|
||||
// skip empty strings
|
||||
size_t nw_pos = line.find_first_not_of(" \t\n\r\7");
|
||||
if (nw_pos==std::string::npos)
|
||||
if (nw_pos == std::string::npos)
|
||||
continue;
|
||||
|
||||
// skip NOTE
|
||||
if (line.substr(nw_pos,15)=="IMPORTANT NOTE:")
|
||||
if (line.substr(nw_pos,15) == "IMPORTANT NOTE:")
|
||||
continue;
|
||||
|
||||
// add required_ check
|
||||
/*
|
||||
if (line.substr(nw_pos,41)=="UPDATE character_db_version SET required_")
|
||||
if (line.substr(nw_pos,41) == "UPDATE character_db_version SET required_")
|
||||
{
|
||||
if (!CharacterDatabase.Execute(line.c_str()))
|
||||
ROLLBACK(DUMP_FILE_BROKEN);
|
||||
@@ -600,7 +600,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||
{
|
||||
//store a map of old pet id to new inserted pet id for use by type 5 tables
|
||||
snprintf(currpetid, 20, "%s", getnth(line, 1).c_str());
|
||||
if (strlen(lastpetid)==0) snprintf(lastpetid, 20, "%s", currpetid);
|
||||
if (strlen(lastpetid) == 0) snprintf(lastpetid, 20, "%s", currpetid);
|
||||
if (strcmp(lastpetid,currpetid)!=0)
|
||||
{
|
||||
snprintf(newpetid, 20, "%d", objmgr.GeneratePetNumber());
|
||||
|
||||
@@ -67,7 +67,7 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const
|
||||
return factionEntry->BaseRepValue[i];
|
||||
}
|
||||
|
||||
// in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i]==0
|
||||
// in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i] == 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ void ReputationMgr::LoadFromDB(QueryResult_AutoPtr result)
|
||||
SetAtWar(faction,true);
|
||||
|
||||
// reset changed flag if values similar to saved in DB
|
||||
if (faction->Flags==dbFactionFlags)
|
||||
if (faction->Flags == dbFactionFlags)
|
||||
faction->Changed = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ void FillSpellSummary()
|
||||
if (pTempSpell->Effect[j] == SPELL_EFFECT_HEAL ||
|
||||
pTempSpell->Effect[j] == SPELL_EFFECT_HEAL_MAX_HEALTH ||
|
||||
pTempSpell->Effect[j] == SPELL_EFFECT_HEAL_MECHANICAL ||
|
||||
(pTempSpell->Effect[j] == SPELL_EFFECT_APPLY_AURA && pTempSpell->EffectApplyAuraName[j]== 8))
|
||||
(pTempSpell->Effect[j] == SPELL_EFFECT_APPLY_AURA && pTempSpell->EffectApplyAuraName[j] == 8))
|
||||
SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_HEALING-1);
|
||||
|
||||
//Make sure that this spell applies an aura
|
||||
|
||||
@@ -183,7 +183,7 @@ void guardAI::DoReplyToTextEmote(uint32 em)
|
||||
|
||||
void guardAI_orgrimmar::ReceiveEmote(Player* pPlayer, uint32 text_emote)
|
||||
{
|
||||
if (pPlayer->GetTeam()==HORDE)
|
||||
if (pPlayer->GetTeam() == HORDE)
|
||||
DoReplyToTextEmote(text_emote);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ void LoadSkillDiscoveryTable()
|
||||
{
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellId);
|
||||
|
||||
if (bounds.first==bounds.second)
|
||||
if (bounds.first == bounds.second)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table",spellId);
|
||||
continue;
|
||||
@@ -154,7 +154,7 @@ void LoadSkillDiscoveryTable()
|
||||
if (!IsExplicitDiscoverySpell(spellEntry))
|
||||
continue;
|
||||
|
||||
if (SkillDiscoveryStore.find(spell_id)==SkillDiscoveryStore.end())
|
||||
if (SkillDiscoveryStore.find(spell_id) == SkillDiscoveryStore.end())
|
||||
sLog.outErrorDb("Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table",spell_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ bool canCreateExtraItems(Player * player, uint32 spellId, float &additionalChanc
|
||||
{
|
||||
// get the info for the specified spell
|
||||
SkillExtraItemMap::const_iterator ret = SkillExtraItemStore.find(spellId);
|
||||
if (ret==SkillExtraItemStore.end())
|
||||
if (ret == SkillExtraItemStore.end())
|
||||
return false;
|
||||
|
||||
SkillExtraItemEntry const* specEntry = &ret->second;
|
||||
|
||||
+26
-26
@@ -985,7 +985,7 @@ void Spell::AddGOTarget(GameObject* pVictim, uint32 effIndex)
|
||||
float dist = m_caster->GetDistance(pVictim->GetPositionX(), pVictim->GetPositionY(), pVictim->GetPositionZ());
|
||||
if (dist < 5.0f) dist = 5.0f;
|
||||
target.timeDelay = (uint64) floor(dist / m_spellInfo->speed * 1000.0f);
|
||||
if (m_delayMoment==0 || m_delayMoment>target.timeDelay)
|
||||
if (m_delayMoment == 0 || m_delayMoment>target.timeDelay)
|
||||
m_delayMoment = target.timeDelay;
|
||||
}
|
||||
else
|
||||
@@ -1035,7 +1035,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
// Get mask of effects for target
|
||||
uint32 mask = target->effectMask;
|
||||
|
||||
Unit* unit = m_caster->GetGUID()==target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster,target->targetGUID);
|
||||
Unit* unit = m_caster->GetGUID() == target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster,target->targetGUID);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
@@ -1071,7 +1071,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
bool canEffectTrigger = unitTarget->CanProc() && (m_spellInfo->AttributesEx4 & (SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) ? m_caster!=unitTarget : true);
|
||||
Unit * spellHitTarget = NULL;
|
||||
|
||||
if (missInfo==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
spellHitTarget = unit;
|
||||
else if (missInfo == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
|
||||
{
|
||||
@@ -1435,7 +1435,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit)
|
||||
}
|
||||
|
||||
// spells with this flag can trigger only if not selfcast (eviscerate for example)
|
||||
if (m_ChanceTriggerSpells.size() && (!((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) && unit==m_caster)))
|
||||
if (m_ChanceTriggerSpells.size() && (!((m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST) && unit == m_caster)))
|
||||
{
|
||||
int _duration=0;
|
||||
for (ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i)
|
||||
@@ -1447,7 +1447,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit)
|
||||
m_caster->CastSpell(unit, i->first, true);
|
||||
sLog.outDebug("Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->first->Id);
|
||||
}
|
||||
if (GetSpellDuration(i->first)==-1)
|
||||
if (GetSpellDuration(i->first) == -1)
|
||||
{
|
||||
if (Aura * triggeredAur = unit->GetAura(i->first->Id, m_caster->GetGUID()))
|
||||
{
|
||||
@@ -1720,7 +1720,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
|
||||
case SPELL_TARGETS_ENTRY:
|
||||
{
|
||||
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(m_spellInfo->Id);
|
||||
if (bounds.first==bounds.second)
|
||||
if (bounds.first == bounds.second)
|
||||
{
|
||||
sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `spell_script_target`", m_spellInfo->Id, m_caster->GetEntry());
|
||||
if (IsPositiveSpell(m_spellInfo->Id))
|
||||
@@ -3379,7 +3379,7 @@ void Spell::finish(bool ok)
|
||||
// Unsummon statue
|
||||
uint32 spell = m_caster->GetUInt32Value(UNIT_CREATED_BY_SPELL);
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell);
|
||||
if (spellInfo && spellInfo->SpellIconID==2056)
|
||||
if (spellInfo && spellInfo->SpellIconID == 2056)
|
||||
{
|
||||
sLog.outDebug("Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id);
|
||||
m_caster->setDeathState(JUST_DIED);
|
||||
@@ -3740,7 +3740,7 @@ void Spell::WriteAmmoToPacket(WorldPacket * data)
|
||||
{
|
||||
if (ItemEntry const * itemEntry = sItemStore.LookupEntry(item_id))
|
||||
{
|
||||
if (itemEntry->Class==ITEM_CLASS_WEAPON)
|
||||
if (itemEntry->Class == ITEM_CLASS_WEAPON)
|
||||
{
|
||||
switch(itemEntry->SubClass)
|
||||
{
|
||||
@@ -4088,7 +4088,7 @@ void Spell::TakeCastItem()
|
||||
m_caster->ToPlayer()->DestroyItemCount(m_CastItem, count, true);
|
||||
|
||||
// prevent crash at access to deleted m_targets.getItemTarget
|
||||
if (m_CastItem==m_targets.getItemTarget())
|
||||
if (m_CastItem == m_targets.getItemTarget())
|
||||
m_targets.setItemTarget(NULL);
|
||||
|
||||
m_CastItem = NULL;
|
||||
@@ -4161,12 +4161,12 @@ void Spell::TakeAmmo()
|
||||
Item *pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK);
|
||||
|
||||
// wands don't have ammo
|
||||
if (!pItem || pItem->IsBroken() || pItem->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_WAND)
|
||||
if (!pItem || pItem->IsBroken() || pItem->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_WAND)
|
||||
return;
|
||||
|
||||
if (pItem->GetProto()->InventoryType == INVTYPE_THROWN)
|
||||
{
|
||||
if (pItem->GetMaxStackCount()==1)
|
||||
if (pItem->GetMaxStackCount() == 1)
|
||||
{
|
||||
// decrease durability for non-stackable throw weapon
|
||||
m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
|
||||
@@ -4462,7 +4462,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
if ((*j)->IsAffectedOnSpell(m_spellInfo))
|
||||
{
|
||||
if ((*j)->GetMiscValue()==1)
|
||||
if ((*j)->GetMiscValue() == 1)
|
||||
{
|
||||
reqCombat=false;
|
||||
break;
|
||||
@@ -4730,7 +4730,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
SpellScriptTarget::const_iterator lower = spellmgr.GetBeginSpellScriptTarget(m_spellInfo->Id);
|
||||
SpellScriptTarget::const_iterator upper = spellmgr.GetEndSpellScriptTarget(m_spellInfo->Id);
|
||||
if (lower==upper)
|
||||
if (lower == upper)
|
||||
sLog.outErrorDb("Spell (ID: %u) has effect EffectImplicitTargetA/EffectImplicitTargetB = TARGET_UNIT_NEARBY_ENTRY or TARGET_DST_NEARBY_ENTRY, but does not have record in `spell_script_target`",m_spellInfo->Id);
|
||||
|
||||
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
|
||||
@@ -5130,7 +5130,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
if (m_caster->GetPetGUID()) //let warlock do a replacement summon
|
||||
{
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass()==CLASS_WARLOCK)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK)
|
||||
{
|
||||
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
if (Pet* pet = m_caster->ToPlayer()->GetPet())
|
||||
@@ -5463,7 +5463,7 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||
dispel_immune |= GetDispellMask(DispelType(m_spellInfo->EffectMiscValue[i]));
|
||||
}
|
||||
//immune movement impairment and loss of control
|
||||
if (m_spellInfo->Id==42292 || m_spellInfo->Id==59752)
|
||||
if (m_spellInfo->Id == 42292 || m_spellInfo->Id == 59752)
|
||||
mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
|
||||
}
|
||||
|
||||
@@ -5522,9 +5522,9 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||
case SPELL_AURA_MOD_SILENCE:
|
||||
case SPELL_AURA_MOD_PACIFY:
|
||||
case SPELL_AURA_MOD_PACIFY_SILENCE:
|
||||
if (m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
|
||||
if (m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY)
|
||||
return SPELL_FAILED_PACIFIED;
|
||||
else if (m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
|
||||
else if (m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
|
||||
return SPELL_FAILED_SILENCED;
|
||||
break;
|
||||
default: break;
|
||||
@@ -6252,7 +6252,7 @@ bool Spell::CheckTargetCreatureType(Unit* target) const
|
||||
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
|
||||
|
||||
// Curse of Doom & Exorcism: not find another way to fix spell target check :/
|
||||
if (m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellInfo->Category == 1179)
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == 1179)
|
||||
{
|
||||
// not allow cast at player
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -6610,7 +6610,7 @@ void Spell::CalculateDamageDoneForAllTargets()
|
||||
if (!mask)
|
||||
continue;
|
||||
|
||||
Unit* unit = m_caster->GetGUID()==target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID);
|
||||
Unit* unit = m_caster->GetGUID() == target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID);
|
||||
if (!unit) // || !unit->isAlive()) do we need to check alive here?
|
||||
continue;
|
||||
|
||||
@@ -6636,7 +6636,7 @@ void Spell::CalculateDamageDoneForAllTargets()
|
||||
}
|
||||
}
|
||||
|
||||
if (target.missCondition==SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
if (target.missCondition == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
{
|
||||
target.damage += CalculateDamageDone(unit, mask, multiplier);
|
||||
target.crit = m_caster->isSpellCrit(unit, m_spellInfo, m_spellSchoolMask, m_attackType);
|
||||
@@ -6726,7 +6726,7 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk
|
||||
{
|
||||
// check key item (many fit cases can be)
|
||||
case LOCK_KEY_ITEM:
|
||||
if (lockInfo->Index[j] && m_CastItem && m_CastItem->GetEntry()==lockInfo->Index[j])
|
||||
if (lockInfo->Index[j] && m_CastItem && m_CastItem->GetEntry() == lockInfo->Index[j])
|
||||
return SPELL_CAST_OK;
|
||||
reqKey = true;
|
||||
break;
|
||||
@@ -6944,16 +6944,16 @@ void Spell::FillRaidOrPartyTargets(UnitList &TagUnitMap, Unit* target, float rad
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
if (Target && (raid || subgroup==Target->GetSubGroup())
|
||||
if (Target && (raid || subgroup == Target->GetSubGroup())
|
||||
&& !m_caster->IsHostileTo(Target))
|
||||
{
|
||||
if (Target==m_caster && withcaster ||
|
||||
if (Target == m_caster && withcaster ||
|
||||
Target!=m_caster && m_caster->IsWithinDistInMap(Target, radius))
|
||||
TagUnitMap.push_back(Target);
|
||||
|
||||
if (withPets)
|
||||
if (Pet* pet = Target->GetPet())
|
||||
if (pet==m_caster && withcaster ||
|
||||
if (pet == m_caster && withcaster ||
|
||||
pet!=m_caster && m_caster->IsWithinDistInMap(pet, radius))
|
||||
TagUnitMap.push_back(pet);
|
||||
}
|
||||
@@ -6962,13 +6962,13 @@ void Spell::FillRaidOrPartyTargets(UnitList &TagUnitMap, Unit* target, float rad
|
||||
else
|
||||
{
|
||||
Unit* ownerOrSelf = pTarget ? pTarget : target->GetCharmerOrOwnerOrSelf();
|
||||
if (ownerOrSelf==m_caster && withcaster ||
|
||||
if (ownerOrSelf == m_caster && withcaster ||
|
||||
ownerOrSelf!=m_caster && m_caster->IsWithinDistInMap(ownerOrSelf, radius))
|
||||
TagUnitMap.push_back(ownerOrSelf);
|
||||
|
||||
if (withPets)
|
||||
if (Guardian* pet = ownerOrSelf->GetGuardianPet())
|
||||
if (pet==m_caster && withcaster ||
|
||||
if (pet == m_caster && withcaster ||
|
||||
pet!=m_caster && m_caster->IsWithinDistInMap(pet, radius))
|
||||
TagUnitMap.push_back(pet);
|
||||
}
|
||||
|
||||
+1
-1
@@ -189,7 +189,7 @@ class SpellCastTargets
|
||||
}
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return m_GOTargetGUID==0 && m_unitTargetGUID==0 && m_itemTarget==0 && m_CorpseTargetGUID==0; }
|
||||
bool IsEmpty() const { return m_GOTargetGUID == 0 && m_unitTargetGUID == 0 && m_itemTarget == 0 && m_CorpseTargetGUID == 0; }
|
||||
bool HasSrc() const { return m_intTargetFlags & FLAG_INT_SRC_LOC; }
|
||||
bool HasDst() const { return m_intTargetFlags & FLAG_INT_DST_LOC; }
|
||||
bool HasTraj() const { return m_speed != 0; }
|
||||
|
||||
@@ -957,7 +957,7 @@ void AuraEffect::ApplySpellMod(Unit * target, bool apply)
|
||||
if (AuraEffect * aurEff = aura->GetEffect(1))
|
||||
aurEff->RecalculateAmount();
|
||||
}
|
||||
else //if (modOp ==SPELLMOD_EFFECT3)
|
||||
else //if (modOp == SPELLMOD_EFFECT3)
|
||||
{
|
||||
if (AuraEffect * aurEff = aura->GetEffect(2))
|
||||
aurEff->RecalculateAmount();
|
||||
@@ -976,7 +976,7 @@ void AuraEffect::Update(uint32 diff, Unit * caster)
|
||||
{
|
||||
if (m_periodicTimer > diff)
|
||||
m_periodicTimer -= diff;
|
||||
else // tick also at m_periodicTimer==0 to prevent lost last tick in case max m_duration == (max m_periodicTimer)*N
|
||||
else // tick also at m_periodicTimer == 0 to prevent lost last tick in case max m_duration == (max m_periodicTimer)*N
|
||||
{
|
||||
++m_tickNumber;
|
||||
|
||||
@@ -1210,7 +1210,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
||||
case 38772: // Grievous Wound
|
||||
{
|
||||
uint32 percent =
|
||||
GetEffIndex() < 2 && GetSpellProto()->Effect[GetEffIndex()]==SPELL_EFFECT_DUMMY ?
|
||||
GetEffIndex() < 2 && GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_DUMMY ?
|
||||
caster->CalculateSpellDamage(GetSpellProto(),GetEffIndex()+1,GetSpellProto()->EffectBasePoints[GetEffIndex()+1],target) :
|
||||
100;
|
||||
if (target->GetHealth()*100 >= target->GetMaxHealth()*percent)
|
||||
@@ -1245,7 +1245,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
||||
}
|
||||
|
||||
// Curse of Agony damage-per-tick calculation
|
||||
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags[0] & 0x400) && GetSpellProto()->SpellIconID==544)
|
||||
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags[0] & 0x400) && GetSpellProto()->SpellIconID == 544)
|
||||
{
|
||||
uint32 totalTick = GetTotalTicks();
|
||||
// 1..4 ticks, 1/2 from normal tick damage
|
||||
@@ -1321,7 +1321,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
||||
if (!caster->isAlive())
|
||||
return;
|
||||
|
||||
if (GetSpellProto()->Effect[GetEffIndex()]==SPELL_EFFECT_PERSISTENT_AREA_AURA &&
|
||||
if (GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
|
||||
caster->SpellHitResult(target,GetSpellProto(),false)!=SPELL_MISS_NONE)
|
||||
return;
|
||||
|
||||
@@ -1507,7 +1507,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
||||
if (!caster || !caster->isAlive())
|
||||
break;
|
||||
|
||||
if (GetSpellProto()->Effect[GetEffIndex()]==SPELL_EFFECT_PERSISTENT_AREA_AURA &&
|
||||
if (GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
|
||||
caster->SpellHitResult(target,GetSpellProto(),false) != SPELL_MISS_NONE)
|
||||
break;
|
||||
|
||||
@@ -1643,7 +1643,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
|
||||
if (target->GetMaxPower(power) == 0)
|
||||
return;
|
||||
|
||||
if (GetBase()->GetDuration() ==-1 && target->GetPower(power)==target->GetMaxPower(power))
|
||||
if (GetBase()->GetDuration() == -1 && target->GetPower(power) == target->GetMaxPower(power))
|
||||
return;
|
||||
|
||||
uint32 amount = m_amount;
|
||||
@@ -1864,7 +1864,7 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const
|
||||
// TODO: this should use effect[1] of 51690
|
||||
UnitList targets;
|
||||
{
|
||||
// eff_radius ==0
|
||||
// eff_radius == 0
|
||||
float radius = GetSpellMaxRange(GetSpellProto(), false);
|
||||
|
||||
CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(),caster->GetPositionY()));
|
||||
@@ -2058,7 +2058,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
|
||||
case 30427:
|
||||
{
|
||||
// move loot to player inventory and despawn target
|
||||
if (caster->GetTypeId() ==TYPEID_PLAYER &&
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER &&
|
||||
triggerTarget->GetTypeId() == TYPEID_UNIT &&
|
||||
triggerTarget->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_GAS_CLOUD)
|
||||
{
|
||||
@@ -2400,7 +2400,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const
|
||||
for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
|
||||
{
|
||||
if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) continue;
|
||||
if (itr->first==spellId || itr->first==spellId2) continue;
|
||||
if (itr->first == spellId || itr->first == spellId2) continue;
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR_PASSIVE | (1<<7)))) continue;
|
||||
if (spellInfo->Stances & (1<<(GetMiscValue()-1)))
|
||||
@@ -2941,7 +2941,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
|
||||
if (apply)
|
||||
{
|
||||
// special case (spell specific functionality)
|
||||
if (GetMiscValue()==0)
|
||||
if (GetMiscValue() == 0)
|
||||
{
|
||||
// player applied only
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
@@ -3028,7 +3028,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
|
||||
target->SetDisplayId(model_id);
|
||||
|
||||
// Dragonmaw Illusion (set mount model also)
|
||||
if (GetId()==42016 && target->GetMountID() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())
|
||||
if (GetId() == 42016 && target->GetMountID() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())
|
||||
target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
|
||||
}
|
||||
}
|
||||
@@ -3184,7 +3184,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo
|
||||
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
|
||||
|
||||
// prevent interrupt message
|
||||
if (GetCasterGUID()==target->GetGUID() && target->GetCurrentSpell(CURRENT_GENERIC_SPELL))
|
||||
if (GetCasterGUID() == target->GetGUID() && target->GetCurrentSpell(CURRENT_GENERIC_SPELL))
|
||||
target->FinishSpell(CURRENT_GENERIC_SPELL, false);
|
||||
target->InterruptNonMeleeSpells(true);
|
||||
target->getHostileRefManager().deleteReferences();
|
||||
@@ -4073,7 +4073,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const * aurApp, uint
|
||||
|
||||
// Patch 3.0.3 Bladestorm now breaks all snares and roots on the warrior when activated.
|
||||
// however not all mechanic specified in immunity
|
||||
if (apply && GetId()==46924)
|
||||
if (apply && GetId() == 46924)
|
||||
{
|
||||
target->RemoveAurasByType(SPELL_AURA_MOD_ROOT);
|
||||
target->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
@@ -4368,7 +4368,7 @@ void AuraEffect::HandleModTargetResistance(AuraApplication const * aurApp, uint8
|
||||
target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,GetAmount(), apply);
|
||||
|
||||
// show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && (GetMiscValue() & SPELL_SCHOOL_MASK_SPELL)==SPELL_SCHOOL_MASK_SPELL)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && (GetMiscValue() & SPELL_SCHOOL_MASK_SPELL) == SPELL_SCHOOL_MASK_SPELL)
|
||||
target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,GetAmount(), apply);
|
||||
}
|
||||
|
||||
@@ -4659,7 +4659,7 @@ void AuraEffect::HandleAuraModIncreaseMaxHealth(AuraApplication const * aurApp,
|
||||
if (oldhealth > 0)
|
||||
{
|
||||
uint32 newhealth = uint32(ceil((double)target->GetMaxHealth() * healthPercentage));
|
||||
if (newhealth==0)
|
||||
if (newhealth == 0)
|
||||
newhealth = 1;
|
||||
|
||||
target->SetHealth(newhealth);
|
||||
@@ -4680,7 +4680,7 @@ void AuraEffect::HandleAuraModIncreaseEnergy(AuraApplication const * aurApp, uin
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
|
||||
|
||||
// Special case with temporary increase max/current power (percent)
|
||||
if (GetId()==64904) // Hymn of Hope
|
||||
if (GetId() == 64904) // Hymn of Hope
|
||||
{
|
||||
if (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK)
|
||||
{
|
||||
@@ -5365,7 +5365,7 @@ void AuraEffect::HandleAuraRetainComboPoints(AuraApplication const * aurApp, uin
|
||||
|
||||
// combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
|
||||
// remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
|
||||
if (!(apply) && GetBase()->GetDuration()==0 && target->ToPlayer()->GetComboTarget())
|
||||
if (!(apply) && GetBase()->GetDuration() == 0 && target->ToPlayer()->GetComboTarget())
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*target,target->ToPlayer()->GetComboTarget()))
|
||||
target->ToPlayer()->AddComboPoints(unit, -GetAmount());
|
||||
}
|
||||
@@ -5682,12 +5682,12 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
|
||||
break;
|
||||
case SPELLFAMILY_HUNTER:
|
||||
// Misdirection
|
||||
if (GetId()==34477)
|
||||
if (GetId() == 34477)
|
||||
target->SetReducedThreatPercent(0, 0);
|
||||
break;
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
// Summon Gargoyle (will start feeding gargoyle)
|
||||
if (GetId()==61777)
|
||||
if (GetId() == 61777)
|
||||
target->CastSpell(target,m_spellProto->EffectTriggerSpell[m_effIndex],true);
|
||||
break;
|
||||
default:
|
||||
@@ -6013,7 +6013,7 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const * aurApp, uint8 mo
|
||||
{
|
||||
count-=noSpaceForCount;
|
||||
plCaster->SendEquipError(msg, NULL, NULL);
|
||||
if (count==0)
|
||||
if (count == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6097,13 +6097,13 @@ void AuraEffect::HandleAuraModFaction(AuraApplication const * aurApp, uint8 mode
|
||||
if (apply)
|
||||
{
|
||||
target->setFaction(GetMiscValue());
|
||||
if (target->GetTypeId()==TYPEID_PLAYER)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->RestoreFaction();
|
||||
if (target->GetTypeId()==TYPEID_PLAYER)
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -458,7 +458,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
case SPELLFAMILY_WARLOCK:
|
||||
{
|
||||
// Incinerate Rank 1 & 2
|
||||
if ((m_spellInfo->SpellFamilyFlags[1] & 0x000040) && m_spellInfo->SpellIconID==2128)
|
||||
if ((m_spellInfo->SpellFamilyFlags[1] & 0x000040) && m_spellInfo->SpellIconID == 2128)
|
||||
{
|
||||
// Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff.
|
||||
// Check aura state for speed but aura state set not only for Immolate spell
|
||||
@@ -572,7 +572,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
case SPELLFAMILY_DRUID:
|
||||
{
|
||||
// Ferocious Bite
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[0] & 0x000800000) && m_spellInfo->SpellVisual[0]==6587)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[0] & 0x000800000) && m_spellInfo->SpellVisual[0] == 6587)
|
||||
{
|
||||
// converts each extra point of energy into ($f1+$AP/410) additional damage
|
||||
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
|
||||
@@ -1941,7 +1941,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
break;
|
||||
case SPELLFAMILY_SHAMAN:
|
||||
// Cleansing Totem Pulse
|
||||
if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS && m_spellInfo->SpellIconID==1673)
|
||||
if (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS && m_spellInfo->SpellIconID == 1673)
|
||||
{
|
||||
int32 bp1 = 1;
|
||||
// Cleansing Totem Effect
|
||||
@@ -2105,7 +2105,7 @@ void Spell::EffectDummy(uint32 i)
|
||||
spell_id=48289;
|
||||
}
|
||||
// Raise dead - take reagents and trigger summon spells
|
||||
else if (m_spellInfo->Id ==48289)
|
||||
else if (m_spellInfo->Id == 48289)
|
||||
{
|
||||
if (m_targets.HasDst())
|
||||
targets.setDst(&m_targets.m_dstPos);
|
||||
@@ -2701,7 +2701,7 @@ void Spell::EffectPowerDrain(uint32 i)
|
||||
if (drain_power == POWER_MANA && m_caster != unitTarget)
|
||||
{
|
||||
float manaMultiplier = m_spellInfo->EffectMultipleValue[i];
|
||||
if (manaMultiplier==0)
|
||||
if (manaMultiplier == 0)
|
||||
manaMultiplier = 1;
|
||||
|
||||
if (Player *modOwner = m_caster->GetSpellModOwner())
|
||||
@@ -2875,7 +2875,7 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
|
||||
}
|
||||
}
|
||||
// Riptide - increase healing done by Chain Heal
|
||||
else if (m_spellInfo->SpellFamilyName==SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[0] & 0x100)
|
||||
else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[0] & 0x100)
|
||||
{
|
||||
addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL);
|
||||
if (AuraEffect * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, m_originalCasterGUID))
|
||||
@@ -3967,7 +3967,7 @@ void Spell::EffectTeleUnitsFaceCaster(uint32 i)
|
||||
float fx,fy,fz;
|
||||
m_caster->GetClosePoint(fx,fy,fz,unitTarget->GetObjectSize(),dis);
|
||||
|
||||
unitTarget->NearTeleportTo(fx,fy,fz,-m_caster->GetOrientation(),unitTarget==m_caster);
|
||||
unitTarget->NearTeleportTo(fx,fy,fz,-m_caster->GetOrientation(),unitTarget == m_caster);
|
||||
}
|
||||
|
||||
void Spell::EffectLearnSkill(uint32 i)
|
||||
@@ -4100,7 +4100,7 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)
|
||||
bool add_socket = false;
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (pEnchant->type[i]==ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
|
||||
if (pEnchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
|
||||
{
|
||||
add_socket = true;
|
||||
break;
|
||||
@@ -4368,7 +4368,7 @@ void Spell::EffectSummonPet(uint32 i)
|
||||
}
|
||||
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
owner->ToPlayer()->RemovePet(OldSummon,(OldSummon->getPetType()==HUNTER_PET ? PET_SAVE_AS_DELETED : PET_SAVE_NOT_IN_SLOT),false);
|
||||
owner->ToPlayer()->RemovePet(OldSummon,(OldSummon->getPetType() == HUNTER_PET ? PET_SAVE_AS_DELETED : PET_SAVE_NOT_IN_SLOT),false);
|
||||
else
|
||||
return;
|
||||
}
|
||||
@@ -4563,7 +4563,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
|
||||
}
|
||||
|
||||
// Seal of Command Unleashed
|
||||
else if (m_spellInfo->Id==20467)
|
||||
else if (m_spellInfo->Id == 20467)
|
||||
{
|
||||
spell_bonus += int32(0.08f*m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
|
||||
spell_bonus += int32(0.13f*m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)));
|
||||
@@ -4849,7 +4849,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
{
|
||||
case 489: //WS
|
||||
{
|
||||
if (bg && bg->GetTypeID()==BATTLEGROUND_WS && bg->GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (bg && bg->GetTypeID() == BATTLEGROUND_WS && bg->GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
uint32 team = ALLIANCE;
|
||||
|
||||
@@ -4862,7 +4862,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
}
|
||||
case 566: //EY
|
||||
{
|
||||
if (bg && bg->GetTypeID()==BATTLEGROUND_EY && bg->GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (bg && bg->GetTypeID() == BATTLEGROUND_EY && bg->GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
((BattleGroundEY*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID());
|
||||
}
|
||||
@@ -4910,7 +4910,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
||||
Player* plr = m_caster->ToPlayer();
|
||||
if (plr && plr->GetLastPetNumber())
|
||||
{
|
||||
PetType NewPetType = (plr->getClass()==CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
||||
PetType NewPetType = (plr->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
||||
if (Pet* NewPet = new Pet(plr,NewPetType))
|
||||
{
|
||||
if (NewPet->LoadPetFromDB(plr, 0, plr->GetLastPetNumber(), true))
|
||||
@@ -5222,11 +5222,11 @@ void Spell::EffectScriptEffect(uint32 effIndex)
|
||||
case 75: unitTarget->CastSpell(unitTarget, 51621, true); break;;
|
||||
case 150: unitTarget->CastSpell(unitTarget, 48024, true); break;
|
||||
case 225:
|
||||
if (unitTarget->ToPlayer()->GetMapId()==571 || unitTarget->ToPlayer()->GetMapId()==530)
|
||||
if (unitTarget->ToPlayer()->GetMapId() == 571 || unitTarget->ToPlayer()->GetMapId() == 530)
|
||||
unitTarget->CastSpell(unitTarget, 51617, true);
|
||||
break;
|
||||
case 300:
|
||||
if (unitTarget->ToPlayer()->GetMapId()==571 || unitTarget->ToPlayer()->GetMapId()==530)
|
||||
if (unitTarget->ToPlayer()->GetMapId() == 571 || unitTarget->ToPlayer()->GetMapId() == 530)
|
||||
unitTarget->CastSpell(unitTarget, 48023, true);
|
||||
break;
|
||||
default: break;
|
||||
@@ -6292,7 +6292,7 @@ void Spell::EffectStuck(uint32 /*i*/)
|
||||
|
||||
pTarget->TeleportTo(pTarget->GetStartPosition(), unitTarget == m_caster ? TELE_TO_SPELL : 0);
|
||||
// homebind location is loaded always
|
||||
// pTarget->TeleportTo(pTarget->m_homebindMapId,pTarget->m_homebindX,pTarget->m_homebindY,pTarget->m_homebindZ,pTarget->GetOrientation(), (unitTarget==m_caster ? TELE_TO_SPELL : 0));
|
||||
// pTarget->TeleportTo(pTarget->m_homebindMapId,pTarget->m_homebindX,pTarget->m_homebindY,pTarget->m_homebindZ,pTarget->GetOrientation(), (unitTarget == m_caster ? TELE_TO_SPELL : 0));
|
||||
|
||||
// Stuck spell trigger Hearthstone cooldown
|
||||
SpellEntry const *spellInfo = sSpellStore.LookupEntry(8690);
|
||||
@@ -6686,7 +6686,7 @@ void Spell::EffectLeapForward(uint32 i)
|
||||
}
|
||||
|
||||
if (j < 10)
|
||||
unitTarget->NearTeleportTo(destx, desty, destz + 0.07531, orientation, unitTarget==m_caster);
|
||||
unitTarget->NearTeleportTo(destx, desty, destz + 0.07531, orientation, unitTarget == m_caster);
|
||||
}
|
||||
|
||||
void Spell::EffectReputation(uint32 i)
|
||||
@@ -7056,7 +7056,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
if (m_targets.HasDst())
|
||||
m_targets.m_dstPos.GetPosition(fx, fy, fz);
|
||||
//FIXME: this can be better check for most objects but still hack
|
||||
else if (m_spellInfo->EffectRadiusIndex[effIndex] && m_spellInfo->speed==0)
|
||||
else if (m_spellInfo->EffectRadiusIndex[effIndex] && m_spellInfo->speed == 0)
|
||||
{
|
||||
float dis = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex]));
|
||||
m_caster->GetClosePoint(fx, fy, fz, DEFAULT_WORLD_OBJECT_SIZE, dis);
|
||||
@@ -7072,7 +7072,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
}
|
||||
|
||||
Map *cMap = m_caster->GetMap();
|
||||
if (goinfo->type==GAMEOBJECT_TYPE_FISHINGNODE)
|
||||
if (goinfo->type == GAMEOBJECT_TYPE_FISHINGNODE)
|
||||
{
|
||||
//dirty way to hack serpent shrine pool
|
||||
if (cMap->GetId() == 548 && m_caster->GetDistance(36.69, -416.38, -19.9645) <= 16)//center of strange pool
|
||||
@@ -7092,7 +7092,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
fz = cMap->GetWaterLevel(fx, fy);
|
||||
}
|
||||
// if gameobject is summoning object, it should be spawned right on caster's position
|
||||
else if (goinfo->type==GAMEOBJECT_TYPE_SUMMONING_RITUAL)
|
||||
else if (goinfo->type == GAMEOBJECT_TYPE_SUMMONING_RITUAL)
|
||||
{
|
||||
m_caster->GetPosition(fx, fy, fz);
|
||||
}
|
||||
@@ -7266,7 +7266,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
|
||||
{
|
||||
sLog.outDebug("Effect: StealBeneficialBuff");
|
||||
|
||||
if (!unitTarget || unitTarget==m_caster) // can't steal from self
|
||||
if (!unitTarget || unitTarget == m_caster) // can't steal from self
|
||||
return;
|
||||
|
||||
Unit::AuraList steal_list;
|
||||
|
||||
@@ -415,7 +415,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
|
||||
if (IsChanneledSpell(spellInfo))
|
||||
{
|
||||
if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
|
||||
if (curSpell->m_spellInfo->Id==spellId)
|
||||
if (curSpell->m_spellInfo->Id == spellId)
|
||||
_player->InterruptSpell(CURRENT_CHANNELED_SPELL);
|
||||
return;
|
||||
}
|
||||
|
||||
+39
-39
@@ -480,8 +480,8 @@ AuraState GetSpellAuraState(SpellEntry const * spellInfo)
|
||||
{
|
||||
for (uint8 i = 0; i<MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_STUN
|
||||
|| spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_ROOT)
|
||||
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_STUN
|
||||
|| spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_ROOT)
|
||||
return AURA_STATE_FROZEN;
|
||||
}
|
||||
}
|
||||
@@ -555,7 +555,7 @@ SpellSpecific GetSpellSpecific(SpellEntry const * spellInfo)
|
||||
if (spellInfo->SpellFamilyFlags[0] & 0x400)
|
||||
return SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE;
|
||||
|
||||
if ((spellInfo->SpellFamilyFlags[0] & 0x1000000) && spellInfo->EffectApplyAuraName[0]==SPELL_AURA_MOD_CONFUSE)
|
||||
if ((spellInfo->SpellFamilyFlags[0] & 0x1000000) && spellInfo->EffectApplyAuraName[0] == SPELL_AURA_MOD_CONFUSE)
|
||||
return SPELL_SPECIFIC_MAGE_POLYMORPH;
|
||||
|
||||
break;
|
||||
@@ -672,7 +672,7 @@ bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1,SpellSpecific s
|
||||
case SPELL_SPECIFIC_ASPECT:
|
||||
case SPELL_SPECIFIC_JUDGEMENT:
|
||||
case SPELL_SPECIFIC_WARLOCK_CORRUPTION:
|
||||
return spellSpec1==spellSpec2;
|
||||
return spellSpec1 == spellSpec2;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -694,17 +694,17 @@ bool IsSingleFromSpellSpecificPerTarget(SpellSpecific spellSpec1, SpellSpecific
|
||||
case SPELL_SPECIFIC_WARRIOR_ENRAGE:
|
||||
case SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE:
|
||||
case SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT:
|
||||
return spellSpec1==spellSpec2;
|
||||
return spellSpec1 == spellSpec2;
|
||||
case SPELL_SPECIFIC_FOOD:
|
||||
return spellSpec2==SPELL_SPECIFIC_FOOD
|
||||
|| spellSpec2==SPELL_SPECIFIC_FOOD_AND_DRINK;
|
||||
return spellSpec2 == SPELL_SPECIFIC_FOOD
|
||||
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
|
||||
case SPELL_SPECIFIC_DRINK:
|
||||
return spellSpec2==SPELL_SPECIFIC_DRINK
|
||||
|| spellSpec2==SPELL_SPECIFIC_FOOD_AND_DRINK;
|
||||
return spellSpec2 == SPELL_SPECIFIC_DRINK
|
||||
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
|
||||
case SPELL_SPECIFIC_FOOD_AND_DRINK:
|
||||
return spellSpec2==SPELL_SPECIFIC_FOOD
|
||||
|| spellSpec2==SPELL_SPECIFIC_DRINK
|
||||
|| spellSpec2==SPELL_SPECIFIC_FOOD_AND_DRINK;
|
||||
return spellSpec2 == SPELL_SPECIFIC_FOOD
|
||||
|| spellSpec2 == SPELL_SPECIFIC_DRINK
|
||||
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -839,7 +839,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
|
||||
// many positive auras have negative triggered spells at damage for example and this not make it negative (it can be canceled for example)
|
||||
break;
|
||||
case SPELL_AURA_MOD_STUN: //have positive and negative spells, we can't sort its correctly at this moment.
|
||||
if (effIndex==0 && spellproto->Effect[1]==0 && spellproto->Effect[2]==0)
|
||||
if (effIndex == 0 && spellproto->Effect[1] == 0 && spellproto->Effect[2] == 0)
|
||||
return false; // but all single stun aura spells is negative
|
||||
break;
|
||||
case SPELL_AURA_MOD_PACIFY_SILENCE:
|
||||
@@ -863,7 +863,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
|
||||
if (spellproto->EffectImplicitTargetA[effIndex] != TARGET_UNIT_CASTER)
|
||||
return false;
|
||||
// but not this if this first effect (didn't find better check)
|
||||
if (spellproto->Attributes & 0x4000000 && effIndex==0)
|
||||
if (spellproto->Attributes & 0x4000000 && effIndex == 0)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_MECHANIC_IMMUNITY:
|
||||
@@ -1017,7 +1017,7 @@ SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32
|
||||
// talents that learn spells can have stance requirements that need ignore
|
||||
// (this requirement only for client-side stance show in talent description)
|
||||
if (GetTalentSpellCost(spellInfo->Id) > 0 &&
|
||||
(spellInfo->Effect[0]==SPELL_EFFECT_LEARN_SPELL || spellInfo->Effect[1]==SPELL_EFFECT_LEARN_SPELL || spellInfo->Effect[2]==SPELL_EFFECT_LEARN_SPELL))
|
||||
(spellInfo->Effect[0] == SPELL_EFFECT_LEARN_SPELL || spellInfo->Effect[1] == SPELL_EFFECT_LEARN_SPELL || spellInfo->Effect[2] == SPELL_EFFECT_LEARN_SPELL))
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
uint32 stanceMask = (form ? 1 << (form - 1) : 0);
|
||||
@@ -1115,7 +1115,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
bool found = false;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (spellInfo->EffectImplicitTargetA[i]==TARGET_DST_DB || spellInfo->EffectImplicitTargetB[i]==TARGET_DST_DB)
|
||||
if (spellInfo->EffectImplicitTargetA[i] == TARGET_DST_DB || spellInfo->EffectImplicitTargetB[i] == TARGET_DST_DB)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -1134,7 +1134,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (st.target_X==0 && st.target_Y==0 && st.target_Z==0)
|
||||
if (st.target_X == 0 && st.target_Y == 0 && st.target_Z == 0)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID:%u) target coordinates not provided.",Spell_ID);
|
||||
continue;
|
||||
@@ -1250,7 +1250,7 @@ void SpellMgr::LoadSpellProcEvents()
|
||||
|
||||
mSpellProcEventMap[entry] = spe;
|
||||
|
||||
if (spell->procFlags==0)
|
||||
if (spell->procFlags == 0)
|
||||
{
|
||||
if (spe.procFlags == 0)
|
||||
{
|
||||
@@ -1638,7 +1638,7 @@ bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellI
|
||||
if (!spellInfo_1 || !spellInfo_2) return false;
|
||||
if (spellInfo_1->Id == spellId_2) return false;
|
||||
|
||||
return GetFirstSpellInChain(spellInfo_1->Id)==GetFirstSpellInChain(spellId_2);
|
||||
return GetFirstSpellInChain(spellInfo_1->Id) == GetFirstSpellInChain(spellId_2);
|
||||
}
|
||||
|
||||
bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
|
||||
@@ -1660,18 +1660,18 @@ bool SpellMgr::canStackSpellRanks(SpellEntry const *spellInfo)
|
||||
{
|
||||
case SPELLFAMILY_PALADIN:
|
||||
// Paladin aura Spell
|
||||
if (spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AREA_AURA_RAID)
|
||||
if (spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_RAID)
|
||||
return false;
|
||||
break;
|
||||
case SPELLFAMILY_DRUID:
|
||||
// Druid form Spell
|
||||
if (spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AURA &&
|
||||
if (spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA &&
|
||||
spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT)
|
||||
return false;
|
||||
break;
|
||||
case SPELLFAMILY_ROGUE:
|
||||
// Rogue Stealth
|
||||
if (spellInfo->Effect[i]==SPELL_EFFECT_APPLY_AURA &&
|
||||
if (spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA &&
|
||||
spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT)
|
||||
return false;
|
||||
}
|
||||
@@ -1741,7 +1741,7 @@ bool SpellMgr::IsPrimaryProfessionSpell(uint32 spellId)
|
||||
|
||||
bool SpellMgr::IsPrimaryProfessionFirstRankSpell(uint32 spellId) const
|
||||
{
|
||||
return IsPrimaryProfessionSpell(spellId) && GetSpellRank(spellId)==1;
|
||||
return IsPrimaryProfessionSpell(spellId) && GetSpellRank(spellId) == 1;
|
||||
}
|
||||
|
||||
bool SpellMgr::IsSkillBonusSpell(uint32 spellId) const
|
||||
@@ -1819,7 +1819,7 @@ void SpellMgr::LoadSpellLearnSkills()
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (entry->Effect[i]==SPELL_EFFECT_SKILL)
|
||||
if (entry->Effect[i] == SPELL_EFFECT_SKILL)
|
||||
{
|
||||
SpellLearnSkillNode dbc_node;
|
||||
dbc_node.skill = entry->EffectMiscValue[i];
|
||||
@@ -1908,7 +1908,7 @@ void SpellMgr::LoadSpellLearnSpells()
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (entry->Effect[i]==SPELL_EFFECT_LEARN_SPELL)
|
||||
if (entry->Effect[i] == SPELL_EFFECT_LEARN_SPELL)
|
||||
{
|
||||
SpellLearnSpellNode dbc_node;
|
||||
dbc_node.spell = entry->EffectTriggerSpell[i];
|
||||
@@ -1991,18 +1991,18 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
bool targetfound = false;
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_AREA_ENTRY_SRC ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_AREA_ENTRY_SRC ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_AREA_ENTRY_DST ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_AREA_ENTRY_DST ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_GAMEOBJECT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_GAMEOBJECT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_DST_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_DST_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i]==TARGET_UNIT_CONE_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i]==TARGET_UNIT_CONE_ENTRY)
|
||||
if (spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENTRY_SRC ||
|
||||
spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ENTRY_SRC ||
|
||||
spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_AREA_ENTRY_DST ||
|
||||
spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_AREA_ENTRY_DST ||
|
||||
spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i] == TARGET_GAMEOBJECT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i] == TARGET_GAMEOBJECT_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i] == TARGET_DST_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i] == TARGET_DST_NEARBY_ENTRY ||
|
||||
spellProto->EffectImplicitTargetA[i] == TARGET_UNIT_CONE_ENTRY ||
|
||||
spellProto->EffectImplicitTargetB[i] == TARGET_UNIT_CONE_ENTRY)
|
||||
{
|
||||
targetfound = true;
|
||||
break;
|
||||
@@ -2574,7 +2574,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spellArea.questEnd==spellArea.questStart && !spellArea.questStartCanActive)
|
||||
if (spellArea.questEnd == spellArea.questStart && !spellArea.questStartCanActive)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd);
|
||||
continue;
|
||||
@@ -2634,7 +2634,7 @@ void SpellMgr::LoadSpellAreas()
|
||||
}
|
||||
}
|
||||
|
||||
if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE)==0)
|
||||
if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
sLog.outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell,spellArea.raceMask);
|
||||
continue;
|
||||
|
||||
+8
-8
@@ -248,7 +248,7 @@ inline float GetSpellMaxRange(uint32 id, bool positive)
|
||||
inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
|
||||
{
|
||||
for (int i= 0; i < 3; ++i)
|
||||
if (SpellEffects(spellInfo->Effect[i])==effect)
|
||||
if (SpellEffects(spellInfo->Effect[i]) == effect)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -256,7 +256,7 @@ inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
|
||||
inline bool IsSpellHaveAura(SpellEntry const *spellInfo, AuraType aura)
|
||||
{
|
||||
for (int i= 0; i < 3; ++i)
|
||||
if (AuraType(spellInfo->EffectApplyAuraName[i])==aura)
|
||||
if (AuraType(spellInfo->EffectApplyAuraName[i]) == aura)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -283,14 +283,14 @@ inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)
|
||||
{
|
||||
return ((spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM
|
||||
&& spellInfo->Effect[1] == SPELL_EFFECT_SCRIPT_EFFECT)
|
||||
|| spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data)
|
||||
|| spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0 == SPELL_EFFECT_SCRIPT_EFFECT without any other data)
|
||||
}
|
||||
|
||||
inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
|
||||
{
|
||||
return (spellInfo->Effect[0]==SPELL_EFFECT_CREATE_RANDOM_ITEM ||
|
||||
// different random cards from Inscription (121==Virtuoso Inking Set category)
|
||||
(spellInfo->Effect[0]==SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121));
|
||||
return (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM ||
|
||||
// different random cards from Inscription (121 == Virtuoso Inking Set category)
|
||||
(spellInfo->Effect[0] == SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121));
|
||||
}
|
||||
|
||||
bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2);
|
||||
@@ -971,7 +971,7 @@ class SpellMgr
|
||||
uint16 GetSpellThreat(uint32 spellid) const
|
||||
{
|
||||
SpellThreatMap::const_iterator itr = mSpellThreatMap.find(spellid);
|
||||
if (itr==mSpellThreatMap.end())
|
||||
if (itr == mSpellThreatMap.end())
|
||||
return 0;
|
||||
|
||||
return itr->second;
|
||||
@@ -1150,7 +1150,7 @@ class SpellMgr
|
||||
{
|
||||
SpellLearnSpellMapBounds bounds = GetSpellLearnSpellMapBounds(spell_id1);
|
||||
for (SpellLearnSpellMap::const_iterator i = bounds.first; i != bounds.second; ++i)
|
||||
if (i->second.spell==spell_id2)
|
||||
if (i->second.spell == spell_id2)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
for (Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
|
||||
{
|
||||
// Predatory Strikes (effect 0)
|
||||
if ((*itr)->GetEffIndex()==0 && (*itr)->GetSpellProto()->SpellIconID == 1563)
|
||||
if ((*itr)->GetEffIndex() == 0 && (*itr)->GetSpellProto()->SpellIconID == 1563)
|
||||
{
|
||||
mLevelMult = (*itr)->GetAmount() / 100.0f;
|
||||
break;
|
||||
@@ -360,7 +360,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
//add dynamic flat mods
|
||||
if (ranged)
|
||||
{
|
||||
if ((getClassMask() & CLASSMASK_WAND_USERS)==0)
|
||||
if ((getClassMask() & CLASSMASK_WAND_USERS) == 0)
|
||||
{
|
||||
AuraEffectList const& mRAPbyStat = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
|
||||
for (AuraEffectList::const_iterator i = mRAPbyStat.begin(); i != mRAPbyStat.end(); ++i)
|
||||
@@ -661,7 +661,7 @@ void Player::UpdateAllSpellCritChances()
|
||||
|
||||
void Player::UpdateExpertise(WeaponAttackType attack)
|
||||
{
|
||||
if (attack==RANGED_ATTACK)
|
||||
if (attack == RANGED_ATTACK)
|
||||
return;
|
||||
|
||||
int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE));
|
||||
|
||||
@@ -124,7 +124,7 @@ void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathN
|
||||
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()==FLIGHT_MOTION_TYPE)
|
||||
while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
|
||||
GetPlayer()->GetMotionMaster()->MovementExpired(false);
|
||||
|
||||
if (mountDisplayId)
|
||||
@@ -216,7 +216,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data)
|
||||
// far teleport case
|
||||
if (curDestNode && curDestNode->map_id != GetPlayer()->GetMapId())
|
||||
{
|
||||
if (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()==FLIGHT_MOTION_TYPE)
|
||||
if (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
|
||||
{
|
||||
// short preparations to continue flight
|
||||
FlightPathMovementGenerator* flight = (FlightPathMovementGenerator*)(GetPlayer()->GetMotionMaster()->top());
|
||||
|
||||
@@ -248,7 +248,7 @@ void ThreatContainer::modifyThreatPercent(Unit *pVictim, int32 iPercent)
|
||||
|
||||
bool HostileReferenceSortPredicate(const HostileReference* lhs, const HostileReference* rhs)
|
||||
{
|
||||
// std::list::sort ordering predicate must be: (Pred(x,y)&&Pred(y,x))==false
|
||||
// std::list::sort ordering predicate must be: (Pred(x,y)&&Pred(y,x)) == false
|
||||
return lhs->getThreat() > rhs->getThreat(); // reverse sorting
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class HostileReference : public Reference<Unit, ThreatManager>
|
||||
void setAccessibleState(bool pIsAccessible);
|
||||
//=================================================
|
||||
|
||||
bool operator ==(const HostileReference& pHostileReference) const { return pHostileReference.getUnitGuid() == getUnitGuid(); }
|
||||
bool operator == (const HostileReference& pHostileReference) const { return pHostileReference.getUnitGuid() == getUnitGuid(); }
|
||||
|
||||
//=================================================
|
||||
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ void Totem::UnSummon()
|
||||
// clear owner's totem slot
|
||||
for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
|
||||
{
|
||||
if (m_owner->m_SummonSlot[i]==GetGUID())
|
||||
if (m_owner->m_SummonSlot[i] == GetGUID())
|
||||
{
|
||||
m_owner->m_SummonSlot[i] = 0;
|
||||
break;
|
||||
|
||||
@@ -183,8 +183,8 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
||||
{
|
||||
ItemPosCountVec traderDst;
|
||||
ItemPosCountVec playerDst;
|
||||
bool traderCanTrade = (myItems[i]==NULL || _player->pTrader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, myItems[i], false) == EQUIP_ERR_OK);
|
||||
bool playerCanTrade = (hisItems[i]==NULL || _player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, hisItems[i], false) == EQUIP_ERR_OK);
|
||||
bool traderCanTrade = (myItems[i] == NULL || _player->pTrader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, myItems[i], false) == EQUIP_ERR_OK);
|
||||
bool playerCanTrade = (hisItems[i] == NULL || _player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, hisItems[i], false) == EQUIP_ERR_OK);
|
||||
if (traderCanTrade && playerCanTrade)
|
||||
{
|
||||
// Ok, if trade item exists and can be stored
|
||||
@@ -336,7 +336,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
||||
}
|
||||
|
||||
// test if item will fit in each inventory
|
||||
hisCanCompleteTrade = (_player->pTrader->CanStoreItems(myItems,TRADE_SLOT_TRADED_COUNT)== EQUIP_ERR_OK);
|
||||
hisCanCompleteTrade = (_player->pTrader->CanStoreItems(myItems,TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK);
|
||||
myCanCompleteTrade = (_player->CanStoreItems(hisItems,TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK);
|
||||
|
||||
// clear 'in-trade' flag
|
||||
|
||||
@@ -543,10 +543,10 @@ void Transport::Update(uint32 /*p_time*/)
|
||||
|
||||
m_nextNodeTime = m_curr->first;
|
||||
|
||||
if (m_curr == m_WayPoints.begin() && (sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0)
|
||||
if (m_curr == m_WayPoints.begin() && (sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0)
|
||||
sLog.outDetail(" ************ BEGIN ************** %s", this->m_name.c_str());
|
||||
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0)
|
||||
if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0)
|
||||
sLog.outDetail("%s moved to %d %f %f %f %d", this->m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
|
||||
|
||||
//Transport Event System
|
||||
@@ -560,7 +560,7 @@ void Transport::UpdateForMap(Map const* targetMap)
|
||||
if (pl.isEmpty())
|
||||
return;
|
||||
|
||||
if (GetMapId()==targetMap->GetId())
|
||||
if (GetMapId() == targetMap->GetId())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
{
|
||||
|
||||
+80
-80
@@ -614,7 +614,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
|
||||
|
||||
// Rage from Damage made (only from direct weapon damage)
|
||||
if (cleanDamage && damagetype==DIRECT_DAMAGE && this != pVictim && getPowerType() == POWER_RAGE)
|
||||
if (cleanDamage && damagetype == DIRECT_DAMAGE && this != pVictim && getPowerType() == POWER_RAGE)
|
||||
{
|
||||
uint32 weaponSpeedHitFactor;
|
||||
uint32 rage_damage = damage + cleanDamage->absorbed_damage;
|
||||
@@ -690,7 +690,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && pVictim->ToPlayer()->duel && damage >= (health-1))
|
||||
{
|
||||
// prevent kill only if killed in duel and killed by opponent or opponent controlled creature
|
||||
if (pVictim->ToPlayer()->duel->opponent==this || pVictim->ToPlayer()->duel->opponent->GetGUID() == GetOwnerGUID())
|
||||
if (pVictim->ToPlayer()->duel->opponent == this || pVictim->ToPlayer()->duel->opponent->GetGUID() == GetOwnerGUID())
|
||||
damage = health-1;
|
||||
|
||||
duel_hasEnded = true;
|
||||
@@ -1144,7 +1144,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
|
||||
|
||||
void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
|
||||
{
|
||||
if (damageInfo==0)
|
||||
if (damageInfo == 0)
|
||||
return;
|
||||
|
||||
Unit *pVictim = damageInfo->target;
|
||||
@@ -1447,7 +1447,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
||||
DealDamage(pVictim, damageInfo->damage, &cleanDamage, DIRECT_DAMAGE, SpellSchoolMask(damageInfo->damageSchoolMask), NULL, durabilityLoss);
|
||||
|
||||
// If this is a creature and it attacks from behind it has a probability to daze it's victim
|
||||
if ((damageInfo->hitOutCome==MELEE_HIT_CRIT || damageInfo->hitOutCome==MELEE_HIT_CRUSHING || damageInfo->hitOutCome==MELEE_HIT_NORMAL || damageInfo->hitOutCome==MELEE_HIT_GLANCING) &&
|
||||
if ((damageInfo->hitOutCome == MELEE_HIT_CRIT || damageInfo->hitOutCome == MELEE_HIT_CRUSHING || damageInfo->hitOutCome == MELEE_HIT_NORMAL || damageInfo->hitOutCome == MELEE_HIT_GLANCING) &&
|
||||
GetTypeId() != TYPEID_PLAYER && !this->ToCreature()->IsControlledByPlayer() && !pVictim->HasInArc(M_PI, this)
|
||||
&& (pVictim->GetTypeId() == TYPEID_PLAYER || !pVictim->ToCreature()->isWorldBoss()))
|
||||
{
|
||||
@@ -1993,7 +1993,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
|
||||
next = i; ++next;
|
||||
|
||||
// check damage school mask
|
||||
if (((*i)->GetMiscValue() & schoolMask)==0)
|
||||
if (((*i)->GetMiscValue() & schoolMask) == 0)
|
||||
continue;
|
||||
|
||||
int32 currentAbsorb;
|
||||
@@ -2066,7 +2066,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
|
||||
next = i; ++next;
|
||||
|
||||
// check damage school mask
|
||||
if (((*i)->GetMiscValue() & schoolMask)==0)
|
||||
if (((*i)->GetMiscValue() & schoolMask) == 0)
|
||||
continue;
|
||||
|
||||
// Damage can be splitted only if aura has an alive caster
|
||||
@@ -2114,7 +2114,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff
|
||||
{
|
||||
pVictim->CastSpell(pVictim,31231,true);
|
||||
pVictim->ToPlayer()->AddSpellCooldown(31231,0,time(NULL)+60);
|
||||
// with health > 10% lost health until health==10%, in other case no losses
|
||||
// with health > 10% lost health until health == 10%, in other case no losses
|
||||
uint32 health10 = pVictim->GetMaxHealth()/10;
|
||||
RemainingDamage = pVictim->GetHealth() > health10 ? pVictim->GetHealth() - health10 : 0;
|
||||
}
|
||||
@@ -2493,7 +2493,7 @@ bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, Weap
|
||||
{
|
||||
if (!(*i)->IsAffectedOnSpell(spellProto))
|
||||
continue;
|
||||
if ((*i)->GetMiscValue() ==)
|
||||
if ((*i)->GetMiscValue() == )
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
@@ -3386,22 +3386,22 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip
|
||||
void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id, bool withInstant)
|
||||
{
|
||||
// generic spells are interrupted if they are not finished or delayed
|
||||
if (m_currentSpells[CURRENT_GENERIC_SPELL] && (!spell_id || m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id==spell_id))
|
||||
if (m_currentSpells[CURRENT_GENERIC_SPELL] && (!spell_id || m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == spell_id))
|
||||
InterruptSpell(CURRENT_GENERIC_SPELL,withDelayed,withInstant);
|
||||
|
||||
// autorepeat spells are interrupted if they are not finished or delayed
|
||||
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && (!spell_id || m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id==spell_id))
|
||||
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && (!spell_id || m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == spell_id))
|
||||
InterruptSpell(CURRENT_AUTOREPEAT_SPELL,withDelayed,withInstant);
|
||||
|
||||
// channeled spells are interrupted if they are not finished, even if they are delayed
|
||||
if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spell_id))
|
||||
if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id == spell_id))
|
||||
InterruptSpell(CURRENT_CHANNELED_SPELL,true,true);
|
||||
}
|
||||
|
||||
Spell* Unit::FindCurrentSpellBySpellId(uint32 spell_id) const
|
||||
{
|
||||
for (uint32 i = 0; i < CURRENT_MAX_SPELL; i++)
|
||||
if (m_currentSpells[i] && m_currentSpells[i]->m_spellInfo->Id==spell_id)
|
||||
if (m_currentSpells[i] && m_currentSpells[i]->m_spellInfo->Id == spell_id)
|
||||
return m_currentSpells[i];
|
||||
return NULL;
|
||||
}
|
||||
@@ -4526,7 +4526,7 @@ uint32 Unit::GetDiseasesByCaster(uint64 casterGUID, bool remove)
|
||||
{
|
||||
// Get auras with disease dispel type by caster
|
||||
if ((*i)->GetSpellProto()->Dispel == DISPEL_DISEASE
|
||||
&& (*i)->GetCasterGUID()==casterGUID)
|
||||
&& (*i)->GetCasterGUID() == casterGUID)
|
||||
{
|
||||
++diseases;
|
||||
|
||||
@@ -4559,7 +4559,7 @@ uint32 Unit::GetDoTsByCaster(uint64 casterGUID) const
|
||||
for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
|
||||
{
|
||||
// Get auras by caster
|
||||
if ((*i)->GetCasterGUID()==casterGUID)
|
||||
if ((*i)->GetCasterGUID() == casterGUID)
|
||||
++dots;
|
||||
}
|
||||
}
|
||||
@@ -4675,7 +4675,7 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value)
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetMiscValue()== misc_value)
|
||||
if ((*i)->GetMiscValue() == misc_value)
|
||||
modifier += (*i)->GetAmount();
|
||||
}
|
||||
return modifier;
|
||||
@@ -4688,7 +4688,7 @@ float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_valu
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetMiscValue()== misc_value)
|
||||
if ((*i)->GetMiscValue() == misc_value)
|
||||
multiplier *= (100.0f + (*i)->GetAmount())/100.0f;
|
||||
}
|
||||
return multiplier;
|
||||
@@ -4701,7 +4701,7 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetMiscValue()== misc_value && (*i)->GetAmount() > modifier)
|
||||
if ((*i)->GetMiscValue() == misc_value && (*i)->GetAmount() > modifier)
|
||||
modifier = (*i)->GetAmount();
|
||||
}
|
||||
|
||||
@@ -4715,7 +4715,7 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
|
||||
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype);
|
||||
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetMiscValue()== misc_value && (*i)->GetAmount() < modifier)
|
||||
if ((*i)->GetMiscValue() == misc_value && (*i)->GetAmount() < modifier)
|
||||
modifier = (*i)->GetAmount();
|
||||
}
|
||||
|
||||
@@ -4788,7 +4788,7 @@ GameObject* Unit::GetGameObject(uint32 spellId) const
|
||||
|
||||
void Unit::AddGameObject(GameObject* gameObj)
|
||||
{
|
||||
if (!gameObj || !gameObj->GetOwnerGUID()==0) return;
|
||||
if (!gameObj || !gameObj->GetOwnerGUID() == 0) return;
|
||||
m_gameObj.push_back(gameObj);
|
||||
gameObj->SetOwnerGUID(GetGUID());
|
||||
|
||||
@@ -4804,7 +4804,7 @@ void Unit::AddGameObject(GameObject* gameObj)
|
||||
|
||||
void Unit::RemoveGameObject(GameObject* gameObj, bool del)
|
||||
{
|
||||
if (!gameObj || !gameObj->GetOwnerGUID()==GetGUID()) return;
|
||||
if (!gameObj || !gameObj->GetOwnerGUID() == GetGUID()) return;
|
||||
|
||||
gameObj->SetOwnerGUID(0);
|
||||
|
||||
@@ -5936,7 +5936,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
AuraEffectList const& SoulLeechAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY);
|
||||
for (Unit::AuraEffectList::const_iterator i = SoulLeechAuras.begin(); i != SoulLeechAuras.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetId()==54117 || (*i)->GetId()==54118)
|
||||
if ((*i)->GetId() == 54117 || (*i)->GetId() == 54118)
|
||||
{
|
||||
if ((*i)->GetEffIndex() != 0)
|
||||
continue;
|
||||
@@ -6126,7 +6126,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
// Frozen Shadoweave (Shadow's Embrace set) warning! its not only priest set
|
||||
case 39372:
|
||||
{
|
||||
if (!procSpell || (GetSpellSchoolMask(procSpell) & (SPELL_SCHOOL_MASK_FROST | SPELL_SCHOOL_MASK_SHADOW))==0)
|
||||
if (!procSpell || (GetSpellSchoolMask(procSpell) & (SPELL_SCHOOL_MASK_FROST | SPELL_SCHOOL_MASK_SHADOW)) == 0)
|
||||
return false;
|
||||
|
||||
// heal amount
|
||||
@@ -6304,7 +6304,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
else if (dummySpell->SpellIconID == 2850)
|
||||
{
|
||||
// Effect 0 - mod damage while having Enrage
|
||||
if (effIndex==0)
|
||||
if (effIndex == 0)
|
||||
{
|
||||
if (!(procSpell->SpellFamilyFlags[0] & 0x00080000))
|
||||
return false;
|
||||
@@ -6314,7 +6314,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
break;
|
||||
}
|
||||
// Effect 1 - Tiger's Fury restore energy
|
||||
else if (effIndex==1)
|
||||
else if (effIndex == 1)
|
||||
{
|
||||
if (!(procSpell->SpellFamilyFlags[2] & 0x00000800))
|
||||
return false;
|
||||
@@ -7367,11 +7367,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
{
|
||||
for (uint8 i=0; i<MAX_SPELL_EFFECTS; i++)
|
||||
{
|
||||
if (procSpell->Effect[i]==SPELL_EFFECT_HEAL)
|
||||
if (procSpell->Effect[i] == SPELL_EFFECT_HEAL)
|
||||
{
|
||||
triggered_spell_id = 21399;
|
||||
}
|
||||
else if (procSpell->Effect[i]==SPELL_EFFECT_ENERGIZE)
|
||||
else if (procSpell->Effect[i] == SPELL_EFFECT_ENERGIZE)
|
||||
{
|
||||
triggered_spell_id = 21400;
|
||||
}
|
||||
@@ -7822,7 +7822,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
case SPELLFAMILY_PRIEST:
|
||||
{
|
||||
// Greater Heal Refund
|
||||
if (auraSpellInfo->Id==37594)
|
||||
if (auraSpellInfo->Id == 37594)
|
||||
trigger_spell_id = 37595;
|
||||
// Blessed Recovery
|
||||
else if (auraSpellInfo->SpellIconID == 1875)
|
||||
@@ -7844,7 +7844,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
case SPELLFAMILY_DRUID:
|
||||
{
|
||||
// Druid Forms Trinket
|
||||
if (auraSpellInfo->Id==37336)
|
||||
if (auraSpellInfo->Id == 37336)
|
||||
{
|
||||
switch(m_form)
|
||||
{
|
||||
@@ -7859,7 +7859,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
}
|
||||
}
|
||||
// Druid T9 Feral Relic (Lacerate, Swipe, Mangle, and Shred)
|
||||
else if (auraSpellInfo->Id==67353)
|
||||
else if (auraSpellInfo->Id == 67353)
|
||||
{
|
||||
switch(m_form)
|
||||
{
|
||||
@@ -7952,7 +7952,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
}
|
||||
default:
|
||||
// Illumination
|
||||
if (auraSpellInfo->SpellIconID==241)
|
||||
if (auraSpellInfo->SpellIconID == 241)
|
||||
{
|
||||
if (!procSpell)
|
||||
return false;
|
||||
@@ -8277,7 +8277,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
|
||||
// Enlightenment (trigger only from mana cost spells)
|
||||
case 35095:
|
||||
{
|
||||
if (!procSpell || procSpell->powerType!=POWER_MANA || procSpell->manaCost==0 && procSpell->ManaCostPercentage==0 && procSpell->manaCostPerlevel==0)
|
||||
if (!procSpell || procSpell->powerType!=POWER_MANA || procSpell->manaCost == 0 && procSpell->ManaCostPercentage == 0 && procSpell->manaCostPerlevel == 0)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
@@ -8568,7 +8568,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
if (!unit)
|
||||
return false;
|
||||
// always non-hostile to self
|
||||
if (unit==this)
|
||||
if (unit == this)
|
||||
return false;
|
||||
|
||||
// always non-hostile to GM in GM mode
|
||||
@@ -8576,7 +8576,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
return false;
|
||||
|
||||
// always hostile to enemy
|
||||
if (getVictim()==unit || unit->getVictim()==this)
|
||||
if (getVictim() == unit || unit->getVictim() == this)
|
||||
return true;
|
||||
|
||||
// test pet/charm masters instead pers/charmeds
|
||||
@@ -8584,22 +8584,22 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
Unit const* targetOwner = unit->GetCharmerOrOwner();
|
||||
|
||||
// always hostile to owner's enemy
|
||||
if (testerOwner && (testerOwner->getVictim()==unit || unit->getVictim()==testerOwner))
|
||||
if (testerOwner && (testerOwner->getVictim() == unit || unit->getVictim() == testerOwner))
|
||||
return true;
|
||||
|
||||
// always hostile to enemy owner
|
||||
if (targetOwner && (getVictim()==targetOwner || targetOwner->getVictim()==this))
|
||||
if (targetOwner && (getVictim() == targetOwner || targetOwner->getVictim() == this))
|
||||
return true;
|
||||
|
||||
// always hostile to owner of owner's enemy
|
||||
if (testerOwner && targetOwner && (testerOwner->getVictim()==targetOwner || targetOwner->getVictim()==testerOwner))
|
||||
if (testerOwner && targetOwner && (testerOwner->getVictim() == targetOwner || targetOwner->getVictim() == testerOwner))
|
||||
return true;
|
||||
|
||||
Unit const* tester = testerOwner ? testerOwner : this;
|
||||
Unit const* target = targetOwner ? targetOwner : unit;
|
||||
|
||||
// always non-hostile to target with common owner, or to owner/pet
|
||||
if (tester==target)
|
||||
if (tester == target)
|
||||
return false;
|
||||
|
||||
// special cases (Duel, etc)
|
||||
@@ -8613,7 +8613,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
return true;
|
||||
|
||||
// Group
|
||||
if (pTester->GetGroup() && pTester->GetGroup()==pTarget->GetGroup())
|
||||
if (pTester->GetGroup() && pTester->GetGroup() == pTarget->GetGroup())
|
||||
return false;
|
||||
|
||||
// Sanctuary
|
||||
@@ -8628,7 +8628,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
// Green/Blue (can't attack)
|
||||
if (!pTester->HasAuraType(SPELL_AURA_MOD_FACTION) && !pTarget->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||
{
|
||||
if (pTester->GetTeam()==pTarget->GetTeam())
|
||||
if (pTester->GetTeam() == pTarget->GetTeam())
|
||||
return false;
|
||||
|
||||
// Red (can attack) if true, Blue/Yellow (can't attack) in another case
|
||||
@@ -8683,7 +8683,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
{
|
||||
// always friendly to self
|
||||
if (unit==this)
|
||||
if (unit == this)
|
||||
return true;
|
||||
|
||||
// always friendly to GM in GM mode
|
||||
@@ -8691,7 +8691,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
return true;
|
||||
|
||||
// always non-friendly to enemy
|
||||
if (getVictim()==unit || unit->getVictim()==this)
|
||||
if (getVictim() == unit || unit->getVictim() == this)
|
||||
return false;
|
||||
|
||||
// test pet/charm masters instead pers/charmeds
|
||||
@@ -8699,22 +8699,22 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
Unit const* targetOwner = unit->GetCharmerOrOwner();
|
||||
|
||||
// always non-friendly to owner's enemy
|
||||
if (testerOwner && (testerOwner->getVictim()==unit || unit->getVictim()==testerOwner))
|
||||
if (testerOwner && (testerOwner->getVictim() == unit || unit->getVictim() == testerOwner))
|
||||
return false;
|
||||
|
||||
// always non-friendly to enemy owner
|
||||
if (targetOwner && (getVictim()==targetOwner || targetOwner->getVictim()==this))
|
||||
if (targetOwner && (getVictim() == targetOwner || targetOwner->getVictim() == this))
|
||||
return false;
|
||||
|
||||
// always non-friendly to owner of owner's enemy
|
||||
if (testerOwner && targetOwner && (testerOwner->getVictim()==targetOwner || targetOwner->getVictim()==testerOwner))
|
||||
if (testerOwner && targetOwner && (testerOwner->getVictim() == targetOwner || targetOwner->getVictim() == testerOwner))
|
||||
return false;
|
||||
|
||||
Unit const* tester = testerOwner ? testerOwner : this;
|
||||
Unit const* target = targetOwner ? targetOwner : unit;
|
||||
|
||||
// always friendly to target with common owner, or to owner/pet
|
||||
if (tester==target)
|
||||
if (tester == target)
|
||||
return true;
|
||||
|
||||
// special cases (Duel)
|
||||
@@ -8728,7 +8728,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
return false;
|
||||
|
||||
// Group
|
||||
if (pTester->GetGroup() && pTester->GetGroup()==pTarget->GetGroup())
|
||||
if (pTester->GetGroup() && pTester->GetGroup() == pTarget->GetGroup())
|
||||
return true;
|
||||
|
||||
// Sanctuary
|
||||
@@ -8743,7 +8743,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
// Green/Blue (non-attackable)
|
||||
if (!pTester->HasAuraType(SPELL_AURA_MOD_FACTION) && !pTarget->HasAuraType(SPELL_AURA_MOD_FACTION))
|
||||
{
|
||||
if (pTester->GetTeam()==pTarget->GetTeam())
|
||||
if (pTester->GetTeam() == pTarget->GetTeam())
|
||||
return true;
|
||||
|
||||
// Blue (friendly/non-attackable) if not PVP, or Yellow/Red in another case (attackable)
|
||||
@@ -9857,13 +9857,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
|
||||
case SPELLFAMILY_PALADIN:
|
||||
// Judgement of Vengeance/Judgement of Corruption
|
||||
if ((spellProto->SpellFamilyFlags[1] & 0x400000) && spellProto->SpellIconID==2292)
|
||||
if ((spellProto->SpellFamilyFlags[1] & 0x400000) && spellProto->SpellIconID == 2292)
|
||||
{
|
||||
// Get stack of Holy Vengeance/Blood Corruption on the target added by caster
|
||||
uint32 stacks = 0;
|
||||
Unit::AuraEffectList const& auras = pVictim->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
|
||||
if (((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID()==GetGUID())
|
||||
if (((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID() == GetGUID())
|
||||
{
|
||||
stacks = (*itr)->GetBase()->GetStackAmount();
|
||||
break;
|
||||
@@ -10529,7 +10529,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
|
||||
coeff = 1.0f;
|
||||
}
|
||||
// Earthliving - 0.45% of normal hot coeff
|
||||
else if (spellProto->SpellFamilyName==SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000)
|
||||
else if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000)
|
||||
factorMod *= 0.45f;
|
||||
// Already set to scripted? so not uses healing bonus coefficient
|
||||
// No heal coeff for SPELL_DAMAGE_CLASS_NONE class spells by default
|
||||
@@ -10658,7 +10658,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
|
||||
|
||||
AuraEffectList const& mHealingGet= pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED);
|
||||
for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i)
|
||||
if (GetGUID()==(*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto))
|
||||
if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto))
|
||||
TakenTotalMod *= ((*i)->GetAmount() + 100.0f) / 100.0f;
|
||||
|
||||
heal = (int32(heal) + TakenTotal) * TakenTotalMod;
|
||||
@@ -11280,7 +11280,7 @@ void Unit::Unmount()
|
||||
else
|
||||
this->ToPlayer()->ResummonPetTemporaryUnSummonedIfAny();
|
||||
}
|
||||
if (GetTypeId()==TYPEID_PLAYER && GetVehicleKit())
|
||||
if (GetTypeId() == TYPEID_PLAYER && GetVehicleKit())
|
||||
{
|
||||
// Send other players that we are no longer a vehicle
|
||||
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, 8+4);
|
||||
@@ -11482,7 +11482,7 @@ int32 Unit::ModifyHealth(int32 dVal)
|
||||
{
|
||||
int32 gain = 0;
|
||||
|
||||
if (dVal==0)
|
||||
if (dVal == 0)
|
||||
return 0;
|
||||
|
||||
int32 curHealth = (int32)GetHealth();
|
||||
@@ -11514,7 +11514,7 @@ int32 Unit::GetHealthGain(int32 dVal)
|
||||
{
|
||||
int32 gain = 0;
|
||||
|
||||
if (dVal==0)
|
||||
if (dVal == 0)
|
||||
return 0;
|
||||
|
||||
int32 curHealth = (int32)GetHealth();
|
||||
@@ -11539,7 +11539,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal)
|
||||
{
|
||||
int32 gain = 0;
|
||||
|
||||
if (dVal==0)
|
||||
if (dVal == 0)
|
||||
return 0;
|
||||
|
||||
int32 curPower = (int32)GetPower(power);
|
||||
@@ -11586,26 +11586,26 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
|
||||
return true;
|
||||
AuraEffectList const& auras = u->GetAuraEffectsByType(SPELL_AURA_MOD_STALKED); // Hunter mark
|
||||
for (AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
|
||||
if ((*iter)->GetCasterGUID()==GetGUID())
|
||||
if ((*iter)->GetCasterGUID() == GetGUID())
|
||||
return true;
|
||||
|
||||
if (uint32 mask = (m_detectInvisibilityMask & u->m_invisibilityMask))
|
||||
{
|
||||
for (uint32 i = 0; i < 10; ++i)
|
||||
{
|
||||
if (((1 << i) & mask)==0)
|
||||
if (((1 << i) & mask) == 0)
|
||||
continue;
|
||||
|
||||
// find invisibility level
|
||||
uint32 invLevel = 0;
|
||||
Unit::AuraEffectList const& iAuras = u->GetAuraEffectsByType(SPELL_AURA_MOD_INVISIBILITY);
|
||||
for (Unit::AuraEffectList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
|
||||
if (((*itr)->GetMiscValue())==i && invLevel < (*itr)->GetAmount())
|
||||
if (((*itr)->GetMiscValue()) == i && invLevel < (*itr)->GetAmount())
|
||||
invLevel = (*itr)->GetAmount();
|
||||
|
||||
// find invisibility detect level
|
||||
uint32 detectLevel = 0;
|
||||
if (i==6 && GetTypeId() == TYPEID_PLAYER) // special drunk detection case
|
||||
if (i == 6 && GetTypeId() == TYPEID_PLAYER) // special drunk detection case
|
||||
{
|
||||
detectLevel = this->ToPlayer()->GetDrunkValue();
|
||||
}
|
||||
@@ -11613,7 +11613,7 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
|
||||
{
|
||||
Unit::AuraEffectList const& dAuras = GetAuraEffectsByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
|
||||
for (Unit::AuraEffectList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr)
|
||||
if (((*itr)->GetMiscValue())==i && detectLevel < (*itr)->GetAmount())
|
||||
if (((*itr)->GetMiscValue()) == i && detectLevel < (*itr)->GetAmount())
|
||||
detectLevel = (*itr)->GetAmount();
|
||||
}
|
||||
|
||||
@@ -12408,7 +12408,7 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
|
||||
return DIMINISHING_LEVEL_1;
|
||||
|
||||
// If last spell was casted more than 15 seconds ago - reset the count.
|
||||
if (i->stack==0 && getMSTimeDiff(i->hitTime,getMSTime()) > 15000)
|
||||
if (i->stack == 0 && getMSTimeDiff(i->hitTime,getMSTime()) > 15000)
|
||||
{
|
||||
i->hitCount = DIMINISHING_LEVEL_1;
|
||||
return DIMINISHING_LEVEL_1;
|
||||
@@ -13547,8 +13547,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag,
|
||||
// Skip this auras
|
||||
if (isNonTriggerAura[aurEff->GetAuraType()])
|
||||
continue;
|
||||
// If not trigger by default and spellProcEvent==NULL - skip
|
||||
if (!isTriggerAura[aurEff->GetAuraType()] && triggerData.spellProcEvent==NULL)
|
||||
// If not trigger by default and spellProcEvent == NULL - skip
|
||||
if (!isTriggerAura[aurEff->GetAuraType()] && triggerData.spellProcEvent == NULL)
|
||||
continue;
|
||||
uint32 triggered_spell_id = aurEff->GetSpellProto()->EffectTriggerSpell[i];
|
||||
// check for positive auras that proc with charge drop
|
||||
@@ -13913,7 +13913,7 @@ bool Unit::IsPolymorphed() const
|
||||
if (!spellInfo)
|
||||
return false;
|
||||
|
||||
return GetSpellSpecific(spellInfo)==SPELL_SPECIFIC_MAGE_POLYMORPH;
|
||||
return GetSpellSpecific(spellInfo) == SPELL_SPECIFIC_MAGE_POLYMORPH;
|
||||
}
|
||||
|
||||
void Unit::SetDisplayId(uint32 modelId)
|
||||
@@ -13938,7 +13938,7 @@ void Unit::ClearComboPointHolders()
|
||||
uint32 lowguid = *m_ComboPointHolders.begin();
|
||||
|
||||
Player* plr = objmgr.GetPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER));
|
||||
if (plr && plr->GetComboTarget()==GetGUID()) // recheck for safe
|
||||
if (plr && plr->GetComboTarget() == GetGUID()) // recheck for safe
|
||||
plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders;
|
||||
else
|
||||
m_ComboPointHolders.erase(lowguid); // or remove manually
|
||||
@@ -14059,8 +14059,8 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply)
|
||||
|
||||
uint32 Unit::GetCastingTimeForBonus(SpellEntry const *spellProto, DamageEffectType damagetype, uint32 CastingTime)
|
||||
{
|
||||
// Not apply this to creature casted spells with casttime==0
|
||||
if (CastingTime==0 && GetTypeId() == TYPEID_UNIT && !this->ToCreature()->isPet())
|
||||
// Not apply this to creature casted spells with casttime == 0
|
||||
if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !this->ToCreature()->isPet())
|
||||
return 3500;
|
||||
|
||||
if (CastingTime > 7000) CastingTime = 7000;
|
||||
@@ -14196,7 +14196,7 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized)
|
||||
case INVTYPE_WEAPONMAINHAND:
|
||||
case INVTYPE_WEAPONOFFHAND:
|
||||
default:
|
||||
return Weapon->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_DAGGER ? 1.7 : 2.4;
|
||||
return Weapon->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER ? 1.7 : 2.4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14609,7 +14609,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
AuraEffectList const& vDummyAuras = pVictim->GetAuraEffectsByType(SPELL_AURA_DUMMY);
|
||||
for (AuraEffectList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetSpellProto()->SpellIconID==1654)
|
||||
if ((*itr)->GetSpellProto()->SpellIconID == 1654)
|
||||
{
|
||||
// save value before aura remove
|
||||
uint32 ressSpellId = pVictim->GetUInt32Value(PLAYER_SELF_RES_SPELL);
|
||||
@@ -14891,7 +14891,7 @@ void Unit::SetFeared(bool apply)
|
||||
caster = ObjectAccessor::GetUnit(*this, fearAuras.front()->GetCasterGUID());
|
||||
if (!caster)
|
||||
caster = getAttackerForHelper();
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld.getConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster==NULL processed in MoveFleeing
|
||||
GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld.getConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == NULL processed in MoveFleeing
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -15313,7 +15313,7 @@ void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
if (Target && Target->GetSubGroup()==subgroup && !IsHostileTo(Target))
|
||||
if (Target && Target->GetSubGroup() == subgroup && !IsHostileTo(Target))
|
||||
{
|
||||
if (Target->isAlive() && IsWithinDistInMap(Target, radius))
|
||||
TagUnitMap.push_back(Target);
|
||||
@@ -15350,7 +15350,7 @@ void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
|
||||
Player* Target = itr->getSource();
|
||||
|
||||
// IsHostileTo check duel and controlled by enemy
|
||||
if (Target && Target->GetSubGroup()==subgroup && !IsHostileTo(Target))
|
||||
if (Target && Target->GetSubGroup() == subgroup && !IsHostileTo(Target))
|
||||
{
|
||||
if (Target->isAlive() && IsInMap(Target))
|
||||
TagUnitMap.push_back(Target);
|
||||
@@ -15644,7 +15644,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form)
|
||||
return 8571;
|
||||
}
|
||||
}
|
||||
else if (Player::TeamForRace(getRace())==ALLIANCE)
|
||||
else if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
return 892;
|
||||
else
|
||||
return 8571;
|
||||
@@ -15723,14 +15723,14 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form)
|
||||
return 2289;
|
||||
}
|
||||
}
|
||||
else if (Player::TeamForRace(getRace())==ALLIANCE)
|
||||
else if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
return 2281;
|
||||
else
|
||||
return 2289;
|
||||
case FORM_TRAVEL:
|
||||
return 632;
|
||||
case FORM_AQUA:
|
||||
if (Player::TeamForRace(getRace())==ALLIANCE)
|
||||
if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
return 2428;
|
||||
else
|
||||
return 2428;
|
||||
@@ -15741,17 +15741,17 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form)
|
||||
case FORM_GHOSTWOLF:
|
||||
return 4613;
|
||||
case FORM_FLIGHT:
|
||||
if (Player::TeamForRace(getRace())==ALLIANCE)
|
||||
if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
return 20857;
|
||||
else
|
||||
return 20872;
|
||||
case FORM_MOONKIN:
|
||||
if (Player::TeamForRace(getRace())==ALLIANCE)
|
||||
if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
return 15374;
|
||||
else
|
||||
return 15375;
|
||||
case FORM_FLIGHT_EPIC:
|
||||
if (Player::TeamForRace(getRace())==ALLIANCE)
|
||||
if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
return 21243;
|
||||
else
|
||||
return 21244;
|
||||
@@ -16176,7 +16176,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
{
|
||||
if (Unit* victim = getVictim())
|
||||
{
|
||||
if (victim->getFactionTemplateEntry()->faction==faction_id)
|
||||
if (victim->getFactionTemplateEntry()->faction == faction_id)
|
||||
{
|
||||
AttackStop();
|
||||
if (IsNonMeleeSpellCasted(false))
|
||||
@@ -16191,7 +16191,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
AttackerSet const& attackers = getAttackers();
|
||||
for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
|
||||
{
|
||||
if ((*itr)->getFactionTemplateEntry()->faction==faction_id)
|
||||
if ((*itr)->getFactionTemplateEntry()->faction == faction_id)
|
||||
{
|
||||
(*itr)->AttackStop();
|
||||
itr = attackers.begin();
|
||||
|
||||
+1
-1
@@ -1169,7 +1169,7 @@ class Unit : public WorldObject
|
||||
bool CanFreeMove() const
|
||||
{
|
||||
return !hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT |
|
||||
UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID()==0;
|
||||
UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID() == 0;
|
||||
}
|
||||
|
||||
uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
|
||||
|
||||
+10
-10
@@ -341,7 +341,7 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
|
||||
|
||||
for (; iter != m_QueuedPlayer.end(); ++iter, ++position)
|
||||
{
|
||||
if (*iter==sess)
|
||||
if (*iter == sess)
|
||||
{
|
||||
sess->SetInQueue(false);
|
||||
iter = m_QueuedPlayer.erase(iter);
|
||||
@@ -2199,7 +2199,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
|
||||
|
||||
if (!resultAccounts)
|
||||
{
|
||||
if (mode==BAN_IP)
|
||||
if (mode == BAN_IP)
|
||||
return BAN_SUCCESS; // ip correctly banned but nobody affected (yet)
|
||||
else
|
||||
return BAN_NOTFOUND; // Nobody to ban
|
||||
@@ -2266,7 +2266,7 @@ void World::_UpdateGameTime()
|
||||
///- ... and it is overdue, stop the world (set m_stopEvent)
|
||||
if (m_ShutdownTimer <= elapsed)
|
||||
{
|
||||
if (!(m_ShutdownMask & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount()==0)
|
||||
if (!(m_ShutdownMask & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0)
|
||||
m_stopEvent = true; // exist code already set
|
||||
else
|
||||
m_ShutdownTimer = 1; // minimum timer value to wait idle state
|
||||
@@ -2292,9 +2292,9 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode)
|
||||
m_ExitCode = exitcode;
|
||||
|
||||
///- If the shutdown time is 0, set m_stopEvent (except if shutdown is 'idle' with remaining sessions)
|
||||
if (time==0)
|
||||
if (time == 0)
|
||||
{
|
||||
if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount()==0)
|
||||
if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0)
|
||||
m_stopEvent = true; // exist code already set
|
||||
else
|
||||
m_ShutdownTimer = 1; //So that the session count is re-evaluated at next world tick
|
||||
@@ -2320,15 +2320,15 @@ void World::ShutdownMsg(bool show, Player* player)
|
||||
if (show ||
|
||||
(m_ShutdownTimer < 10) ||
|
||||
// < 30 sec; every 5 sec
|
||||
(m_ShutdownTimer<30 && (m_ShutdownTimer % 5)==0) ||
|
||||
(m_ShutdownTimer<30 && (m_ShutdownTimer % 5) == 0) ||
|
||||
// < 5 min ; every 1 min
|
||||
(m_ShutdownTimer<5*MINUTE && (m_ShutdownTimer % MINUTE)==0) ||
|
||||
(m_ShutdownTimer<5*MINUTE && (m_ShutdownTimer % MINUTE) == 0) ||
|
||||
// < 30 min ; every 5 min
|
||||
(m_ShutdownTimer<30*MINUTE && (m_ShutdownTimer % (5*MINUTE))==0) ||
|
||||
(m_ShutdownTimer<30*MINUTE && (m_ShutdownTimer % (5*MINUTE)) == 0) ||
|
||||
// < 12 h ; every 1 h
|
||||
(m_ShutdownTimer<12*HOUR && (m_ShutdownTimer % HOUR)==0) ||
|
||||
(m_ShutdownTimer<12*HOUR && (m_ShutdownTimer % HOUR) == 0) ||
|
||||
// > 12 h ; every 12 h
|
||||
(m_ShutdownTimer>12*HOUR && (m_ShutdownTimer % (12*HOUR))==0))
|
||||
(m_ShutdownTimer>12*HOUR && (m_ShutdownTimer % (12*HOUR)) == 0))
|
||||
{
|
||||
std::string str = secsToTimeString(m_ShutdownTimer);
|
||||
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ enum RealmZone
|
||||
#define SCRIPT_COMMAND_OPEN_DOOR 11 // source = unit, datalong=db_guid, datalong2=reset_delay
|
||||
#define SCRIPT_COMMAND_CLOSE_DOOR 12 // source = unit, datalong=db_guid, datalong2=reset_delay
|
||||
#define SCRIPT_COMMAND_ACTIVATE_OBJECT 13 // source = unit, target=GO
|
||||
#define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id
|
||||
#define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong == 0) unit, datalong = spell_id
|
||||
#define SCRIPT_COMMAND_CAST_SPELL 15 // source/target cast spell at target/source (script->datalong2: 0: s->t 1: s->s 2: t->t 3: t->s
|
||||
#define SCRIPT_COMMAND_PLAY_SOUND 16 // source = any object, target=any/player, datalong (sound_id), datalong2 (bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent)
|
||||
#define SCRIPT_COMMAND_LOAD_PATH 20 // source = unit, path = datalong, repeatable datalong2
|
||||
|
||||
@@ -586,7 +586,7 @@ void WorldSession::LoadAccountData(QueryResult_AutoPtr result, uint32 mask)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((mask & (1 << type))==0)
|
||||
if ((mask & (1 << type)) == 0)
|
||||
{
|
||||
sLog.outError("Table `%s` have non appropriate for table account data type (%u), ignore.",
|
||||
mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
|
||||
|
||||
@@ -938,7 +938,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
|
||||
if (wp==7)
|
||||
if (wp == 7)
|
||||
{
|
||||
if (!pInstance->GetData(DATA_GATE_J) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
@@ -951,7 +951,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
|
||||
pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_ENDED);
|
||||
}
|
||||
}
|
||||
else if (wp==11)
|
||||
else if (wp == 11)
|
||||
{
|
||||
if (!pInstance->GetData(DATA_GATE_S) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
@@ -964,7 +964,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
|
||||
SetEscortPaused(false);
|
||||
}
|
||||
}
|
||||
else if (wp==20)
|
||||
else if (wp == 20)
|
||||
{
|
||||
if (!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED)
|
||||
{
|
||||
@@ -978,7 +978,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
|
||||
pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED);
|
||||
}
|
||||
}
|
||||
if (pInstance->GetData(DATA_TOBIAS)==ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false);
|
||||
if (pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false);
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ struct npc_converted_sentryAI : public ScriptedAI
|
||||
if (Timer <= diff)
|
||||
{
|
||||
uint32 i = urand(1,2);
|
||||
if (i==1)
|
||||
if (i == 1)
|
||||
DoScriptText(SAY_CONVERTED_1, m_creature);
|
||||
else
|
||||
DoScriptText(SAY_CONVERTED_2, m_creature);
|
||||
|
||||
@@ -94,7 +94,7 @@ struct boss_midnightAI : public ScriptedAI
|
||||
if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen))
|
||||
Mount(pAttumen);
|
||||
}
|
||||
else if (Phase ==3)
|
||||
else if (Phase == 3)
|
||||
{
|
||||
if (Mount_Timer)
|
||||
{
|
||||
|
||||
@@ -207,7 +207,7 @@ struct boss_netherspiteAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
// aggro target if Red Beam
|
||||
if (j==RED_PORTAL && m_creature->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (j == RED_PORTAL && m_creature->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
m_creature->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(m_creature->getVictim()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ struct instance_uldaman : public ScriptedInstance
|
||||
for (std::vector<uint64>::const_iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i)
|
||||
{
|
||||
Creature *pTarget = instance->GetCreature(*i);
|
||||
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction()==14)
|
||||
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
|
||||
continue;
|
||||
pTarget->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
|
||||
pTarget->setFaction(14);
|
||||
@@ -119,7 +119,7 @@ struct instance_uldaman : public ScriptedInstance
|
||||
for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
|
||||
{
|
||||
Creature *pTarget = instance->GetCreature(*i);
|
||||
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction()==14)
|
||||
if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14)
|
||||
continue;
|
||||
archaedas->CastSpell(pTarget, SPELL_AWAKEN_VAULT_WALKER, true);
|
||||
pTarget->CastSpell(pTarget, SPELL_ARCHAEDAS_AWAKEN,true);
|
||||
@@ -216,19 +216,19 @@ struct instance_uldaman : public ScriptedInstance
|
||||
void SetData (uint32 type, uint32 data)
|
||||
{
|
||||
//error_log ("SetData: data = %d", data);
|
||||
if (data==0) OpenDoor (altarOfTheKeeperTempleDoor);
|
||||
if (data==0) OpenDoor (archaedasTempleDoor);
|
||||
if (data==3) OpenDoor (ancientVaultDoor);
|
||||
if (data==1) ActivateStoneKeepers();
|
||||
if (data==2) ActivateWallMinions();
|
||||
if (data==4) DeActivateMinions();
|
||||
if (data==5) RespawnMinions();
|
||||
if (data == 0) OpenDoor (altarOfTheKeeperTempleDoor);
|
||||
if (data == 0) OpenDoor (archaedasTempleDoor);
|
||||
if (data == 3) OpenDoor (ancientVaultDoor);
|
||||
if (data == 1) ActivateStoneKeepers();
|
||||
if (data == 2) ActivateWallMinions();
|
||||
if (data == 4) DeActivateMinions();
|
||||
if (data == 5) RespawnMinions();
|
||||
}
|
||||
|
||||
void SetData64 (uint32 type, uint64 data)
|
||||
{
|
||||
// Archaedas
|
||||
if (type==0)
|
||||
if (type == 0)
|
||||
{
|
||||
ActivateArchaedas (data);
|
||||
}
|
||||
|
||||
@@ -59,13 +59,13 @@ EndScriptData */
|
||||
#define SOUND_INTRO 12090
|
||||
|
||||
//Spells:
|
||||
// ====== Troll Form
|
||||
//====== Troll Form
|
||||
#define SPELL_WHIRLWIND 17207
|
||||
#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed
|
||||
// ====== Bear Form
|
||||
//====== Bear Form
|
||||
#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid
|
||||
#define SPELL_OVERPOWER 43456 // use after melee attack dodged
|
||||
// ====== Eagle Form
|
||||
//====== Eagle Form
|
||||
#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577
|
||||
#define SPELL_ZAP_INFORM 42577
|
||||
#define SPELL_ZAP_DAMAGE 43137 // 1250 damage
|
||||
|
||||
@@ -56,7 +56,7 @@ struct mobs_spitelashesAI : public ScriptedAI
|
||||
if (!spellhit &&
|
||||
Hitter->GetTypeId() == TYPEID_PLAYER &&
|
||||
CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
|
||||
(Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826))
|
||||
(Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826))
|
||||
{
|
||||
spellhit=true;
|
||||
DoCast(m_creature, 29124); //become a sheep
|
||||
|
||||
@@ -490,7 +490,7 @@ struct npc_geezleAI : public ScriptedAI
|
||||
|
||||
for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY)==QUEST_STATUS_INCOMPLETE
|
||||
if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE
|
||||
&&(*itr)->HasAura(SPELL_TREE_DISGUISE))
|
||||
{
|
||||
(*itr)->KilledMonsterCredit(MOB_SPARK,0);
|
||||
|
||||
@@ -171,7 +171,7 @@ struct instance_mount_hyjal : public ScriptedInstance
|
||||
case DATA_AZGALOREVENT:
|
||||
{
|
||||
m_auiEncounter[3] = data;
|
||||
if (data==DONE)
|
||||
if (data == DONE)
|
||||
{
|
||||
if (ArchiYell)break;
|
||||
ArchiYell = true;
|
||||
|
||||
@@ -40,19 +40,19 @@ bool GossipHello_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCrea
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
if (eCreature==9528)
|
||||
if (eCreature == 9528)
|
||||
{
|
||||
if (pPlayer->GetQuestRewardStatus(4101))
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
pPlayer->SEND_GOSSIP_MENU(2848, pCreature->GetGUID());
|
||||
} else if (pPlayer->GetTeam()==HORDE)
|
||||
} else if (pPlayer->GetTeam() == HORDE)
|
||||
pPlayer->SEND_GOSSIP_MENU(2845, pCreature->GetGUID());
|
||||
else
|
||||
pPlayer->SEND_GOSSIP_MENU(2844, pCreature->GetGUID());
|
||||
}
|
||||
|
||||
if (eCreature==9529)
|
||||
if (eCreature == 9529)
|
||||
{
|
||||
if (pPlayer->GetQuestRewardStatus(4102))
|
||||
{
|
||||
@@ -69,7 +69,7 @@ bool GossipHello_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCrea
|
||||
|
||||
bool GossipSelect_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiAction ==GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pCreature->CastSpell(pPlayer, 15120, false);
|
||||
|
||||
@@ -130,9 +130,9 @@ bool GossipSelect_npc_great_bear_spirit(Player* pPlayer, Creature* pCreature, ui
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
pPlayer->SEND_GOSSIP_MENU(4735, pCreature->GetGUID());
|
||||
if (pPlayer->GetQuestStatus(5929)==QUEST_STATUS_INCOMPLETE)
|
||||
if (pPlayer->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE)
|
||||
pPlayer->AreaExploredOrEventHappens(5929);
|
||||
if (pPlayer->GetQuestStatus(5930)==QUEST_STATUS_INCOMPLETE)
|
||||
if (pPlayer->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE)
|
||||
pPlayer->AreaExploredOrEventHappens(5930);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -80,20 +80,20 @@ struct boss_ayamissAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
//If he is 70% start phase 2
|
||||
if (phase==1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false))
|
||||
if (phase == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
phase=2;
|
||||
}
|
||||
|
||||
//STINGERSPRAY_Timer (only in phase2)
|
||||
if (phase==2 && STINGERSPRAY_Timer <= diff)
|
||||
if (phase == 2 && STINGERSPRAY_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STINGERSPRAY);
|
||||
STINGERSPRAY_Timer = 30000;
|
||||
} else STINGERSPRAY_Timer -= diff;
|
||||
|
||||
//POISONSTINGER_Timer (only in phase1)
|
||||
if (phase==1 && POISONSTINGER_Timer <= diff)
|
||||
if (phase == 1 && POISONSTINGER_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_POISONSTINGER);
|
||||
POISONSTINGER_Timer = 30000;
|
||||
|
||||
@@ -931,7 +931,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
|
||||
if (Spawn)
|
||||
{
|
||||
Spawn->LoadCreaturesAddon();
|
||||
if (Spawn->GetGUID()== 15423)
|
||||
if (Spawn->GetGUID() == 15423)
|
||||
Spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID,15427+rand()%4);
|
||||
if (i >= 30) WaveCount = 1;
|
||||
if (i >= 33) WaveCount = 2;
|
||||
|
||||
@@ -253,7 +253,7 @@ struct aqsentinelAI : public ScriptedAI
|
||||
for (i = m_creature->getThreatManager().getThreatList().begin(); i != m_creature->getThreatManager().getThreatList().end(); ++i)
|
||||
{
|
||||
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
|
||||
if (pUnit->getPowerType()==POWER_MANA)
|
||||
if (pUnit->getPowerType() == POWER_MANA)
|
||||
return pUnit;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -134,7 +134,7 @@ bool GossipHello_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature)
|
||||
|
||||
bool GossipSelect_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiAction ==GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
pCreature->CastSpell(pPlayer, 16351, false);
|
||||
|
||||
@@ -1845,7 +1845,7 @@ enum Mootoo_the_Younger_Entries
|
||||
};
|
||||
bool QuestAccept_npc_mootoo_the_younger(Player* pPlayer, Creature* pCreature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId()==QUEST_ESCAPING_THE_MIST)
|
||||
if (quest->GetQuestId() == QUEST_ESCAPING_THE_MIST)
|
||||
{
|
||||
switch (pPlayer->GetTeam())
|
||||
{
|
||||
@@ -1930,7 +1930,7 @@ enum Script_Texts_Bonker_Togglevolt
|
||||
|
||||
bool QuestAccept_npc_bonker_togglevolt(Player* pPlayer, Creature* pCreature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId()==QUEST_GET_ME_OUTA_HERE)
|
||||
if (quest->GetQuestId() == QUEST_GET_ME_OUTA_HERE)
|
||||
{
|
||||
switch (pPlayer->GetTeam())
|
||||
{
|
||||
@@ -1967,7 +1967,7 @@ struct npc_bonker_togglevoltAI : public npc_escortAI
|
||||
{
|
||||
if (GetAttack() && UpdateVictim())
|
||||
{
|
||||
if (Bonker_agro==0)
|
||||
if (Bonker_agro == 0)
|
||||
{
|
||||
DoScriptText(SAY_bonker_1,m_creature);
|
||||
Bonker_agro++;
|
||||
|
||||
@@ -131,11 +131,11 @@ struct boss_malygosAI : public ScriptedAI
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
|
||||
if (phase ==1)
|
||||
if (phase == 1)
|
||||
DoScriptText(RAND(SAY_PHASE1_SLAY_1,SAY_PHASE1_SLAY_2,SAY_PHASE1_SLAY_3), m_creature);
|
||||
if (phase ==2)
|
||||
if (phase == 2)
|
||||
DoScriptText(RAND(SAY_PHASE2_SLAY_1,SAY_PHASE2_SLAY_2,SAY_PHASE2_SLAY_3), m_creature);
|
||||
if (phase ==3)
|
||||
if (phase == 3)
|
||||
DoScriptText(RAND(SAY_PHASE3_SLAY_1,SAY_PHASE3_SLAY_2,SAY_PHASE3_SLAY_3), m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -274,7 +274,7 @@ struct mob_ravenous_furbolgAI : public ScriptedAI
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (pInstance)
|
||||
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
|
||||
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
@@ -380,7 +380,7 @@ struct mob_frenzied_worgenAI : public ScriptedAI
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (pInstance)
|
||||
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
|
||||
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
@@ -489,7 +489,7 @@ struct mob_ferocious_rhinoAI : public ScriptedAI
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (pInstance)
|
||||
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
|
||||
if (pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
@@ -702,7 +702,7 @@ struct mob_palehoof_orbAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (currentPhase==PHASE_NONE)
|
||||
if (currentPhase == PHASE_NONE)
|
||||
return;
|
||||
|
||||
if (SummonTimer<=diff)
|
||||
|
||||
@@ -909,7 +909,7 @@ bool ItemUse_item_tainted_core(Player* pPlayer, Item* _Item, SpellCastTargets co
|
||||
Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ)));
|
||||
if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2)
|
||||
{
|
||||
if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT)
|
||||
if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT)
|
||||
{
|
||||
uint32 identifier;
|
||||
uint8 channel_identifier;
|
||||
|
||||
@@ -293,7 +293,7 @@ struct boss_vazruden_the_heraldAI : public ScriptedAI
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
if (phase==0)
|
||||
if (phase == 0)
|
||||
{
|
||||
phase = 1;
|
||||
check = 0;
|
||||
|
||||
Reference in New Issue
Block a user