diff --git a/.gitignore b/.gitignore index 3bb0872dd..d785f4fc6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,56 +9,66 @@ # # Normal rules # - -compile -FILES -INSTALL - -*.pyc -*.[oa] -*.lo -*.loT -*.la -*.laT +.* +*.o +*.o.* +*.a *.so -*.bak -*.dist -.deps -.libs -*~ -.*.swp -Makefile.in -Makefile +*.so.dbg +*.bin +*.gz -core -core.* -!core.h -vgcore* - -doc/html -doc/Doxyfile -doc/doxygen.log +# +# Top-level generic files +# +tags +TAGS +INSTALL +!.gitignore +# +# Build generated files +# aclocal.m4 autom4te.cache +compile config.guess config.h.in +config.log +config.status config.sub configure depcomp +libtool install-sh ltmain.sh missing -config.log -config.status -libtool stamp-h1 +Makefile.in +Makefile + +# +# Editors / debuggers / other output files +# +*~ +*.bak +*.orig +*.patch callgrind.out.* # +# Git stuff # -# MaNGOS generated files -# +# stgit directories +patches-* +# +# VS binaries output +# bin/* + +# +# Special exceptions +# +!dep/ACE_wrappers/ace/ace_message_table.bin diff --git a/contrib/vmap_debugger/VC8/vmapdebugger.vcproj b/contrib/vmap_debugger/VC8/vmapdebugger.vcproj index 35ca727ab..100ee1eca 100644 --- a/contrib/vmap_debugger/VC8/vmapdebugger.vcproj +++ b/contrib/vmap_debugger/VC8/vmapdebugger.vcproj @@ -1,308 +1,308 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 000000000..e0462fcee --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,14 @@ +# +# NOTE! Don't add files that are generated in specific +# subdirectories here. Add them in the ".gitignore" file +# in that subdirectory instead. +# +# NOTE! Please use 'git-ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. +# +# Doxygen generic files +# +html +Doxyfile +doxygen.log diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 912f9508d..8d91103c0 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -562,6 +562,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { // std. case: increment at 1 case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: + case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if(!miscvalue1) continue; @@ -1151,7 +1152,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS: - case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: diff --git a/src/game/FleeingMovementGenerator.h b/src/game/FleeingMovementGenerator.h index 045f02498..c402a3a4c 100644 --- a/src/game/FleeingMovementGenerator.h +++ b/src/game/FleeingMovementGenerator.h @@ -53,8 +53,8 @@ class MANGOS_DLL_SPEC FleeingMovementGenerator float i_last_distance_from_caster; float i_to_distance_from_caster; float i_cur_angle; - TimeTracker i_nextCheckTime; uint64 i_frightGUID; + TimeTracker i_nextCheckTime; DestinationHolder< Traveller > i_destinationHolder; }; diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index d1de13ad3..b7c55e664 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -196,7 +196,6 @@ void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ ) if(!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName())) return; - uint8 subgroup = group->GetMemberGroup(GetPlayer()->GetGUID()); } void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ ) diff --git a/src/game/Guild.h b/src/game/Guild.h index 8890baf44..d856ebea1 100644 --- a/src/game/Guild.h +++ b/src/game/Guild.h @@ -189,6 +189,22 @@ enum GuildEmblem ERR_GUILDEMBLEM_INVALIDVENDOR = 5 }; +inline uint32 GetGuildBankTabPrice(uint8 Index) +{ + switch(Index) + { + case 0: return 100; + case 1: return 250; + case 2: return 500; + case 3: return 1000; + case 4: return 2500; + case 5: return 5000; + default: + return 0; + } + return 0; +} + struct GuildBankEvent { uint32 LogGuid; diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp index 607d469a9..a65435d42 100644 --- a/src/game/GuildHandler.cpp +++ b/src/game/GuildHandler.cpp @@ -1573,7 +1573,7 @@ void WorldSession::HandleGuildBankBuyTab( WorldPacket & recv_data ) if(!pGuild) return; - uint32 TabCost = objmgr.GetGuildBankTabPrice(TabId) * GOLD; + uint32 TabCost = GetGuildBankTabPrice(TabId) * GOLD; if (!TabCost) return; diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index a0723e46f..4942ea09a 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -665,7 +665,7 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg) return true; } -bool ChatHandler::HandleReloadDbScriptStringCommand(const char* arg) +bool ChatHandler::HandleReloadDbScriptStringCommand(const char* /*arg*/) { sLog.outString( "Re-Loading Script strings from `db_script_string`..."); objmgr.LoadDbScriptStrings(); @@ -1998,7 +1998,7 @@ bool ChatHandler::HandleAddItemCommand(const char* args) if(args[0]=='[') // [name] manual form { - char* citemName = citemName = strtok((char*)args, "]"); + char* citemName = strtok((char*)args, "]"); if(citemName && citemName[0]) { @@ -3411,7 +3411,7 @@ bool ChatHandler::HandleDamageCommand(const char * args) if(!spellid || !sSpellStore.LookupEntry(spellid)) return false; - m_session->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage, false); + m_session->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage); return true; } @@ -4911,7 +4911,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args) return true; } -bool ChatHandler::HandleServerShutDownCancelCommand(const char* args) +bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/) { sWorld.ShutdownCancel(); return true; @@ -4928,7 +4928,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char* args) int32 time = atoi (time_str); ///- Prevent interpret wrong arg value as 0 secs shutdown time - if(time == 0 && (time_str[0]!='0' || time_str[1]!='\0') || time < 0) + if ((time == 0 && (time_str[0]!='0' || time_str[1]!='\0')) || time < 0) return false; if (exitcode_str) @@ -6803,7 +6803,7 @@ bool ChatHandler::HandleModifyGenderCommand(const char *args) if(!player) { - PSendSysMessage(LANG_NO_PLAYER); + PSendSysMessage(LANG_PLAYER_NOT_FOUND); SetSentErrorMessage(true); return false; } diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 05991882a..f12c2147b 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -183,8 +183,9 @@ void Map::DeleteStateMachine() Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) : i_mapEntry (sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode), - i_id(id), i_InstanceId(InstanceId), m_unloadTimer(0), i_gridExpiry(expiry), - m_activeNonPlayersIter(m_activeNonPlayers.end()) + i_id(id), i_InstanceId(InstanceId), m_unloadTimer(0), + m_activeNonPlayersIter(m_activeNonPlayers.end()), + i_gridExpiry(expiry) { for(unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx) { @@ -1226,7 +1227,7 @@ uint16 GridMap::getArea(float x, float y) return m_area_map[lx*16 + ly]; } -float GridMap::getHeightFromFlat(float x, float y) const +float GridMap::getHeightFromFlat(float /*x*/, float /*y*/) const { return m_gridHeight; } @@ -1640,10 +1641,72 @@ uint16 Map::GetAreaFlag(float x, float y, float z) const case 2456: // Death's Breach (Eastern Plaguelands) if(z > 350.0f) areaflag = 1950; break; // Dalaran - case 1593: // Crystalsong Forest - case 2484: // The Twilight Rivulet (Crystalsong Forest) case 2492: // Forlorn Woods (Crystalsong Forest) - if (x > 5568.0f && x < 6116.0f && y > 282.0f && y < 982.0f && z > 563.0f) areaflag = 2153; break; + if (x > 5568.0f && x < 6116.0f && y > 282.0f && y < 982.0f && z > 563.0f) + { + // Krasus' Landing (Dalaran), fast check + if (x > 5758.77f && x < 5869.03f && y < 510.46f) + { + // Krasus' Landing (Dalaran), with open east side + if (y < 449.33f || (x-5813.9f)*(x-5813.9f)+(y-449.33f)*(y-449.33f) < 1864.0f) + { + areaflag = 2533; // Note: also 2633, possible one flight allowed and other not allowed case + break; + } + } + + // Dalaran + areaflag = 2153; + } + break; + // The Violet Citadel (Dalaran) or Dalaran + case 2484: // The Twilight Rivulet (Crystalsong Forest) + case 1593: // Crystalsong Forest + // Dalaran + if (x > 5568.0f && x < 6116.0f && y > 282.0f && y < 982.0f && z > 563.0f) + { + // The Violet Citadel (Dalaran), fast check + if (x > 5721.1f && x < 5884.66f && y > 764.4f && y < 948.0f) + { + // The Violet Citadel (Dalaran) + if ((x-5803.0f)*(x-5803.0f)+(y-846.18f)*(y-846.18f) < 6690.0f) + { + areaflag = 2696; + break; + } + } + + // Dalaran + areaflag = 2153; + } + break; + // Vargoth's Retreat (Dalaran) or The Violet Citadel (Dalaran) or Dalaran + case 2504: // Violet Stand (Crystalsong Forest) + // Dalaran + if (x > 5568.0f && x < 6116.0f && y > 282.0f && y < 982.0f && z > 563.0f) + { + // The Violet Citadel (Dalaran), fast check + if (x > 5721.1f && x < 5884.66f && y > 764.4f && y < 948.0f) + { + // Vargoth's Retreat (Dalaran), nice slow circle with upper limit + if (z < 898.0f && (x-5765.0f)*(x-5765.0f)+(y-862.4f)*(y-862.4f) < 262.0f) + { + areaflag = 2748; + break; + } + + // The Violet Citadel (Dalaran) + if ((x-5803.0f)*(x-5803.0f)+(y-846.18f)*(y-846.18f) < 6690.0f) + { + areaflag = 2696; + break; + } + } + + // Dalaran + areaflag = 2153; + } + break; // Maw of Neltharion (cave) case 164: // Dragonblight case 1797: // Obsidian Dragonshrine (Dragonblight) diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index ce20d5cd7..e693484b2 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -397,6 +397,8 @@ void MotionMaster::Mutate(MovementGenerator *m) // DistractMovement interrupted by any other movement case DISTRACT_MOTION_TYPE: MovementExpired(false); + default: + break; } } m->Initialize(*i_owner); diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index 05b77b4b4..abbebf648 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -434,6 +434,10 @@ void WorldSession::HandleBinderActivateOpcode( WorldPacket & recv_data ) void WorldSession::SendBindPoint(Creature *npc) { + // prevent set homebind to instances in any case + if(sMapStore.LookupEntry(GetPlayer()->GetMapId())->Instanceable()) + return; + uint32 bindspell = 3286; uint32 zone_id = _player->GetZoneId(); diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 684cb5739..7b11731bd 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -173,6 +173,8 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c case GAMEOBJECT_TYPE_TRANSPORT: flags |= UPDATEFLAG_TRANSPORT; break; + default: + break; } } @@ -628,10 +630,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *data << uint32(m_floatValues[ index ] < 0 ? 0 : m_floatValues[ index ]); } // there are some float values which may be negative or can't get negative due to other checks - else if(index >= UNIT_FIELD_NEGSTAT0 && index <= UNIT_FIELD_NEGSTAT4 || - index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6) || - index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + 6) || - index >= UNIT_FIELD_POSSTAT0 && index <= UNIT_FIELD_POSSTAT4) + else if ((index >= UNIT_FIELD_NEGSTAT0 && index <= UNIT_FIELD_NEGSTAT4) || + (index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + 6)) || + (index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index <= (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + 6)) || + (index >= UNIT_FIELD_POSSTAT0 && index <= UNIT_FIELD_POSSTAT4)) { *data << uint32(m_floatValues[ index ]); } diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 5231c05cf..137351b21 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -124,14 +124,6 @@ ObjectMgr::ObjectMgr() m_arenaTeamId = 1; m_auctionid = 1; - mGuildBankTabPrice.resize(GUILD_BANK_MAX_TABS); - mGuildBankTabPrice[0] = 100; - mGuildBankTabPrice[1] = 250; - mGuildBankTabPrice[2] = 500; - mGuildBankTabPrice[3] = 1000; - mGuildBankTabPrice[4] = 2500; - mGuildBankTabPrice[5] = 5000; - // Only zero condition left, others will be added while loading DB tables mConditions.resize(1); } @@ -4848,8 +4840,10 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float if(MapId != entry->map_id) { // if find graveyard at different map from where entrance placed (or no entrance data), use any first - if (!mapEntry || mapEntry->entrance_map < 0 || mapEntry->entrance_map != entry->map_id || - mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0) + if (!mapEntry || + mapEntry->entrance_map < 0 || + mapEntry->entrance_map != entry->map_id || + (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) { // not have any corrdinates for check distance anyway entryFar = entry; @@ -6833,6 +6827,8 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val } break; } + case CONDITION_NONE: + break; } return true; } diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 8bde701a1..d2815c4b8 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -695,8 +695,6 @@ class ObjectMgr int GetIndexForLocale(LocaleConstant loc); LocaleConstant GetLocaleForIndex(int i); - // guild bank tabs - uint32 GetGuildBankTabPrice(uint8 Index) const { return Index < GUILD_BANK_MAX_TABS ? mGuildBankTabPrice[Index] : 0; } uint16 GetConditionId(ConditionType condition, uint32 value1, uint32 value2); bool IsPlayerMeetToCondition(Player const* player, uint16 condition_id) const @@ -864,9 +862,6 @@ class ObjectMgr RespawnTimes mCreatureRespawnTimes; RespawnTimes mGORespawnTimes; - typedef std::vector GuildBankTabPriceMap; - GuildBankTabPriceMap mGuildBankTabPrice; - // Storage for Conditions. First element (index 0) is reserved for zero-condition (nothing required) typedef std::vector ConditionStore; ConditionStore mConditions; diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index b8ea6540e..07c4fb6dc 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -38,8 +38,8 @@ char const* petTypeSuffix[MAX_PET_TYPE] = }; Pet::Pet(PetType type) : -Creature(), m_petType(type), m_removed(false), m_happinessTimer(7500), m_duration(0), m_bonusdamage(0), -m_resetTalentsCost(0), m_resetTalentsTime(0), m_usedTalentCount(0), m_auraUpdateMask(0), m_loading(false), +Creature(), m_removed(false), m_petType(type), m_happinessTimer(7500), m_duration(0), m_resetTalentsCost(0), +m_bonusdamage(0), m_resetTalentsTime(0), m_usedTalentCount(0), m_auraUpdateMask(0), m_loading(false), m_declinedname(NULL) { m_isPet = true; @@ -1278,6 +1278,12 @@ bool Pet::addSpell(uint32 spell_id, uint16 active, PetSpellState state, PetSpell { // can be in case spell loading but learned at some previous spell loading itr->second->state = PETSPELL_UNCHANGED; + + if(active == ACT_ENABLED) + ToggleAutocast(spell_id, true); + else if(active == ACT_DISABLED) + ToggleAutocast(spell_id, false); + return false; } else @@ -1677,8 +1683,13 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply) if (i == m_autospells.size()) { m_autospells.push_back(spellid); - itr->second->active = ACT_ENABLED; - itr->second->state = PETSPELL_CHANGED; + + if(itr->second->active != ACT_ENABLED) + { + itr->second->active = ACT_ENABLED; + if(itr->second->state != PETSPELL_NEW) + itr->second->state = PETSPELL_CHANGED; + } } } else @@ -1690,8 +1701,12 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply) if (i < m_autospells.size()) { m_autospells.erase(itr2); - itr->second->active = ACT_DISABLED; - itr->second->state = PETSPELL_CHANGED; + if(itr->second->active != ACT_DISABLED) + { + itr->second->active = ACT_DISABLED; + if(itr->second->state != PETSPELL_NEW) + itr->second->state = PETSPELL_CHANGED; + } } } } diff --git a/src/game/PetAI.h b/src/game/PetAI.h index 02a412934..797138539 100644 --- a/src/game/PetAI.h +++ b/src/game/PetAI.h @@ -48,8 +48,8 @@ class MANGOS_DLL_DECL PetAI : public CreatureAI void UpdateAllies(); - bool inCombat; TimeTracker i_tracker; + bool inCombat; std::set m_AllySet; uint32 m_updateAlliesTimer; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 40b0596a7..fbb8eb1aa 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1868,6 +1868,7 @@ void Player::Regenerate(Powers power) } break; case POWER_FOCUS: case POWER_HAPPINESS: + case POWER_HEALTH: break; } @@ -1957,8 +1958,8 @@ Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask) if(!IsInWorld()) return NULL; - // exist - Creature *unit = GetMap()->GetCreature(guid); + // exist (we need look pets also for some interaction (quest/etc) + Creature *unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid); if (!unit) return NULL; @@ -1974,8 +1975,8 @@ Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask) if(!unit->isAlive() && (!unit->isSpiritService() || isAlive() )) return NULL; - // not allow interaction under control - if(unit->GetCharmerOrOwnerGUID()) + // not allow interaction under control, but allow with own pets + if(unit->GetCharmerGUID()) return NULL; // not enemy @@ -3420,6 +3421,7 @@ bool Player::resetTalents(bool no_cost) { ModifyMoney(-(int32)cost); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1); m_resetTalentsCost = cost; m_resetTalentsTime = time(NULL); @@ -4807,6 +4809,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) UpdateExpertise(OFF_ATTACK); } break; + case CR_ARMOR_PENETRATION: + break; } } @@ -5353,7 +5357,7 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const return 0; } -void Player::SendInitialActionButtons() +void Player::SendInitialActionButtons() const { sLog.outDetail( "Initializing Action Buttons for '%u'", GetGUIDLow() ); @@ -5607,7 +5611,7 @@ uint32 Player::TeamForRace(uint8 race) case 1: return HORDE; } - sLog.outError("Race %u have wrong team id in DBC: wrong DBC files?",uint32(race),rEntry->TeamID); + sLog.outError("Race %u have wrong teamid %u in DBC: wrong DBC files?",uint32(race),rEntry->TeamID); return ALLIANCE; } @@ -9651,7 +9655,6 @@ uint8 Player::CanBankItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *p if (!pItem->IsBag()) return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; - Bag *pBag = (Bag*)pItem; if( !HasBankBagSlot( slot ) ) return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT; @@ -11775,7 +11778,9 @@ void Player::PrepareQuestMenu( uint64 guid ) Object *pObject; QuestRelations* pObjectQR; QuestRelations* pObjectQIR; - Creature *pCreature = GetMap()->GetCreature(guid); + + // pets also can have quests + Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid); if( pCreature ) { pObject = (Object*)pCreature; @@ -11861,7 +11866,9 @@ void Player::SendPreparedQuest( uint64 guid ) qe._Delay = 0; qe._Emote = 0; std::string title = ""; - Creature *pCreature = GetMap()->GetCreature(guid); + + // need pet case for some quests + Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid); if( pCreature ) { uint32 textid = pCreature->GetNpcTextId(); @@ -11925,7 +11932,7 @@ Quest const * Player::GetNextQuest( uint64 guid, Quest const *pQuest ) QuestRelations* pObjectQR; QuestRelations* pObjectQIR; - Creature *pCreature = GetMap()->GetCreature(guid); + Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid); if( pCreature ) { pObject = (Object*)pCreature; @@ -12988,7 +12995,6 @@ void Player::AdjustQuestReqItemCount( Quest const* pQuest, QuestStatusData& ques uint32 reqitemcount = pQuest->ReqItemCount[i]; if( reqitemcount != 0 ) { - uint32 quest_id = pQuest->GetQuestId(); uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i],true); questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount); @@ -18475,7 +18481,7 @@ uint32 Player::GetResurrectionSpellId() case 27239: spell_id = 27240; break; // rank 6 case 47883: spell_id = 47882; break; // rank 7 default: - sLog.outError("Unhandled spell %%u: S.Resurrection",(*itr)->GetId()); + sLog.outError("Unhandled spell %u: S.Resurrection",(*itr)->GetId()); continue; } @@ -18639,17 +18645,17 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const { - if(pRewardSource->GetDistance(this) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE)) + if (pRewardSource->IsWithinDistInMap(this,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE))) return true; - if(isAlive()) + if (isAlive()) return false; Corpse* corpse = GetCorpse(); - if(!corpse) + if (!corpse) return false; - return pRewardSource->GetDistance(corpse) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE); + return pRewardSource->IsWithinDistInMap(corpse,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE)); } uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const diff --git a/src/game/Player.h b/src/game/Player.h index 24dd953b1..e21802479 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1448,7 +1448,7 @@ class MANGOS_DLL_SPEC Player : public Unit bool addActionButton(uint8 button, uint16 action, uint8 type, uint8 misc); void removeActionButton(uint8 button); - void SendInitialActionButtons(); + void SendInitialActionButtons() const; PvPInfo pvpInfo; void UpdatePvP(bool state, bool ovrride=false); diff --git a/src/game/PointMovementGenerator.h b/src/game/PointMovementGenerator.h index d21c364d8..21b5e7172 100644 --- a/src/game/PointMovementGenerator.h +++ b/src/game/PointMovementGenerator.h @@ -43,9 +43,9 @@ class MANGOS_DLL_SPEC PointMovementGenerator bool GetDestination(float& x, float& y, float& z) const { x=i_x; y=i_y; z=i_z; return true; } private: - TimeTracker i_nextMoveTime; - float i_x,i_y,i_z; uint32 id; + float i_x,i_y,i_z; + TimeTracker i_nextMoveTime; DestinationHolder< Traveller > i_destinationHolder; }; #endif diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp index bb2276a6d..753b6a249 100644 --- a/src/game/PoolHandler.cpp +++ b/src/game/PoolHandler.cpp @@ -322,7 +322,7 @@ bool PoolGroup::ReSpawn1Object(uint32 guid) // Nothing to do for a child Pool template <> -bool PoolGroup::ReSpawn1Object(uint32 guid) +bool PoolGroup::ReSpawn1Object(uint32 /*guid*/) { return true; } @@ -623,6 +623,7 @@ void PoolHandler::Initialize() SpawnPool(pool_entry); count++; } while (result->NextRow()); + delete result; } sLog.outBasic("Pool handling system initialized, %u pools spawned.", count); diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index 819672f81..a49529f13 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -618,7 +618,8 @@ void WorldSession::HandleQuestgiverStatusQueryMultipleOpcode(WorldPacket& /*recv if(IS_CREATURE_GUID(*itr)) { - Creature *questgiver = GetPlayer()->GetMap()->GetCreature(*itr); + // need also pet quests case support + Creature *questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*GetPlayer(),*itr); if(!questgiver || questgiver->IsHostileTo(_player)) continue; if(!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER)) diff --git a/src/game/SkillDiscovery.cpp b/src/game/SkillDiscovery.cpp index adc6b6b26..32b75eab7 100644 --- a/src/game/SkillDiscovery.cpp +++ b/src/game/SkillDiscovery.cpp @@ -91,7 +91,7 @@ void LoadSkillDiscoveryTable() // explicit discovery ability !IsExplicitDiscoverySpell(spellEntry)) { - sLog.outErrorDb("Spell (ID: %u) not have have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc and not 100% chance random discovery ability but listed in `skill_discovery_template` table",spellId); + sLog.outErrorDb("Spell (ID: %u) not have have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc and not 100%% chance random discovery ability but listed in `skill_discovery_template` table",spellId); continue; } diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp index 2a93a8f68..01dbfeb85 100644 --- a/src/game/SocialMgr.cpp +++ b/src/game/SocialMgr.cpp @@ -240,6 +240,8 @@ void SocialMgr::SendFriendStatus(Player *player, FriendsResult result, uint32 fr case FRIEND_ADDED_ONLINE: data << fi.Note; break; + default: + break; } switch(result) @@ -251,6 +253,8 @@ void SocialMgr::SendFriendStatus(Player *player, FriendsResult result, uint32 fr data << uint32(fi.Level); data << uint32(fi.Class); break; + default: + break; } if(broadcast) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 1556095ec..40af5ed29 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2877,6 +2877,8 @@ void Spell::SendCastResult(SpellCastResult result) data << uint32(m_spellInfo->EquippedItemSubClassMask); //data << uint32(m_spellInfo->EquippedItemInventoryTypeMask); break; + default: + break; } ((Player*)m_caster)->GetSession()->SendPacket(&data); } @@ -2895,8 +2897,6 @@ void Spell::SendSpellStart() if(m_spellInfo->runeCostID) castFlags |= CAST_FLAG_UNKNOWN10; - Unit *target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster; - WorldPacket data(SMSG_SPELL_START, (8+8+4+4+2)); if(m_CastItem) data.append(m_CastItem->GetPackGUID()); @@ -2943,8 +2943,6 @@ void Spell::SendSpellGo() sLog.outDebug("Sending SMSG_SPELL_GO id=%u", m_spellInfo->Id); - Unit *target = m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster; - uint32 castFlags = CAST_FLAG_UNKNOWN3; if(IsRangedSpell()) castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index bac90f2d1..a35938dbc 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -349,11 +349,11 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= static AuraType const frozenAuraTypes[] = { SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_NONE }; Aura::Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) : -m_spellmod(NULL), m_caster_guid(0), m_castItemGuid(castItem?castItem->GetGUID():0), m_target(target), +m_spellmod(NULL), m_caster_guid(0), m_target(target), m_castItemGuid(castItem?castItem->GetGUID():0), m_timeCla(1000), m_periodicTimer(0), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE), m_effIndex(eff), m_auraSlot(MAX_AURAS), m_auraFlags(AFLAG_NONE), m_auraLevel(1), m_procCharges(0), m_stackAmount(1), m_positive(false), m_permanent(false), m_isPeriodic(false), m_isAreaAura(false), m_isPersistent(false), -m_updated(false), m_isRemovedOnShapeLost(true), m_in_use(false) +m_isRemovedOnShapeLost(true), m_updated(false), m_in_use(false) { assert(target); @@ -701,7 +701,6 @@ void AreaAura::Update(uint32 diff) if( pGroup) { - uint8 subgroup = ((Player*)owner)->GetSubGroup(); for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* Target = itr->getSource(); @@ -1305,7 +1304,7 @@ void Aura::HandleAddModifier(bool apply, bool Real) m_target->CastSpell(m_target,45471,true); } } -void Aura::HandleAddTargetTrigger(bool apply, bool Real) +void Aura::HandleAddTargetTrigger(bool apply, bool /*Real*/) { // Use SpellModifier structure for check // used only fields: @@ -2556,7 +2555,7 @@ void Aura::HandleAuraHover(bool apply, bool Real) m_target->SendMessageToSet(&data,true); } -void Aura::HandleWaterBreathing(bool apply, bool Real) +void Aura::HandleWaterBreathing(bool /*apply*/, bool /*Real*/) { // update timers in client if(m_target->GetTypeId()==TYPEID_PLAYER) @@ -2963,7 +2962,7 @@ void Aura::HandleForceReaction(bool apply, bool Real) player->GetReputationMgr().SendForceReactions(); } -void Aura::HandleAuraModSkill(bool apply, bool Real) +void Aura::HandleAuraModSkill(bool apply, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -3016,7 +3015,7 @@ void Aura::HandleChannelDeathItem(bool apply, bool Real) } } -void Aura::HandleBindSight(bool apply, bool Real) +void Aura::HandleBindSight(bool apply, bool /*Real*/) { Unit* caster = GetCaster(); if(!caster || caster->GetTypeId() != TYPEID_PLAYER) @@ -3025,7 +3024,7 @@ void Aura::HandleBindSight(bool apply, bool Real) ((Player*)caster)->SetFarSightGUID(apply ? m_target->GetGUID() : 0); } -void Aura::HandleFarSight(bool apply, bool Real) +void Aura::HandleFarSight(bool apply, bool /*Real*/) { Unit* caster = GetCaster(); if(!caster || caster->GetTypeId() != TYPEID_PLAYER) @@ -3034,7 +3033,7 @@ void Aura::HandleFarSight(bool apply, bool Real) ((Player*)caster)->SetFarSightGUID(apply ? m_target->GetGUID() : 0); } -void Aura::HandleAuraTrackCreatures(bool apply, bool Real) +void Aura::HandleAuraTrackCreatures(bool apply, bool /*Real*/) { if(m_target->GetTypeId()!=TYPEID_PLAYER) return; @@ -3044,7 +3043,7 @@ void Aura::HandleAuraTrackCreatures(bool apply, bool Real) m_target->SetUInt32Value(PLAYER_TRACK_CREATURES, apply ? ((uint32)1)<<(m_modifier.m_miscvalue-1) : 0 ); } -void Aura::HandleAuraTrackResources(bool apply, bool Real) +void Aura::HandleAuraTrackResources(bool apply, bool /*Real*/) { if(m_target->GetTypeId()!=TYPEID_PLAYER) return; @@ -3054,7 +3053,7 @@ void Aura::HandleAuraTrackResources(bool apply, bool Real) m_target->SetUInt32Value(PLAYER_TRACK_RESOURCES, apply ? ((uint32)1)<<(m_modifier.m_miscvalue-1): 0 ); } -void Aura::HandleAuraTrackStealthed(bool apply, bool Real) +void Aura::HandleAuraTrackStealthed(bool apply, bool /*Real*/) { if(m_target->GetTypeId()!=TYPEID_PLAYER) return; @@ -3065,7 +3064,7 @@ void Aura::HandleAuraTrackStealthed(bool apply, bool Real) m_target->ApplyModFlag(PLAYER_FIELD_BYTES,PLAYER_FIELD_BYTE_TRACK_STEALTHED,apply); } -void Aura::HandleAuraModScale(bool apply, bool Real) +void Aura::HandleAuraModScale(bool apply, bool /*Real*/) { m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X,m_modifier.m_amount,apply); } @@ -3193,7 +3192,7 @@ void Aura::HandleModPossessPet(bool apply, bool Real) } } -void Aura::HandleAuraModPetTalentsPoints(bool Apply, bool Real) +void Aura::HandleAuraModPetTalentsPoints(bool /*Apply*/, bool Real) { if(!Real) return; @@ -3688,7 +3687,6 @@ void Aura::HandleAuraModRoot(bool apply, bool Real) if(!Real) return; - uint32 apply_stat = UNIT_STAT_ROOT; if (apply) { // Frost root aura -> freeze/unfreeze target @@ -3986,7 +3984,7 @@ void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real) /*** IMMUNITY ***/ /*********************************************************/ -void Aura::HandleModMechanicImmunity(bool apply, bool Real) +void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/) { uint32 mechanic = 1 << m_modifier.m_miscvalue; @@ -4063,7 +4061,7 @@ void Aura::HandleModMechanicImmunity(bool apply, bool Real) } //this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect -void Aura::HandleAuraModEffectImmunity(bool apply, bool Real) +void Aura::HandleAuraModEffectImmunity(bool apply, bool /*Real*/) { // when removing flag aura, handle flag drop if( !apply && m_target->GetTypeId() == TYPEID_PLAYER @@ -4139,7 +4137,7 @@ void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real) } } -void Aura::HandleAuraModDmgImmunity(bool apply, bool Real) +void Aura::HandleAuraModDmgImmunity(bool apply, bool /*Real*/) { m_target->ApplySpellImmune(GetId(),IMMUNITY_DAMAGE,m_modifier.m_miscvalue,apply); } @@ -4171,7 +4169,7 @@ void Aura::HandleAuraProcTriggerSpell(bool apply, bool Real) } } -void Aura::HandleAuraModStalked(bool apply, bool Real) +void Aura::HandleAuraModStalked(bool apply, bool /*Real*/) { // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND if(apply) @@ -4184,7 +4182,7 @@ void Aura::HandleAuraModStalked(bool apply, bool Real) /*** PERIODIC ***/ /*********************************************************/ -void Aura::HandlePeriodicTriggerSpell(bool apply, bool Real) +void Aura::HandlePeriodicTriggerSpell(bool apply, bool /*Real*/) { m_isPeriodic = apply; if (m_spellProto->Id == 66 && !apply) @@ -4194,7 +4192,7 @@ void Aura::HandlePeriodicTriggerSpell(bool apply, bool Real) } } -void Aura::HandlePeriodicTriggerSpellWithValue(bool apply, bool Real) +void Aura::HandlePeriodicTriggerSpellWithValue(bool apply, bool /*Real*/) { m_isPeriodic = apply; } @@ -4213,7 +4211,7 @@ void Aura::HandlePeriodicEnergize(bool apply, bool Real) m_modifier.m_amount = m_target->GetMaxPower(POWER_MANA) * 25 / 10000; } -void Aura::HandleAuraPowerBurn(bool apply, bool Real) +void Aura::HandleAuraPowerBurn(bool apply, bool /*Real*/) { m_isPeriodic = apply; } @@ -4258,7 +4256,7 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real) m_isPeriodic = apply; } -void Aura::HandlePeriodicHeal(bool apply, bool Real) +void Aura::HandlePeriodicHeal(bool apply, bool /*Real*/) { m_isPeriodic = apply; } @@ -4371,7 +4369,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) //3 points: ${($m1+$b1*3+0.03*$AP)*6} damage over 12 secs //4 points: ${($m1+$b1*4+0.03428571*$AP)*7} damage over 14 secs //5 points: ${($m1+$b1*5+0.0375*$AP)*8} damage over 16 secs - float AP_per_combo[] = {0, 0.015f, 0.024, 0.03, 0.03428571, 0.0375}; + float AP_per_combo[6] = {0.0f, 0.015f, 0.024f, 0.03f, 0.03428571f, 0.0375f}; uint8 cp = ((Player*)caster)->GetComboPoints(); if (cp > 5) cp = 5; m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * AP_per_combo[cp]); @@ -4424,22 +4422,22 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) } } -void Aura::HandlePeriodicDamagePCT(bool apply, bool Real) +void Aura::HandlePeriodicDamagePCT(bool apply, bool /*Real*/) { m_isPeriodic = apply; } -void Aura::HandlePeriodicLeech(bool apply, bool Real) +void Aura::HandlePeriodicLeech(bool apply, bool /*Real*/) { m_isPeriodic = apply; } -void Aura::HandlePeriodicManaLeech(bool apply, bool Real) +void Aura::HandlePeriodicManaLeech(bool apply, bool /*Real*/) { m_isPeriodic = apply; } -void Aura::HandlePeriodicHealthFunnel(bool apply, bool Real) +void Aura::HandlePeriodicHealthFunnel(bool apply, bool /*Real*/) { m_isPeriodic = apply; } @@ -4452,7 +4450,7 @@ void Aura::HandlePeriodicHealthFunnel(bool apply, bool Real) /*** RESISTANCE ***/ /********************************/ -void Aura::HandleAuraModResistanceExclusive(bool apply, bool Real) +void Aura::HandleAuraModResistanceExclusive(bool apply, bool /*Real*/) { for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++) { @@ -4465,7 +4463,7 @@ void Aura::HandleAuraModResistanceExclusive(bool apply, bool Real) } } -void Aura::HandleAuraModResistance(bool apply, bool Real) +void Aura::HandleAuraModResistance(bool apply, bool /*Real*/) { for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++) { @@ -4478,7 +4476,7 @@ void Aura::HandleAuraModResistance(bool apply, bool Real) } } -void Aura::HandleAuraModBaseResistancePCT(bool apply, bool Real) +void Aura::HandleAuraModBaseResistancePCT(bool apply, bool /*Real*/) { // only players have base stats if(m_target->GetTypeId() != TYPEID_PLAYER) @@ -4497,7 +4495,7 @@ void Aura::HandleAuraModBaseResistancePCT(bool apply, bool Real) } } -void Aura::HandleModResistancePercent(bool apply, bool Real) +void Aura::HandleModResistancePercent(bool apply, bool /*Real*/) { for(int8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++) { @@ -4513,7 +4511,7 @@ void Aura::HandleModResistancePercent(bool apply, bool Real) } } -void Aura::HandleModBaseResistance(bool apply, bool Real) +void Aura::HandleModBaseResistance(bool apply, bool /*Real*/) { // only players have base stats if(m_target->GetTypeId() != TYPEID_PLAYER) @@ -4534,7 +4532,7 @@ void Aura::HandleModBaseResistance(bool apply, bool Real) /*** STAT ***/ /********************************/ -void Aura::HandleAuraModStat(bool apply, bool Real) +void Aura::HandleAuraModStat(bool apply, bool /*Real*/) { if (m_modifier.m_miscvalue < -2 || m_modifier.m_miscvalue > 4) { @@ -4555,7 +4553,7 @@ void Aura::HandleAuraModStat(bool apply, bool Real) } } -void Aura::HandleModPercentStat(bool apply, bool Real) +void Aura::HandleModPercentStat(bool apply, bool /*Real*/) { if (m_modifier.m_miscvalue < -1 || m_modifier.m_miscvalue > 4) { @@ -4574,7 +4572,7 @@ void Aura::HandleModPercentStat(bool apply, bool Real) } } -void Aura::HandleModSpellDamagePercentFromStat(bool /*apply*/, bool Real) +void Aura::HandleModSpellDamagePercentFromStat(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -4585,7 +4583,7 @@ void Aura::HandleModSpellDamagePercentFromStat(bool /*apply*/, bool Real) ((Player*)m_target)->UpdateSpellDamageAndHealingBonus(); } -void Aura::HandleModSpellHealingPercentFromStat(bool /*apply*/, bool Real) +void Aura::HandleModSpellHealingPercentFromStat(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -4603,7 +4601,7 @@ void Aura::HandleAuraModDispelResist(bool apply, bool Real) m_target->CastSpell(m_target,44416,true,NULL,this,GetCasterGUID()); } -void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool Real) +void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -4614,7 +4612,7 @@ void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool Real) ((Player*)m_target)->UpdateSpellDamageAndHealingBonus(); } -void Aura::HandleModSpellHealingPercentFromAttackPower(bool /*apply*/, bool Real) +void Aura::HandleModSpellHealingPercentFromAttackPower(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -4623,7 +4621,7 @@ void Aura::HandleModSpellHealingPercentFromAttackPower(bool /*apply*/, bool Real ((Player*)m_target)->UpdateSpellDamageAndHealingBonus(); } -void Aura::HandleModHealingDone(bool /*apply*/, bool Real) +void Aura::HandleModHealingDone(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -4632,7 +4630,7 @@ void Aura::HandleModHealingDone(bool /*apply*/, bool Real) ((Player*)m_target)->UpdateSpellDamageAndHealingBonus(); } -void Aura::HandleModTotalPercentStat(bool apply, bool Real) +void Aura::HandleModTotalPercentStat(bool apply, bool /*Real*/) { if (m_modifier.m_miscvalue < -1 || m_modifier.m_miscvalue > 4) { @@ -4663,7 +4661,7 @@ void Aura::HandleModTotalPercentStat(bool apply, bool Real) } } -void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real) +void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -4683,12 +4681,12 @@ void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real) /********************************/ /*** HEAL & ENERGIZE ***/ /********************************/ -void Aura::HandleAuraModTotalHealthPercentRegen(bool apply, bool Real) +void Aura::HandleAuraModTotalHealthPercentRegen(bool apply, bool /*Real*/) { m_isPeriodic = apply; } -void Aura::HandleAuraModTotalManaPercentRegen(bool apply, bool Real) +void Aura::HandleAuraModTotalManaPercentRegen(bool apply, bool /*Real*/) { if(m_modifier.periodictime == 0) m_modifier.periodictime = 1000; @@ -4697,7 +4695,7 @@ void Aura::HandleAuraModTotalManaPercentRegen(bool apply, bool Real) m_isPeriodic = apply; } -void Aura::HandleModRegen(bool apply, bool Real) // eating +void Aura::HandleModRegen(bool apply, bool /*Real*/) // eating { if(m_modifier.periodictime == 0) m_modifier.periodictime = 5000; @@ -4756,7 +4754,7 @@ void Aura::HandleModManaRegen(bool /*apply*/, bool Real) ((Player*)m_target)->UpdateManaRegen(); } -void Aura::HandleComprehendLanguage(bool apply, bool Real) +void Aura::HandleComprehendLanguage(bool apply, bool /*Real*/) { if(apply) m_target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_COMPREHEND_LANG); @@ -4799,7 +4797,7 @@ void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real) m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); } -void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool Real) +void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool /*Real*/) { uint32 oldhealth = m_target->GetHealth(); double healthPercentage = (double)oldhealth / (double)m_target->GetMaxHealth(); @@ -4817,7 +4815,7 @@ void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool Real) } } -void Aura::HandleAuraModIncreaseEnergy(bool apply, bool Real) +void Aura::HandleAuraModIncreaseEnergy(bool apply, bool /*Real*/) { Powers powerType = m_target->getPowerType(); if(int32(powerType) != m_modifier.m_miscvalue) @@ -4853,7 +4851,7 @@ void Aura::HandleAuraIncreaseBaseHealthPercent(bool apply, bool /*Real*/) /*** FIGHT ***/ /********************************/ -void Aura::HandleAuraModParryPercent(bool /*apply*/, bool Real) +void Aura::HandleAuraModParryPercent(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId()!=TYPEID_PLAYER) return; @@ -4861,7 +4859,7 @@ void Aura::HandleAuraModParryPercent(bool /*apply*/, bool Real) ((Player*)m_target)->UpdateParryPercentage(); } -void Aura::HandleAuraModDodgePercent(bool /*apply*/, bool Real) +void Aura::HandleAuraModDodgePercent(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId()!=TYPEID_PLAYER) return; @@ -4870,7 +4868,7 @@ void Aura::HandleAuraModDodgePercent(bool /*apply*/, bool Real) //sLog.outError("BONUS DODGE CHANCE: + %f", float(m_modifier.m_amount)); } -void Aura::HandleAuraModBlockPercent(bool /*apply*/, bool Real) +void Aura::HandleAuraModBlockPercent(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId()!=TYPEID_PLAYER) return; @@ -4920,7 +4918,7 @@ void Aura::HandleAuraModCritPercent(bool apply, bool Real) } } -void Aura::HandleModHitChance(bool apply, bool Real) +void Aura::HandleModHitChance(bool apply, bool /*Real*/) { if(m_target->GetTypeId() == TYPEID_PLAYER) { @@ -4934,7 +4932,7 @@ void Aura::HandleModHitChance(bool apply, bool Real) } } -void Aura::HandleModSpellHitChance(bool apply, bool Real) +void Aura::HandleModSpellHitChance(bool apply, bool /*Real*/) { if(m_target->GetTypeId() == TYPEID_PLAYER) { @@ -4980,19 +4978,19 @@ void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real) /*** ATTACK SPEED ***/ /********************************/ -void Aura::HandleModCastingSpeed(bool apply, bool Real) +void Aura::HandleModCastingSpeed(bool apply, bool /*Real*/) { m_target->ApplyCastTimePercentMod(m_modifier.m_amount,apply); } -void Aura::HandleModMeleeRangedSpeedPct(bool apply, bool Real) +void Aura::HandleModMeleeRangedSpeedPct(bool apply, bool /*Real*/) { m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply); m_target->ApplyAttackTimePercentMod(OFF_ATTACK,m_modifier.m_amount,apply); m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply); } -void Aura::HandleModCombatSpeedPct(bool apply, bool Real) +void Aura::HandleModCombatSpeedPct(bool apply, bool /*Real*/) { m_target->ApplyCastTimePercentMod(m_modifier.m_amount,apply); m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply); @@ -5000,7 +4998,7 @@ void Aura::HandleModCombatSpeedPct(bool apply, bool Real) m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply); } -void Aura::HandleModAttackSpeed(bool apply, bool Real) +void Aura::HandleModAttackSpeed(bool apply, bool /*Real*/) { if(!m_target->isAlive() ) return; @@ -5008,19 +5006,19 @@ void Aura::HandleModAttackSpeed(bool apply, bool Real) m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply); } -void Aura::HandleHaste(bool apply, bool Real) +void Aura::HandleHaste(bool apply, bool /*Real*/) { m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount,apply); m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount,apply); m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_modifier.m_amount,apply); } -void Aura::HandleAuraModRangedHaste(bool apply, bool Real) +void Aura::HandleAuraModRangedHaste(bool apply, bool /*Real*/) { m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply); } -void Aura::HandleRangedAmmoHaste(bool apply, bool Real) +void Aura::HandleRangedAmmoHaste(bool apply, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -5031,12 +5029,12 @@ void Aura::HandleRangedAmmoHaste(bool apply, bool Real) /*** ATTACK POWER ***/ /********************************/ -void Aura::HandleAuraModAttackPower(bool apply, bool Real) +void Aura::HandleAuraModAttackPower(bool apply, bool /*Real*/) { m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(m_modifier.m_amount), apply); } -void Aura::HandleAuraModRangedAttackPower(bool apply, bool Real) +void Aura::HandleAuraModRangedAttackPower(bool apply, bool /*Real*/) { if((m_target->getClassMask() & CLASSMASK_WAND_USERS)!=0) return; @@ -5044,13 +5042,13 @@ void Aura::HandleAuraModRangedAttackPower(bool apply, bool Real) m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(m_modifier.m_amount), apply); } -void Aura::HandleAuraModAttackPowerPercent(bool apply, bool Real) +void Aura::HandleAuraModAttackPowerPercent(bool apply, bool /*Real*/) { //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1 m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, float(m_modifier.m_amount), apply); } -void Aura::HandleAuraModRangedAttackPowerPercent(bool apply, bool Real) +void Aura::HandleAuraModRangedAttackPowerPercent(bool apply, bool /*Real*/) { if((m_target->getClassMask() & CLASSMASK_WAND_USERS)!=0) return; @@ -5059,7 +5057,7 @@ void Aura::HandleAuraModRangedAttackPowerPercent(bool apply, bool Real) m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_PCT, float(m_modifier.m_amount), apply); } -void Aura::HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real) +void Aura::HandleAuraModRangedAttackPowerOfStatPercent(bool /*apply*/, bool Real) { // spells required only Real aura add/remove if(!Real) @@ -5070,7 +5068,7 @@ void Aura::HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real) ((Player*)m_target)->UpdateAttackPowerAndDamage(true); } -void Aura::HandleAuraModAttackPowerOfStatPercent(bool apply, bool Real) +void Aura::HandleAuraModAttackPowerOfStatPercent(bool /*apply*/, bool Real) { // spells required only Real aura add/remove if(!Real) @@ -5262,7 +5260,7 @@ void Aura::HandleModPowerCost(bool apply, bool Real) m_target->ApplyModInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,m_modifier.m_amount,apply); } -void Aura::HandleNoReagentUseAura(bool Apply, bool Real) +void Aura::HandleNoReagentUseAura(bool /*Apply*/, bool Real) { // spells required only Real aura add/remove if(!Real) @@ -5430,7 +5428,7 @@ void Aura::HandleShapeshiftBoosts(bool apply) m_target->SetHealth(uint32(ceil((double)m_target->GetMaxHealth() * healthPercentage)));*/ } -void Aura::HandleAuraEmpathy(bool apply, bool Real) +void Aura::HandleAuraEmpathy(bool apply, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_UNIT) return; @@ -5440,7 +5438,7 @@ void Aura::HandleAuraEmpathy(bool apply, bool Real) m_target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply); } -void Aura::HandleAuraUntrackable(bool apply, bool Real) +void Aura::HandleAuraUntrackable(bool apply, bool /*Real*/) { if(apply) m_target->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE); @@ -5448,7 +5446,7 @@ void Aura::HandleAuraUntrackable(bool apply, bool Real) m_target->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_UNTRACKABLE); } -void Aura::HandleAuraModPacify(bool apply, bool Real) +void Aura::HandleAuraModPacify(bool apply, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -5465,7 +5463,7 @@ void Aura::HandleAuraModPacifyAndSilence(bool apply, bool Real) HandleAuraModSilence(apply,Real); } -void Aura::HandleAuraGhost(bool apply, bool Real) +void Aura::HandleAuraGhost(bool apply, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -5535,7 +5533,7 @@ void Aura::HandleForceMoveForward(bool apply, bool Real) m_target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVE); } -void Aura::HandleAuraModExpertise(bool /*apply*/, bool Real) +void Aura::HandleAuraModExpertise(bool /*apply*/, bool /*Real*/) { if(m_target->GetTypeId() != TYPEID_PLAYER) return; @@ -5560,7 +5558,7 @@ void Aura::HandleModTargetResistance(bool apply, bool Real) m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,m_modifier.m_amount, apply); } -void Aura::HandleShieldBlockValue(bool apply, bool Real) +void Aura::HandleShieldBlockValue(bool apply, bool /*Real*/) { BaseModType modType = FLAT_MOD; if(m_modifier.m_auraname == SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT) @@ -5959,14 +5957,9 @@ void Aura::PeriodicTick() if( BattleGround *bg = ((Player*)pCaster)->GetBattleGround() ) bg->UpdatePlayerScore(((Player*)pCaster), SCORE_HEALING_DONE, gain); - //Do check before because m_modifier.auraName can be invalidate by DealDamage. - bool procSpell = (m_modifier.m_auraname == SPELL_AURA_PERIODIC_HEAL && m_target != pCaster); - m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto()); - Unit* target = m_target; // aura can be deleted in DealDamage SpellEntry const* spellProto = GetSpellProto(); - bool haveCastItem = GetCastItemGUID()!=0; // heal for caster damage if(m_target!=pCaster && spellProto->SpellVisual[0]==163) @@ -5996,8 +5989,8 @@ void Aura::PeriodicTick() } } - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;// | PROC_FLAG_SUCCESSFUL_HEAL; - uint32 procVictim = 0;//ROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_HEAL; +// uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;// | PROC_FLAG_SUCCESSFUL_HEAL; +// uint32 procVictim = 0;//ROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_HEAL; // ignore item heals // if(procSpell && !haveCastItem) // pCaster->ProcDamageAndSpell(target, procAttacker, procVictim, PROC_EX_NORMAL_HIT, pdamage, BASE_ATTACK, spellProto); @@ -6691,7 +6684,7 @@ void Aura::HandleArenaPreparation(bool apply, bool Real) m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION); } -void Aura::HandleAuraControlVehicle(bool apply, bool Real) +void Aura::HandleAuraControlVehicle(bool /*apply*/, bool Real) { if(!Real) return; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index dac092d2e..c4a04a5ef 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2156,7 +2156,6 @@ void Spell::EffectTeleportUnits(uint32 i) return; } // Init dest coordinates - uint32 mapid = m_caster->GetMapId(); float x = m_targets.m_destX; float y = m_targets.m_destY; float z = m_targets.m_destZ; @@ -2558,7 +2557,7 @@ void Spell::EffectHealthLeech(uint32 i) int32 new_damage = int32(damage*multiplier); uint32 curHealth = unitTarget->GetHealth(); - new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage, m_IsTriggeredSpell, true); + new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage ); if(curHealth < new_damage) new_damage = curHealth; @@ -2925,6 +2924,8 @@ void Spell::SendLoot(uint64 guid, LootType loottype) gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster); // Don't return, let loots been taken + default: + break; } } @@ -3849,7 +3850,7 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx) } if(!add_socket) { - sLog.outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (u), not suppoted yet.", + sLog.outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.", m_spellInfo->Id,SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC,ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET); return; } @@ -4906,11 +4907,23 @@ void Spell::EffectScriptEffect(uint32 effIndex) uint32 spellID = m_spellInfo->CalculateSimpleValue(0); uint32 questID = m_spellInfo->CalculateSimpleValue(1); - if( ((Player*)unitTarget)->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE && !((Player*)unitTarget)->GetQuestRewardStatus (questID) ) + if (((Player*)unitTarget)->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE && !((Player*)unitTarget)->GetQuestRewardStatus (questID)) unitTarget->CastSpell(unitTarget, spellID, true); return; } + case 59317: // Teleporting + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) + return; + + // return from top + if (((Player*)unitTarget)->GetAreaId() == 4637) + unitTarget->CastSpell(unitTarget, 59316, true); + // teleport atop + else + unitTarget->CastSpell(unitTarget, 59314, true); + + return; // random spell learn instead placeholder case 60893: // Northrend Alchemy Research case 61177: // Northrend Inscription Research @@ -5974,9 +5987,9 @@ void Spell::EffectSummonCritter(uint32 i) critter->AIM_Initialize(); critter->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as critter... - critter->SetMaxHealth(1); - critter->SetHealth(1); - critter->SetLevel(1); + critter->SelectLevel(critter->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp + critter->SetUInt32Value(UNIT_NPC_FLAGS, critter->GetCreatureInfo()->npcflag); + // some mini-pets have quests // set timer for unsummon int32 duration = GetSpellDuration(m_spellInfo); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 863c01d1b..3413fba83 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -502,6 +502,8 @@ bool IsSingleTargetSpell(SpellEntry const *spellInfo) { case SPELL_JUDGEMENT: return true; + default: + break; } // single target triggered spell. @@ -531,6 +533,8 @@ bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellI if(GetSpellSpecific(spellInfo2->Id) == spec1) return true; break; + default: + break; } return false; @@ -1136,12 +1140,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons case SPELLFAMILY_GENERIC: // same family case { // Thunderfury - if( spellInfo_1->Id == 21992 && spellInfo_2->Id == 27648 || spellInfo_2->Id == 21992 && spellInfo_1->Id == 27648 ) + if ((spellInfo_1->Id == 21992 && spellInfo_2->Id == 27648) || + (spellInfo_2->Id == 21992 && spellInfo_1->Id == 27648)) return false; // Lightning Speed (Mongoose) and Fury of the Crashing Waves (Tsunami Talisman) - if( spellInfo_1->Id == 28093 && spellInfo_2->Id == 42084 || - spellInfo_2->Id == 28093 && spellInfo_1->Id == 42084 ) + if ((spellInfo_1->Id == 28093 && spellInfo_2->Id == 42084) || + (spellInfo_2->Id == 28093 && spellInfo_1->Id == 42084)) return false; // Soulstone Resurrection and Twisting Nether (resurrector) @@ -2789,6 +2794,8 @@ bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group) case DIMINISHING_BANISH: case DIMINISHING_LIMITONLY: return true; + default: + return false; } return false; } @@ -2816,6 +2823,8 @@ DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group) case DIMINISHING_WARLOCK_FEAR: case DIMINISHING_KNOCKOUT: return DRTYPE_PLAYER; + default: + break; } return DRTYPE_NONE; diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 1a87ace79..b7dd52d2a 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -318,8 +318,9 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe break; } - if( currentRef->getThreat() > 1.3f * pCurrentVictim->getThreat() || - currentRef->getThreat() > 1.1f * pCurrentVictim->getThreat() && pAttacker->IsWithinDistInMap(target, ATTACK_DISTANCE) ) + if ((currentRef->getThreat() > 1.3f * pCurrentVictim->getThreat() || + currentRef->getThreat() > 1.1f * pCurrentVictim->getThreat()) && + pAttacker->IsWithinDistInMap(target, ATTACK_DISTANCE)) { //implement 110% threat rule for targets in melee range found = true; //and 130% rule for targets in ranged distances break; //for selecting alive targets diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index dd8973a2a..3fd0e8b1a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -980,7 +980,7 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const *spellInfo, boo } // Obsolete func need remove, here only for comotability vs another patches -uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell, bool useSpellDamage) +uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellID); SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, spellInfo->SchoolMask); @@ -2275,7 +2275,7 @@ void Unit::SendAttackStop(Unit* victim) ((Creature*)victim)->AI().EnterEvadeMode(this);*/ } -bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAttackType attackType) +bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType) { if (pVictim->HasInArc(M_PI,this)) { @@ -4352,7 +4352,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SendMessageToSet( &data, true ); } -bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) +bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const * /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) { SpellEntry const *hasteSpell = triggeredByAura->GetSpellProto(); @@ -4662,7 +4662,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu break; } return false; - }/**/ + }*/ // Sunwell Exalted Caster Neck (Shattered Sun Pendant of Acumen neck) // cast 45479 Light's Wrath if Exalted by Aldor // cast 45429 Arcane Bolt if Exalted by Scryers @@ -7326,24 +7326,28 @@ void Unit::ModifyAuraState(AuraState flag, bool apply) if (HasFlag(UNIT_FIELD_AURASTATE,1<<(flag-1))) { RemoveFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)); - Unit::AuraMap& tAuras = GetAuras(); - for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end();) - { - SpellEntry const* spellProto = (*itr).second->GetSpellProto(); - if (spellProto->CasterAuraState == flag) - { - // exceptions (applied at state but not removed at state change) - // Rampage - if(spellProto->SpellIconID==2006 && spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && spellProto->SpellFamilyFlags==0x100000) - { - ++itr; - continue; - } - RemoveAura(itr); + if (flag != AURA_STATE_ENRAGE) // enrage aura state triggering continues auras + { + Unit::AuraMap& tAuras = GetAuras(); + for (Unit::AuraMap::iterator itr = tAuras.begin(); itr != tAuras.end();) + { + SpellEntry const* spellProto = (*itr).second->GetSpellProto(); + if (spellProto->CasterAuraState == flag) + { + // exceptions (applied at state but not removed at state change) + // Rampage + if(spellProto->SpellIconID==2006 && spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && spellProto->SpellFamilyFlags==0x100000) + { + ++itr; + continue; + } + + RemoveAura(itr); + } + else + ++itr; } - else - ++itr; } } } @@ -9946,6 +9950,7 @@ Powers Unit::GetPowerTypeByAuraGroup(UnitMods unitMod) const case UNIT_MOD_HAPPINESS: return POWER_HAPPINESS; case UNIT_MOD_RUNE: return POWER_RUNE; case UNIT_MOD_RUNIC_POWER:return POWER_RUNIC_POWER; + default: return POWER_MANA; } return POWER_MANA; @@ -10169,6 +10174,8 @@ uint32 Unit::GetCreatePowers( Powers power ) const case POWER_ENERGY: return 100; case POWER_HAPPINESS: return (GetTypeId()==TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType()!=HUNTER_PET ? 0 : 1050000); case POWER_RUNIC_POWER: return 1000; + case POWER_RUNE: return 0; + case POWER_HEALTH: return 0; } return 0; @@ -10581,7 +10588,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag Aura *triggeredByAura = i->triggeredByAura; Modifier *auraModifier = triggeredByAura->GetModifier(); SpellEntry const *spellInfo = triggeredByAura->GetSpellProto(); - uint32 effIndex = triggeredByAura->GetEffIndex(); bool useCharges = triggeredByAura->GetAuraCharges() > 0; // For players set spell cooldown if need uint32 cooldown = 0; diff --git a/src/game/Unit.h b/src/game/Unit.h index 9282cbfa6..0652f5269 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1085,7 +1085,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false); void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype); - uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true); + uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage); void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0); diff --git a/src/mangosd/CliRunnable.cpp b/src/mangosd/CliRunnable.cpp index a1d20bbdf..5e7c05dbc 100644 --- a/src/mangosd/CliRunnable.cpp +++ b/src/mangosd/CliRunnable.cpp @@ -153,7 +153,7 @@ bool ChatHandler::HandleCharacterDeleteCommand(const char* args) } /// Exit the realm -bool ChatHandler::HandleServerExitCommand(const char* args) +bool ChatHandler::HandleServerExitCommand(const char* /*args*/) { SendSysMessage(LANG_COMMAND_EXIT); World::StopNow(SHUTDOWN_EXIT_CODE); @@ -161,7 +161,7 @@ bool ChatHandler::HandleServerExitCommand(const char* args) } /// Display info on users currently in the realm -bool ChatHandler::HandleAccountOnlineListCommand(const char* args) +bool ChatHandler::HandleAccountOnlineListCommand(const char* /*args*/) { ///- Get the list of accounts ID logged to the realm QueryResult *resultDB = CharacterDatabase.Query("SELECT name,account FROM characters WHERE online > 0"); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7cd2371a0..09af13931 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7744" + #define REVISION_NR "7768" #endif // __REVISION_NR_H__ diff --git a/win/VC80/script.vcproj b/win/VC80/script.vcproj index f48460ecb..dc43b0ebf 100644 --- a/win/VC80/script.vcproj +++ b/win/VC80/script.vcproj @@ -233,7 +233,7 @@ AdditionalDependencies="mangosd.lib zlib.lib zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib" OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\MaNGOSScript.dll" LinkIncremental="1" - AdditionalLibraryDirectories="".\mangosd__$(PlatformName)_$(ConfigurationName)";"..\..\dep\lib\$(PlatformName)_$(ConfigurationName)";".\zlib__$(PlatformName)_$(ConfigurationName)";".\zthread__$(PlatformName)_$(ConfigurationName)"" + AdditionalLibraryDirectories="".\mangosd__$(PlatformName)_$(ConfigurationName)";"..\..\dep\lib\$(PlatformName)_debug";".\zlib__$(PlatformName)_$(ConfigurationName)";".\zthread__$(PlatformName)_$(ConfigurationName)"" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)\MaNGOSScript.pdb" SubSystem="2" @@ -316,7 +316,7 @@ AdditionalDependencies="mangosd.lib zlib.lib zthread.lib libmySQL.lib libeay32.lib ws2_32.lib winmm.lib odbc32.lib odbccp32.lib" OutputFile="..\..\bin\$(PlatformName)_$(ConfigurationName)\MaNGOSScript.dll" LinkIncremental="1" - AdditionalLibraryDirectories="".\mangosd__$(PlatformName)_$(ConfigurationName)";"..\..\dep\lib\$(PlatformName)_$(ConfigurationName)";".\zlib__$(PlatformName)_$(ConfigurationName)";".\zthread__$(PlatformName)_$(ConfigurationName)"" + AdditionalLibraryDirectories="".\mangosd__$(PlatformName)_$(ConfigurationName)";"..\..\dep\lib\$(PlatformName)_debug";".\zlib__$(PlatformName)_$(ConfigurationName)";".\zthread__$(PlatformName)_$(ConfigurationName)"" GenerateDebugInformation="true" ProgramDatabaseFile="$(OutDir)\MaNGOSScript.pdb" SubSystem="2" diff --git a/win/VC90/mangosd.vcproj b/win/VC90/mangosd.vcproj index 2544af175..1c78276bf 100644 --- a/win/VC90/mangosd.vcproj +++ b/win/VC90/mangosd.vcproj @@ -6,6 +6,7 @@ ProjectGUID="{A3A04E47-43A2-4C08-90B3-029CEF558594}" RootNamespace="mangosd" Keyword="Win32Proj" + TargetFrameworkVersion="0" >