diff options
Diffstat (limited to 'src')
30 files changed, 199 insertions, 203 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index bdbcfc63bac..de9c0f6125d 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -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); diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 3944d4e0bfc..02bbd01b4e4 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -286,7 +286,7 @@ void WorldSession::HandleBattlefieldListOpcode( WorldPacket &recv_data ) uint8 fromWhere; recv_data >> fromWhere; // 0 - battlemaster (lua: ShowBattlefieldList), 1 - UI (lua: RequestBattlegroundInstanceInfo) - + uint8 unk1; recv_data >> unk1; // Unknown 3.2.2 @@ -641,7 +641,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode( WorldPacket & recv_data ) } } - + } void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data ) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 56fbf772aea..953607ab222 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -2158,21 +2158,21 @@ bool BattleGroundMgr::IsBGWeekend(BattleGroundTypeId bgTypeId) void BattleGroundMgr::DoCompleteAchievement(uint32 achievement, Player * player) { - AchievementEntry const* AE = GetAchievementStore()->LookupEntry(achievement); - - 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); - } + AchievementEntry const* AE = GetAchievementStore()->LookupEntry(achievement); + + 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); + } } diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h index 95b45640b69..5844ae73db9 100644 --- a/src/game/BattleGroundMgr.h +++ b/src/game/BattleGroundMgr.h @@ -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; diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index 0071e2c615c..a3a1dd61c98 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -67,32 +67,31 @@ BattleGroundWS::~BattleGroundWS() void BattleGroundWS::Update(uint32 diff) { BattleGround::Update(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) == GetTeamScore(ALLIANCE) ) // Team score equal, winner is team that scored the first flag + + 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 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); } - + if (m_FlagState[BG_TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN) { m_FlagsTimer[BG_TEAM_ALLIANCE] -= diff; @@ -317,7 +316,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source) UpdateTeamScore(Source->GetTeam()); // only flag capture should be updated UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures - + if(!m_FirstFlagCaptureTeam) SetFirstFlagCapture(Source->GetTeam()); diff --git a/src/game/BattleGroundWS.h b/src/game/BattleGroundWS.h index 1a98f0623c5..b3ac6781030 100644 --- a/src/game/BattleGroundWS.h +++ b/src/game/BattleGroundWS.h @@ -208,7 +208,7 @@ class BattleGroundWS : public BattleGround int32 m_FlagsTimer[2]; int32 m_FlagsDropTimer[2]; uint32 m_FirstFlagCaptureTeam; // Winner is based on this if score is equal - + uint32 m_ReputationCapture; uint32 m_HonorWinKills; uint32 m_HonorEndKills; diff --git a/src/game/CombatAI.cpp b/src/game/CombatAI.cpp index 8be14d32787..7837d3b3c43 100644 --- a/src/game/CombatAI.cpp +++ b/src/game/CombatAI.cpp @@ -272,7 +272,7 @@ bool AOEAI::CanAIAttack(const Unit *who) const void AOEAI::AttackStart(Unit *who) { - + } void AOEAI::UpdateAI(const uint32 diff) diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index c9832a830eb..d089bb8bd3a 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -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); diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 71fedfe242a..2aab9970a18 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1214,7 +1214,7 @@ struct ScalingStatValuesEntry //uint32 unk1; // 18 all fields equal to 0 //uint32 unk2; // 19 unk, probably also Armor for level uint32 armorMod2[4]; // 20-23 Armor for level - + uint32 getssdMultiplier(uint32 mask) const { if (mask & 0x001F) diff --git a/src/game/Group.cpp b/src/game/Group.cpp index a3fe884a645..299b9cdf888 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -104,7 +104,7 @@ bool Group::Create(const uint64 &guid, const char * name) m_dungeonDifficulty = leader->GetDungeonDifficulty(); m_raidDifficulty = leader->GetRaidDifficulty(); } - + Player::ConvertInstancesToGroup(leader, this, guid); // store group in database @@ -1480,7 +1480,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty) m_dungeonDifficulty = difficulty; if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE leaderGuid ='%u'", m_dungeonDifficulty, GUID_LOPART(m_leaderGuid)); - + for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player *player = itr->getSource(); diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 05c1adec795..d00e4d535d3 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -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) diff --git a/src/game/Item.h b/src/game/Item.h index 710e0a56d57..e235659a968 100644 --- a/src/game/Item.h +++ b/src/game/Item.h @@ -319,7 +319,7 @@ class TRINITY_DLL_SPEC Item : public Object bool IsWeaponVellum() const { return GetProto()->IsWeaponVellum(); } bool IsArmorVellum() const { return GetProto()->IsArmorVellum(); } bool IsConjuredConsumable() const { return GetProto()->IsConjuredConsumable(); } - + // Item Refund system uint32 GetPaidHonorPoints() { return m_paidHonorPoints; } uint32 GetPaidArenaPoints() { return m_paidArenaPoints; } @@ -341,7 +341,7 @@ class TRINITY_DLL_SPEC Item : public Object ItemUpdateState uState; int16 uQueuePos; bool mb_in_trade; // true if item is currently in trade-window - + // refund system uint32 m_paidHonorPoints; uint32 m_paidArenaPoints; diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index b4b22fe90cc..b31edcf2b42 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -1393,7 +1393,7 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) sLog.outDebug("Item refund: item not refundable!"); return; } - + if(item->GetRefundExpiryTime() <= time(NULL)) // item refund has expired { WorldPacket data(SMSG_ITEM_REFUND); @@ -1401,7 +1401,7 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) data << uint32(1); // error, abort refund return; } - + WorldPacket data(SMSG_ITEM_REFUND); data << uint64(guid); // guid? data << uint32(0); // must be 0 or client side error in refund @@ -1414,7 +1414,7 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) data << uint32(item->GetPaidExtendedCostCount(i)); } SendPacket(&data); - + // Grant back extendedcost items uint32 count = 0; uint32 itemid = 0; @@ -1438,11 +1438,11 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) // Grant back Honor points if (uint32 honorRefund = item->GetPaidHonorPoints() > 0) _player->ModifyHonorPoints(honorRefund); - + // Grant back Arena points if (uint32 arenaRefund = item->GetPaidArenaPoints() > 0) _player->ModifyArenaPoints(arenaRefund); - + // Destroy item _player->DestroyItemCount(item->GetEntry(), 1, true, true); } diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index e4adb4c6550..0fec45ec35a 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -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; diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index 3d4c9962a9d..3791ea75ace 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -916,7 +916,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sender, MailCheckMask checked, uint32 deliver_delay) { Player* pReceiver = receiver.GetPlayer(); // can be NULL - + if (pReceiver) prepareItems(pReceiver); // generate mail template items diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index d1457b5adee..4312c7a3b16 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -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) } } @@ -234,7 +234,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) sLog.outDebug("Map::CanEnter - player '%s' is dead but doesn't have a corpse!", player->GetName()); } } - + InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid); if(!instance) return false; @@ -255,7 +255,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) //TODO: send some kind of error message to the player return false; } - + //Encounters in progress if (entry->map_type == MAP_RAID && ((InstanceMap*)boundedMap)->GetInstanceData() && ((InstanceMap*)boundedMap)->GetInstanceData()->IsEncounterInProgress()) { @@ -263,7 +263,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) player->SendTransferAborted(mapid, TRANSFER_ABORT_ZONE_IN_COMBAT); return(false); } - + //Instance is full MapDifficulty const* mapDiff = ((InstanceMap*)player)->GetMapDifficulty(); int8 maxPlayers = mapDiff ? mapDiff->maxPlayers : 0; @@ -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) { diff --git a/src/game/MapUpdater.cpp b/src/game/MapUpdater.cpp index 8162efa0d06..61d367ef2e1 100644 --- a/src/game/MapUpdater.cpp +++ b/src/game/MapUpdater.cpp @@ -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) { diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 7968fe06fb7..2fc1e5a9125 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -404,7 +404,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) { uint32 opcode = recv_data.GetOpcode(); sLog.outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); - + /* extract packet */ uint64 guid; uint32 unk1; @@ -526,7 +526,7 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) MovementInfo mi; mi.guid = old_mover_guid; ReadMovementInfo(recv_data, &mi); - + //ReadMovementInfo(recv_data, &_player->m_mover->m_movementInfo); _player->m_movementInfo = mi; } @@ -554,7 +554,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) ReadMovementInfo(recv_data, &mi); _player->m_movementInfo = mi; - + /* ReadMovementInfo(recv_data, &_player->m_mover->m_movementInfo);*/ _player->ExitVehicle(); diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index d1b7d58c54f..aeb0fade34f 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -2070,7 +2070,7 @@ void ObjectMgr::LoadItemPrototypes() break; } } - + if (req) { if(!(proto->AllowableClass & CLASSMASK_ALL_PLAYABLE)) @@ -3338,7 +3338,7 @@ void ObjectMgr::LoadGroups() uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 QueryResult *result = CharacterDatabase.Query("SELECT mainTank, mainAssistant, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, isRaid, difficulty, raiddifficulty, leaderGuid FROM groups"); - + if( !result ) { barGoLink bar( 1 ); @@ -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) @@ -4689,36 +4689,36 @@ void ObjectMgr::LoadWaypointScripts() void ObjectMgr::LoadItemTexts() { QueryResult *result = CharacterDatabase.Query("SELECT id, text FROM item_text"); - + uint32 count = 0; - + if( !result ) { barGoLink bar( 1 ); bar.step(); - + sLog.outString(); sLog.outString( ">> Loaded %u item pages", count ); return; } - + barGoLink bar( result->GetRowCount() ); - + Field* fields; do { bar.step(); - + fields = result->Fetch(); - + mItemTexts[ fields[0].GetUInt32() ] = fields[1].GetCppString(); - + ++count; - + } while ( result->NextRow() ); - + delete result; - + sLog.outString(); sLog.outString( ">> Loaded %u item texts", count ); } @@ -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) diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 1b2503eed0b..ee8c02dfb43 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -404,18 +404,18 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data ) uint32 position[2]; uint32 data[2]; bool move_command = false; - + for(uint8 i = 0; i < count; ++i) { recv_data >> position[i]; recv_data >> data[i]; - + uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]); - + //ignore invalid position if(position[i] >= MAX_UNIT_ACTION_BAR_INDEX) return; - + // in the normal case, command and reaction buttons can only be moved, not removed // at moving count ==2, at removing count == 1 // ignore attempt to remove command|reaction buttons (not possible at normal case) @@ -423,11 +423,11 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data ) { if (count == 1) return; - + move_command = true; } } - + // check swap (at command->spell swap client remove spell first in another packet, so check only command move correctness) if (move_command) { @@ -440,7 +440,7 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data ) act_state_0 != actionEntry_1->GetType()) return; } - + uint8 act_state_1 = UNIT_ACTION_BUTTON_TYPE(data[1]); if(act_state_1 == ACT_COMMAND || act_state_1 == ACT_REACTION) { @@ -451,12 +451,12 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data ) return; } } - + for(uint8 i = 0; i < count; ++i) { uint32 spell_id = UNIT_ACTION_BUTTON_ACTION(data[i]); uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]); - + sLog.outDetail( "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", _player->GetName(), position[i], spell_id, uint32(act_state)); //if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c1e4a9aa5ef..69571eb9ee1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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 @@ -18503,7 +18503,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint data << uint32(count); GetSession()->SendPacket(&data); SendNewItem(it, pProto->BuyCount*count, true, false, false); - + // Item Refund system, only works for non stackable items with extendedcost if(count == 1 && crItem->ExtendedCost ) { @@ -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 { diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index c6cf5debe77..476fed4c345 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2488,7 +2488,7 @@ enum DiminishingGroup DIMINISHING_TAUNT, DIMINISHING_LIMITONLY // Don't Diminish, but limit duration to 10s }; - + enum SummonCategory { SUMMON_CATEGORY_WILD = 0, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 4757e03a24b..99b8876b6e8 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -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 @@ -4763,7 +4763,7 @@ void AuraEffect::HandlePeriodicTriggerSpell(bool apply, bool Real, bool /*change { case 66: // Invisibility m_target->CastSpell(m_target, 32612, true, NULL, this); - + return; case 42783: //Wrath of the Astrom... m_target->CastSpell(m_target, m_spellProto->CalculateSimpleValue(GetEffIndex()+1), true); @@ -6055,7 +6055,7 @@ void AuraEffect::PeriodicTick() bool crit = IsPeriodicTickCrit(pCaster); if (crit) pdamage = pCaster->SpellCriticalDamageBonus(m_spellProto, pdamage, m_target); - + // Reduce dot damage from resilience for players. if (m_target->GetTypeId() == TYPEID_PLAYER) pdamage-=((Player*)m_target)->GetSpellDamageReduction(pdamage); @@ -6126,7 +6126,7 @@ void AuraEffect::PeriodicTick() cleanDamage.mitigated_damage += pdamage - pdamageReductedArmor; pdamage = pdamageReductedArmor; } - + // Reduce dot damage from resilience for players. if (m_target->GetTypeId() == TYPEID_PLAYER) pdamage-=((Player*)m_target)->GetSpellDamageReduction(pdamage); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index e6bd5b53ae2..b31277a4673 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -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; - - 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; - } + 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; + } + + 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; } diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 3f4f9200e05..05e47ee1db3 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -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 - { - - SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value - mod += mod * (sProto->EffectBasePoints[0] / 100.0f); - } - } + { + 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); + } + } 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 - { - - SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value + { + 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 += (sProto->EffectBasePoints[1] / 100.0f); - } - } + } + } bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod; SetBonusDamage( int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod)); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 587b102a8a5..af07f8eee97 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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 diff --git a/src/game/World.cpp b/src/game/World.cpp index 7d103c0457f..dc14a5229e0 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -260,7 +260,7 @@ World::AddSession_ (WorldSession* s) s->SendPacket(&pkt); s->SendAccountDataTimes(GLOBAL_CACHE_MASK); - + s->SendTutorialsData(); UpdateMaxSessionCounters (); @@ -2584,12 +2584,12 @@ void World::LoadDBVersion() void World::ProcessStartEvent() { - isEventKillStart = true; + isEventKillStart = true; } void World::ProcessStopEvent() { - isEventKillStart = false; + isEventKillStart = false; } void World::UpdateAreaDependentAuras() diff --git a/src/game/World.h b/src/game/World.h index 6884dcd5597..6baff8aac4d 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -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 diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 680d0515d61..0f25f92ab66 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -1013,7 +1013,7 @@ int WorldSocket::iSendPartialPacket(WorldPacket& pct) return 0; // nothing written, still remaining data => 0 m_Crypt.EncryptSend(header.header, header.getHeaderLength()); - + if (m_OutBuffer->copy((char*) header.header, header.getHeaderLength()) == -1) return 0; // no space left. This should not happend. Just return 0 as nothing written and still remaining data @@ -1033,10 +1033,9 @@ int WorldSocket::iSendPartialPacket(WorldPacket& pct) if (m_OutBuffer->copy((char*) (pct.contents() + pct.rpos()), remainingLen) == -1) ACE_ASSERT (false); - + return 1; // some byte written and packet completed } - bool WorldSocket::iFlushPacketQueue() { diff --git a/src/shared/Util.h b/src/shared/Util.h index a8b9df8f29a..eb59392497e 100644 --- a/src/shared/Util.h +++ b/src/shared/Util.h @@ -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; |