*Cleanup, proper indentation, and remove some wrong/irrelevant comments copied from custom patches..

--HG--
branch : trunk
This commit is contained in:
maximius
2009-12-18 13:41:30 -08:00
parent 89464472a9
commit dc1207139a
30 changed files with 195 additions and 199 deletions
-1
View File
@@ -784,7 +784,6 @@ void BattleGround::EndBattleGround(uint32 winner)
else if(winner)
RewardMark(plr,ITEM_LOSER_COUNT);
plr->SetHealth(plr->GetMaxHealth());
plr->SetPower(POWER_MANA, plr->GetMaxPower(POWER_MANA));
plr->CombatStopWithPets(true);
+15 -15
View File
@@ -2158,21 +2158,21 @@ bool BattleGroundMgr::IsBGWeekend(BattleGroundTypeId bgTypeId)
void BattleGroundMgr::DoCompleteAchievement(uint32 achievement, Player * player)
{
AchievementEntry const* AE = GetAchievementStore()->LookupEntry(achievement);
AchievementEntry const* AE = GetAchievementStore()->LookupEntry(achievement);
if(!player)
{
//Map::PlayerList const &PlayerList = this->GetPlayers();
//GroupsQueueType::iterator group = SelectedGroups.begin();
if(!player)
{
//Map::PlayerList const &PlayerList = this->GetPlayers();
//GroupsQueueType::iterator group = SelectedGroups.begin();
//if (!PlayerList.isEmpty())
//for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
// for (GroupsQueueType::iterator itr = group; itr != SelectedGroups.end(); ++itr)
// if (Player *pPlayer = itr->getSource())
// pPlayer->CompletedAchievement(AE);
}
else
{
player->CompletedAchievement(AE);
}
//if (!PlayerList.isEmpty())
//for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
// for (GroupsQueueType::iterator itr = group; itr != SelectedGroups.end(); ++itr)
// if (Player *pPlayer = itr->getSource())
// pPlayer->CompletedAchievement(AE);
}
else
{
player->CompletedAchievement(AE);
}
}
+1 -1
View File
@@ -250,7 +250,7 @@ class BattleGroundMgr
static uint8 BGArenaType(BattleGroundQueueTypeId bgQueueTypeId);
static bool IsBGWeekend(BattleGroundTypeId bgTypeId);
void DoCompleteAchievement(uint32 achievement, Player * player = NULL);
void DoCompleteAchievement(uint32 achievement, Player * player = NULL);
private:
BattleMastersMap mBattleMastersMap;
+7 -8
View File
@@ -70,24 +70,23 @@ void BattleGroundWS::Update(uint32 diff)
if (GetStatus() == STATUS_IN_PROGRESS)
{
if( GetStartTime() >= 25*MINUTE*1000 ) // Òàéìåð òèêàòü íà÷èíàåò ïîñëå 25 ìèíóò
if (GetStartTime() >= 25*MINUTE*IN_MILISECONDS) // Òàéìåð òèêàòü íà÷èíàåò ïîñëå 25 ìèíóò
{
if( GetTeamScore(ALLIANCE) == 0 )
if (GetTeamScore(ALLIANCE) == 0)
{
if ( GetTeamScore(HORDE) == 0 ) // No one scored - result is tie
if (GetTeamScore(HORDE) == 0) // No one scored - result is tie
EndBattleGround(NULL);
else // Horde has more points and thus wins
EndBattleGround(HORDE);
}
else if( GetTeamScore(HORDE) == 0 )
EndBattleGround(ALLIANCE); // Alliance has >0, Horde has 0, alliance wins
else if (GetTeamScore(HORDE) == 0)
EndBattleGround(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
else if( GetTeamScore(HORDE) == GetTeamScore(ALLIANCE) ) // Team score equal, winner is team that scored the first flag
else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the first flag
EndBattleGround(m_FirstFlagCaptureTeam);
else if( GetTeamScore(HORDE) > GetTeamScore(ALLIANCE) ) // Last but not least, check who has the higher score
else if (GetTeamScore(HORDE) > GetTeamScore(ALLIANCE)) // Last but not least, check who has the higher score
EndBattleGround(HORDE);
else
EndBattleGround(ALLIANCE);
+1 -1
View File
@@ -334,7 +334,7 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineStore, dbcPath,"SkillLine.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineAbilityStore, dbcPath,"SkillLineAbility.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSoundEntriesStore, dbcPath,"SoundEntries.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellStore, dbcPath,"Spell.dbc", &CustomSpellEntryfmt, &CustomSpellEntryIndex);
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellStore, dbcPath,"Spell.dbc", &CustomSpellEntryfmt, &CustomSpellEntryIndex);
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
{
SpellEntry const * spell = sSpellStore.LookupEntry(i);
+1 -1
View File
@@ -759,7 +759,7 @@ uint32 Item::GetEnchantRequiredLevel() const
bool Item::IsBoundByEnchant() const
{
// Check all enchants for soulbound
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
+1 -1
View File
@@ -5410,7 +5410,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args)
char* time_str = strtok ((char*) args, " ");
char* exitcode_str = strtok (NULL, "");
char* tailStr = *args!='"' ? strtok(NULL, "") : (char*)args;
char* tailStr = *args!='"' ? strtok(NULL, "") : (char*)args;
if(!tailStr)
return false;
+7 -7
View File
@@ -186,8 +186,8 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName);
return false;
}
// Åñëè ÈÊ èëè È×, òî ïðîâåðÿòü óðîâåíü øìîòà îäåòîãî íà ïåðñå.
//if(mapid==649)
// Åñëè ÈÊ èëè È×, òî ïðîâåðÿòü óðîâåíü øìîòà îäåòîãî íà ïåðñå.
//if (mapid == 649)
}
}
@@ -308,15 +308,15 @@ MapManager::Update(uint32 diff)
#ifdef MULTI_THREAD_MAP
for(; iter != i_maps.end(); ++iter)
{
if (m_updater.activated())
m_updater.schedule_update(*iter->second, i_timer.GetCurrent());
if (m_updater.activated())
m_updater.schedule_update(*iter->second, i_timer.GetCurrent());
else
{
{
iter->second->Update(i_timer.GetCurrent());
}
}
}
if (m_updater.activated())
m_updater.wait();
m_updater.wait();
#else
for (; iter != i_maps.end(); ++iter)
{
+1 -1
View File
@@ -112,7 +112,7 @@ bool MapUpdater::activated()
void MapUpdater::update_finished()
{
ACE_GUARD(ACE_Thread_Mutex, guard, this->m_mutex);
ACE_GUARD(ACE_Thread_Mutex, guard, this->m_mutex);
if (this->pedning_requests == 0)
{
+3 -4
View File
@@ -3561,7 +3561,7 @@ void ObjectMgr::LoadQuests()
delete result;
std::map<uint32,uint32> usedMailTemplates;
std::map<uint32,uint32> usedMailTemplates;
// Post processing
for (QuestMap::iterator iter = mQuestTemplates.begin(); iter != mQuestTemplates.end(); ++iter)
@@ -5253,7 +5253,6 @@ void ObjectMgr::LoadAreaTriggerScripts()
sLog.outString( ">> Loaded %u areatrigger scripts", count );
}
// use searched_node for search some known node
uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team )
{
bool found = false;
@@ -5264,7 +5263,7 @@ uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, u
{
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
if(!node || node->map_id != mapid || !node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981) // dk flight
if(!node || node->map_id != mapid || !node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981) // dk flight
continue;
uint8 field = (uint8)((i - 1) / 32);
@@ -5274,7 +5273,7 @@ uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, u
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);
float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z);
if(found)
{
if(dist2 < dist)
+7 -7
View File
@@ -8248,12 +8248,12 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
// 8 Arena season id
data << uint32(0xF3D) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
// May be send timer to start Wintergrasp
//if(sWorld.GetWintergrapsState()==4354)
// data << uint32(0x1102) << sWorld.GetWintergrapsTimer();
//else
// data << uint32(0xEC5) << sWorld.GetWintergrapsTimer();
// ---
// May be send timer to start Wintergrasp
//if(sWorld.GetWintergrapsState()==4354)
// data << uint32(0x1102) << sWorld.GetWintergrapsTimer();
//else
// data << uint32(0xEC5) << sWorld.GetWintergrapsTimer();
// ---
if(mapid == 530) // Outland
{
data << uint32(0x9bf) << uint32(0x0); // 7
@@ -19443,7 +19443,7 @@ void Player::AddComboPoints(Unit* target, int8 count, Spell * spell)
// without combo points lost (duration checked in aura)
RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS);
if (target->GetGUID() == m_comboTarget)
if (target->GetGUID() == m_comboTarget)
*comboPoints += count;
else
{
+2 -2
View File
@@ -955,10 +955,10 @@ void AuraEffect::HandleSchoolAbsorb(bool apply, bool Real, bool changeAmount)
if (apply)
{
// prevent double apply bonuses
if (m_target->GetTypeId()!=TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
if (m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
{
float DoneActualBenefit = 0.0f;
switch(m_spellProto->SpellFamilyName)
switch (m_spellProto->SpellFamilyName)
{
case SPELLFAMILY_PRIEST:
// Power Word: Shield
+26 -26
View File
@@ -865,22 +865,22 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(unitTarget,spell_id,true,NULL);
return;
}
case 67019: // Flask of the North
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
case 67019: // Flask of the North
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
uint32 spell_id;
switch(urand(1, 3))
{
case 1: spell_id = 67016; break;
case 2: spell_id = 67017; break;
default:spell_id = 67018; break;
}
uint32 spell_id;
switch(urand(1, 3))
{
case 1: spell_id = 67016; break;
case 2: spell_id = 67017; break;
default:spell_id = 67018; break;
}
m_caster->CastSpell(m_caster, spell_id, true, NULL);
return;
}
m_caster->CastSpell(m_caster, spell_id, true, NULL);
return;
}
case 13280: // Gnomish Death Ray
{
if (!unitTarget)
@@ -3367,7 +3367,7 @@ void Spell::EffectOpenLock(uint32 effIndex)
return;
}
}
// TODO: Add script for spell 41920 - Filling, becouse server it freze when use this spell
// TODO: Add script for spell 41920 - Filling, becouse server it freze when use this spell
// handle outdoor pvp object opening, return true if go was registered for handling
// these objects must have been spawned by outdoorpvp!
else if(gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_GOOBER && sOutdoorPvPMgr.HandleOpenGo(player, gameObjTarget->GetGUID()))
@@ -5204,17 +5204,17 @@ void Spell::EffectScriptEffect(uint32 effIndex)
switch(((Player*)unitTarget)->GetBaseSkillValue(762))
{
case 75: unitTarget->CastSpell(unitTarget, 51621, true); break;;
case 150: unitTarget->CastSpell(unitTarget, 48024, true); break;
case 225:
if(((Player*)unitTarget)->GetMapId()==571 || ((Player*)unitTarget)->GetMapId()==530)
unitTarget->CastSpell(unitTarget, 51617, true);
break;
case 300:
if(((Player*)unitTarget)->GetMapId()==571 || ((Player*)unitTarget)->GetMapId()==530)
unitTarget->CastSpell(unitTarget, 48023, true);
break;
default: break;
case 75: unitTarget->CastSpell(unitTarget, 51621, true); break;;
case 150: unitTarget->CastSpell(unitTarget, 48024, true); break;
case 225:
if(((Player*)unitTarget)->GetMapId()==571 || ((Player*)unitTarget)->GetMapId()==530)
unitTarget->CastSpell(unitTarget, 51617, true);
break;
case 300:
if(((Player*)unitTarget)->GetMapId()==571 || ((Player*)unitTarget)->GetMapId()==530)
unitTarget->CastSpell(unitTarget, 48023, true);
break;
default: break;
}
break;
}
+30 -30
View File
@@ -923,7 +923,7 @@ bool Guardian::UpdateStats(Stats stat)
Unit *owner = GetOwner();
// Handle Death Knight Glyphs and Talents
float mod = 0.75f;
float mod = 0.75f;
if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH))
{
switch (stat)
@@ -948,26 +948,26 @@ bool Guardian::UpdateStats(Stats stat)
else if (stat == STAT_STAMINA)
{
if (owner->getClass() == CLASS_WARLOCK && isPet())
value += float(owner->GetStat(STAT_STAMINA)) * 0.75f;
value += float(owner->GetStat(STAT_STAMINA)) * 0.75f;
else
{
mod = 0.3f;
if (((Creature*)this)->isPet())
{
PetSpellMap::const_iterator itr = (((Pet*)this)->m_spells.find(62758)); //Wild Hunt rank1
if (itr == ((Pet*)this)->m_spells.end())
{
itr = ((Pet*)this)->m_spells.find(62762); //Wild Hunt rank2
}
if (itr != ((Pet*)this)->m_spells.end()) // If pet has Wild Hunt
{
{
mod = 0.3f;
if (((Creature*)this)->isPet())
{
PetSpellMap::const_iterator itr = (((Pet*)this)->m_spells.find(62758)); // Wild Hunt rank 1
if (itr == ((Pet*)this)->m_spells.end())
{
itr = ((Pet*)this)->m_spells.find(62762); // Wild Hunt rank 2
}
if (itr != ((Pet*)this)->m_spells.end()) // If pet has Wild Hunt
{
SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value
mod += mod * (sProto->EffectBasePoints[0] / 100.0f);
}
}
SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value
mod += mod * (sProto->EffectBasePoints[0] / 100.0f);
}
}
value += float(owner->GetStat(stat)) * mod;
}
}
}
//warlock's and mage's pets gain 30% of owner's intellect
else if (stat == STAT_INTELLECT)
@@ -1117,21 +1117,21 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
{
if(isHunterPet()) //hunter pets benefit from owner's attack power
{
float mod = 1.0f; //Hunter contribution modifier
float mod = 1.0f; //Hunter contribution modifier
if (((Creature*)this)->isPet())
{
PetSpellMap::const_iterator itr = ((Pet*)this)->m_spells.find(62758); //Wild Hunt rank1
if (itr == ((Pet*)this)->m_spells.end())
{
itr = ((Pet*)this)->m_spells.find(62762); //Wild Hunt rank2
}
if (itr != ((Pet*)this)->m_spells.end()) // If pet has Wild Hunt
{
{
PetSpellMap::const_iterator itr = ((Pet*)this)->m_spells.find(62758); //Wild Hunt rank 1
if (itr == ((Pet*)this)->m_spells.end())
{
itr = ((Pet*)this)->m_spells.find(62762); //Wild Hunt rank 2
}
if (itr != ((Pet*)this)->m_spells.end()) // If pet has Wild Hunt
{
SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value
SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value
mod += (sProto->EffectBasePoints[1] / 100.0f);
}
}
}
}
bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod;
SetBonusDamage( int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod));
}
+17 -17
View File
@@ -5014,17 +5014,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
triggered_spell_id = 58374;
break;
}
// Glyph of Devastate
if (dummySpell->Id == 58388)
{
if (!pVictim || !pVictim->isAlive())
return false;
// Glyph of Devastate
if (dummySpell->Id == 58388)
{
if (!pVictim || !pVictim->isAlive())
return false;
if (Aura* aur = pVictim->GetAura(58567,0))
aur->modStackAmount(1);
if (Aura* aur = pVictim->GetAura(58567,0))
aur->modStackAmount(1);
return true;
}
return true;
}
// Unstable Power
case 24658:
{
@@ -5332,12 +5332,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// Shadowfiend Death (Gain mana if pet dies with Glyph of Shadowfiend)
case 57989:
{
Unit *owner = GetOwner();
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return false;
// Glyph of Shadowfiend (need cast as self cast for owner, no hidden cooldown)
owner->CastSpell(owner,58227,true,castItem,triggeredByAura);
return true;
Unit *owner = GetOwner();
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return false;
// Glyph of Shadowfiend (need cast as self cast for owner, no hidden cooldown)
owner->CastSpell(owner,58227,true,castItem,triggeredByAura);
return true;
}
// Divine purpose
case 31871:
@@ -5467,7 +5467,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
return true;
}
// Glyph of Drain Soul
// Glyph of Drain Soul
case 58070:
{
triggered_spell_id = 58068;
@@ -6604,7 +6604,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
// Windfury Weapon (Passive) 1-5 Ranks
case 33757:
{
if(GetTypeId()!=TYPEID_PLAYER || !castItem || !castItem->IsEquipped() || !pVictim || !pVictim->isAlive())
if(GetTypeId()!=TYPEID_PLAYER || !castItem || !castItem->IsEquipped() || !pVictim || !pVictim->isAlive())
return false;
// custom cooldown processing case
+2 -2
View File
@@ -2584,12 +2584,12 @@ void World::LoadDBVersion()
void World::ProcessStartEvent()
{
isEventKillStart = true;
isEventKillStart = true;
}
void World::ProcessStopEvent()
{
isEventKillStart = false;
isEventKillStart = false;
}
void World::UpdateAreaDependentAuras()
+13 -13
View File
@@ -614,17 +614,17 @@ class World
static float GetVisibleObjectGreyDistance() { return m_VisibleObjectGreyDistance; }
void SetWintergrapsTimer(uint32 timer, uint32 state)
{
m_WintergrapsTimer = timer;
m_WintergrapsState = state;
}
void SetWintergrapsTimer(uint32 timer, uint32 state)
{
m_WintergrapsTimer = timer;
m_WintergrapsState = state;
}
uint32 GetWintergrapsTimer() { return m_WintergrapsTimer; }
uint32 GetWintergrapsState() { return m_WintergrapsState; }
uint32 GetWintergrapsTimer() { return m_WintergrapsTimer; }
uint32 GetWintergrapsState() { return m_WintergrapsState; }
uint32 m_WintergrapsTimer;
uint32 m_WintergrapsState;
uint32 m_WintergrapsTimer;
uint32 m_WintergrapsState;
void ProcessCliCommands();
void QueueCliCommand( CliCommandHolder::Print* zprintf, char const* input ) { cliCmdQueue.add(new CliCommandHolder(input, zprintf)); }
@@ -655,11 +655,11 @@ class World
void UpdateAreaDependentAuras();
void ProcessStartEvent();
void ProcessStopEvent();
bool GetEventKill() { return isEventKillStart; }
void ProcessStartEvent();
void ProcessStopEvent();
bool GetEventKill() { return isEventKillStart; }
bool isEventKillStart;
bool isEventKillStart;
protected:
void _UpdateGameTime();
// callback for UpdateRealmCharacters
-1
View File
@@ -1037,7 +1037,6 @@ int WorldSocket::iSendPartialPacket(WorldPacket& pct)
return 1; // some byte written and packet completed
}
bool WorldSocket::iFlushPacketQueue()
{
WorldPacket *pct;
+2 -2
View File
@@ -348,7 +348,7 @@ public:
template<class type>
inline bool operator < (type & right)
{
for (uint8 i=3; i>0; i--)
for (uint8 i=3; i > 0; --i)
{
if (part[i-1]<right.part[i-1])
return 1;
@@ -361,7 +361,7 @@ public:
template<class type>
inline bool operator < (type & right) const
{
for (uint8 i=3; i>0; i--)
for (uint8 i = 3; i > 0; --i)
{
if (part[i-1]<right.part[i-1])
return 1;