Merge branch 'bfa'
This commit is contained in:
@@ -407,7 +407,7 @@ uint32 Battlenet::Session::HandleGetAccountState(account::v1::GetAccountStateReq
|
||||
if (request->options().field_privacy_info())
|
||||
{
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_using_rid(false);
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_real_id_visible_for_view_friends(false);
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_visible_for_view_friends(false);
|
||||
response->mutable_state()->mutable_privacy_info()->set_is_hidden_from_friend_finder(true);
|
||||
|
||||
response->mutable_tags()->set_privacy_info_tag(0xD7CA834D);
|
||||
|
||||
@@ -21,13 +21,13 @@ Battlenet::ServiceDispatcher::ServiceDispatcher()
|
||||
{
|
||||
AddService<Services::Account>();
|
||||
AddService<Services::Authentication>();
|
||||
AddService<Service<challenge::v1::ChallengeService>>();
|
||||
AddService<Service<channel::v1::ChannelService>>();
|
||||
AddService<Service<club::v1::membership::ClubMembershipService>>();
|
||||
AddService<Services::Connection>();
|
||||
AddService<Service<friends::v1::FriendsService>>();
|
||||
AddService<Services::GameUtilities>();
|
||||
AddService<Service<presence::v1::PresenceService>>();
|
||||
AddService<Service<report::v1::ReportService>>();
|
||||
AddService<Service<report::v2::ReportService>>();
|
||||
AddService<Service<resources::v1::ResourcesService>>();
|
||||
AddService<Service<user_manager::v1::UserManagerService>>();
|
||||
}
|
||||
|
||||
@@ -24,12 +24,15 @@
|
||||
#include "AccountService.h"
|
||||
#include "AuthenticationService.h"
|
||||
#include "challenge_service.pb.h"
|
||||
#include "channel_service.pb.h"
|
||||
#include "club_membership_listener.pb.h"
|
||||
#include "club_membership_service.pb.h"
|
||||
#include "ConnectionService.h"
|
||||
#include "friends_service.pb.h"
|
||||
#include "GameUtilitiesService.h"
|
||||
#include "presence_listener.pb.h"
|
||||
#include "presence_service.pb.h"
|
||||
#include "report_service.pb.h"
|
||||
#include "api/client/v2/report_service.pb.h"
|
||||
#include "resource_service.pb.h"
|
||||
#include "user_manager_service.pb.h"
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
"resettalents_time, primarySpecialization, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeonDifficulty, "
|
||||
"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
|
||||
"health, power1, power2, power3, power4, power5, power6, instance_id, activeTalentGroup, lootSpecId, exploredZones, knownTitles, actionBars, grantableLevels, raidDifficulty, legacyRaidDifficulty, fishingSteps, "
|
||||
"honor, honorLevel, prestigeLevel, honorRestState, honorRestBonus "
|
||||
"honor, honorLevel, honorRestState, honorRestBonus "
|
||||
"FROM characters c LEFT JOIN character_fishingsteps cfs ON c.guid = cfs.guid WHERE c.guid = ?", CONNECTION_ASYNC);
|
||||
|
||||
PrepareStatement(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH);
|
||||
@@ -139,7 +139,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_GLYPHS, "SELECT talentGroup, glyphId FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_TALENTS, "SELECT talentId, talentGroup FROM character_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_PVP_TALENTS, "SELECT talentId, talentGroup FROM character_pvp_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_PVP_TALENTS, "SELECT talentId0, talentId1, talentId2, talentId3, talentGroup FROM character_pvp_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC);
|
||||
@@ -437,7 +437,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
"logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,primarySpecialization=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?,"
|
||||
"totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,"
|
||||
"watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,power6=?,latency=?,activeTalentGroup=?,lootSpecId=?,exploredZones=?,"
|
||||
"equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=?,honor=?,honorLevel=?,prestigeLevel=?,honorRestState=?,honorRestBonus=?,lastLoginBuild=? WHERE guid=?", CONNECTION_ASYNC);
|
||||
"equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=?,honor=?,honorLevel=?,honorRestState=?,honorRestBonus=?,lastLoginBuild=? WHERE guid=?", CONNECTION_ASYNC);
|
||||
|
||||
PrepareStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG, "UPDATE characters SET at_login = at_login | ? WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_UPD_REM_AT_LOGIN_FLAG, "UPDATE characters set at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC);
|
||||
@@ -625,7 +625,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, talentId, talentGroup) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_PVP_TALENT, "INSERT INTO character_pvp_talent (guid, talentId, talentGroup) VALUES (?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_PVP_TALENT, "INSERT INTO character_pvp_talent (guid, talentId0, talentId1, talentId2, talentId3, talentGroup) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_UPD_CHAR_LIST_SLOT, "UPDATE characters SET slot = ? WHERE guid = ? AND account = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_CHAR_FISHINGSTEPS, "INSERT INTO character_fishingsteps (guid, fishingSteps) VALUES (?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_DEL_CHAR_FISHINGSTEPS, "DELETE FROM character_fishingsteps WHERE guid = ?", CONNECTION_ASYNC);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
HOTFIX_SEL_ACHIEVEMENT,
|
||||
HOTFIX_SEL_ACHIEVEMENT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_ANIMATION_DATA,
|
||||
|
||||
HOTFIX_SEL_ANIM_KIT,
|
||||
|
||||
HOTFIX_SEL_AREA_GROUP_MEMBER,
|
||||
@@ -126,6 +128,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_CINEMATIC_SEQUENCES,
|
||||
|
||||
HOTFIX_SEL_CONTENT_TUNING,
|
||||
|
||||
HOTFIX_SEL_CONVERSATION_LINE,
|
||||
|
||||
HOTFIX_SEL_CREATURE_DISPLAY_INFO,
|
||||
@@ -170,6 +174,10 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_EMOTES_TEXT_SOUND,
|
||||
|
||||
HOTFIX_SEL_EXPECTED_STAT,
|
||||
|
||||
HOTFIX_SEL_EXPECTED_STAT_MOD,
|
||||
|
||||
HOTFIX_SEL_FACTION,
|
||||
HOTFIX_SEL_FACTION_LOCALE,
|
||||
|
||||
@@ -197,7 +205,6 @@ enum HotfixDatabaseStatements : uint32
|
||||
HOTFIX_SEL_GARR_FOLLOWER_X_ABILITY,
|
||||
|
||||
HOTFIX_SEL_GARR_PLOT,
|
||||
HOTFIX_SEL_GARR_PLOT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_GARR_PLOT_BUILDING,
|
||||
|
||||
@@ -359,6 +366,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_NAMES_RESERVED_LOCALE,
|
||||
|
||||
HOTFIX_SEL_NUM_TALENTS_AT_LEVEL,
|
||||
|
||||
HOTFIX_SEL_OVERRIDE_SPELL_DATA,
|
||||
|
||||
HOTFIX_SEL_PHASE,
|
||||
@@ -379,12 +388,12 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_PVP_ITEM,
|
||||
|
||||
HOTFIX_SEL_PVP_REWARD,
|
||||
|
||||
HOTFIX_SEL_PVP_TALENT,
|
||||
HOTFIX_SEL_PVP_TALENT_LOCALE,
|
||||
|
||||
HOTFIX_SEL_PVP_TALENT_UNLOCK,
|
||||
HOTFIX_SEL_PVP_TALENT_CATEGORY,
|
||||
|
||||
HOTFIX_SEL_PVP_TALENT_SLOT_UNLOCK,
|
||||
|
||||
HOTFIX_SEL_QUEST_FACTION_REWARD,
|
||||
|
||||
@@ -409,8 +418,6 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_RULESET_ITEM_UPGRADE,
|
||||
|
||||
HOTFIX_SEL_SANDBOX_SCALING,
|
||||
|
||||
HOTFIX_SEL_SCALING_STAT_DISTRIBUTION,
|
||||
|
||||
HOTFIX_SEL_SCENARIO,
|
||||
@@ -439,9 +446,6 @@ enum HotfixDatabaseStatements : uint32
|
||||
HOTFIX_SEL_SPECIALIZATION_SPELLS,
|
||||
HOTFIX_SEL_SPECIALIZATION_SPELLS_LOCALE,
|
||||
|
||||
HOTFIX_SEL_SPELL,
|
||||
HOTFIX_SEL_SPELL_LOCALE,
|
||||
|
||||
HOTFIX_SEL_SPELL_AURA_OPTIONS,
|
||||
|
||||
HOTFIX_SEL_SPELL_AURA_RESTRICTIONS,
|
||||
@@ -481,6 +485,9 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_SPELL_MISC,
|
||||
|
||||
HOTFIX_SEL_SPELL_NAME,
|
||||
HOTFIX_SEL_SPELL_NAME_LOCALE,
|
||||
|
||||
HOTFIX_SEL_SPELL_POWER,
|
||||
|
||||
HOTFIX_SEL_SPELL_POWER_DIFFICULTY,
|
||||
@@ -543,6 +550,15 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_TRANSPORT_ROTATION,
|
||||
|
||||
HOTFIX_SEL_UI_MAP,
|
||||
HOTFIX_SEL_UI_MAP_LOCALE,
|
||||
|
||||
HOTFIX_SEL_UI_MAP_ASSIGNMENT,
|
||||
|
||||
HOTFIX_SEL_UI_MAP_LINK,
|
||||
|
||||
HOTFIX_SEL_UI_MAP_X_MAP_ART,
|
||||
|
||||
HOTFIX_SEL_UNIT_POWER_BAR,
|
||||
HOTFIX_SEL_UNIT_POWER_BAR_LOCALE,
|
||||
|
||||
@@ -555,12 +571,8 @@ enum HotfixDatabaseStatements : uint32
|
||||
|
||||
HOTFIX_SEL_WORLD_EFFECT,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_AREA,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_OVERLAY,
|
||||
|
||||
HOTFIX_SEL_WORLD_MAP_TRANSFORMS,
|
||||
|
||||
HOTFIX_SEL_WORLD_SAFE_LOCS,
|
||||
HOTFIX_SEL_WORLD_SAFE_LOCS_LOCALE,
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, permission, help FROM command", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, femaleName, subname, TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, faction, npcflag, speed_walk, speed_run, scale, rank, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, unit_flags3, dynamicflags, family, trainer_class, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, name, femaleName, subname, TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, faction, npcflag, speed_walk, speed_run, scale, rank, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, unit_flags3, dynamicflags, family, trainer_class, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH);
|
||||
PrepareStatement(WORLD_SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH);
|
||||
|
||||
@@ -412,10 +412,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
|
||||
{
|
||||
uint32 displayId = ObjectMgr::ChooseDisplayId(ci);
|
||||
(*itr)->ToCreature()->SetDisplayId(displayId);
|
||||
CreatureModel const* model = ObjectMgr::ChooseDisplayId(ci);
|
||||
(*itr)->ToCreature()->SetDisplayId(model->CreatureDisplayID, model->DisplayScale);
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, %s set displayid to %u",
|
||||
(*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), displayId);
|
||||
(*itr)->GetEntry(), (*itr)->GetGUID().ToString().c_str(), model->CreatureDisplayID);
|
||||
}
|
||||
}
|
||||
//if no param1, then use value from param2 (modelId)
|
||||
@@ -1291,7 +1291,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (e.action.morphOrMount.creature > 0)
|
||||
{
|
||||
if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
|
||||
(*itr)->ToUnit()->Mount(ObjectMgr::ChooseDisplayId(cInfo));
|
||||
(*itr)->ToUnit()->Mount(ObjectMgr::ChooseDisplayId(cInfo)->CreatureDisplayID);
|
||||
}
|
||||
else
|
||||
(*itr)->ToUnit()->Mount(e.action.morphOrMount.model);
|
||||
|
||||
@@ -597,7 +597,7 @@ void PlayerAchievementMgr::SendAchievementEarned(AchievementEntry const* achieve
|
||||
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
|
||||
{
|
||||
// broadcast realm first reached
|
||||
WorldPackets::Achievement::ServerFirstAchievement serverFirstAchievement;
|
||||
WorldPackets::Achievement::BroadcastAchievement serverFirstAchievement;
|
||||
serverFirstAchievement.Name = _owner->GetName();
|
||||
serverFirstAchievement.PlayerGUID = _owner->GetGUID();
|
||||
serverFirstAchievement.AchievementID = achievement->ID;
|
||||
@@ -945,7 +945,7 @@ void GuildAchievementMgr::SendAchievementEarned(AchievementEntry const* achievem
|
||||
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
|
||||
{
|
||||
// broadcast realm first reached
|
||||
WorldPackets::Achievement::ServerFirstAchievement serverFirstAchievement;
|
||||
WorldPackets::Achievement::BroadcastAchievement serverFirstAchievement;
|
||||
serverFirstAchievement.Name = _owner->GetName();
|
||||
serverFirstAchievement.PlayerGUID = _owner->GetGUID();
|
||||
serverFirstAchievement.AchievementID = achievement->ID;
|
||||
|
||||
@@ -107,7 +107,7 @@ bool CriteriaData::IsValid(Criteria const* criteria)
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Class);
|
||||
return false;
|
||||
}
|
||||
if (ClassRace.Race && ((1 << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
if (ClassRace.Race && ((UI64LIT(1) << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `criteria_data` (Entry: %u Type: %u) for data type CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) contains a non-existing race in value2 (%u), ignored.",
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Race);
|
||||
@@ -252,7 +252,7 @@ bool CriteriaData::IsValid(Criteria const* criteria)
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Class);
|
||||
return false;
|
||||
}
|
||||
if (ClassRace.Race && ((1 << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
if (ClassRace.Race && ((UI64LIT(1) << (ClassRace.Race-1)) & RACEMASK_ALL_PLAYABLE) == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `criteria_data` (Entry: %u Type: %u) for data type CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) contains a non-existing race entry in value2 (%u), ignored.",
|
||||
criteria->ID, criteria->Entry->Type, DataType, ClassRace.Race);
|
||||
@@ -504,6 +504,8 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
case CRITERIA_TYPE_OWN_BATTLE_PET_COUNT:
|
||||
case CRITERIA_TYPE_HONOR_LEVEL_REACHED:
|
||||
case CRITERIA_TYPE_PRESTIGE_REACHED:
|
||||
case CRITERIA_TYPE_APPEARANCE_UNLOCKED_BY_SLOT:
|
||||
case CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED:
|
||||
SetCriteriaProgress(criteria, 1, referencePlayer, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
// std case: increment at miscValue1
|
||||
@@ -593,7 +595,7 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr)
|
||||
{
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(*itr);
|
||||
if (quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == criteria->Entry->Asset.ZoneID)
|
||||
if (quest && quest->GetZoneOrSort() >= 0 && quest->GetZoneOrSort() == criteria->Entry->Asset.ZoneID)
|
||||
++counter;
|
||||
}
|
||||
SetCriteriaProgress(criteria, counter, referencePlayer);
|
||||
@@ -655,7 +657,7 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetReputationMgr().GetVisibleFactionCount(), referencePlayer);
|
||||
break;
|
||||
case CRITERIA_TYPE_EARN_HONORABLE_KILL:
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS), referencePlayer);
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetUInt32Value(ACTIVE_PLAYER_FIELD_LIFETIME_HONORABLE_KILLS), referencePlayer);
|
||||
break;
|
||||
case CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED:
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetMoney(), referencePlayer, PROGRESS_HIGHEST);
|
||||
@@ -700,16 +702,6 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
case CRITERIA_TYPE_REACH_GUILD_LEVEL:
|
||||
SetCriteriaProgress(criteria, miscValue1, referencePlayer);
|
||||
break;
|
||||
case CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED:
|
||||
if (miscValue1 != criteria->Entry->Asset.TransmogSetGroupID)
|
||||
continue;
|
||||
SetCriteriaProgress(criteria, 1, referencePlayer, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
case CRITERIA_TYPE_APPEARANCE_UNLOCKED_BY_SLOT:
|
||||
if (!miscValue2 /*login case*/ || miscValue1 != criteria->Entry->Asset.EquipmentSlot)
|
||||
continue;
|
||||
SetCriteriaProgress(criteria, 1, referencePlayer, PROGRESS_ACCUMULATE);
|
||||
break;
|
||||
// FIXME: not triggered in code as result, need to implement
|
||||
case CRITERIA_TYPE_COMPLETE_RAID:
|
||||
case CRITERIA_TYPE_PLAY_ARENA:
|
||||
@@ -789,6 +781,9 @@ void CriteriaHandler::UpdateCriteria(CriteriaTypes type, uint64 miscValue1 /*= 0
|
||||
case CRITERIA_TYPE_GAIN_PARAGON_REPUTATION:
|
||||
case CRITERIA_TYPE_EARN_HONOR_XP:
|
||||
case CRITERIA_TYPE_RELIC_TALENT_UNLOCKED:
|
||||
case CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED:
|
||||
break; // Not implemented yet :(
|
||||
}
|
||||
|
||||
@@ -1151,6 +1146,9 @@ bool CriteriaHandler::IsCompletedCriteria(Criteria const* criteria, uint64 requi
|
||||
case CRITERIA_TYPE_GAIN_PARAGON_REPUTATION:
|
||||
case CRITERIA_TYPE_EARN_HONOR_XP:
|
||||
case CRITERIA_TYPE_RELIC_TALENT_UNLOCKED:
|
||||
case CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED:
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED:
|
||||
return progress->Counter >= requiredAmount;
|
||||
case CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
|
||||
case CRITERIA_TYPE_COMPLETE_QUEST:
|
||||
@@ -1335,22 +1333,22 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
case CRITERIA_TYPE_WIN_BG:
|
||||
case CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
|
||||
case CRITERIA_TYPE_DEATH_AT_MAP:
|
||||
if (!miscValue1 || criteria->Entry->Asset.MapID != referencePlayer->GetMapId())
|
||||
if (!miscValue1 || uint32(criteria->Entry->Asset.MapID) != referencePlayer->GetMapId())
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_KILL_CREATURE:
|
||||
case CRITERIA_TYPE_KILLED_BY_CREATURE:
|
||||
if (!miscValue1 || criteria->Entry->Asset.CreatureID != miscValue1)
|
||||
if (!miscValue1 || uint32(criteria->Entry->Asset.CreatureID) != miscValue1)
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_REACH_SKILL_LEVEL:
|
||||
case CRITERIA_TYPE_LEARN_SKILL_LEVEL:
|
||||
// update at loading or specific skill update
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.SkillID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.SkillID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.ZoneID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.ZoneID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_DEATH:
|
||||
@@ -1369,7 +1367,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
return false;
|
||||
|
||||
//FIXME: work only for instances where max == min for players
|
||||
if (map->ToInstanceMap()->GetMaxPlayers() != criteria->Entry->Asset.GroupSize)
|
||||
if (map->ToInstanceMap()->GetMaxPlayers() != uint32(criteria->Entry->Asset.GroupSize))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
@@ -1378,7 +1376,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_DEATHS_FROM:
|
||||
if (!miscValue1 || miscValue2 != criteria->Entry->Asset.DamageType)
|
||||
if (!miscValue1 || miscValue2 != uint32(criteria->Entry->Asset.DamageType))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_COMPLETE_QUEST:
|
||||
@@ -1386,7 +1384,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
// if miscValues != 0, it contains the questID.
|
||||
if (miscValue1)
|
||||
{
|
||||
if (miscValue1 != criteria->Entry->Asset.QuestID)
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.QuestID))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1405,11 +1403,11 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
case CRITERIA_TYPE_BE_SPELL_TARGET2:
|
||||
case CRITERIA_TYPE_CAST_SPELL:
|
||||
case CRITERIA_TYPE_CAST_SPELL2:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.SpellID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.SpellID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_LEARN_SPELL:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.SpellID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.SpellID))
|
||||
return false;
|
||||
|
||||
if (!referencePlayer->HasSpell(criteria->Entry->Asset.SpellID))
|
||||
@@ -1418,17 +1416,17 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
case CRITERIA_TYPE_LOOT_TYPE:
|
||||
// miscValue1 = itemId - miscValue2 = count of item loot
|
||||
// miscValue3 = loot_type (note: 0 = LOOT_CORPSE and then it ignored)
|
||||
if (!miscValue1 || !miscValue2 || !miscValue3 || miscValue3 != criteria->Entry->Asset.LootType)
|
||||
if (!miscValue1 || !miscValue2 || !miscValue3 || miscValue3 != uint32(criteria->Entry->Asset.LootType))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_OWN_ITEM:
|
||||
if (miscValue1 && criteria->Entry->Asset.ItemID != miscValue1)
|
||||
if (miscValue1 && uint32(criteria->Entry->Asset.ItemID) != miscValue1)
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_USE_ITEM:
|
||||
case CRITERIA_TYPE_LOOT_ITEM:
|
||||
case CRITERIA_TYPE_EQUIP_ITEM:
|
||||
if (!miscValue1 || criteria->Entry->Asset.ItemID != miscValue1)
|
||||
if (!miscValue1 || uint32(criteria->Entry->Asset.ItemID )!= miscValue1)
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_EXPLORE_AREA:
|
||||
@@ -1452,7 +1450,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
continue;
|
||||
|
||||
uint32 mask = 1 << (uint32(area->AreaBit) % 32);
|
||||
if (referencePlayer->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask)
|
||||
if (referencePlayer->GetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + playerIndexOffset) & mask)
|
||||
{
|
||||
matchFound = true;
|
||||
break;
|
||||
@@ -1464,19 +1462,19 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
}
|
||||
case CRITERIA_TYPE_GAIN_REPUTATION:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.FactionID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.FactionID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_EQUIP_EPIC_ITEM:
|
||||
// miscValue1 = itemid miscValue2 = itemSlot
|
||||
if (!miscValue1 || miscValue2 != criteria->Entry->Asset.ItemSlot)
|
||||
if (!miscValue1 || miscValue2 != uint32(criteria->Entry->Asset.ItemSlot))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_ROLL_NEED_ON_LOOT:
|
||||
case CRITERIA_TYPE_ROLL_GREED_ON_LOOT:
|
||||
{
|
||||
// miscValue1 = itemid miscValue2 = diced value
|
||||
if (!miscValue1 || miscValue2 != criteria->Entry->Asset.RollValue)
|
||||
if (!miscValue1 || miscValue2 != uint32(criteria->Entry->Asset.RollValue))
|
||||
return false;
|
||||
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(uint32(miscValue1));
|
||||
@@ -1485,7 +1483,7 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
}
|
||||
case CRITERIA_TYPE_DO_EMOTE:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.EmoteID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.EmoteID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_DAMAGE_DONE:
|
||||
@@ -1505,12 +1503,12 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
case CRITERIA_TYPE_USE_GAMEOBJECT:
|
||||
case CRITERIA_TYPE_FISH_IN_GAMEOBJECT:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.GameObjectID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.GameObjectID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS:
|
||||
case CRITERIA_TYPE_LEARN_SKILL_LINE:
|
||||
if (miscValue1 && miscValue1 != criteria->Entry->Asset.SkillID)
|
||||
if (miscValue1 && miscValue1 != uint32(criteria->Entry->Asset.SkillID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_LOOT_EPIC_ITEM:
|
||||
@@ -1524,34 +1522,42 @@ bool CriteriaHandler::RequirementsSatisfied(Criteria const* criteria, uint64 mis
|
||||
break;
|
||||
}
|
||||
case CRITERIA_TYPE_HK_CLASS:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.ClassID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.ClassID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_HK_RACE:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.RaceID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.RaceID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.ObjectiveId)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.ObjectiveId))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_HONORABLE_KILL_AT_AREA:
|
||||
if (!miscValue1 || miscValue1 != criteria->Entry->Asset.AreaID)
|
||||
if (!miscValue1 || miscValue1 != uint32(criteria->Entry->Asset.AreaID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_CURRENCY:
|
||||
if (!miscValue1 || !miscValue2 || int64(miscValue2) < 0
|
||||
|| miscValue1 != criteria->Entry->Asset.CurrencyID)
|
||||
|| miscValue1 != uint32(criteria->Entry->Asset.CurrencyID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_WIN_ARENA:
|
||||
if (miscValue1 != criteria->Entry->Asset.MapID)
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.MapID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_HIGHEST_TEAM_RATING:
|
||||
return false;
|
||||
case CRITERIA_TYPE_PLACE_GARRISON_BUILDING:
|
||||
if (miscValue1 != criteria->Entry->Asset.GarrBuildingID)
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.GarrBuildingID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED:
|
||||
if (miscValue1 != uint32(criteria->Entry->Asset.TransmogSetGroupID))
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_TYPE_APPEARANCE_UNLOCKED_BY_SLOT:
|
||||
if (!miscValue2 /*login case*/ || miscValue1 != uint32(criteria->Entry->Asset.EquipmentSlot))
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
@@ -1781,9 +1787,7 @@ bool CriteriaHandler::AdditionalRequirementsSatisfied(ModifierTreeNode const* tr
|
||||
return false;
|
||||
break;
|
||||
case CRITERIA_ADDITIONAL_CONDITION_PRESTIGE_LEVEL: // 194
|
||||
if (!referencePlayer || referencePlayer->GetPrestigeLevel() != reqValue)
|
||||
return false;
|
||||
break;
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2157,6 +2161,12 @@ char const* CriteriaMgr::GetCriteriaTypeString(CriteriaTypes type)
|
||||
return "EARN_HONOR_XP";
|
||||
case CRITERIA_TYPE_RELIC_TALENT_UNLOCKED:
|
||||
return "RELIC_TALENT_UNLOCKED";
|
||||
case CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL:
|
||||
return "REACH_ACCOUNT_HONOR_LEVEL";
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED:
|
||||
return "HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED";
|
||||
case CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED:
|
||||
return "HEART_OF_AZEROTH_LEVEL_REACHED";
|
||||
}
|
||||
return "MISSING_TYPE";
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ void BattlePetMgr::SummonPet(ObjectGuid guid)
|
||||
return;
|
||||
|
||||
// TODO: set proper CreatureID for spell DEFAULT_SUMMON_BATTLE_PET_SPELL (default EffectMiscValueA is 40721 - Murkimus the Gladiator)
|
||||
_owner->GetPlayer()->SetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, guid);
|
||||
_owner->GetPlayer()->SetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, guid);
|
||||
_owner->GetPlayer()->CastSpell(_owner->GetPlayer(), speciesEntry->SummonSpellID ? speciesEntry->SummonSpellID : uint32(DEFAULT_SUMMON_BATTLE_PET_SPELL));
|
||||
|
||||
// TODO: set pet level, quality... update fields
|
||||
@@ -454,10 +454,10 @@ void BattlePetMgr::DismissPet()
|
||||
{
|
||||
Player* ownerPlayer = _owner->GetPlayer();
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*ownerPlayer, ownerPlayer->GetCritterGUID());
|
||||
if (pet && ownerPlayer->GetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID) == pet->GetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID))
|
||||
if (pet && ownerPlayer->GetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID) == pet->GetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID))
|
||||
{
|
||||
pet->DespawnOrUnsummon();
|
||||
ownerPlayer->SetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, ObjectGuid::Empty);
|
||||
ownerPlayer->SetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID, ObjectGuid::Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1289,9 +1289,10 @@ void Battleground::BuildPvPLogDataPacket(WorldPackets::Battleground::PVPLogData&
|
||||
{
|
||||
playerData.IsInWorld = true;
|
||||
playerData.PrimaryTalentTree = player->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID);
|
||||
playerData.PrimaryTalentTreeNameIndex = 0;
|
||||
playerData.Sex = player->getGender();
|
||||
playerData.Race = player->getRace();
|
||||
playerData.Prestige = player->GetPrestigeLevel();
|
||||
playerData.Class = player->getClass();
|
||||
playerData.HonorLevel = player->GetHonorLevel();
|
||||
}
|
||||
|
||||
pvpLogData.Players.push_back(playerData);
|
||||
|
||||
@@ -463,6 +463,7 @@ void CalendarMgr::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEven
|
||||
packet.ClearPending = true; // FIXME
|
||||
packet.Date = calendarEvent.GetDate();
|
||||
packet.Description = calendarEvent.GetDescription();
|
||||
packet.EventClubID = calendarEvent.GetGuildId();
|
||||
packet.EventID = calendarEvent.GetEventId();
|
||||
packet.EventName = calendarEvent.GetTitle();
|
||||
packet.EventType = calendarEvent.GetType();
|
||||
@@ -534,18 +535,15 @@ void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEven
|
||||
packet.OwnerGuid = calendarEvent.GetOwnerGUID();
|
||||
packet.Status = invite.GetStatus();
|
||||
packet.TextureID = calendarEvent.GetTextureId();
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId());
|
||||
packet.EventGuildID = guild ? guild->GetGUID() : ObjectGuid::Empty;
|
||||
packet.EventClubID = calendarEvent.GetGuildId();
|
||||
|
||||
if (calendarEvent.IsGuildEvent() || calendarEvent.IsGuildAnnouncement())
|
||||
{
|
||||
if (guild)
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId()))
|
||||
guild->BroadcastPacket(packet.Write());
|
||||
}
|
||||
else
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(invite.GetInviteeGUID()))
|
||||
player->SendDirectMessage(packet.Write());
|
||||
else if (Player* player = ObjectAccessor::FindConnectedPlayer(invite.GetInviteeGUID()))
|
||||
player->SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calendarEvent, CalendarSendEventType sendType)
|
||||
@@ -567,9 +565,7 @@ void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calend
|
||||
packet.LockDate = calendarEvent.GetLockDate(); // Always 0 ?
|
||||
packet.OwnerGuid = calendarEvent.GetOwnerGUID();
|
||||
packet.TextureID = calendarEvent.GetTextureId();
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId());
|
||||
packet.EventGuildID = (guild ? guild->GetGUID() : ObjectGuid::Empty);
|
||||
packet.EventClubID = calendarEvent.GetGuildId();
|
||||
|
||||
for (auto const& calendarInvite : eventInviteeList)
|
||||
{
|
||||
|
||||
@@ -455,7 +455,7 @@ bool ChatHandler::isValidChatMessage(char const* message)
|
||||
/*
|
||||
Valid examples:
|
||||
|cffa335ee|Hitem:812:0:0:0:0:0:0:0:70|h[Glowing Brightwood Staff]|h|r
|
||||
|cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
|
||||
|cffffff00|Hquest:51101:-1:110:120:5|h[The Wounded King]|h|r
|
||||
|cffffd000|Htrade:4037:1:150:1:6AAAAAAAAAAAAAAAAAAAAAAOAADAAAAAAAAAAAAAAAAIAAAAAAAAA|h[Engineering]|h|r
|
||||
|cff4e96f7|Htalent:2232:-1|h[Taste for Blood]|h|r
|
||||
|cff71d5ff|Hspell:21563|h[Command]|h|r
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
// - client, item icon shift click
|
||||
// |color|Hitemset:itemset_id|h[name]|h|r
|
||||
// |color|Hplayer:name|h[name]|h|r - client, in some messages, at click copy only name instead link
|
||||
// |color|Hquest:quest_id:quest_level|h[name]|h|r - client, quest list name shift-click
|
||||
// |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
|
||||
// - client, quest list name shift-click
|
||||
// |color|Hskill:skill_id|h[name]|h|r
|
||||
// |color|Hspell:spell_id|h[name]|h|r - client, spellbook spell icon shift-click
|
||||
// |color|Htalent:talent_id, rank|h[name]|h|r - client, talent icon shift-click
|
||||
@@ -395,8 +396,8 @@ bool ItemChatLink::ValidateName(char* buffer, char const* context)
|
||||
return false;
|
||||
}
|
||||
|
||||
// |color|Hquest:quest_id:quest_level|h[name]|h|r
|
||||
// |cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
|
||||
// |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
|
||||
// |cffffff00|Hquest:51101:-1:110:120:5|h[The Wounded King]|h|r
|
||||
bool QuestChatLink::Initialize(std::istringstream& iss)
|
||||
{
|
||||
// Read quest id
|
||||
@@ -428,6 +429,21 @@ bool QuestChatLink::Initialize(std::istringstream& iss)
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): quest level %d is too big", iss.str().c_str(), _questLevel);
|
||||
return false;
|
||||
}
|
||||
if (!ReadInt32(iss, _minLevel))
|
||||
{
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest min level", iss.str().c_str());
|
||||
return false;
|
||||
}
|
||||
if (!ReadInt32(iss, _maxLevel))
|
||||
{
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest max level", iss.str().c_str());
|
||||
return false;
|
||||
}
|
||||
if (!ReadInt32(iss, _scalingFaction))
|
||||
{
|
||||
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest scaling faction", iss.str().c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,13 +90,16 @@ protected:
|
||||
class TC_GAME_API QuestChatLink : public ChatLink
|
||||
{
|
||||
public:
|
||||
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0) { }
|
||||
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0), _minLevel(0), _maxLevel(0), _scalingFaction(0) { }
|
||||
virtual bool Initialize(std::istringstream& iss) override;
|
||||
virtual bool ValidateName(char* buffer, const char* context) override;
|
||||
|
||||
protected:
|
||||
Quest const* _quest;
|
||||
int32 _questLevel;
|
||||
int32 _minLevel;
|
||||
int32 _maxLevel;
|
||||
int32 _scalingFaction;
|
||||
};
|
||||
|
||||
// SpellChatLink - link to quest
|
||||
|
||||
@@ -2002,7 +2002,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
|
||||
}
|
||||
case CONDITION_CLASS:
|
||||
{
|
||||
if (!(cond->ConditionValue1 & CLASSMASK_ALL_PLAYABLE))
|
||||
if (cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing classmask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE);
|
||||
return false;
|
||||
@@ -2011,9 +2011,9 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
|
||||
}
|
||||
case CONDITION_RACE:
|
||||
{
|
||||
if (!(cond->ConditionValue1 & RACEMASK_ALL_PLAYABLE))
|
||||
if (cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing racemask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing racemask (" UI64FMTD "), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -2590,10 +2590,10 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio
|
||||
}
|
||||
}
|
||||
|
||||
if (condition->PvpMedal && !((1 << (condition->PvpMedal - 1)) & player->GetUInt32Value(PLAYER_FIELD_PVP_MEDALS)))
|
||||
if (condition->PvpMedal && !((1 << (condition->PvpMedal - 1)) & player->GetUInt32Value(ACTIVE_PLAYER_FIELD_PVP_MEDALS)))
|
||||
return false;
|
||||
|
||||
if (condition->LifetimeMaxPVPRank && player->GetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_LIFETIME_MAX_PVP_RANK) != condition->LifetimeMaxPVPRank)
|
||||
if (condition->LifetimeMaxPVPRank && player->GetByteValue(ACTIVE_PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_LIFETIME_MAX_PVP_RANK) != condition->LifetimeMaxPVPRank)
|
||||
return false;
|
||||
|
||||
if (condition->MovementFlags[0] && !(player->GetUnitMovementFlags() & condition->MovementFlags[0]))
|
||||
@@ -2647,7 +2647,7 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio
|
||||
results.fill(true);
|
||||
for (std::size_t i = 0; i < PrevQuestCount::value; ++i)
|
||||
if (uint32 questBit = sDB2Manager.GetQuestUniqueBitFlag(condition->PrevQuestID[i]))
|
||||
results[i] = (player->GetUInt32Value(PLAYER_FIELD_QUEST_COMPLETED + ((questBit - 1) >> 5)) & (1 << ((questBit - 1) & 31))) != 0;
|
||||
results[i] = (player->GetUInt32Value(ACTIVE_PLAYER_FIELD_QUEST_COMPLETED + ((questBit - 1) >> 5)) & (1 << ((questBit - 1) & 31))) != 0;
|
||||
|
||||
if (!PlayerConditionLogic(condition->PrevQuestLogic, results))
|
||||
return false;
|
||||
@@ -2731,7 +2731,7 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio
|
||||
for (std::size_t i = 0; i < ExploredCount::value; ++i)
|
||||
{
|
||||
if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(condition->Explored[i]))
|
||||
if (area->AreaBit != -1 && !(player->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + area->AreaBit / 32) & (1 << (uint32(area->AreaBit) % 32))))
|
||||
if (area->AreaBit != -1 && !(player->GetUInt32Value(ACTIVE_PLAYER_FIELD_EXPLORED_ZONES + area->AreaBit / 32) & (1 << (uint32(area->AreaBit) % 32))))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+7286
-1896
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,7 @@
|
||||
class DB2HotfixGeneratorBase;
|
||||
|
||||
TC_GAME_API extern DB2Storage<AchievementEntry> sAchievementStore;
|
||||
TC_GAME_API extern DB2Storage<AnimationDataEntry> sAnimationDataStore;
|
||||
TC_GAME_API extern DB2Storage<AnimKitEntry> sAnimKitStore;
|
||||
TC_GAME_API extern DB2Storage<AreaTableEntry> sAreaTableStore;
|
||||
TC_GAME_API extern DB2Storage<AreaTriggerEntry> sAreaTriggerStore;
|
||||
@@ -65,6 +66,7 @@ TC_GAME_API extern DB2Storage<ChrRacesEntry> sChrRacesSto
|
||||
TC_GAME_API extern DB2Storage<ChrSpecializationEntry> sChrSpecializationStore;
|
||||
TC_GAME_API extern DB2Storage<CinematicCameraEntry> sCinematicCameraStore;
|
||||
TC_GAME_API extern DB2Storage<CinematicSequencesEntry> sCinematicSequencesStore;
|
||||
TC_GAME_API extern DB2Storage<ContentTuningEntry> sContentTuningStore;
|
||||
TC_GAME_API extern DB2Storage<ConversationLineEntry> sConversationLineStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureDisplayInfoEntry> sCreatureDisplayInfoStore;
|
||||
TC_GAME_API extern DB2Storage<CreatureDisplayInfoExtraEntry> sCreatureDisplayInfoExtraStore;
|
||||
@@ -148,14 +150,14 @@ TC_GAME_API extern DB2Storage<PhaseEntry> sPhaseStore;
|
||||
TC_GAME_API extern DB2Storage<PlayerConditionEntry> sPlayerConditionStore;
|
||||
TC_GAME_API extern DB2Storage<PowerDisplayEntry> sPowerDisplayStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentEntry> sPvpTalentStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentUnlockEntry> sPvpTalentUnlockStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentCategoryEntry> sPvpTalentCategoryStore;
|
||||
TC_GAME_API extern DB2Storage<PvpTalentSlotUnlockEntry> sPvpTalentSlotUnlockStore;
|
||||
TC_GAME_API extern DB2Storage<QuestFactionRewardEntry> sQuestFactionRewardStore;
|
||||
TC_GAME_API extern DB2Storage<QuestMoneyRewardEntry> sQuestMoneyRewardStore;
|
||||
TC_GAME_API extern DB2Storage<QuestSortEntry> sQuestSortStore;
|
||||
TC_GAME_API extern DB2Storage<QuestXPEntry> sQuestXPStore;
|
||||
TC_GAME_API extern DB2Storage<RandPropPointsEntry> sRandPropPointsStore;
|
||||
TC_GAME_API extern DB2Storage<RewardPackEntry> sRewardPackStore;
|
||||
TC_GAME_API extern DB2Storage<SandboxScalingEntry> sSandboxScalingStore;
|
||||
TC_GAME_API extern DB2Storage<ScalingStatDistributionEntry> sScalingStatDistributionStore;
|
||||
TC_GAME_API extern DB2Storage<ScenarioEntry> sScenarioStore;
|
||||
TC_GAME_API extern DB2Storage<ScenarioStepEntry> sScenarioStepStore;
|
||||
@@ -164,7 +166,6 @@ TC_GAME_API extern DB2Storage<SceneScriptPackageEntry> sSceneScript
|
||||
TC_GAME_API extern DB2Storage<SkillLineAbilityEntry> sSkillLineAbilityStore;
|
||||
TC_GAME_API extern DB2Storage<SkillRaceClassInfoEntry> sSkillRaceClassInfoStore;
|
||||
TC_GAME_API extern DB2Storage<SoundKitEntry> sSoundKitStore;
|
||||
TC_GAME_API extern DB2Storage<SpellEntry> sSpellStore;
|
||||
TC_GAME_API extern DB2Storage<SpellAuraOptionsEntry> sSpellAuraOptionsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellCastTimesEntry> sSpellCastTimesStore;
|
||||
@@ -183,6 +184,7 @@ TC_GAME_API extern DB2Storage<SpellItemEnchantmentConditionEntry> sSpellItemEn
|
||||
TC_GAME_API extern DB2Storage<SpellLearnSpellEntry> sSpellLearnSpellStore;
|
||||
TC_GAME_API extern DB2Storage<SpellLevelsEntry> sSpellLevelsStore;
|
||||
TC_GAME_API extern DB2Storage<SpellMiscEntry> sSpellMiscStore;
|
||||
TC_GAME_API extern DB2Storage<SpellNameEntry> sSpellNameStore;
|
||||
TC_GAME_API extern DB2Storage<SpellPowerEntry> sSpellPowerStore;
|
||||
TC_GAME_API extern DB2Storage<SpellProcsPerMinuteEntry> sSpellProcsPerMinuteStore;
|
||||
TC_GAME_API extern DB2Storage<SpellRadiusEntry> sSpellRadiusStore;
|
||||
@@ -208,7 +210,6 @@ TC_GAME_API extern DB2Storage<UnitPowerBarEntry> sUnitPowerBa
|
||||
TC_GAME_API extern DB2Storage<VehicleEntry> sVehicleStore;
|
||||
TC_GAME_API extern DB2Storage<VehicleSeatEntry> sVehicleSeatStore;
|
||||
TC_GAME_API extern DB2Storage<WorldEffectEntry> sWorldEffectStore;
|
||||
TC_GAME_API extern DB2Storage<WorldMapAreaEntry> sWorldMapAreaStore;
|
||||
TC_GAME_API extern DB2Storage<WorldMapOverlayEntry> sWorldMapOverlayStore;
|
||||
TC_GAME_API extern DB2Storage<WorldSafeLocsEntry> sWorldSafeLocsStore;
|
||||
|
||||
@@ -257,7 +258,9 @@ public:
|
||||
DB2StorageBase const* GetStorage(uint32 type) const;
|
||||
|
||||
void LoadHotfixData();
|
||||
void LoadHotfixBlob();
|
||||
std::map<uint64, int32> const& GetHotfixData() const;
|
||||
std::vector<uint8> const* GetHotfixBlobData(uint32 tableHash, int32 recordId);
|
||||
|
||||
std::vector<uint32> GetAreasForGroup(uint32 areaGroupId) const;
|
||||
static bool IsInArea(uint32 objectAreaId, uint32 areaId);
|
||||
@@ -277,6 +280,7 @@ public:
|
||||
static char const* GetCreatureFamilyPetName(uint32 petfamily, uint32 locale);
|
||||
float GetCurveValueAt(uint32 curveId, float x) const;
|
||||
EmotesTextSoundEntry const* GetTextSoundEmoteFor(uint32 emote, uint8 race, uint8 gender, uint8 class_) const;
|
||||
float EvaluateExpectedStat(ExpectedStatType stat, uint32 level, int32 expansion, uint32 contentTuningId, Classes unitClass) const;
|
||||
std::vector<uint32> const* GetFactionTeamList(uint32 faction) const;
|
||||
HeirloomEntry const* GetHeirloomByItemId(uint32 itemId) const;
|
||||
std::vector<uint32> const* GetGlyphBindableSpells(uint32 glyphPropertiesId) const;
|
||||
@@ -300,28 +304,28 @@ public:
|
||||
MapDifficultyEntry const* GetDefaultMapDifficulty(uint32 mapId, Difficulty* difficulty = nullptr) const;
|
||||
MapDifficultyEntry const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) const;
|
||||
MapDifficultyEntry const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty) const;
|
||||
std::string GetNameGenEntry(uint8 race, uint8 gender) const;
|
||||
MountEntry const* GetMount(uint32 spellId) const;
|
||||
MountEntry const* GetMountById(uint32 id) const;
|
||||
MountTypeXCapabilitySet const* GetMountCapabilities(uint32 mountType) const;
|
||||
MountXDisplayContainer const* GetMountDisplays(uint32 mountId) const;
|
||||
std::string GetNameGenEntry(uint8 race, uint8 gender) const;
|
||||
ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale) const;
|
||||
static int32 GetNumTalentsAtLevel(uint32 level, Classes playerClass);
|
||||
std::vector<uint32> const* GetPhasesForGroup(uint32 group) const;
|
||||
PowerTypeEntry const* GetPowerTypeEntry(Powers power) const;
|
||||
PowerTypeEntry const* GetPowerTypeByName(std::string const& name) const;
|
||||
uint8 GetPvpItemLevelBonus(uint32 itemId) const;
|
||||
uint8 GetMaxPrestige() const;
|
||||
static PVPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
|
||||
static PVPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
|
||||
uint32 GetRewardPackIDForPvpRewardByHonorLevelAndPrestige(uint8 honorLevel, uint8 prestige) const;
|
||||
uint32 GetRequiredHonorLevelForPvpTalent(PvpTalentEntry const* talentInfo) const;
|
||||
std::vector<PvpTalentEntry const*> const& GetPvpTalentsByPosition(uint32 class_, uint32 tier, uint32 column) const;
|
||||
uint32 GetRequiredLevelForPvpTalentSlot(uint8 slot, Classes class_) const;
|
||||
int32 GetPvpTalentNumSlotsAtLevel(uint32 level, Classes class_) const;
|
||||
std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItems(uint32 questPackageID) const;
|
||||
std::vector<QuestPackageItemEntry const*> const* GetQuestPackageItemsFallback(uint32 questPackageID) const;
|
||||
uint32 GetQuestUniqueBitFlag(uint32 questId);
|
||||
std::vector<RewardPackXCurrencyTypeEntry const*> const* GetRewardPackCurrencyTypesByRewardID(uint32 rewardPackID) const;
|
||||
std::vector<RewardPackXItemEntry const*> const* GetRewardPackItemsByRewardID(uint32 rewardPackID) const;
|
||||
uint32 GetRulesetItemUpgrade(uint32 itemId) const;
|
||||
std::vector<SkillLineAbilityEntry const*> const* GetSkillLineAbilitiesBySkill(uint32 skillId) const;
|
||||
SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_);
|
||||
std::vector<SpecializationSpellsEntry const*> const* GetSpecializationSpells(uint32 specId) const;
|
||||
static bool IsValidSpellFamiliyName(SpellFamilyNames family);
|
||||
@@ -332,11 +336,12 @@ public:
|
||||
bool IsToyItem(uint32 toy) const;
|
||||
std::vector<TransmogSetEntry const*> const* GetTransmogSetsForItemModifiedAppearance(uint32 itemModifiedAppearanceId) const;
|
||||
std::vector<TransmogSetItemEntry const*> const* GetTransmogSetItems(uint32 transmogSetId) const;
|
||||
WMOAreaTableEntry const* GetWMOAreaTable(int32 rootId, int32 adtId, int32 groupId) const;
|
||||
uint32 GetVirtualMapForMapAndZone(uint32 mapId, uint32 zoneId) const;
|
||||
static bool GetUiMapPosition(float x, float y, float z, int32 mapId, int32 areaId, int32 wmoDoodadPlacementId, int32 wmoGroupId, UiMapSystem system, bool local,
|
||||
int32* uiMapId = nullptr, DBCPosition2D* newPos = nullptr);
|
||||
void Zone2MapCoordinates(uint32 areaId, float& x, float& y) const;
|
||||
void Map2ZoneCoordinates(uint32 areaId, float& x, float& y) const;
|
||||
static void DeterminaAlternateMapPosition(uint32 mapId, float x, float y, float z, uint32* newMapId = nullptr, DBCPosition2D* newPos = nullptr);
|
||||
bool IsUiMapPhase(uint32 phaseId) const;
|
||||
WMOAreaTableEntry const* GetWMOAreaTable(int32 rootId, int32 adtId, int32 groupId) const;
|
||||
|
||||
private:
|
||||
friend class DB2HotfixGeneratorBase;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,11 +44,11 @@ enum LevelLimit
|
||||
// Client expected level limitation, like as used in DBC item max levels for "until max player level"
|
||||
// use as default max player level, must be fit max level for used client
|
||||
// also see MAX_LEVEL and STRONG_MAX_LEVEL define
|
||||
DEFAULT_MAX_LEVEL = 110,
|
||||
DEFAULT_MAX_LEVEL = 120,
|
||||
|
||||
// client supported max level for player/pets/etc. Avoid overflow or client stability affected.
|
||||
// also see GT_MAX_LEVEL define
|
||||
MAX_LEVEL = 110,
|
||||
MAX_LEVEL = 120,
|
||||
|
||||
// Server side limitation. Base at used code requirements.
|
||||
// also see MAX_LEVEL and GT_MAX_LEVEL define
|
||||
@@ -58,7 +58,7 @@ enum LevelLimit
|
||||
enum BattlegroundBracketId // bracketId for level ranges
|
||||
{
|
||||
BG_BRACKET_ID_FIRST = 0,
|
||||
BG_BRACKET_ID_LAST = 11,
|
||||
BG_BRACKET_ID_LAST = 12,
|
||||
|
||||
// must be max value in PvPDificulty slot + 1
|
||||
MAX_BATTLEGROUND_BRACKETS
|
||||
@@ -166,7 +166,7 @@ enum ArtifactPowerFlag : uint8
|
||||
|
||||
#define MAX_ARTIFACT_TIER 1
|
||||
|
||||
#define BATTLE_PET_SPECIES_MAX_ID 2164
|
||||
#define BATTLE_PET_SPECIES_MAX_ID 2480
|
||||
|
||||
enum ChrSpecializationFlag
|
||||
{
|
||||
@@ -502,10 +502,13 @@ enum CriteriaTypes : uint8
|
||||
CRITERIA_TYPE_TRANSMOG_SET_UNLOCKED = 205,
|
||||
CRITERIA_TYPE_GAIN_PARAGON_REPUTATION = 206,
|
||||
CRITERIA_TYPE_EARN_HONOR_XP = 207,
|
||||
CRITERIA_TYPE_RELIC_TALENT_UNLOCKED = 211
|
||||
CRITERIA_TYPE_RELIC_TALENT_UNLOCKED = 211,
|
||||
CRITERIA_TYPE_REACH_ACCOUNT_HONOR_LEVEL = 213,
|
||||
CRITERIA_TREE_HEART_OF_AZEROTH_ARTIFACT_POWER_EARNED= 214,
|
||||
CRITERIA_TREE_HEART_OF_AZEROTH_LEVEL_REACHED = 215
|
||||
};
|
||||
|
||||
#define CRITERIA_TYPE_TOTAL 213
|
||||
#define CRITERIA_TYPE_TOTAL 216
|
||||
|
||||
enum CriteriaTreeFlags : uint16
|
||||
{
|
||||
@@ -608,6 +611,11 @@ enum Difficulty : uint8
|
||||
DIFFICULTY_WORLD_PVP_SCENARIO_2 = 32,
|
||||
DIFFICULTY_TIMEWALKING_RAID = 33,
|
||||
DIFFICULTY_PVP = 34,
|
||||
DIFFICULTY_NORMAL_ISLAND = 38,
|
||||
DIFFICULTY_HEROIC_ISLAND = 39,
|
||||
DIFFICULTY_MYTHIC_ISLAND = 40,
|
||||
DIFFICULTY_PVP_ISLAND = 45,
|
||||
DIFFICULTY_NORMAL_WARFRONT = 147,
|
||||
|
||||
MAX_DIFFICULTY
|
||||
};
|
||||
@@ -643,6 +651,20 @@ enum SpawnMask
|
||||
SPAWNMASK_RAID_ALL = (SPAWNMASK_RAID_NORMAL_ALL | SPAWNMASK_RAID_HEROIC_ALL)
|
||||
};
|
||||
|
||||
enum class ExpectedStatType : uint8
|
||||
{
|
||||
CreatureHealth = 0,
|
||||
PlayerHealth = 1,
|
||||
CreatureAutoAttackDps = 2,
|
||||
CreatureArmor = 3,
|
||||
PlayerMana = 4,
|
||||
PlayerPrimaryStat = 5,
|
||||
PlayerSecondaryStat = 6,
|
||||
ArmorConstant = 7,
|
||||
None = 8,
|
||||
CreatureSpellDamage = 9
|
||||
};
|
||||
|
||||
enum FactionTemplateFlags
|
||||
{
|
||||
FACTION_TEMPLATE_ENEMY_SPAR = 0x00000020, // guessed, sparring with enemies?
|
||||
@@ -745,6 +767,68 @@ enum ItemBonusType
|
||||
ITEM_BONUS_OVERRIDE_REQUIRED_LEVEL = 18
|
||||
};
|
||||
|
||||
enum class ItemContext : uint8
|
||||
{
|
||||
NONE = 0,
|
||||
Dungeon_Normal = 1,
|
||||
Dungeon_Heroic = 2,
|
||||
Raid_Normal = 3,
|
||||
Raid_Raid_Finder = 4,
|
||||
Raid_Heroic = 5,
|
||||
Raid_Mythic = 6,
|
||||
PVP_Unranked_1 = 7,
|
||||
PVP_Ranked_1 = 8,
|
||||
Scenario_Normal = 9,
|
||||
Scenario_Heroic = 10,
|
||||
Quest_Reward = 11,
|
||||
Store = 12,
|
||||
Trade_Skill = 13,
|
||||
Vendor = 14,
|
||||
Black_Market = 15,
|
||||
Challenge_Mode_1 = 16,
|
||||
Dungeon_Lvl_Up_1 = 17,
|
||||
Dungeon_Lvl_Up_2 = 18,
|
||||
Dungeon_Lvl_Up_3 = 19,
|
||||
Dungeon_Lvl_Up_4 = 20,
|
||||
Force_to_NONE = 21,
|
||||
TimeWalker = 22,
|
||||
Dungeon_Mythic = 23,
|
||||
Pvp_Honor_Reward = 24,
|
||||
World_Quest_1 = 25,
|
||||
World_Quest_2 = 26,
|
||||
World_Quest_3 = 27,
|
||||
World_Quest_4 = 28,
|
||||
World_Quest_5 = 29,
|
||||
World_Quest_6 = 30,
|
||||
Mission_Reward_1 = 31,
|
||||
Mission_Reward_2 = 32,
|
||||
Challenge_Mode_2 = 33,
|
||||
Challenge_Mode_3 = 34,
|
||||
Challenge_Mode_Jackpot = 35,
|
||||
World_Quest_7 = 36,
|
||||
World_Quest_8 = 37,
|
||||
PVP_Ranked_2 = 38,
|
||||
PVP_Ranked_3 = 39,
|
||||
PVP_Ranked_4 = 40,
|
||||
PVP_Unranked_2 = 41,
|
||||
World_Quest_9 = 42,
|
||||
World_Quest_10 = 43,
|
||||
PVP_Ranked_5 = 44,
|
||||
PVP_Ranked_6 = 45,
|
||||
PVP_Ranked_7 = 46,
|
||||
PVP_Unranked_3 = 47,
|
||||
PVP_Unranked_4 = 48,
|
||||
PVP_Unranked_5 = 49,
|
||||
PVP_Unranked_6 = 50,
|
||||
PVP_Unranked_7 = 51,
|
||||
PVP_Ranked_8 = 52,
|
||||
World_Quest_11 = 53,
|
||||
World_Quest_12 = 54,
|
||||
World_Quest_13 = 55,
|
||||
PVP_Ranked_Jackpot = 56,
|
||||
Tournament_Realm = 57,
|
||||
};
|
||||
|
||||
enum ItemLimitCategoryMode
|
||||
{
|
||||
ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank
|
||||
@@ -917,7 +1001,7 @@ enum SpellShapeshiftFormFlags
|
||||
SHAPESHIFT_FORM_PREVENT_EMOTE_SOUNDS = 0x1000
|
||||
};
|
||||
|
||||
#define TaxiMaskSize 258
|
||||
#define TaxiMaskSize 286
|
||||
typedef std::array<uint8, TaxiMaskSize> TaxiMask;
|
||||
|
||||
enum TotemCategoryType
|
||||
@@ -989,8 +1073,7 @@ enum SummonPropFlags
|
||||
|
||||
#define MAX_TALENT_TIERS 7
|
||||
#define MAX_TALENT_COLUMNS 3
|
||||
#define MAX_PVP_TALENT_TIERS 6
|
||||
#define MAX_PVP_TALENT_COLUMNS 3
|
||||
#define MAX_PVP_TALENT_SLOTS 4
|
||||
|
||||
enum TaxiNodeFlags
|
||||
{
|
||||
@@ -1005,6 +1088,25 @@ enum TaxiPathNodeFlags
|
||||
TAXI_PATH_NODE_FLAG_STOP = 0x2
|
||||
};
|
||||
|
||||
enum UiMapSystem : int8
|
||||
{
|
||||
UI_MAP_SYSTEM_WORLD = 0,
|
||||
UI_MAP_SYSTEM_TAXI = 1,
|
||||
UI_MAP_SYSTEM_ADVENTURE = 2,
|
||||
MAX_UI_MAP_SYSTEM = 3
|
||||
};
|
||||
|
||||
enum UiMapType : int8
|
||||
{
|
||||
UI_MAP_TYPE_COSMIC = 0,
|
||||
UI_MAP_TYPE_WORLD = 1,
|
||||
UI_MAP_TYPE_CONTINENT = 2,
|
||||
UI_MAP_TYPE_ZONE = 3,
|
||||
UI_MAP_TYPE_DUNGEON = 4,
|
||||
UI_MAP_TYPE_MICRO = 5,
|
||||
UI_MAP_TYPE_ORPHAN = 6,
|
||||
};
|
||||
|
||||
enum VehicleSeatFlags
|
||||
{
|
||||
VEHICLE_SEAT_FLAG_HAS_LOWER_ANIM_FOR_ENTER = 0x00000001,
|
||||
|
||||
@@ -29,7 +29,6 @@ GameTable<GtBarberShopCostBaseEntry> sBarberShopCostBaseGameTable;
|
||||
GameTable<GtBaseMPEntry> sBaseMPGameTable;
|
||||
GameTable<GtCombatRatingsEntry> sCombatRatingsGameTable;
|
||||
GameTable<GtCombatRatingsMultByILvl> sCombatRatingsMultByILvlGameTable;
|
||||
GameTable<GtHonorLevelEntry> sHonorLevelGameTable;
|
||||
GameTable<GtHpPerStaEntry> sHpPerStaGameTable;
|
||||
GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable;
|
||||
GameTable<GtNpcDamageByClassEntry> sNpcDamageByClassGameTable[MAX_EXPANSIONS];
|
||||
@@ -118,7 +117,6 @@ void LoadGameTables(std::string const& dataPath)
|
||||
LOAD_GT(sCombatRatingsGameTable, "CombatRatings.txt");
|
||||
LOAD_GT(sCombatRatingsMultByILvlGameTable, "CombatRatingsMultByILvl.txt");
|
||||
LOAD_GT(sItemSocketCostPerLevelGameTable, "ItemSocketCostPerLevel.txt");
|
||||
LOAD_GT(sHonorLevelGameTable, "HonorLevel.txt");
|
||||
LOAD_GT(sHpPerStaGameTable, "HpPerSta.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[0], "NpcDamageByClass.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[1], "NpcDamageByClassExp1.txt");
|
||||
@@ -127,6 +125,7 @@ void LoadGameTables(std::string const& dataPath)
|
||||
LOAD_GT(sNpcDamageByClassGameTable[4], "NpcDamageByClassExp4.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[5], "NpcDamageByClassExp5.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[6], "NpcDamageByClassExp6.txt");
|
||||
LOAD_GT(sNpcDamageByClassGameTable[7], "NpcDamageByClassExp7.txt");
|
||||
LOAD_GT(sNpcManaCostScalerGameTable, "NPCManaCostScaler.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[0], "NpcTotalHp.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[1], "NpcTotalHpExp1.txt");
|
||||
@@ -135,6 +134,7 @@ void LoadGameTables(std::string const& dataPath)
|
||||
LOAD_GT(sNpcTotalHpGameTable[4], "NpcTotalHpExp4.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[5], "NpcTotalHpExp5.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[6], "NpcTotalHpExp6.txt");
|
||||
LOAD_GT(sNpcTotalHpGameTable[7], "NpcTotalHpExp7.txt");
|
||||
LOAD_GT(sSpellScalingGameTable, "SpellScaling.txt");
|
||||
LOAD_GT(sXpGameTable, "xp.txt");
|
||||
|
||||
|
||||
@@ -103,12 +103,6 @@ struct GtCombatRatingsMultByILvl
|
||||
float JewelryMultiplier = 0.0f;
|
||||
};
|
||||
|
||||
uint8 constexpr PRESTIGE_COLUMN_COUNT = 33;
|
||||
struct GtHonorLevelEntry
|
||||
{
|
||||
float Prestige[PRESTIGE_COLUMN_COUNT] = { };
|
||||
};
|
||||
|
||||
struct GtHpPerStaEntry
|
||||
{
|
||||
float Health = 0.0f;
|
||||
@@ -176,6 +170,7 @@ struct GtSpellScalingEntry
|
||||
float Gem2 = 0.0f;
|
||||
float Gem3 = 0.0f;
|
||||
float Health = 0.0f;
|
||||
float DamageReplaceStat = 0.0f;
|
||||
};
|
||||
|
||||
struct GtXpEntry
|
||||
@@ -214,7 +209,6 @@ TC_GAME_API extern GameTable<GtBarberShopCostBaseEntry> sBarberShopC
|
||||
TC_GAME_API extern GameTable<GtBaseMPEntry> sBaseMPGameTable;
|
||||
TC_GAME_API extern GameTable<GtCombatRatingsEntry> sCombatRatingsGameTable;
|
||||
TC_GAME_API extern GameTable<GtCombatRatingsMultByILvl> sCombatRatingsMultByILvlGameTable;
|
||||
TC_GAME_API extern GameTable<GtHonorLevelEntry> sHonorLevelGameTable;
|
||||
TC_GAME_API extern GameTable<GtHpPerStaEntry> sHpPerStaGameTable;
|
||||
TC_GAME_API extern GameTable<GtItemSocketCostPerLevelEntry> sItemSocketCostPerLevelGameTable;
|
||||
TC_GAME_API extern GameTable<GtNpcDamageByClassEntry> sNpcDamageByClassGameTable[MAX_EXPANSIONS];
|
||||
@@ -290,6 +284,7 @@ inline float GetSpellScalingColumnForClass(GtSpellScalingEntry const* row, int32
|
||||
case CLASS_DEMON_HUNTER:
|
||||
return row->DemonHunter;
|
||||
case -1:
|
||||
case -7:
|
||||
return row->Item;
|
||||
case -2:
|
||||
return row->Consumable;
|
||||
@@ -301,6 +296,8 @@ inline float GetSpellScalingColumnForClass(GtSpellScalingEntry const* row, int32
|
||||
return row->Gem3;
|
||||
case -6:
|
||||
return row->Health;
|
||||
case -8:
|
||||
return row->DamageReplaceStat;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ requiredItemLevel(0)
|
||||
LFGDungeonData::LFGDungeonData(LFGDungeonsEntry const* dbc) : id(dbc->ID), name(dbc->Name->Str[sWorld->GetDefaultDbcLocale()]), map(dbc->MapID),
|
||||
type(uint8(dbc->TypeID)), expansion(uint8(dbc->ExpansionLevel)), group(uint8(dbc->GroupID)),
|
||||
minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->DifficultyID)),
|
||||
seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
seasonal((dbc->Flags[0] & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
|
||||
requiredItemLevel(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -46,7 +46,8 @@ AreaTrigger::AreaTrigger() : WorldObject(false), MapObject(), _aurEff(nullptr),
|
||||
m_objectType |= TYPEMASK_AREATRIGGER;
|
||||
m_objectTypeId = TYPEID_AREATRIGGER;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_AREATRIGGER;
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.AreaTrigger = true;
|
||||
|
||||
m_valuesCount = AREATRIGGER_END;
|
||||
_dynamicValuesCount = AREATRIGGER_DYNAMIC_END;
|
||||
@@ -142,7 +143,7 @@ bool AreaTrigger::Create(uint32 spellMiscId, Unit* caster, Unit* target, SpellIn
|
||||
{
|
||||
AreaTriggerCircularMovementInfo cmi = GetMiscTemplate()->CircularMovementInfo;
|
||||
if (target && GetTemplate()->HasFlag(AREATRIGGER_FLAG_HAS_ATTACHED))
|
||||
cmi.TargetGUID = target->GetGUID();
|
||||
cmi.PathTarget = target->GetGUID();
|
||||
else
|
||||
cmi.Center = pos;
|
||||
|
||||
@@ -637,12 +638,12 @@ void AreaTrigger::InitSplines(std::vector<G3D::Vector3> splinePoints, uint32 tim
|
||||
{
|
||||
if (_reachedDestination)
|
||||
{
|
||||
WorldPackets::AreaTrigger::AreaTriggerReShape reshape;
|
||||
WorldPackets::AreaTrigger::AreaTriggerRePath reshape;
|
||||
reshape.TriggerGUID = GetGUID();
|
||||
SendMessageToSet(reshape.Write(), true);
|
||||
}
|
||||
|
||||
WorldPackets::AreaTrigger::AreaTriggerReShape reshape;
|
||||
WorldPackets::AreaTrigger::AreaTriggerRePath reshape;
|
||||
reshape.TriggerGUID = GetGUID();
|
||||
reshape.AreaTriggerSpline = boost::in_place();
|
||||
reshape.AreaTriggerSpline->ElapsedTimeForMovement = GetElapsedTimeForMovement();
|
||||
@@ -664,7 +665,7 @@ bool AreaTrigger::HasSplines() const
|
||||
void AreaTrigger::InitCircularMovement(AreaTriggerCircularMovementInfo const& cmi, uint32 timeToTarget)
|
||||
{
|
||||
// Circular movement requires either a center position or an attached unit
|
||||
ASSERT(cmi.Center.is_initialized() || cmi.TargetGUID.is_initialized());
|
||||
ASSERT(cmi.Center.is_initialized() || cmi.PathTarget.is_initialized());
|
||||
|
||||
// should be sent in object create packets only
|
||||
m_uint32Values[AREATRIGGER_TIME_TO_TARGET] = timeToTarget;
|
||||
@@ -676,7 +677,7 @@ void AreaTrigger::InitCircularMovement(AreaTriggerCircularMovementInfo const& cm
|
||||
|
||||
if (IsInWorld())
|
||||
{
|
||||
WorldPackets::AreaTrigger::AreaTriggerReShape reshape;
|
||||
WorldPackets::AreaTrigger::AreaTriggerRePath reshape;
|
||||
reshape.TriggerGUID = GetGUID();
|
||||
reshape.AreaTriggerCircularMovement = _circularMovementInfo;
|
||||
|
||||
@@ -691,11 +692,11 @@ bool AreaTrigger::HasCircularMovement() const
|
||||
|
||||
Position const* AreaTrigger::GetCircularMovementCenterPosition() const
|
||||
{
|
||||
if (_circularMovementInfo.is_initialized())
|
||||
if (!_circularMovementInfo.is_initialized())
|
||||
return nullptr;
|
||||
|
||||
if (_circularMovementInfo->TargetGUID.is_initialized())
|
||||
if (WorldObject* center = ObjectAccessor::GetWorldObject(*this, *_circularMovementInfo->TargetGUID))
|
||||
if (_circularMovementInfo->PathTarget.is_initialized())
|
||||
if (WorldObject* center = ObjectAccessor::GetWorldObject(*this, *_circularMovementInfo->PathTarget))
|
||||
return center;
|
||||
|
||||
if (_circularMovementInfo->Center.is_initialized())
|
||||
|
||||
@@ -96,6 +96,9 @@ AreaTriggerMiscTemplate::AreaTriggerMiscTemplate()
|
||||
MorphCurveId = 0;
|
||||
FacingCurveId = 0;
|
||||
|
||||
AnimId = 0;
|
||||
AnimKitId = 0;
|
||||
|
||||
DecalPropertiesId = 0;
|
||||
|
||||
TimeToTarget = 0;
|
||||
|
||||
@@ -36,10 +36,11 @@ enum AreaTriggerFlags
|
||||
AREATRIGGER_FLAG_HAS_FOLLOWS_TERRAIN = 0x00010, // NYI
|
||||
AREATRIGGER_FLAG_UNK1 = 0x00020,
|
||||
AREATRIGGER_FLAG_HAS_TARGET_ROLL_PITCH_YAW = 0x00040, // NYI
|
||||
AREATRIGGER_FLAG_UNK2 = 0x00080,
|
||||
AREATRIGGER_FLAG_HAS_ANIM_ID = 0x00080,
|
||||
AREATRIGGER_FLAG_UNK3 = 0x00100,
|
||||
AREATRIGGER_FLAG_UNK4 = 0x00200,
|
||||
AREATRIGGER_FLAG_HAS_CIRCULAR_MOVEMENT = 0x00400
|
||||
AREATRIGGER_FLAG_HAS_ANIM_KIT_ID = 0x00200,
|
||||
AREATRIGGER_FLAG_HAS_CIRCULAR_MOVEMENT = 0x00400,
|
||||
AREATRIGGER_FLAG_UNK5 = 0x00800,
|
||||
};
|
||||
|
||||
enum AreaTriggerTypes
|
||||
@@ -96,7 +97,7 @@ struct AreaTriggerScaleInfo
|
||||
|
||||
struct AreaTriggerCircularMovementInfo
|
||||
{
|
||||
Optional<ObjectGuid> TargetGUID;
|
||||
Optional<ObjectGuid> PathTarget;
|
||||
Optional<TaggedPosition<Position::XYZ>> Center;
|
||||
bool CounterClockwise = false;
|
||||
bool CanLoop = false;
|
||||
@@ -190,6 +191,9 @@ public:
|
||||
uint32 MorphCurveId;
|
||||
uint32 FacingCurveId;
|
||||
|
||||
int32 AnimId;
|
||||
int32 AnimKitId;
|
||||
|
||||
uint32 DecalPropertiesId;
|
||||
|
||||
uint32 TimeToTarget;
|
||||
|
||||
@@ -30,7 +30,8 @@ Conversation::Conversation() : WorldObject(false), _duration(0)
|
||||
m_objectType |= TYPEMASK_CONVERSATION;
|
||||
m_objectTypeId = TYPEID_CONVERSATION;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION;
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.Conversation = true;
|
||||
|
||||
m_valuesCount = CONVERSATION_END;
|
||||
_dynamicValuesCount = CONVERSATION_DYNAMIC_END;
|
||||
@@ -123,13 +124,15 @@ bool Conversation::Create(ObjectGuid::LowType lowGuid, uint32 conversationEntry,
|
||||
|
||||
SetUInt32Value(CONVERSATION_LAST_LINE_END_TIME, conversationTemplate->LastLineEndTime);
|
||||
_duration = conversationTemplate->LastLineEndTime;
|
||||
_textureKitId = conversationTemplate->TextureKitId;
|
||||
|
||||
for (uint16 actorIndex = 0; actorIndex < conversationTemplate->Actors.size(); ++actorIndex)
|
||||
{
|
||||
if (ConversationActorTemplate const* actor = conversationTemplate->Actors[actorIndex])
|
||||
{
|
||||
ConversationDynamicFieldActor actorField;
|
||||
actorField.ActorTemplate = *actor;
|
||||
actorField.ActorTemplate.CreatureId = actor->CreatureId;
|
||||
actorField.ActorTemplate.CreatureModelId = actor->CreatureModelId;
|
||||
actorField.Type = ConversationDynamicFieldActor::ActorType::CreatureActor;
|
||||
SetDynamicStructuredValue(CONVERSATION_DYNAMIC_FIELD_ACTORS, actorIndex, &actorField);
|
||||
}
|
||||
|
||||
@@ -47,8 +47,11 @@ struct ConversationDynamicFieldActor
|
||||
union
|
||||
{
|
||||
ObjectGuid ActorGuid;
|
||||
|
||||
ConversationActorTemplate ActorTemplate;
|
||||
struct
|
||||
{
|
||||
uint32 CreatureId;
|
||||
uint32 CreatureModelId;
|
||||
} ActorTemplate;
|
||||
|
||||
struct
|
||||
{
|
||||
@@ -75,6 +78,7 @@ class TC_GAME_API Conversation : public WorldObject, public GridObject<Conversat
|
||||
void Update(uint32 diff) override;
|
||||
void Remove();
|
||||
int32 GetDuration() const { return _duration; }
|
||||
uint32 GetTextureKitId() const { return _textureKitId; }
|
||||
|
||||
static Conversation* CreateConversation(uint32 conversationEntry, Unit* creator, Position const& pos, GuidUnorderedSet&& participants, SpellInfo const* spellInfo = nullptr);
|
||||
bool Create(ObjectGuid::LowType lowGuid, uint32 conversationEntry, Map* map, Unit* creator, Position const& pos, GuidUnorderedSet&& participants, SpellInfo const* spellInfo = nullptr);
|
||||
@@ -95,6 +99,7 @@ class TC_GAME_API Conversation : public WorldObject, public GridObject<Conversat
|
||||
Position _stationaryPosition;
|
||||
ObjectGuid _creatorGuid;
|
||||
uint32 _duration;
|
||||
uint32 _textureKitId;
|
||||
GuidUnorderedSet _participants;
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type
|
||||
m_objectType |= TYPEMASK_CORPSE;
|
||||
m_objectTypeId = TYPEID_CORPSE;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION;
|
||||
m_updateFlag.Stationary = true;
|
||||
|
||||
m_valuesCount = CORPSE_END;
|
||||
_dynamicValuesCount = CORPSE_DYNAMIC_END;
|
||||
|
||||
@@ -77,68 +77,67 @@ VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extend
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetRandomValidModelId() const
|
||||
CreatureModel const CreatureModel::DefaultInvisibleModel(11686, 1.0f, 1.0f);
|
||||
CreatureModel const CreatureModel::DefaultVisibleModel(17519, 1.0f, 1.0f);
|
||||
|
||||
CreatureModel const* CreatureTemplate::GetModelByIdx(uint32 idx) const
|
||||
{
|
||||
uint8 c = 0;
|
||||
uint32 modelIDs[4];
|
||||
|
||||
if (Modelid1) modelIDs[c++] = Modelid1;
|
||||
if (Modelid2) modelIDs[c++] = Modelid2;
|
||||
if (Modelid3) modelIDs[c++] = Modelid3;
|
||||
if (Modelid4) modelIDs[c++] = Modelid4;
|
||||
|
||||
return ((c>0) ? modelIDs[urand(0, c-1)] : 0);
|
||||
return idx < Models.size() ? &Models[idx] : nullptr;
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetFirstValidModelId() const
|
||||
CreatureModel const* CreatureTemplate::GetRandomValidModel() const
|
||||
{
|
||||
if (Modelid1) return Modelid1;
|
||||
if (Modelid2) return Modelid2;
|
||||
if (Modelid3) return Modelid3;
|
||||
if (Modelid4) return Modelid4;
|
||||
return 0;
|
||||
if (!Models.size())
|
||||
return nullptr;
|
||||
|
||||
// If only one element, ignore the Probability (even if 0)
|
||||
if (Models.size() == 1)
|
||||
return &Models[0];
|
||||
|
||||
auto selectedItr = Trinity::Containers::SelectRandomWeightedContainerElement(Models, [](CreatureModel const& model)
|
||||
{
|
||||
return model.Probability;
|
||||
});
|
||||
|
||||
return &(*selectedItr);
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetFirstInvisibleModel() const
|
||||
CreatureModel const* CreatureTemplate::GetFirstValidModel() const
|
||||
{
|
||||
CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid1);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid1;
|
||||
for (CreatureModel const& model : Models)
|
||||
if (model.CreatureDisplayID)
|
||||
return &model;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid2);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid2;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid3);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid3;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid4);
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return Modelid4;
|
||||
|
||||
return 11686;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetFirstVisibleModel() const
|
||||
CreatureModel const* CreatureTemplate::GetModelWithDisplayId(uint32 displayId) const
|
||||
{
|
||||
CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid1);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid1;
|
||||
for (CreatureModel const& model : Models)
|
||||
if (displayId == model.CreatureDisplayID)
|
||||
return &model;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid2);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid2;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid3);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid3;
|
||||
CreatureModel const* CreatureTemplate::GetFirstInvisibleModel() const
|
||||
{
|
||||
for (CreatureModel const& model : Models)
|
||||
if (CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(model.CreatureDisplayID))
|
||||
if (modelInfo && modelInfo->is_trigger)
|
||||
return &model;
|
||||
|
||||
modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid4);
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return Modelid4;
|
||||
return &CreatureModel::DefaultInvisibleModel;
|
||||
}
|
||||
|
||||
return 17519;
|
||||
CreatureModel const* CreatureTemplate::GetFirstVisibleModel() const
|
||||
{
|
||||
for (CreatureModel const& model : Models)
|
||||
if (CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(model.CreatureDisplayID))
|
||||
if (modelInfo && !modelInfo->is_trigger)
|
||||
return &model;
|
||||
|
||||
return &CreatureModel::DefaultVisibleModel;
|
||||
}
|
||||
|
||||
bool AssistDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
@@ -347,22 +346,22 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, uint8(cinfo->unit_class));
|
||||
|
||||
// Cancel load if no model defined
|
||||
if (!(cinfo->GetFirstValidModelId()))
|
||||
if (!(cinfo->GetFirstValidModel()))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", entry);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 displayID = ObjectMgr::ChooseDisplayId(GetCreatureTemplate(), data);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
CreatureModel model = *ObjectMgr::ChooseDisplayId(cinfo, data);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&model, cinfo);
|
||||
if (!minfo) // Cancel load if no model defined
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid model %u defined in table `creature_template`, can't load.", entry, displayID);
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid model %u defined in table `creature_template`, can't load.", entry, model.CreatureDisplayID);
|
||||
return false;
|
||||
}
|
||||
|
||||
SetDisplayId(displayID);
|
||||
SetNativeDisplayId(displayID);
|
||||
SetDisplayId(model.CreatureDisplayID, model.DisplayScale);
|
||||
SetNativeDisplayId(model.CreatureDisplayID, model.DisplayScale);
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
|
||||
// Load creature equipment
|
||||
@@ -388,7 +387,7 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
|
||||
SetSpeedRate(MOVE_SWIM, 1.0f); // using 1.0 rate
|
||||
SetSpeedRate(MOVE_FLIGHT, 1.0f); // using 1.0 rate
|
||||
|
||||
// Will set UNIT_FIELD_BOUNDINGRADIUS and UNIT_FIELD_COMBATREACH
|
||||
// Will set UNIT_FIELD_BOUNDINGRADIUS, UNIT_FIELD_COMBATREACH and UNIT_FIELD_DISPLAYSCALE
|
||||
SetObjectScale(cinfo->scale);
|
||||
|
||||
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight);
|
||||
@@ -434,6 +433,8 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
|
||||
|
||||
SetUInt32Value(OBJECT_DYNAMIC_FLAGS, dynamicFlags);
|
||||
|
||||
SetUInt32Value(UNIT_FIELD_STATE_ANIM_ID, sAnimationDataStore.GetNumRows());
|
||||
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
|
||||
SetBaseAttackTime(BASE_ATTACK, cInfo->BaseAttackTime);
|
||||
@@ -894,7 +895,8 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 entry, float
|
||||
if (!CreateFromProto(guidlow, entry, data, vehId))
|
||||
return false;
|
||||
|
||||
switch (GetCreatureTemplate()->rank)
|
||||
cinfo = GetCreatureTemplate(); // might be different than initially requested
|
||||
switch (cinfo->rank)
|
||||
{
|
||||
case CREATURE_ELITE_RARE:
|
||||
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE);
|
||||
@@ -924,12 +926,12 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 entry, float
|
||||
Relocate(x, y, z, ang);
|
||||
}
|
||||
|
||||
uint32 displayID = GetNativeDisplayId();
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
CreatureModel display(GetNativeDisplayId(), GetNativeDisplayScale(), 1.0f);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&display, cinfo);
|
||||
if (minfo && !IsTotem()) // Cancel load if no model defined or if totem
|
||||
{
|
||||
SetDisplayId(displayID);
|
||||
SetNativeDisplayId(displayID);
|
||||
SetDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetNativeDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
}
|
||||
|
||||
@@ -942,10 +944,10 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 entry, float
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
}
|
||||
|
||||
if (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING)
|
||||
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_PATHFINDING)
|
||||
AddUnitState(UNIT_STATE_IGNORE_PATHFINDING);
|
||||
|
||||
if (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK)
|
||||
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK)
|
||||
{
|
||||
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
|
||||
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
|
||||
@@ -1129,9 +1131,9 @@ void Creature::SaveToDB(uint32 mapid, std::vector<Difficulty> const& spawnDiffic
|
||||
CreatureTemplate const* cinfo = GetCreatureTemplate();
|
||||
if (cinfo)
|
||||
{
|
||||
if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 ||
|
||||
displayId == cinfo->Modelid3 || displayId == cinfo->Modelid4)
|
||||
displayId = 0;
|
||||
for (CreatureModel model : cinfo->Models)
|
||||
if (displayId && displayId == model.CreatureDisplayID)
|
||||
displayId = 0;
|
||||
|
||||
if (npcflag == cinfo->npcflag)
|
||||
npcflag = 0;
|
||||
@@ -1844,12 +1846,12 @@ void Creature::Respawn(bool force)
|
||||
|
||||
setDeathState(JUST_RESPAWNED);
|
||||
|
||||
uint32 displayID = GetNativeDisplayId();
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
|
||||
CreatureModel display(GetNativeDisplayId(), GetNativeDisplayScale(), 1.0f);
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&display, GetCreatureTemplate());
|
||||
if (minfo) // Cancel load if no model defined
|
||||
{
|
||||
SetDisplayId(displayID);
|
||||
SetNativeDisplayId(displayID);
|
||||
SetDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetNativeDisplayId(display.CreatureDisplayID, display.DisplayScale);
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
}
|
||||
|
||||
@@ -2575,7 +2577,7 @@ uint8 Creature::GetLevelForTarget(WorldObject const* target) const
|
||||
uint8 targetLevelWithDelta = unitTarget->getLevel() + GetInt32Value(UNIT_FIELD_SCALING_LEVEL_DELTA);
|
||||
|
||||
if (target->IsPlayer())
|
||||
targetLevelWithDelta += target->GetUInt32Value(PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA);
|
||||
targetLevelWithDelta += target->GetUInt32Value(ACTIVE_PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA);
|
||||
|
||||
return RoundToInterval<uint8>(targetLevelWithDelta, GetUInt32Value(UNIT_FIELD_SCALING_LEVEL_MIN), GetUInt32Value(UNIT_FIELD_SCALING_LEVEL_MAX));
|
||||
}
|
||||
@@ -2853,9 +2855,9 @@ void Creature::SetObjectScale(float scale)
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::SetDisplayId(uint32 modelId)
|
||||
void Creature::SetDisplayId(uint32 modelId, float displayScale /*= 1.f*/)
|
||||
{
|
||||
Unit::SetDisplayId(modelId);
|
||||
Unit::SetDisplayId(modelId, displayScale);
|
||||
|
||||
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
|
||||
{
|
||||
@@ -2864,6 +2866,12 @@ void Creature::SetDisplayId(uint32 modelId)
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::SetDisplayFromModel(uint32 modelIdx)
|
||||
{
|
||||
if (CreatureModel const* model = GetCreatureTemplate()->GetModelByIdx(modelIdx))
|
||||
SetDisplayId(model->CreatureDisplayID, model->DisplayScale);
|
||||
}
|
||||
|
||||
void Creature::SetTarget(ObjectGuid const& guid)
|
||||
{
|
||||
if (IsFocusing(nullptr, true))
|
||||
|
||||
@@ -69,7 +69,8 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
void RemoveFromWorld() override;
|
||||
|
||||
void SetObjectScale(float scale) override;
|
||||
void SetDisplayId(uint32 modelId) override;
|
||||
void SetDisplayId(uint32 displayId, float displayScale = 1.f) override;
|
||||
void SetDisplayFromModel(uint32 modelIdx);
|
||||
|
||||
void DisappearAndDie();
|
||||
|
||||
@@ -149,7 +150,6 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
|
||||
bool UpdateStats(Stats stat) override;
|
||||
bool UpdateAllStats() override;
|
||||
void UpdateResistances(uint32 school) override;
|
||||
void UpdateArmor() override;
|
||||
void UpdateMaxHealth() override;
|
||||
void UpdateMaxPower(Powers power) override;
|
||||
|
||||
@@ -301,16 +301,29 @@ struct CreatureLevelScaling
|
||||
int16 DeltaLevelMax;
|
||||
};
|
||||
|
||||
struct CreatureModel
|
||||
{
|
||||
static CreatureModel const DefaultInvisibleModel;
|
||||
static CreatureModel const DefaultVisibleModel;
|
||||
|
||||
CreatureModel() :
|
||||
CreatureDisplayID(0), DisplayScale(0.0f), Probability(0.0f) { }
|
||||
|
||||
CreatureModel(uint32 creatureDisplayID, float displayScale, float probability) :
|
||||
CreatureDisplayID(creatureDisplayID), DisplayScale(displayScale), Probability(probability) { }
|
||||
|
||||
uint32 CreatureDisplayID;
|
||||
float DisplayScale;
|
||||
float Probability;
|
||||
};
|
||||
|
||||
// from `creature_template` table
|
||||
struct TC_GAME_API CreatureTemplate
|
||||
{
|
||||
uint32 Entry;
|
||||
uint32 DifficultyEntry[MAX_CREATURE_DIFFICULTIES];
|
||||
uint32 KillCredit[MAX_KILL_CREDIT];
|
||||
uint32 Modelid1;
|
||||
uint32 Modelid2;
|
||||
uint32 Modelid3;
|
||||
uint32 Modelid4;
|
||||
std::vector<CreatureModel> Models;
|
||||
std::string Name;
|
||||
std::string FemaleName;
|
||||
std::string SubName;
|
||||
@@ -369,10 +382,12 @@ struct TC_GAME_API CreatureTemplate
|
||||
uint32 MechanicImmuneMask;
|
||||
uint32 flags_extra;
|
||||
uint32 ScriptID;
|
||||
uint32 GetRandomValidModelId() const;
|
||||
uint32 GetFirstValidModelId() const;
|
||||
uint32 GetFirstInvisibleModel() const;
|
||||
uint32 GetFirstVisibleModel() const;
|
||||
CreatureModel const* GetModelByIdx(uint32 idx) const;
|
||||
CreatureModel const* GetRandomValidModel() const;
|
||||
CreatureModel const* GetFirstValidModel() const;
|
||||
CreatureModel const* GetModelWithDisplayId(uint32 displayId) const;
|
||||
CreatureModel const* GetFirstInvisibleModel() const;
|
||||
CreatureModel const* GetFirstVisibleModel() const;
|
||||
|
||||
// helpers
|
||||
SkillType GetRequiredLootSkill() const
|
||||
|
||||
@@ -286,6 +286,7 @@ void PlayerMenu::SendPointOfInterest(uint32 id) const
|
||||
}
|
||||
|
||||
WorldPackets::NPC::GossipPOI packet;
|
||||
packet.ID = pointOfInterest->ID;
|
||||
packet.Name = pointOfInterest->Name;
|
||||
|
||||
LocaleConstant localeConstant = _session->GetSessionDbLocaleIndex();
|
||||
@@ -438,6 +439,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
packet.InformUnit = _session->GetPlayer()->GetDivider();
|
||||
packet.QuestID = quest->GetQuestId();
|
||||
packet.PortraitGiver = quest->GetQuestGiverPortrait();
|
||||
packet.PortraitGiverMount = quest->GetQuestGiverPortraitMount();
|
||||
packet.PortraitTurnIn = quest->GetQuestTurnInPortrait();
|
||||
packet.AutoLaunched = autoLaunched;
|
||||
packet.DisplayPopup = displayPopup;
|
||||
@@ -512,6 +514,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
packet.Info.QuestID = quest->GetQuestId();
|
||||
packet.Info.QuestType = quest->GetQuestType();
|
||||
packet.Info.QuestLevel = quest->GetQuestLevel();
|
||||
packet.Info.QuestScalingFactionGroup = quest->GetQuestScalingFactionGroup();
|
||||
packet.Info.QuestMaxScalingLevel = quest->GetQuestMaxScalingLevel();
|
||||
packet.Info.QuestPackageID = quest->GetQuestPackageID();
|
||||
packet.Info.QuestMinLevel = quest->GetMinLevel();
|
||||
@@ -543,12 +546,14 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
packet.Info.StartItem = quest->GetSrcItemId();
|
||||
packet.Info.Flags = quest->GetFlags();
|
||||
packet.Info.FlagsEx = quest->GetFlagsEx();
|
||||
packet.Info.FlagsEx2 = quest->GetFlagsEx2();
|
||||
packet.Info.RewardTitle = quest->GetRewTitle();
|
||||
packet.Info.RewardArenaPoints = quest->GetRewArenaPoints();
|
||||
packet.Info.RewardSkillLineID = quest->GetRewardSkillId();
|
||||
packet.Info.RewardNumSkillUps = quest->GetRewardSkillPoints();
|
||||
packet.Info.RewardFactionFlags = quest->GetRewardReputationMask();
|
||||
packet.Info.PortraitGiver = quest->GetQuestGiverPortrait();
|
||||
packet.Info.PortraitGiverMount = quest->GetQuestGiverPortraitMount();
|
||||
packet.Info.PortraitTurnIn = quest->GetQuestTurnInPortrait();
|
||||
|
||||
for (uint8 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i)
|
||||
@@ -585,7 +590,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
packet.Info.POIPriority = quest->GetPOIPriority();
|
||||
|
||||
packet.Info.AllowableRaces = quest->GetAllowableRaces();
|
||||
packet.Info.QuestRewardID = quest->GetRewardId();
|
||||
packet.Info.TreasurePickerID = quest->GetTreasurePickerId();
|
||||
packet.Info.Expansion = quest->GetExpansion();
|
||||
|
||||
for (QuestObjective const& questObjective : quest->GetObjectives())
|
||||
@@ -666,6 +671,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
|
||||
packet.PortraitTurnIn = quest->GetQuestTurnInPortrait();
|
||||
packet.PortraitGiver = quest->GetQuestGiverPortrait();
|
||||
packet.PortraitGiverMount = quest->GetQuestGiverPortraitMount();
|
||||
packet.QuestPackageID = quest->GetQuestPackageID();
|
||||
|
||||
_session->SendPacket(packet.Write());
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
namespace Trainer
|
||||
{
|
||||
bool Spell::IsCastable() const
|
||||
{
|
||||
return sSpellMgr->AssertSpellInfo(SpellId)->HasEffect(SPELL_EFFECT_LEARN_SPELL);
|
||||
}
|
||||
|
||||
Trainer::Trainer(uint32 id, Type type, std::string greeting, std::vector<Spell> spells) : _id(id), _type(type), _spells(std::move(spells))
|
||||
{
|
||||
@@ -136,9 +140,30 @@ namespace Trainer
|
||||
return SpellState::Unavailable;
|
||||
|
||||
// check ranks
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(trainerSpell->LearnedSpellId))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
bool hasLearnSpellEffect = false;
|
||||
bool knowsAllLearnedSpells = true;
|
||||
for (SpellEffectInfo const* spellEffect : sSpellMgr->AssertSpellInfo(trainerSpell->SpellId)->GetEffectsForDifficulty(DIFFICULTY_NONE))
|
||||
{
|
||||
if (!spellEffect || !spellEffect->IsEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
continue;
|
||||
|
||||
hasLearnSpellEffect = true;
|
||||
if (!player->HasSpell(spellEffect->TriggerSpell))
|
||||
knowsAllLearnedSpells = false;
|
||||
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(spellEffect->TriggerSpell))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
}
|
||||
|
||||
if (!hasLearnSpellEffect)
|
||||
{
|
||||
if (uint32 previousRankSpellId = sSpellMgr->GetPrevSpellInChain(trainerSpell->SpellId))
|
||||
if (!player->HasSpell(previousRankSpellId))
|
||||
return SpellState::Unavailable;
|
||||
}
|
||||
else if (knowsAllLearnedSpells)
|
||||
return SpellState::Known;
|
||||
|
||||
// check additional spell requirement
|
||||
for (auto const& requirePair : sSpellMgr->GetSpellsRequiredForSpellBounds(trainerSpell->SpellId))
|
||||
|
||||
@@ -59,8 +59,7 @@ namespace Trainer
|
||||
std::array<uint32, 3> ReqAbility = { };
|
||||
uint8 ReqLevel = 0;
|
||||
|
||||
uint32 LearnedSpellId = 0;
|
||||
bool IsCastable() const { return LearnedSpellId != SpellId; }
|
||||
bool IsCastable() const;
|
||||
};
|
||||
|
||||
class Trainer
|
||||
|
||||
@@ -38,7 +38,7 @@ DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject),
|
||||
m_objectType |= TYPEMASK_DYNAMICOBJECT;
|
||||
m_objectTypeId = TYPEID_DYNAMICOBJECT;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_STATIONARY_POSITION;
|
||||
m_updateFlag.Stationary = true;
|
||||
|
||||
m_valuesCount = DYNAMICOBJECT_END;
|
||||
_dynamicValuesCount = DYNAMICOBJECT_DYNAMIC_END;
|
||||
|
||||
@@ -61,7 +61,8 @@ GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_objectType |= TYPEMASK_GAMEOBJECT;
|
||||
m_objectTypeId = TYPEID_GAMEOBJECT;
|
||||
|
||||
m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION);
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.Rotation = true;
|
||||
|
||||
m_valuesCount = GAMEOBJECT_END;
|
||||
_dynamicValuesCount = GAMEOBJECT_DYNAMIC_END;
|
||||
@@ -238,7 +239,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
else
|
||||
{
|
||||
guid = ObjectGuid::Create<HighGuid::Transport>(map->GenerateLowGuid<HighGuid::Transport>());
|
||||
m_updateFlag |= UPDATEFLAG_TRANSPORT;
|
||||
m_updateFlag.ServerTime = true;
|
||||
}
|
||||
|
||||
Object::_Create(guid);
|
||||
@@ -271,7 +272,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
|
||||
if (m_goTemplateAddon->WorldEffectID)
|
||||
{
|
||||
m_updateFlag |= UPDATEFLAG_GAMEOBJECT;
|
||||
m_updateFlag.GameObject = true;
|
||||
SetWorldEffectID(m_goTemplateAddon->WorldEffectID);
|
||||
}
|
||||
}
|
||||
@@ -292,6 +293,8 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
SetGoState(goState);
|
||||
SetGoArtKit(artKit);
|
||||
|
||||
SetUInt32Value(GAMEOBJECT_STATE_ANIM_ID, sAnimationDataStore.GetNumRows());
|
||||
|
||||
switch (goInfo->type)
|
||||
{
|
||||
case GAMEOBJECT_TYPE_FISHINGHOLE:
|
||||
@@ -376,7 +379,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
|
||||
if (gameObjectAddon && gameObjectAddon->WorldEffectID)
|
||||
{
|
||||
m_updateFlag |= UPDATEFLAG_GAMEOBJECT;
|
||||
m_updateFlag.GameObject = true;
|
||||
SetWorldEffectID(gameObjectAddon->WorldEffectID);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ struct GameObjectTemplate
|
||||
uint32 usegrouplootrules; // 15 use group loot rules, enum { false, true, }; Default: false
|
||||
uint32 floatingTooltip; // 16 floatingTooltip, enum { false, true, }; Default: false
|
||||
uint32 conditionID1; // 17 conditionID1, References: PlayerCondition, NoValue = 0
|
||||
int32 xpLevel; // 18 xpLevel, int, Min value: -1, Max value: 123, Default value: 0
|
||||
uint32 XPLevelRange; // 18 XP Level Range, References: ContentTuning, NoValue = 0
|
||||
uint32 xpDifficulty; // 19 xpDifficulty, enum { No Exp, Trivial, Very Small, Small, Substandard, Standard, High, Epic, Dungeon, 5, }; Default: No Exp
|
||||
uint32 lootLevel; // 20 lootLevel, int, Min value: 0, Max value: 123, Default value: 0
|
||||
uint32 GroupXP; // 21 Group XP, enum { false, true, }; Default: false
|
||||
@@ -120,6 +120,7 @@ struct GameObjectTemplate
|
||||
uint32 chestPersonalLoot; // 30 chest Personal Loot, References: Treasure, NoValue = 0
|
||||
uint32 turnpersonallootsecurityoff; // 31 turn personal loot security off, enum { false, true, }; Default: false
|
||||
uint32 ChestProperties; // 32 Chest Properties, References: ChestProperties, NoValue = 0
|
||||
uint32 chestPushLoot; // 33 chest Push Loot, References: Treasure, NoValue = 0
|
||||
} chest;
|
||||
// 4 GAMEOBJECT_TYPE_BINDER
|
||||
struct
|
||||
@@ -332,6 +333,7 @@ struct GameObjectTemplate
|
||||
{
|
||||
uint32 creatureID; // 0 creatureID, References: Creature, NoValue = 0
|
||||
uint32 charges; // 1 charges, int, Min value: 0, Max value: 65535, Default value: 1
|
||||
uint32 Preferonlyifinlineofsight; // 2 Prefer only if in line of sight (expensive), enum { false, true, }; Default: false
|
||||
} guardPost;
|
||||
// 22 GAMEOBJECT_TYPE_SPELLCASTER
|
||||
struct
|
||||
@@ -503,7 +505,10 @@ struct GameObjectTemplate
|
||||
uint32 startOpen; // 1 startOpen, enum { false, true, }; Default: false
|
||||
uint32 autoClose; // 2 autoClose (ms), int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 BlocksPathsDown; // 3 Blocks Paths Down, enum { false, true, }; Default: false
|
||||
uint32 PathBlockerBump; // 4 Path Blocker Bump (ft), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
int32 PathBlockerBump; // 4 Path Blocker Bump (ft), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
uint32 GiganticAOI; // 5 Gigantic AOI, enum { false, true, }; Default: false
|
||||
uint32 InfiniteAOI; // 6 Infinite AOI, enum { false, true, }; Default: false
|
||||
uint32 DoorisOpaque; // 7 Door is Opaque (Disable portal on close), enum { false, true, }; Default: false
|
||||
} trapdoor;
|
||||
// 36 GAMEOBJECT_TYPE_NEW_FLAG
|
||||
struct
|
||||
@@ -581,7 +586,7 @@ struct GameObjectTemplate
|
||||
struct
|
||||
{
|
||||
int32 SpawnMap; // 0 Spawn Map, References: Map, NoValue = -1
|
||||
uint32 AreaNameSet; // 1 Area Name Set (Index), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
int32 AreaNameSet; // 1 Area Name Set (Index), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetA; // 2 Doodad Set A, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetB; // 3 Doodad Set B, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
} phaseableMO;
|
||||
@@ -616,7 +621,7 @@ struct GameObjectTemplate
|
||||
// 48 GAMEOBJECT_TYPE_UI_LINK
|
||||
struct
|
||||
{
|
||||
uint32 UILinkType; // 0 UI Link Type, enum { Adventure Journal, Obliterum Forge, }; Default: Adventure Journal
|
||||
uint32 UILinkType; // 0 UI Link Type, enum { Adventure Journal, Obliterum Forge, Scrapping Machine, }; Default: Adventure Journal
|
||||
uint32 allowMounted; // 1 allowMounted, enum { false, true, }; Default: false
|
||||
uint32 GiganticAOI; // 2 Gigantic AOI, enum { false, true, }; Default: false
|
||||
uint32 spellFocusType; // 3 spellFocusType, References: SpellFocusObject, NoValue = 0
|
||||
@@ -641,7 +646,7 @@ struct GameObjectTemplate
|
||||
uint32 openTextID; // 9 openTextID, References: BroadcastText, NoValue = 0
|
||||
uint32 floatingTooltip; // 10 floatingTooltip, enum { false, true, }; Default: false
|
||||
uint32 conditionID1; // 11 conditionID1, References: PlayerCondition, NoValue = 0
|
||||
uint32 xpLevel; // 12 xpLevel, int, Min value: -1, Max value: 123, Default value: 0
|
||||
uint32 XPLevelRange; // 12 XP Level Range, References: ContentTuning, NoValue = 0
|
||||
uint32 xpDifficulty; // 13 xpDifficulty, enum { No Exp, Trivial, Very Small, Small, Substandard, Standard, High, Epic, Dungeon, 5, }; Default: No Exp
|
||||
uint32 spell; // 14 spell, References: Spell, NoValue = 0
|
||||
uint32 GiganticAOI; // 15 Gigantic AOI, enum { false, true, }; Default: false
|
||||
@@ -650,13 +655,45 @@ struct GameObjectTemplate
|
||||
uint32 MaxNumberofLoots; // 18 Max Number of Loots, int, Min value: 1, Max value: 40, Default value: 10
|
||||
uint32 logloot; // 19 log loot, enum { false, true, }; Default: false
|
||||
uint32 linkedTrap; // 20 linkedTrap, References: GameObjects, NoValue = 0
|
||||
uint32 PlayOpenAnimationonOpening; // 21 Play Open Animation on Opening, enum { false, true, }; Default: false
|
||||
} gatheringNode;
|
||||
// 51 GAMEOBJECT_TYPE_CHALLENGE_MODE_REWARD
|
||||
struct
|
||||
{
|
||||
uint32 chestLoot; // 0 chestLoot, References: Treasure, NoValue = 0
|
||||
uint32 WhenAvailable; // 1 When Available, References: GameObjectDisplayInfo, NoValue = 0
|
||||
uint32 open; // 2 open, References: Lock_, NoValue = 0
|
||||
uint32 openTextID; // 3 openTextID, References: BroadcastText, NoValue = 0
|
||||
} challengeModeReward;
|
||||
// 52 GAMEOBJECT_TYPE_MULTI
|
||||
struct
|
||||
{
|
||||
uint32 MultiProperties; // 0 Multi Properties, References: MultiProperties, NoValue = 0
|
||||
} multi;
|
||||
// 53 GAMEOBJECT_TYPE_SIEGEABLE_MULTI
|
||||
struct
|
||||
{
|
||||
uint32 MultiProperties; // 0 Multi Properties, References: MultiProperties, NoValue = 0
|
||||
uint32 InitialDamage; // 1 Initial Damage, enum { None, Raw, Ratio, }; Default: None
|
||||
} siegeableMulti;
|
||||
// 54 GAMEOBJECT_TYPE_SIEGEABLE_MO
|
||||
struct
|
||||
{
|
||||
uint32 SiegeableProperties; // 0 Siegeable Properties, References: SiegeableProperties, NoValue = 0
|
||||
uint32 DoodadSetA; // 1 Doodad Set A, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetB; // 2 Doodad Set B, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
uint32 DoodadSetC; // 3 Doodad Set C, int, Min value: 0, Max value: 2147483647, Default value: 0
|
||||
int32 SpawnMap; // 4 Spawn Map, References: Map, NoValue = -1
|
||||
int32 AreaNameSet; // 5 Area Name Set (Index), int, Min value: -2147483648, Max value: 2147483647, Default value: 0
|
||||
} siegeableMO;
|
||||
// 55 GAMEOBJECT_TYPE_PVP_REWARD
|
||||
struct
|
||||
{
|
||||
uint32 chestLoot; // 0 chestLoot, References: Treasure, NoValue = 0
|
||||
uint32 WhenAvailable; // 1 When Available, References: GameObjectDisplayInfo, NoValue = 0
|
||||
uint32 open; // 2 open, References: Lock_, NoValue = 0
|
||||
uint32 openTextID; // 3 openTextID, References: BroadcastText, NoValue = 0
|
||||
} pvpReward;
|
||||
struct
|
||||
{
|
||||
uint32 data[MAX_GAMEOBJECT_DATA];
|
||||
@@ -709,6 +746,8 @@ struct GameObjectTemplate
|
||||
case GAMEOBJECT_TYPE_NEW_FLAG_DROP: return newflagdrop.open;
|
||||
case GAMEOBJECT_TYPE_CAPTURE_POINT: return capturePoint.open;
|
||||
case GAMEOBJECT_TYPE_GATHERING_NODE: return gatheringNode.open;
|
||||
case GAMEOBJECT_TYPE_CHALLENGE_MODE_REWARD: return challengeModeReward.open;
|
||||
case GAMEOBJECT_TYPE_PVP_REWARD: return pvpReward.open;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,8 +275,6 @@ Item::Item()
|
||||
m_objectType |= TYPEMASK_ITEM;
|
||||
m_objectTypeId = TYPEID_ITEM;
|
||||
|
||||
m_updateFlag = 0;
|
||||
|
||||
m_valuesCount = ITEM_END;
|
||||
_dynamicValuesCount = ITEM_DYNAMIC_END;
|
||||
m_slot = 0;
|
||||
@@ -316,14 +314,8 @@ bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemId, Player const* owne
|
||||
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
|
||||
|
||||
for (std::size_t i = 0; i < itemProto->Effects.size(); ++i)
|
||||
{
|
||||
if (i < 5)
|
||||
SetSpellCharges(i, itemProto->Effects[i]->Charges);
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemProto->Effects[i]->SpellID))
|
||||
if (owner && spellInfo->HasEffect(SPELL_EFFECT_GIVE_ARTIFACT_POWER))
|
||||
if (uint32 artifactKnowledgeLevel = sWorld->getIntConfig(CONFIG_CURRENCY_START_ARTIFACT_KNOWLEDGE))
|
||||
SetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL, artifactKnowledgeLevel + 1);
|
||||
}
|
||||
|
||||
SetUInt32Value(ITEM_FIELD_DURATION, itemProto->GetDuration());
|
||||
SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, 0);
|
||||
@@ -1709,7 +1701,7 @@ bool Item::HasStats() const
|
||||
ItemTemplate const* proto = GetTemplate();
|
||||
Player const* owner = GetOwner();
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
if ((owner ? GetItemStatValue(i, owner) : proto->GetItemStatValue(i)) != 0)
|
||||
if ((owner ? GetItemStatValue(i, owner) : proto->GetItemStatAllocation(i)) != 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1721,7 +1713,7 @@ bool Item::HasStats(WorldPackets::Item::ItemInstance const& itemInstance, BonusD
|
||||
return true;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
if (bonus->ItemStatValue[i] != 0)
|
||||
if (bonus->ItemStatAllocation[i] != 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -2231,9 +2223,9 @@ uint32 Item::GetItemLevel(ItemTemplate const* itemTemplate, BonusData const& bon
|
||||
else
|
||||
level = std::min(std::max(int32(level), ssd->MinLevel), ssd->MaxLevel);
|
||||
|
||||
if (SandboxScalingEntry const* sandbox = sSandboxScalingStore.LookupEntry(bonusData.SandboxScalingId))
|
||||
if ((sandbox->Flags & 2 || sandbox->MinLevel || sandbox->MaxLevel) && !(sandbox->Flags & 4))
|
||||
level = std::min(std::max(int32(level), sandbox->MinLevel), sandbox->MaxLevel);
|
||||
if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(bonusData.ContentTuningId))
|
||||
if ((contentTuning->Flags & 2 || contentTuning->MinLevel || contentTuning->MaxLevel) && !(contentTuning->Flags & 4))
|
||||
level = std::min(std::max(int32(level), contentTuning->MinLevel), contentTuning->MaxLevel);
|
||||
|
||||
if (uint32 heirloomIlvl = uint32(sDB2Manager.GetCurveValueAt(ssd->PlayerLevelToItemLevelCurveID, level)))
|
||||
itemLevel = heirloomIlvl;
|
||||
@@ -2276,7 +2268,7 @@ int32 Item::GetItemStatValue(uint32 index, Player const* owner) const
|
||||
return int32(std::floor(statValue + 0.5f));
|
||||
}
|
||||
|
||||
return _bonusData.ItemStatValue[index];
|
||||
return 0;
|
||||
}
|
||||
|
||||
ItemDisenchantLootEntry const* Item::GetDisenchantLoot(Player const* owner) const
|
||||
@@ -2565,8 +2557,6 @@ void Item::GiveArtifactXp(uint64 amount, Item* sourceItem, uint32 artifactCatego
|
||||
uint32 artifactKnowledgeLevel = 1;
|
||||
if (sourceItem && sourceItem->GetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL))
|
||||
artifactKnowledgeLevel = sourceItem->GetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL);
|
||||
else if (artifactCategoryId == ARTIFACT_CATEGORY_PRIMARY)
|
||||
artifactKnowledgeLevel = sWorld->getIntConfig(CONFIG_CURRENCY_START_ARTIFACT_KNOWLEDGE) + 1;
|
||||
|
||||
if (GtArtifactKnowledgeMultiplierEntry const* artifactKnowledge = sArtifactKnowledgeMultiplierGameTable.GetRow(artifactKnowledgeLevel))
|
||||
amount = uint64(amount * artifactKnowledge->Multiplier);
|
||||
@@ -2598,9 +2588,9 @@ void Item::SetFixedLevel(uint8 level)
|
||||
{
|
||||
level = std::min(std::max(int32(level), ssd->MinLevel), ssd->MaxLevel);
|
||||
|
||||
if (SandboxScalingEntry const* sandbox = sSandboxScalingStore.LookupEntry(_bonusData.SandboxScalingId))
|
||||
if ((sandbox->Flags & 2 || sandbox->MinLevel || sandbox->MaxLevel) && !(sandbox->Flags & 4))
|
||||
level = std::min(std::max(int32(level), sandbox->MinLevel), sandbox->MaxLevel);
|
||||
if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(_bonusData.ContentTuningId))
|
||||
if ((contentTuning->Flags & 2 || contentTuning->MinLevel || contentTuning->MaxLevel) && !(contentTuning->Flags & 4))
|
||||
level = std::min(std::max(int32(level), contentTuning->MinLevel), contentTuning->MaxLevel);
|
||||
|
||||
SetModifier(ITEM_MODIFIER_SCALING_STAT_DISTRIBUTION_FIXED_LEVEL, level);
|
||||
}
|
||||
@@ -2624,9 +2614,6 @@ void BonusData::Initialize(ItemTemplate const* proto)
|
||||
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
ItemStatType[i] = proto->GetItemStatType(i);
|
||||
|
||||
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
ItemStatValue[i] = proto->GetItemStatValue(i);
|
||||
|
||||
for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i)
|
||||
ItemStatAllocation[i] = proto->GetItemStatAllocation(i);
|
||||
|
||||
@@ -2646,7 +2633,7 @@ void BonusData::Initialize(ItemTemplate const* proto)
|
||||
AppearanceModID = 0;
|
||||
RepairCostMultiplier = 1.0f;
|
||||
ScalingStatDistribution = proto->GetScalingStatDistribution();
|
||||
SandboxScalingId = 0;
|
||||
ContentTuningId = 0;
|
||||
RelicType = -1;
|
||||
HasItemLevelBonus = false;
|
||||
HasFixedLevel = false;
|
||||
@@ -2734,7 +2721,7 @@ void BonusData::AddBonus(uint32 type, int32 const (&values)[3])
|
||||
if (values[1] < _state.ScalingStatDistributionPriority)
|
||||
{
|
||||
ScalingStatDistribution = static_cast<uint32>(values[0]);
|
||||
SandboxScalingId = static_cast<uint32>(values[2]);
|
||||
ContentTuningId = static_cast<uint32>(values[2]);
|
||||
_state.ScalingStatDistributionPriority = values[1];
|
||||
HasFixedLevel = type == ITEM_BONUS_SCALING_STAT_DISTRIBUTION_FIXED;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ struct BonusData
|
||||
int32 ItemLevelBonus;
|
||||
int32 RequiredLevel;
|
||||
int32 ItemStatType[MAX_ITEM_PROTO_STATS];
|
||||
int32 ItemStatValue[MAX_ITEM_PROTO_STATS];
|
||||
int32 ItemStatAllocation[MAX_ITEM_PROTO_STATS];
|
||||
float ItemStatSocketCostMultiplier[MAX_ITEM_PROTO_STATS];
|
||||
uint32 SocketColor[MAX_ITEM_PROTO_SOCKETS];
|
||||
@@ -86,7 +85,7 @@ struct BonusData
|
||||
uint32 AppearanceModID;
|
||||
float RepairCostMultiplier;
|
||||
uint32 ScalingStatDistribution;
|
||||
uint32 SandboxScalingId;
|
||||
uint32 ContentTuningId;
|
||||
uint32 DisenchantLootId;
|
||||
uint32 GemItemLevelBonus[MAX_ITEM_PROTO_SOCKETS];
|
||||
int32 GemRelicType[MAX_ITEM_PROTO_SOCKETS];
|
||||
|
||||
@@ -51,79 +51,82 @@ enum InventoryResult : uint8
|
||||
EQUIP_ERR_TOO_FEW_TO_SPLIT = 26, // Tried to split more than number in stack.
|
||||
EQUIP_ERR_SPLIT_FAILED = 27, // Couldn't split those items.
|
||||
EQUIP_ERR_SPELL_FAILED_REAGENTS_GENERIC = 28, // Missing reagent
|
||||
EQUIP_ERR_NOT_ENOUGH_MONEY = 29, // You don't have enough money.
|
||||
EQUIP_ERR_NOT_A_BAG = 30, // Not a bag.
|
||||
EQUIP_ERR_DESTROY_NONEMPTY_BAG = 31, // You can only do that with empty bags.
|
||||
EQUIP_ERR_NOT_OWNER = 32, // You don't own that item.
|
||||
EQUIP_ERR_ONLY_ONE_QUIVER = 33, // You can only equip one quiver.
|
||||
EQUIP_ERR_NO_BANK_SLOT = 34, // You must purchase that bag slot first
|
||||
EQUIP_ERR_NO_BANK_HERE = 35, // You are too far away from a bank.
|
||||
EQUIP_ERR_ITEM_LOCKED = 36, // Item is locked.
|
||||
EQUIP_ERR_GENERIC_STUNNED = 37, // You are stunned
|
||||
EQUIP_ERR_PLAYER_DEAD = 38, // You can't do that when you're dead.
|
||||
EQUIP_ERR_CLIENT_LOCKED_OUT = 39, // You can't do that right now.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR = 40, // Internal Bag Error
|
||||
EQUIP_ERR_ONLY_ONE_BOLT = 41, // You can only equip one quiver.
|
||||
EQUIP_ERR_ONLY_ONE_AMMO = 42, // You can only equip one ammo pouch.
|
||||
EQUIP_ERR_CANT_WRAP_STACKABLE = 43, // Stackable items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_EQUIPPED = 44, // Equipped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_WRAPPED = 45, // Wrapped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BOUND = 46, // Bound items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_UNIQUE = 47, // Unique items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BAGS = 48, // Bags can't be wrapped.
|
||||
EQUIP_ERR_LOOT_GONE = 49, // Already looted
|
||||
EQUIP_ERR_INV_FULL = 50, // Inventory is full.
|
||||
EQUIP_ERR_BANK_FULL = 51, // Your bank is full
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT = 52, // That item is currently sold out.
|
||||
EQUIP_ERR_BAG_FULL_2 = 53, // That bag is full.
|
||||
EQUIP_ERR_ITEM_NOT_FOUND_2 = 54, // The item was not found.
|
||||
EQUIP_ERR_CANT_STACK_2 = 55, // This item cannot stack.
|
||||
EQUIP_ERR_BAG_FULL_3 = 56, // That bag is full.
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT_2 = 57, // That item is currently sold out.
|
||||
EQUIP_ERR_OBJECT_IS_BUSY = 58, // That object is busy.
|
||||
EQUIP_ERR_CANT_BE_DISENCHANTED = 59,
|
||||
EQUIP_ERR_NOT_IN_COMBAT = 60, // You can't do that while in combat
|
||||
EQUIP_ERR_NOT_WHILE_DISARMED = 61, // You can't do that while disarmed
|
||||
EQUIP_ERR_BAG_FULL_4 = 62, // That bag is full.
|
||||
EQUIP_ERR_CANT_EQUIP_RANK = 63, // You don't have the required rank for that item
|
||||
EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, // You don't have the required reputation for that item
|
||||
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, // You cannot equip another bag of that type
|
||||
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, // You can't loot that item now.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 67, // You cannot equip more than one of those.
|
||||
EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, // You do not have the required items for that purchase
|
||||
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, // You don't have enough honor points
|
||||
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, // You don't have enough arena points
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, // You have the maximum number of those gems in your inventory or socketed into items.
|
||||
EQUIP_ERR_MAIL_BOUND_ITEM = 72, // You can't mail soulbound items.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 73, // Internal Bag Error
|
||||
EQUIP_ERR_BAG_FULL_5 = 74, // That bag is full.
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, // You have the maximum number of those gems socketed into equipped items.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, // You cannot socket more than one of those gems into a single item.
|
||||
EQUIP_ERR_TOO_MUCH_GOLD = 77, // At gold limit
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // You can't do that while in an arena match
|
||||
EQUIP_ERR_TRADE_BOUND_ITEM = 79, // You can't trade a soulbound item.
|
||||
EQUIP_ERR_CANT_EQUIP_RATING = 80, // You don't have the personal, team, or battleground rating required to buy that item
|
||||
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
|
||||
EQUIP_ERR_NOT_SAME_ACCOUNT = 82, // Account-bound items can only be given to your own characters.
|
||||
EQUIP_ERR_NO_OUTPUT = 83,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, // You can only carry %d %s
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, // Your level is too high to use that item
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, // You must reach level %d to purchase that item.
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, // You do not have the required talent to equip that.
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 89, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 90, // Cannot equip item in this form
|
||||
EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 91, // Your inventory is full. Your satchel has been delivered to your mailbox.
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 92, // Your level is too low to use that item
|
||||
EQUIP_ERR_CANT_BUY_QUANTITY = 93, // You can't buy the specified quantity of that item.
|
||||
EQUIP_ERR_ITEM_IS_BATTLE_PAY_LOCKED = 94, // Your purchased item is still waiting to be unlocked
|
||||
EQUIP_ERR_REAGENT_BANK_FULL = 95, // Your reagent bank is full
|
||||
EQUIP_ERR_REAGENT_BANK_LOCKED = 96,
|
||||
EQUIP_ERR_WRONG_BAG_TYPE_3 = 97,
|
||||
EQUIP_ERR_CANT_USE_ITEM = 98, // You can't use that item.
|
||||
EQUIP_ERR_CANT_BE_OBLITERATED = 99, // You can't obliterate that item
|
||||
EQUIP_ERR_GUILD_BANK_CONJURED_ITEM = 100,// You cannot store conjured items in the guild bank
|
||||
EQUIP_ERR_CANT_DO_THAT_RIGHT_NOW = 101,// You can't do that right now.
|
||||
EQUIP_ERR_CANT_TRADE_GOLD = 29, // Gold may only be offered by one trader.
|
||||
EQUIP_ERR_NOT_ENOUGH_MONEY = 30, // You don't have enough money.
|
||||
EQUIP_ERR_NOT_A_BAG = 31, // Not a bag.
|
||||
EQUIP_ERR_DESTROY_NONEMPTY_BAG = 32, // You can only do that with empty bags.
|
||||
EQUIP_ERR_NOT_OWNER = 33, // You don't own that item.
|
||||
EQUIP_ERR_ONLY_ONE_QUIVER = 34, // You can only equip one quiver.
|
||||
EQUIP_ERR_NO_BANK_SLOT = 35, // You must purchase that bag slot first
|
||||
EQUIP_ERR_NO_BANK_HERE = 36, // You are too far away from a bank.
|
||||
EQUIP_ERR_ITEM_LOCKED = 37, // Item is locked.
|
||||
EQUIP_ERR_GENERIC_STUNNED = 38, // You are stunned
|
||||
EQUIP_ERR_PLAYER_DEAD = 39, // You can't do that when you're dead.
|
||||
EQUIP_ERR_CLIENT_LOCKED_OUT = 40, // You can't do that right now.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR = 41, // Internal Bag Error
|
||||
EQUIP_ERR_ONLY_ONE_BOLT = 42, // You can only equip one quiver.
|
||||
EQUIP_ERR_ONLY_ONE_AMMO = 43, // You can only equip one ammo pouch.
|
||||
EQUIP_ERR_CANT_WRAP_STACKABLE = 44, // Stackable items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_EQUIPPED = 45, // Equipped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_WRAPPED = 46, // Wrapped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BOUND = 47, // Bound items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_UNIQUE = 48, // Unique items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BAGS = 49, // Bags can't be wrapped.
|
||||
EQUIP_ERR_LOOT_GONE = 50, // Already looted
|
||||
EQUIP_ERR_INV_FULL = 51, // Inventory is full.
|
||||
EQUIP_ERR_BANK_FULL = 52, // Your bank is full
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT = 53, // That item is currently sold out.
|
||||
EQUIP_ERR_BAG_FULL_2 = 54, // That bag is full.
|
||||
EQUIP_ERR_ITEM_NOT_FOUND_2 = 55, // The item was not found.
|
||||
EQUIP_ERR_CANT_STACK_2 = 56, // This item cannot stack.
|
||||
EQUIP_ERR_BAG_FULL_3 = 57, // That bag is full.
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT_2 = 58, // That item is currently sold out.
|
||||
EQUIP_ERR_OBJECT_IS_BUSY = 59, // That object is busy.
|
||||
EQUIP_ERR_CANT_BE_DISENCHANTED = 60, // Item cannot be disenchanted
|
||||
EQUIP_ERR_NOT_IN_COMBAT = 61, // You can't do that while in combat
|
||||
EQUIP_ERR_NOT_WHILE_DISARMED = 62, // You can't do that while disarmed
|
||||
EQUIP_ERR_BAG_FULL_4 = 63, // That bag is full.
|
||||
EQUIP_ERR_CANT_EQUIP_RANK = 64, // You don't have the required rank for that item
|
||||
EQUIP_ERR_CANT_EQUIP_REPUTATION = 65, // You don't have the required reputation for that item
|
||||
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 66, // You cannot equip another bag of that type
|
||||
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 67, // You can't loot that item now.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 68, // You cannot equip more than one of those.
|
||||
EQUIP_ERR_VENDOR_MISSING_TURNINS = 69, // You do not have the required items for that purchase
|
||||
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 70, // You don't have enough honor points
|
||||
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 71, // You don't have enough arena points
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 72, // You have the maximum number of those gems in your inventory or socketed into items.
|
||||
EQUIP_ERR_MAIL_BOUND_ITEM = 73, // You can't mail soulbound items.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 74, // Internal Bag Error
|
||||
EQUIP_ERR_BAG_FULL_5 = 75, // That bag is full.
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 76, // You have the maximum number of those gems socketed into equipped items.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 77, // You cannot socket more than one of those gems into a single item.
|
||||
EQUIP_ERR_TOO_MUCH_GOLD = 78, // At gold limit
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 79, // You can't do that while in an arena match
|
||||
EQUIP_ERR_TRADE_BOUND_ITEM = 80, // You can't trade a soulbound item.
|
||||
EQUIP_ERR_CANT_EQUIP_RATING = 81, // You don't have the personal, team, or battleground rating required to buy that item
|
||||
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 82,
|
||||
EQUIP_ERR_NOT_SAME_ACCOUNT = 83, // Account-bound items can only be given to your own characters.
|
||||
EQUIP_NONE_3 = 84,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 85, // You can only carry %d %s
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 86, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 87, // Your level is too high to use that item
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 88, // You must reach level %d to purchase that item.
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 89, // You do not have the required talent to equip that.
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 90, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 91, // Cannot equip item in this form
|
||||
EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 92, // Your inventory is full. Your satchel has been delivered to your mailbox.
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 93, // Your level is too low to use that item
|
||||
EQUIP_ERR_CANT_BUY_QUANTITY = 94, // You can't buy the specified quantity of that item.
|
||||
EQUIP_ERR_ITEM_IS_BATTLE_PAY_LOCKED = 95, // Your purchased item is still waiting to be unlocked
|
||||
EQUIP_ERR_REAGENT_BANK_FULL = 96, // Your reagent bank is full
|
||||
EQUIP_ERR_REAGENT_BANK_LOCKED = 97,
|
||||
EQUIP_ERR_WRONG_BAG_TYPE_3 = 98, // That item doesn't go in that container.
|
||||
EQUIP_ERR_CANT_USE_ITEM = 99, // You can't use that item.
|
||||
EQUIP_ERR_CANT_BE_OBLITERATED = 100,// You can't obliterate that item
|
||||
EQUIP_ERR_GUILD_BANK_CONJURED_ITEM = 101,// You cannot store conjured items in the guild bank
|
||||
EQUIP_ERR_CANT_DO_THAT_RIGHT_NOW = 102,// You can't do that right now.
|
||||
EQUIP_ERR_BAG_FULL_6 = 103,// That bag is full.
|
||||
EQUIP_ERR_CANT_BE_SCRAPPED = 104,// You can't scrap that item
|
||||
};
|
||||
|
||||
enum BuyResult
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "ItemTemplate.h"
|
||||
#include "Player.h"
|
||||
|
||||
uint32 const SocketColorToGemTypeMask[19] =
|
||||
int32 const SocketColorToGemTypeMask[19] =
|
||||
{
|
||||
0,
|
||||
SOCKET_COLOR_META,
|
||||
@@ -241,7 +241,7 @@ bool ItemTemplate::IsUsableByLootSpecialization(Player const* player, bool alway
|
||||
if (GetFlags() & ITEM_FLAG_IS_BOUND_TO_ACCOUNT && alwaysAllowBoundToAccount)
|
||||
return true;
|
||||
|
||||
uint32 spec = player->GetUInt32Value(PLAYER_FIELD_LOOT_SPEC_ID);
|
||||
uint32 spec = player->GetUInt32Value(ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID);
|
||||
if (!spec)
|
||||
spec = player->GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID);
|
||||
if (!spec)
|
||||
|
||||
@@ -337,7 +337,7 @@ enum SocketColor
|
||||
SOCKET_COLOR_RELIC_HOLY = 0x10000
|
||||
};
|
||||
|
||||
extern uint32 const SocketColorToGemTypeMask[19];
|
||||
extern int32 const SocketColorToGemTypeMask[19];
|
||||
|
||||
#define SOCKET_COLOR_STANDARD (SOCKET_COLOR_RED | SOCKET_COLOR_YELLOW | SOCKET_COLOR_BLUE)
|
||||
|
||||
@@ -732,7 +732,6 @@ struct TC_GAME_API ItemTemplate
|
||||
uint32 GetMaxCount() const { return ExtendedData->MaxCount; }
|
||||
uint32 GetContainerSlots() const { return ExtendedData->ContainerSlots; }
|
||||
int32 GetItemStatType(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatModifierBonusStat[index]; }
|
||||
int32 GetItemStatValue(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->ItemStatValue[index]; }
|
||||
int32 GetItemStatAllocation(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentEditor[index]; }
|
||||
float GetItemStatSocketCostMultiplier(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentageOfSocket[index]; }
|
||||
uint32 GetScalingStatDistribution() const { return ExtendedData->ScalingStatDistributionID; }
|
||||
|
||||
@@ -55,7 +55,7 @@ Object::Object()
|
||||
{
|
||||
m_objectTypeId = TYPEID_OBJECT;
|
||||
m_objectType = TYPEMASK_OBJECT;
|
||||
m_updateFlag = UPDATEFLAG_NONE;
|
||||
m_updateFlag.Clear();
|
||||
|
||||
m_uint32Values = nullptr;
|
||||
_dynamicValues = nullptr;
|
||||
@@ -130,7 +130,6 @@ void Object::_Create(ObjectGuid const& guid)
|
||||
if (!m_uint32Values) _InitValues();
|
||||
|
||||
SetGuidValue(OBJECT_FIELD_GUID, guid);
|
||||
SetUInt16Value(OBJECT_FIELD_TYPE, 0, m_objectType);
|
||||
}
|
||||
|
||||
std::string Object::_ConcatFields(uint16 startIndex, uint16 size) const
|
||||
@@ -171,12 +170,19 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
uint8 updateType = UPDATETYPE_CREATE_OBJECT;
|
||||
uint32 flags = m_updateFlag;
|
||||
uint8 updateType = UPDATETYPE_CREATE_OBJECT;
|
||||
uint8 objectType = m_objectTypeId;
|
||||
uint16 objectTypeMask = m_objectType;
|
||||
CreateObjectBits flags = m_updateFlag;
|
||||
|
||||
/** lower flag1 **/
|
||||
if (target == this) // building packet for yourself
|
||||
flags |= UPDATEFLAG_SELF;
|
||||
{
|
||||
flags.ThisIsYou = true;
|
||||
flags.ActivePlayer = true;
|
||||
objectType = TYPEID_ACTIVE_PLAYER;
|
||||
objectTypeMask |= TYPEMASK_ACTIVE_PLAYER;
|
||||
}
|
||||
|
||||
switch (GetGUID().GetHigh())
|
||||
{
|
||||
@@ -209,15 +215,14 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
|
||||
if (WorldObject const* worldObject = dynamic_cast<WorldObject const*>(this))
|
||||
{
|
||||
if (!(flags & UPDATEFLAG_LIVING))
|
||||
if (!worldObject->m_movementInfo.transport.guid.IsEmpty())
|
||||
flags |= UPDATEFLAG_TRANSPORT_POSITION;
|
||||
if (!flags.MovementUpdate && !worldObject->m_movementInfo.transport.guid.IsEmpty())
|
||||
flags.MovementTransport = true;
|
||||
|
||||
if (worldObject->GetAIAnimKitId() || worldObject->GetMovementAnimKitId() || worldObject->GetMeleeAnimKitId())
|
||||
flags |= UPDATEFLAG_ANIMKITS;
|
||||
flags.AnimKit = true;
|
||||
}
|
||||
|
||||
if (flags & UPDATEFLAG_STATIONARY_POSITION)
|
||||
if (flags.Stationary)
|
||||
{
|
||||
// UPDATETYPE_CREATE_OBJECT2 for some gameobject types...
|
||||
if (isType(TYPEMASK_GAMEOBJECT))
|
||||
@@ -238,12 +243,13 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
||||
|
||||
if (Unit const* unit = ToUnit())
|
||||
if (unit->GetVictim())
|
||||
flags |= UPDATEFLAG_HAS_TARGET;
|
||||
flags.CombatVictim = true;
|
||||
|
||||
ByteBuffer buf(0x400);
|
||||
buf << uint8(updateType);
|
||||
buf << GetGUID();
|
||||
buf << uint8(m_objectTypeId);
|
||||
buf << uint8(objectType);
|
||||
buf << uint32(objectTypeMask);
|
||||
|
||||
BuildMovementUpdate(&buf, flags);
|
||||
BuildValuesUpdate(updateType, &buf, target);
|
||||
@@ -338,25 +344,8 @@ ObjectGuid const& Object::GetGuidValue(uint16 index) const
|
||||
return *((ObjectGuid*)&(m_uint32Values[index]));
|
||||
}
|
||||
|
||||
void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
void Object::BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags) const
|
||||
{
|
||||
bool NoBirthAnim = false;
|
||||
bool EnablePortals = false;
|
||||
bool PlayHoverAnim = false;
|
||||
bool HasMovementUpdate = (flags & UPDATEFLAG_LIVING) != 0;
|
||||
bool HasMovementTransport = (flags & UPDATEFLAG_TRANSPORT_POSITION) != 0;
|
||||
bool Stationary = (flags & UPDATEFLAG_STATIONARY_POSITION) != 0;
|
||||
bool CombatVictim = (flags & UPDATEFLAG_HAS_TARGET) != 0;
|
||||
bool ServerTime = (flags & UPDATEFLAG_TRANSPORT) != 0;
|
||||
bool VehicleCreate = (flags & UPDATEFLAG_VEHICLE) != 0;
|
||||
bool AnimKitCreate = (flags & UPDATEFLAG_ANIMKITS) != 0;
|
||||
bool Rotation = (flags & UPDATEFLAG_ROTATION) != 0;
|
||||
bool HasAreaTrigger = (flags & UPDATEFLAG_AREATRIGGER) != 0;
|
||||
bool HasGameObject = (flags & UPDATEFLAG_GAMEOBJECT) != 0;
|
||||
bool ThisIsYou = (flags & UPDATEFLAG_SELF) != 0;
|
||||
bool SmoothPhasing = false;
|
||||
bool SceneObjCreate = false;
|
||||
bool PlayerCreateData = GetTypeId() == TYPEID_PLAYER && ToUnit()->GetPowerIndex(POWER_RUNES) != MAX_POWERS;
|
||||
std::vector<uint32> const* PauseTimes = nullptr;
|
||||
uint32 PauseTimesCount = 0;
|
||||
if (GameObject const* go = ToGameObject())
|
||||
@@ -368,26 +357,27 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
}
|
||||
}
|
||||
|
||||
data->WriteBit(NoBirthAnim);
|
||||
data->WriteBit(EnablePortals);
|
||||
data->WriteBit(PlayHoverAnim);
|
||||
data->WriteBit(HasMovementUpdate);
|
||||
data->WriteBit(HasMovementTransport);
|
||||
data->WriteBit(Stationary);
|
||||
data->WriteBit(CombatVictim);
|
||||
data->WriteBit(ServerTime);
|
||||
data->WriteBit(VehicleCreate);
|
||||
data->WriteBit(AnimKitCreate);
|
||||
data->WriteBit(Rotation);
|
||||
data->WriteBit(HasAreaTrigger);
|
||||
data->WriteBit(HasGameObject);
|
||||
data->WriteBit(SmoothPhasing);
|
||||
data->WriteBit(ThisIsYou);
|
||||
data->WriteBit(SceneObjCreate);
|
||||
data->WriteBit(PlayerCreateData);
|
||||
data->WriteBit(flags.NoBirthAnim);
|
||||
data->WriteBit(flags.EnablePortals);
|
||||
data->WriteBit(flags.PlayHoverAnim);
|
||||
data->WriteBit(flags.MovementUpdate);
|
||||
data->WriteBit(flags.MovementTransport);
|
||||
data->WriteBit(flags.Stationary);
|
||||
data->WriteBit(flags.CombatVictim);
|
||||
data->WriteBit(flags.ServerTime);
|
||||
data->WriteBit(flags.Vehicle);
|
||||
data->WriteBit(flags.AnimKit);
|
||||
data->WriteBit(flags.Rotation);
|
||||
data->WriteBit(flags.AreaTrigger);
|
||||
data->WriteBit(flags.GameObject);
|
||||
data->WriteBit(flags.SmoothPhasing);
|
||||
data->WriteBit(flags.ThisIsYou);
|
||||
data->WriteBit(flags.SceneObject);
|
||||
data->WriteBit(flags.ActivePlayer);
|
||||
data->WriteBit(flags.Conversation);
|
||||
data->FlushBits();
|
||||
|
||||
if (HasMovementUpdate)
|
||||
if (flags.MovementUpdate)
|
||||
{
|
||||
Unit const* unit = ToUnit();
|
||||
bool HasFallDirection = unit->HasUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
@@ -458,6 +448,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
// *data << uint32(TransportID);
|
||||
// *data << float(Magnitude);
|
||||
// data->WriteBits(Type, 2);
|
||||
// data->FlushBits();
|
||||
//}
|
||||
|
||||
if (HasSpline)
|
||||
@@ -466,7 +457,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
|
||||
*data << uint32(PauseTimesCount);
|
||||
|
||||
if (Stationary)
|
||||
if (flags.Stationary)
|
||||
{
|
||||
WorldObject const* self = static_cast<WorldObject const*>(this);
|
||||
*data << float(self->GetStationaryX());
|
||||
@@ -475,10 +466,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << float(self->GetStationaryO());
|
||||
}
|
||||
|
||||
if (CombatVictim)
|
||||
if (flags.CombatVictim)
|
||||
*data << ToUnit()->GetVictim()->GetGUID(); // CombatVictim
|
||||
|
||||
if (ServerTime)
|
||||
if (flags.ServerTime)
|
||||
{
|
||||
GameObject const* go = ToGameObject();
|
||||
/** @TODO Use IsTransport() to also handle type 11 (TRANSPORT)
|
||||
@@ -492,14 +483,14 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint32(getMSTime());
|
||||
}
|
||||
|
||||
if (VehicleCreate)
|
||||
if (flags.Vehicle)
|
||||
{
|
||||
Unit const* unit = ToUnit();
|
||||
*data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->ID); // RecID
|
||||
*data << float(unit->GetOrientation()); // InitialRawFacing
|
||||
}
|
||||
|
||||
if (AnimKitCreate)
|
||||
if (flags.AnimKit)
|
||||
{
|
||||
WorldObject const* self = static_cast<WorldObject const*>(this);
|
||||
*data << uint16(self->GetAIAnimKitId()); // AiID
|
||||
@@ -507,19 +498,19 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint16(self->GetMeleeAnimKitId()); // MeleeID
|
||||
}
|
||||
|
||||
if (Rotation)
|
||||
if (flags.Rotation)
|
||||
*data << uint64(ToGameObject()->GetPackedWorldRotation()); // Rotation
|
||||
|
||||
if (PauseTimesCount)
|
||||
data->append(PauseTimes->data(), PauseTimes->size());
|
||||
|
||||
if (HasMovementTransport)
|
||||
if (flags.MovementTransport)
|
||||
{
|
||||
WorldObject const* self = static_cast<WorldObject const*>(this);
|
||||
*data << self->m_movementInfo.transport;
|
||||
}
|
||||
|
||||
if (HasAreaTrigger)
|
||||
if (flags.AreaTrigger)
|
||||
{
|
||||
AreaTrigger const* areaTrigger = ToAreaTrigger();
|
||||
AreaTriggerMiscTemplate const* areaTriggerMiscTemplate = areaTrigger->GetMiscTemplate();
|
||||
@@ -540,9 +531,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
bool hasMorphCurveID = areaTriggerMiscTemplate->MorphCurveId != 0;
|
||||
bool hasFacingCurveID = areaTriggerMiscTemplate->FacingCurveId != 0;
|
||||
bool hasMoveCurveID = areaTriggerMiscTemplate->MoveCurveId != 0;
|
||||
bool hasUnk2 = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_UNK2);
|
||||
bool hasAnimation = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_HAS_ANIM_ID);
|
||||
bool hasUnk3 = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_UNK3);
|
||||
bool hasUnk4 = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_UNK4);
|
||||
bool hasAnimKitID = areaTriggerTemplate->HasFlag(AREATRIGGER_FLAG_HAS_ANIM_KIT_ID);
|
||||
bool hasAnimProgress = false;
|
||||
bool hasAreaTriggerSphere = areaTriggerTemplate->IsSphere();
|
||||
bool hasAreaTriggerBox = areaTriggerTemplate->IsBox();
|
||||
bool hasAreaTriggerPolygon = areaTriggerTemplate->IsPolygon();
|
||||
@@ -561,9 +553,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
data->WriteBit(hasMorphCurveID);
|
||||
data->WriteBit(hasFacingCurveID);
|
||||
data->WriteBit(hasMoveCurveID);
|
||||
data->WriteBit(hasUnk2);
|
||||
data->WriteBit(hasAnimation);
|
||||
data->WriteBit(hasAnimKitID);
|
||||
data->WriteBit(hasUnk3);
|
||||
data->WriteBit(hasUnk4);
|
||||
data->WriteBit(hasAnimProgress);
|
||||
data->WriteBit(hasAreaTriggerSphere);
|
||||
data->WriteBit(hasAreaTriggerBox);
|
||||
data->WriteBit(hasAreaTriggerPolygon);
|
||||
@@ -599,10 +592,13 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
if (hasMoveCurveID)
|
||||
*data << uint32(areaTriggerMiscTemplate->MoveCurveId);
|
||||
|
||||
if (hasUnk2)
|
||||
*data << int32(0);
|
||||
if (hasAnimation)
|
||||
*data << int32(areaTriggerMiscTemplate->AnimId);
|
||||
|
||||
if (hasUnk4)
|
||||
if (hasAnimKitID)
|
||||
*data << int32(areaTriggerMiscTemplate->AnimKitId);
|
||||
|
||||
if (hasAnimProgress)
|
||||
*data << uint32(0);
|
||||
|
||||
if (hasAreaTriggerSphere)
|
||||
@@ -649,7 +645,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << *areaTrigger->GetCircularMovementInfo();
|
||||
}
|
||||
|
||||
if (HasGameObject)
|
||||
if (flags.GameObject)
|
||||
{
|
||||
bool bit8 = false;
|
||||
uint32 Int1 = 0;
|
||||
@@ -664,7 +660,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint32(Int1);
|
||||
}
|
||||
|
||||
//if (SmoothPhasing)
|
||||
//if (flags.SmoothPhasing)
|
||||
//{
|
||||
// data->WriteBit(ReplaceActive);
|
||||
// data->WriteBit(HasReplaceObject);
|
||||
@@ -673,7 +669,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
// *data << ObjectGuid(ReplaceObject);
|
||||
//}
|
||||
|
||||
//if (SceneObjCreate)
|
||||
//if (flags.SceneObject)
|
||||
//{
|
||||
// data->WriteBit(HasLocalScriptData);
|
||||
// data->WriteBit(HasPetBattleFullUpdate);
|
||||
@@ -783,7 +779,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
// }
|
||||
//}
|
||||
|
||||
if (PlayerCreateData)
|
||||
if (flags.ActivePlayer)
|
||||
{
|
||||
bool HasSceneInstanceIDs = false;
|
||||
bool HasRuneState = ToUnit()->GetPowerIndex(POWER_RUNES) != MAX_POWERS;
|
||||
@@ -810,6 +806,15 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
|
||||
*data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags.Conversation)
|
||||
{
|
||||
Conversation const* self = ToConversation();
|
||||
if (data->WriteBit(self->GetTextureKitId() != 0))
|
||||
*data << uint32(self->GetTextureKitId());
|
||||
|
||||
data->FlushBits();
|
||||
}
|
||||
}
|
||||
|
||||
void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const
|
||||
@@ -843,7 +848,11 @@ void Object::BuildDynamicValuesUpdate(uint8 updateType, ByteBuffer* data, Player
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
std::size_t blockCount = UpdateMask::GetBlockCount(_dynamicValuesCount);
|
||||
std::size_t valueCount = _dynamicValuesCount;
|
||||
if (target != this && GetTypeId() == TYPEID_PLAYER)
|
||||
valueCount = PLAYER_DYNAMIC_END;
|
||||
|
||||
std::size_t blockCount = UpdateMask::GetBlockCount(valueCount);
|
||||
|
||||
uint32* flags = nullptr;
|
||||
uint32 visibleFlag = GetDynamicUpdateFieldData(target, flags);
|
||||
@@ -852,7 +861,7 @@ void Object::BuildDynamicValuesUpdate(uint8 updateType, ByteBuffer* data, Player
|
||||
std::size_t maskPos = data->wpos();
|
||||
data->resize(data->size() + blockCount * sizeof(UpdateMask::BlockType));
|
||||
|
||||
for (uint16 index = 0; index < _dynamicValuesCount; ++index)
|
||||
for (uint16 index = 0; index < valueCount; ++index)
|
||||
{
|
||||
std::vector<uint32> const& values = _dynamicValues[index];
|
||||
if (_fieldNotifyFlags & flags[index] ||
|
||||
@@ -928,7 +937,17 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
||||
{
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
flags = ItemUpdateFieldFlags;
|
||||
flags = ContainerUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
break;
|
||||
case TYPEID_AZERITE_EMPOWERED_ITEM:
|
||||
flags = AzeriteEmpoweredItemUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
break;
|
||||
case TYPEID_AZERITE_ITEM:
|
||||
flags = AzeriteItemUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
break;
|
||||
@@ -973,6 +992,7 @@ uint32 Object::GetUpdateFieldData(Player const* target, uint32*& flags) const
|
||||
flags = ConversationUpdateFieldFlags;
|
||||
break;
|
||||
case TYPEID_OBJECT:
|
||||
case TYPEID_ACTIVE_PLAYER:
|
||||
ABORT();
|
||||
break;
|
||||
}
|
||||
@@ -991,6 +1011,8 @@ uint32 Object::GetDynamicUpdateFieldData(Player const* target, uint32*& flags) c
|
||||
{
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
case TYPEID_AZERITE_EMPOWERED_ITEM:
|
||||
case TYPEID_AZERITE_ITEM:
|
||||
flags = ItemDynamicUpdateFieldFlags;
|
||||
if (((Item const*)this)->GetOwnerGUID() == target->GetGUID())
|
||||
visibleFlag |= UF_FLAG_OWNER | UF_FLAG_ITEM_OWNER;
|
||||
@@ -2983,7 +3005,7 @@ struct WorldObjectChangeAccumulator
|
||||
{
|
||||
//Caster may be NULL if DynObj is in removelist
|
||||
if (Player* caster = ObjectAccessor::FindPlayer(guid))
|
||||
if (caster->GetGuidValue(PLAYER_FARSIGHT) == source->GetGUID())
|
||||
if (caster->GetGuidValue(ACTIVE_PLAYER_FIELD_FARSIGHT) == source->GetGUID())
|
||||
BuildPacket(caster);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,33 @@ struct QuaternionData;
|
||||
|
||||
typedef std::unordered_map<Player*, UpdateData> UpdateDataMapType;
|
||||
|
||||
struct CreateObjectBits
|
||||
{
|
||||
bool NoBirthAnim : 1;
|
||||
bool EnablePortals : 1;
|
||||
bool PlayHoverAnim : 1;
|
||||
bool MovementUpdate : 1;
|
||||
bool MovementTransport : 1;
|
||||
bool Stationary : 1;
|
||||
bool CombatVictim : 1;
|
||||
bool ServerTime : 1;
|
||||
bool Vehicle : 1;
|
||||
bool AnimKit : 1;
|
||||
bool Rotation : 1;
|
||||
bool AreaTrigger : 1;
|
||||
bool GameObject : 1;
|
||||
bool SmoothPhasing : 1;
|
||||
bool ThisIsYou : 1;
|
||||
bool SceneObject : 1;
|
||||
bool ActivePlayer : 1;
|
||||
bool Conversation : 1;
|
||||
|
||||
void Clear()
|
||||
{
|
||||
memset(this, 0, sizeof(CreateObjectBits));
|
||||
}
|
||||
};
|
||||
|
||||
namespace UpdateMask
|
||||
{
|
||||
typedef uint32 BlockType;
|
||||
@@ -299,14 +326,14 @@ class TC_GAME_API Object
|
||||
uint32 GetUpdateFieldData(Player const* target, uint32*& flags) const;
|
||||
uint32 GetDynamicUpdateFieldData(Player const* target, uint32*& flags) const;
|
||||
|
||||
void BuildMovementUpdate(ByteBuffer* data, uint32 flags) const;
|
||||
void BuildMovementUpdate(ByteBuffer* data, CreateObjectBits flags) const;
|
||||
virtual void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const;
|
||||
virtual void BuildDynamicValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const;
|
||||
|
||||
uint16 m_objectType;
|
||||
|
||||
TypeID m_objectTypeId;
|
||||
uint32 m_updateFlag;
|
||||
CreateObjectBits m_updateFlag;
|
||||
|
||||
union
|
||||
{
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace
|
||||
SET_GUID_NAME(CommerceObj);
|
||||
SET_GUID_NAME(ClientSession);
|
||||
SET_GUID_NAME(Cast);
|
||||
SET_GUID_NAME(ClientConnection);
|
||||
|
||||
#undef SET_GUID_NAME
|
||||
}
|
||||
|
||||
@@ -30,35 +30,41 @@
|
||||
|
||||
enum TypeID
|
||||
{
|
||||
TYPEID_OBJECT = 0,
|
||||
TYPEID_ITEM = 1,
|
||||
TYPEID_CONTAINER = 2,
|
||||
TYPEID_UNIT = 3,
|
||||
TYPEID_PLAYER = 4,
|
||||
TYPEID_GAMEOBJECT = 5,
|
||||
TYPEID_DYNAMICOBJECT = 6,
|
||||
TYPEID_CORPSE = 7,
|
||||
TYPEID_AREATRIGGER = 8,
|
||||
TYPEID_SCENEOBJECT = 9,
|
||||
TYPEID_CONVERSATION = 10
|
||||
TYPEID_OBJECT = 0,
|
||||
TYPEID_ITEM = 1,
|
||||
TYPEID_CONTAINER = 2,
|
||||
TYPEID_AZERITE_EMPOWERED_ITEM = 3,
|
||||
TYPEID_AZERITE_ITEM = 4,
|
||||
TYPEID_UNIT = 5,
|
||||
TYPEID_PLAYER = 6,
|
||||
TYPEID_ACTIVE_PLAYER = 7,
|
||||
TYPEID_GAMEOBJECT = 8,
|
||||
TYPEID_DYNAMICOBJECT = 9,
|
||||
TYPEID_CORPSE = 10,
|
||||
TYPEID_AREATRIGGER = 11,
|
||||
TYPEID_SCENEOBJECT = 12,
|
||||
TYPEID_CONVERSATION = 13
|
||||
};
|
||||
|
||||
#define NUM_CLIENT_OBJECT_TYPES 11
|
||||
#define NUM_CLIENT_OBJECT_TYPES 14
|
||||
|
||||
enum TypeMask
|
||||
{
|
||||
TYPEMASK_OBJECT = 0x0001,
|
||||
TYPEMASK_ITEM = 0x0002,
|
||||
TYPEMASK_CONTAINER = 0x0004,
|
||||
TYPEMASK_UNIT = 0x0008,
|
||||
TYPEMASK_PLAYER = 0x0010,
|
||||
TYPEMASK_GAMEOBJECT = 0x0020,
|
||||
TYPEMASK_DYNAMICOBJECT = 0x0040,
|
||||
TYPEMASK_CORPSE = 0x0080,
|
||||
TYPEMASK_AREATRIGGER = 0x0100,
|
||||
TYPEMASK_SCENEOBJECT = 0x0200,
|
||||
TYPEMASK_CONVERSATION = 0x0400,
|
||||
TYPEMASK_SEER = TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
|
||||
TYPEMASK_OBJECT = 0x0001,
|
||||
TYPEMASK_ITEM = 0x0002,
|
||||
TYPEMASK_CONTAINER = 0x0004,
|
||||
TYPEMASK_AZERITE_EMPOWERED_ITEM = 0x0008,
|
||||
TYPEMASK_AZERITE_ITEM = 0x0010,
|
||||
TYPEMASK_UNIT = 0x0020,
|
||||
TYPEMASK_PLAYER = 0x0040,
|
||||
TYPEMASK_ACTIVE_PLAYER = 0x0080,
|
||||
TYPEMASK_GAMEOBJECT = 0x0100,
|
||||
TYPEMASK_DYNAMICOBJECT = 0x0200,
|
||||
TYPEMASK_CORPSE = 0x0400,
|
||||
TYPEMASK_AREATRIGGER = 0x0800,
|
||||
TYPEMASK_SCENEOBJECT = 0x1000,
|
||||
TYPEMASK_CONVERSATION = 0x2000,
|
||||
TYPEMASK_SEER = TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT
|
||||
};
|
||||
|
||||
enum class HighGuid
|
||||
@@ -111,6 +117,7 @@ enum class HighGuid
|
||||
CommerceObj = 45,
|
||||
ClientSession = 46,
|
||||
Cast = 47,
|
||||
ClientConnection = 48,
|
||||
|
||||
Count,
|
||||
};
|
||||
@@ -349,6 +356,7 @@ class TC_GAME_API ObjectGuidGeneratorBase
|
||||
{
|
||||
public:
|
||||
ObjectGuidGeneratorBase(ObjectGuid::LowType start = UI64LIT(1)) : _nextGuid(start) { }
|
||||
virtual ~ObjectGuidGeneratorBase() { }
|
||||
|
||||
virtual void Set(uint64 val) { _nextGuid = val; }
|
||||
virtual ObjectGuid::LowType Generate() = 0;
|
||||
|
||||
@@ -34,29 +34,6 @@ enum OBJECT_UPDATE_TYPE
|
||||
UPDATETYPE_OUT_OF_RANGE_OBJECTS = 3,
|
||||
};
|
||||
|
||||
enum OBJECT_UPDATE_FLAGS
|
||||
{
|
||||
UPDATEFLAG_NONE = 0x0000,
|
||||
UPDATEFLAG_SELF = 0x0001,
|
||||
UPDATEFLAG_TRANSPORT = 0x0002,
|
||||
UPDATEFLAG_HAS_TARGET = 0x0004,
|
||||
UPDATEFLAG_LIVING = 0x0008,
|
||||
UPDATEFLAG_STATIONARY_POSITION = 0x0010,
|
||||
UPDATEFLAG_VEHICLE = 0x0020,
|
||||
UPDATEFLAG_TRANSPORT_POSITION = 0x0040,
|
||||
UPDATEFLAG_ROTATION = 0x0080,
|
||||
UPDATEFLAG_ANIMKITS = 0x0100,
|
||||
UPDATEFLAG_AREATRIGGER = 0x0200,
|
||||
UPDATEFLAG_GAMEOBJECT = 0x0400,
|
||||
//UPDATEFLAG_REPLACE_ACTIVE = 0x0800,
|
||||
//UPDATEFLAG_NO_BIRTH_ANIM = 0x1000,
|
||||
//UPDATEFLAG_ENABLE_PORTALS = 0x2000,
|
||||
//UPDATEFLAG_PLAY_HOVER_ANIM = 0x4000,
|
||||
//UPDATEFLAG_IS_SUPPRESSING_GREETINGS = 0x8000
|
||||
//UPDATEFLAG_SCENEOBJECT = 0x10000,
|
||||
//UPDATEFLAG_SCENE_PENDING_INSTANCE = 0x20000
|
||||
};
|
||||
|
||||
class UpdateData
|
||||
{
|
||||
public:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,10 +37,12 @@ enum UpdatefieldFlags
|
||||
UF_FLAG_URGENT_SELF_ONLY = 0x400
|
||||
};
|
||||
|
||||
TC_GAME_API extern uint32 ItemUpdateFieldFlags[CONTAINER_END];
|
||||
TC_GAME_API extern uint32 ContainerUpdateFieldFlags[CONTAINER_END];
|
||||
TC_GAME_API extern uint32 AzeriteEmpoweredItemUpdateFieldFlags[AZERITE_EMPOWERED_ITEM_END];
|
||||
TC_GAME_API extern uint32 AzeriteItemUpdateFieldFlags[AZERITE_ITEM_END];
|
||||
TC_GAME_API extern uint32 ItemDynamicUpdateFieldFlags[CONTAINER_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 UnitUpdateFieldFlags[PLAYER_END];
|
||||
TC_GAME_API extern uint32 UnitDynamicUpdateFieldFlags[PLAYER_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 UnitUpdateFieldFlags[ACTIVE_PLAYER_END];
|
||||
TC_GAME_API extern uint32 UnitDynamicUpdateFieldFlags[ACTIVE_PLAYER_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 GameObjectUpdateFieldFlags[GAMEOBJECT_END];
|
||||
TC_GAME_API extern uint32 GameObjectDynamicUpdateFieldFlags[GAMEOBJECT_DYNAMIC_END];
|
||||
TC_GAME_API extern uint32 DynamicObjectUpdateFieldFlags[DYNAMICOBJECT_END];
|
||||
|
||||
@@ -19,17 +19,15 @@
|
||||
#ifndef _UPDATEFIELDS_H
|
||||
#define _UPDATEFIELDS_H
|
||||
|
||||
// Auto generated for version 7, 3, 5, 25928
|
||||
// Auto generated for version 8, 0, 1, 27980
|
||||
|
||||
enum ObjectFields
|
||||
{
|
||||
OBJECT_FIELD_GUID = 0x000, // Size: 4, Flags: PUBLIC
|
||||
OBJECT_FIELD_DATA = 0x004, // Size: 4, Flags: PUBLIC
|
||||
OBJECT_FIELD_TYPE = 0x008, // Size: 1, Flags: PUBLIC
|
||||
OBJECT_FIELD_ENTRY = 0x009, // Size: 1, Flags: DYNAMIC
|
||||
OBJECT_DYNAMIC_FLAGS = 0x00A, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
OBJECT_FIELD_SCALE_X = 0x00B, // Size: 1, Flags: PUBLIC
|
||||
OBJECT_END = 0x00C,
|
||||
OBJECT_FIELD_ENTRY = 0x004, // Size: 1, Flags: DYNAMIC
|
||||
OBJECT_DYNAMIC_FLAGS = 0x005, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
OBJECT_FIELD_SCALE_X = 0x006, // Size: 1, Flags: PUBLIC
|
||||
OBJECT_END = 0x007,
|
||||
};
|
||||
|
||||
enum ObjectDynamicFields
|
||||
@@ -66,8 +64,7 @@ enum ItemDynamicFields
|
||||
ITEM_DYNAMIC_FIELD_BONUSLIST_IDS = OBJECT_DYNAMIC_END + 0x001, // Flags: OWNER, 0x100
|
||||
ITEM_DYNAMIC_FIELD_ARTIFACT_POWERS = OBJECT_DYNAMIC_END + 0x002, // Flags: OWNER
|
||||
ITEM_DYNAMIC_FIELD_GEMS = OBJECT_DYNAMIC_END + 0x003, // Flags: OWNER
|
||||
ITEM_DYNAMIC_FIELD_RELIC_TALENT_DATA = OBJECT_DYNAMIC_END + 0x004, // Flags: OWNER
|
||||
ITEM_DYNAMIC_END = OBJECT_DYNAMIC_END + 0x005,
|
||||
ITEM_DYNAMIC_END = OBJECT_DYNAMIC_END + 0x004,
|
||||
};
|
||||
|
||||
enum ContainerFields
|
||||
@@ -82,6 +79,32 @@ enum ContainerDynamicFields
|
||||
CONTAINER_DYNAMIC_END = ITEM_DYNAMIC_END + 0x000,
|
||||
};
|
||||
|
||||
enum AzeriteEmpoweredItemField
|
||||
{
|
||||
AZERITE_EMPOWERED_ITEM_FIELD_SELECTIONS = ITEM_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
AZERITE_EMPOWERED_ITEM_END = ITEM_END + 0x004,
|
||||
};
|
||||
|
||||
enum AzeriteEmpoweredItemDynamicField
|
||||
{
|
||||
AZERITE_EMPOWERED_ITEM_DYNAMIC_END = ITEM_DYNAMIC_END + 0x000,
|
||||
};
|
||||
|
||||
enum AzeriteItemField
|
||||
{
|
||||
AZERITE_ITEM_FIELD_XP = ITEM_END + 0x000, // Size: 2, Flags: PUBLIC
|
||||
AZERITE_ITEM_FIELD_LEVEL = ITEM_END + 0x002, // Size: 1, Flags: PUBLIC
|
||||
AZERITE_ITEM_FIELD_AURA_LEVEL = ITEM_END + 0x003, // Size: 1, Flags: PUBLIC
|
||||
AZERITE_ITEM_FIELD_KNOWLEDGE_LEVEL = ITEM_END + 0x004, // Size: 1, Flags: OWNER
|
||||
AZERITE_ITEM_FIELD_DEBUG_KNOWLEDGE_WEEK = ITEM_END + 0x005, // Size: 1, Flags: OWNER
|
||||
AZERITE_ITEM_END = ITEM_END + 0x006,
|
||||
};
|
||||
|
||||
enum AzeriteItemDynamicField
|
||||
{
|
||||
AZERITE_ITEM_DYNAMIC_END = ITEM_DYNAMIC_END + 0x000,
|
||||
};
|
||||
|
||||
enum UnitFields
|
||||
{
|
||||
UNIT_FIELD_CHARM = OBJECT_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
@@ -91,98 +114,106 @@ enum UnitFields
|
||||
UNIT_FIELD_SUMMONEDBY = OBJECT_END + 0x010, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_CREATEDBY = OBJECT_END + 0x014, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_DEMON_CREATOR = OBJECT_END + 0x018, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_TARGET = OBJECT_END + 0x01C, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_COMPANION_GUID = OBJECT_END + 0x020, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_DB_ID = OBJECT_END + 0x024, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_CHANNEL_DATA = OBJECT_END + 0x026, // Size: 2, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_SUMMONED_BY_HOME_REALM = OBJECT_END + 0x028, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BYTES_0 = OBJECT_END + 0x029, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAY_POWER = OBJECT_END + 0x02A, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID = OBJECT_END + 0x02B, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_HEALTH = OBJECT_END + 0x02C, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER = OBJECT_END + 0x02E, // Size: 6, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x034, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXPOWER = OBJECT_END + 0x036, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x03C, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x042, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_LEVEL = OBJECT_END + 0x048, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_EFFECTIVE_LEVEL = OBJECT_END + 0x049, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SANDBOX_SCALING_ID = OBJECT_END + 0x04A, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MIN = OBJECT_END + 0x04B, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MAX = OBJECT_END + 0x04C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_DELTA = OBJECT_END + 0x04D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x04E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x04F, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_FLAGS = OBJECT_END + 0x055, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x056, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_3 = OBJECT_END + 0x057, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_AURASTATE = OBJECT_END + 0x058, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x059, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x05B, // Size: 1, Flags: PRIVATE
|
||||
UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x05C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_COMBATREACH = OBJECT_END + 0x05D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAYID = OBJECT_END + 0x05E, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x05F, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x060, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x061, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x062, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x063, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x064, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_BYTES_1 = OBJECT_END + 0x065, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETNUMBER = OBJECT_END + 0x066, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x067, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x068, // Size: 1, Flags: OWNER
|
||||
UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x069, // Size: 1, Flags: OWNER
|
||||
UNIT_MOD_CAST_SPEED = OBJECT_END + 0x06A, // Size: 1, Flags: PUBLIC
|
||||
UNIT_MOD_CAST_HASTE = OBJECT_END + 0x06B, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE = OBJECT_END + 0x06C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_RANGED_HASTE = OBJECT_END + 0x06D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE_REGEN = OBJECT_END + 0x06E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_TIME_RATE = OBJECT_END + 0x06F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_CREATED_BY_SPELL = OBJECT_END + 0x070, // Size: 1, Flags: PUBLIC
|
||||
UNIT_NPC_FLAGS = OBJECT_END + 0x071, // Size: 2, Flags: PUBLIC, DYNAMIC
|
||||
UNIT_NPC_EMOTESTATE = OBJECT_END + 0x073, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STAT = OBJECT_END + 0x074, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POSSTAT = OBJECT_END + 0x078, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_NEGSTAT = OBJECT_END + 0x07C, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RESISTANCES = OBJECT_END + 0x080, // Size: 7, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x087, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x08E, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MOD_BONUS_ARMOR = OBJECT_END + 0x095, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BASE_MANA = OBJECT_END + 0x096, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x097, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BYTES_2 = OBJECT_END + 0x098, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x099, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09A, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x09B, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x09C, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x09D, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09E, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x09F, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0A0, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_SPEED_AURA = OBJECT_END + 0x0A1, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x0A2, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x0A3, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x0A4, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x0AB, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x0B2, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x0B3, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL_CUTOFF = OBJECT_END + 0x0B4, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL = OBJECT_END + 0x0B5, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0B6, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_WILD_BATTLEPET_LEVEL = OBJECT_END + 0x0B7, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLEPET_COMPANION_NAME_TIMESTAMP = OBJECT_END + 0x0B8, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_INTERACT_SPELLID = OBJECT_END + 0x0B9, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x0BA, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_ID = OBJECT_END + 0x0BB, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_KIT_ID = OBJECT_END + 0x0BC, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x0BD, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_SCALE_DURATION = OBJECT_END + 0x0C1, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_MOUNT_ID = OBJECT_END + 0x0C2, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_CREATURE_ID = OBJECT_END + 0x0C3, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_ID = OBJECT_END + 0x0C4, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_TARGET = OBJECT_END + 0x0C5, // Size: 4, Flags: PUBLIC
|
||||
UNIT_END = OBJECT_END + 0x0C9,
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_TARGET = OBJECT_END + 0x01C, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_TARGET = OBJECT_END + 0x020, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_COMPANION_GUID = OBJECT_END + 0x024, // Size: 4, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLE_PET_DB_ID = OBJECT_END + 0x028, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_CHANNEL_DATA = OBJECT_END + 0x02A, // Size: 2, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_SUMMONED_BY_HOME_REALM = OBJECT_END + 0x02C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BYTES_0 = OBJECT_END + 0x02D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAY_POWER = OBJECT_END + 0x02E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_OVERRIDE_DISPLAY_POWER_ID = OBJECT_END + 0x02F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_HEALTH = OBJECT_END + 0x030, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER = OBJECT_END + 0x032, // Size: 6, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x038, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXPOWER = OBJECT_END + 0x03A, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x040, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x046, // Size: 6, Flags: PRIVATE, OWNER, UNIT_ALL
|
||||
UNIT_FIELD_LEVEL = OBJECT_END + 0x04C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_EFFECTIVE_LEVEL = OBJECT_END + 0x04D, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_CONTENT_TUNING_ID = OBJECT_END + 0x04E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MIN = OBJECT_END + 0x04F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_MAX = OBJECT_END + 0x050, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_LEVEL_DELTA = OBJECT_END + 0x051, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_FACTION_GROUP = OBJECT_END + 0x052, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_HEALTH_ITEM_LEVEL_CURVE_ID = OBJECT_END + 0x053, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_SCALING_DAMAGE_ITEM_LEVEL_CURVE_ID = OBJECT_END + 0x054, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x055, // Size: 1, Flags: PUBLIC
|
||||
UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x056, // Size: 6, Flags: PUBLIC
|
||||
UNIT_FIELD_FLAGS = OBJECT_END + 0x05C, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x05D, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_FLAGS_3 = OBJECT_END + 0x05E, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_AURASTATE = OBJECT_END + 0x05F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x060, // Size: 2, Flags: PUBLIC
|
||||
UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x062, // Size: 1, Flags: PRIVATE
|
||||
UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x063, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_COMBATREACH = OBJECT_END + 0x064, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_DISPLAYID = OBJECT_END + 0x065, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_DISPLAY_SCALE = OBJECT_END + 0x066, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x067, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_NATIVE_X_DISPLAY_SCALE = OBJECT_END + 0x068, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x069, // Size: 1, Flags: PUBLIC, URGENT
|
||||
UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x06A, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x06B, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x06C, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x06D, // Size: 1, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_BYTES_1 = OBJECT_END + 0x06E, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETNUMBER = OBJECT_END + 0x06F, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x070, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x071, // Size: 1, Flags: OWNER
|
||||
UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x072, // Size: 1, Flags: OWNER
|
||||
UNIT_MOD_CAST_SPEED = OBJECT_END + 0x073, // Size: 1, Flags: PUBLIC
|
||||
UNIT_MOD_CAST_HASTE = OBJECT_END + 0x074, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE = OBJECT_END + 0x075, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_RANGED_HASTE = OBJECT_END + 0x076, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_HASTE_REGEN = OBJECT_END + 0x077, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MOD_TIME_RATE = OBJECT_END + 0x078, // Size: 1, Flags: PUBLIC
|
||||
UNIT_CREATED_BY_SPELL = OBJECT_END + 0x079, // Size: 1, Flags: PUBLIC
|
||||
UNIT_NPC_FLAGS = OBJECT_END + 0x07A, // Size: 2, Flags: PUBLIC, DYNAMIC
|
||||
UNIT_NPC_EMOTESTATE = OBJECT_END + 0x07C, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STAT = OBJECT_END + 0x07D, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POSSTAT = OBJECT_END + 0x081, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_NEGSTAT = OBJECT_END + 0x085, // Size: 4, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RESISTANCES = OBJECT_END + 0x089, // Size: 7, Flags: PRIVATE, OWNER, SPECIAL_INFO
|
||||
UNIT_FIELD_BONUS_RESISTANCE_MODS = OBJECT_END + 0x090, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BASE_MANA = OBJECT_END + 0x097, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x098, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_BYTES_2 = OBJECT_END + 0x099, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x09A, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09B, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x09C, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x09D, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x09E, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = OBJECT_END + 0x09F, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0A0, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0A1, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAIN_HAND_WEAPON_ATTACK_POWER = OBJECT_END + 0x0A2, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_OFF_HAND_WEAPON_ATTACK_POWER = OBJECT_END + 0x0A3, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_RANGED_HAND_WEAPON_ATTACK_POWER = OBJECT_END + 0x0A4, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_ATTACK_SPEED_AURA = OBJECT_END + 0x0A5, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_LIFESTEAL = OBJECT_END + 0x0A6, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x0A7, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x0A8, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x0A9, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x0B0, // Size: 7, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x0B7, // Size: 1, Flags: PRIVATE, OWNER
|
||||
UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x0B8, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL_CUTOFF = OBJECT_END + 0x0B9, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MIN_ITEM_LEVEL = OBJECT_END + 0x0BA, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0BB, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_WILD_BATTLEPET_LEVEL = OBJECT_END + 0x0BC, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_BATTLEPET_COMPANION_NAME_TIMESTAMP = OBJECT_END + 0x0BD, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_INTERACT_SPELLID = OBJECT_END + 0x0BE, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x0BF, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_ID = OBJECT_END + 0x0C0, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_ANIM_KIT_ID = OBJECT_END + 0x0C1, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x0C2, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
UNIT_FIELD_SCALE_DURATION = OBJECT_END + 0x0C6, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_MOUNT_ID = OBJECT_END + 0x0C7, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOKS_LIKE_CREATURE_ID = OBJECT_END + 0x0C8, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_LOOK_AT_CONTROLLER_ID = OBJECT_END + 0x0C9, // Size: 1, Flags: PUBLIC
|
||||
UNIT_FIELD_GUILD_GUID = OBJECT_END + 0x0CA, // Size: 4, Flags: PUBLIC
|
||||
UNIT_END = OBJECT_END + 0x0CE,
|
||||
};
|
||||
|
||||
enum UnitDynamicFields
|
||||
@@ -209,141 +240,152 @@ enum PlayerFields
|
||||
PLAYER_BYTES_4 = UNIT_END + 0x014, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_DUEL_TEAM = UNIT_END + 0x015, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_GUILD_TIMESTAMP = UNIT_END + 0x016, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_QUEST_LOG = UNIT_END + 0x017, // Size: 800, Flags: PARTY_MEMBER
|
||||
PLAYER_VISIBLE_ITEM = UNIT_END + 0x337, // Size: 38, Flags: PUBLIC
|
||||
PLAYER_CHOSEN_TITLE = UNIT_END + 0x35D, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FAKE_INEBRIATION = UNIT_END + 0x35E, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_VIRTUAL_PLAYER_REALM = UNIT_END + 0x35F, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_SPEC_ID = UNIT_END + 0x360, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_TAXI_MOUNT_ANIM_KIT_ID = UNIT_END + 0x361, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_AVG_ITEM_LEVEL = UNIT_END + 0x362, // Size: 4, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_BATTLE_PET_BREED_QUALITY = UNIT_END + 0x366, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_PRESTIGE = UNIT_END + 0x367, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_HONOR_LEVEL = UNIT_END + 0x368, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x369, // Size: 780, Flags: PRIVATE
|
||||
PLAYER_FIELD_END_NOT_SELF = UNIT_END + 0x369,
|
||||
PLAYER_FARSIGHT = UNIT_END + 0x675, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_FIELD_SUMMONED_BATTLE_PET_ID = UNIT_END + 0x679, // Size: 4, Flags: PRIVATE
|
||||
PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x67D, // Size: 12, Flags: PRIVATE
|
||||
PLAYER_FIELD_COINAGE = UNIT_END + 0x689, // Size: 2, Flags: PRIVATE
|
||||
PLAYER_XP = UNIT_END + 0x68B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x68C, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_TRIAL_XP = UNIT_END + 0x68D, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SKILL_LINEID = UNIT_END + 0x68E, // Size: 448, Flags: PRIVATE
|
||||
PLAYER_CHARACTER_POINTS = UNIT_END + 0x84E, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MAX_TALENT_TIERS = UNIT_END + 0x84F, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_TRACK_CREATURES = UNIT_END + 0x850, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_TRACK_RESOURCES = UNIT_END + 0x851, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_EXPERTISE = UNIT_END + 0x852, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x853, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_RANGED_EXPERTISE = UNIT_END + 0x854, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_COMBAT_RATING_EXPERTISE = UNIT_END + 0x855, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x856, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x857, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_DODGE_PERCENTAGE_FROM_ATTRIBUTE = UNIT_END + 0x858, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x859, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_PARRY_PERCENTAGE_FROM_ATTRIBUTE = UNIT_END + 0x85A, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x85B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x85C, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x85D, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x85E, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SHIELD_BLOCK = UNIT_END + 0x85F, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x860, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_MASTERY = UNIT_END + 0x861, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_SPEED = UNIT_END + 0x862, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_LIFESTEAL = UNIT_END + 0x863, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_AVOIDANCE = UNIT_END + 0x864, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_STURDINESS = UNIT_END + 0x865, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_VERSATILITY = UNIT_END + 0x866, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_VERSATILITY_BONUS = UNIT_END + 0x867, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_PVP_POWER_DAMAGE = UNIT_END + 0x868, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_PVP_POWER_HEALING = UNIT_END + 0x869, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x86A, // Size: 320, Flags: PRIVATE
|
||||
PLAYER_FIELD_REST_INFO = UNIT_END + 0x9AA, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x9AE, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x9B5, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x9BC, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x9C3, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x9C4, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x9C5, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_PERIODIC_HEALING_DONE_PERCENT = UNIT_END + 0x9C6, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS = UNIT_END + 0x9C7, // Size: 3, Flags: PRIVATE
|
||||
PLAYER_FIELD_WEAPON_ATK_SPEED_MULTIPLIERS = UNIT_END + 0x9CA, // Size: 3, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_SPELL_POWER_PCT = UNIT_END + 0x9CD, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_RESILIENCE_PERCENT = UNIT_END + 0x9CE, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT = UNIT_END + 0x9CF, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT = UNIT_END + 0x9D0, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x9D1, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x9D2, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_LOCAL_FLAGS = UNIT_END + 0x9D3, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BYTES = UNIT_END + 0x9D4, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x9D5, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x9D6, // Size: 12, Flags: PRIVATE
|
||||
PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x9E2, // Size: 12, Flags: PRIVATE
|
||||
PLAYER_FIELD_KILLS = UNIT_END + 0x9EE, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = UNIT_END + 0x9EF, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x9F0, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x9F1, // Size: 32, Flags: PRIVATE
|
||||
PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0xA11, // Size: 42, Flags: PRIVATE
|
||||
PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0xA3B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA = UNIT_END + 0xA3C, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MAX_CREATURE_SCALING_LEVEL = UNIT_END + 0xA3D, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0xA3E, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_PET_SPELL_POWER = UNIT_END + 0xA42, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_RESEARCHING_1 = UNIT_END + 0xA43, // Size: 10, Flags: PRIVATE
|
||||
PLAYER_PROFESSION_SKILL_LINE_1 = UNIT_END + 0xA4D, // Size: 2, Flags: PRIVATE
|
||||
PLAYER_FIELD_UI_HIT_MODIFIER = UNIT_END + 0xA4F, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = UNIT_END + 0xA50, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_HOME_REALM_TIME_OFFSET = UNIT_END + 0xA51, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_MOD_PET_HASTE = UNIT_END + 0xA52, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BYTES2 = UNIT_END + 0xA53, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_BYTES3 = UNIT_END + 0xA54, // Size: 1, Flags: PRIVATE, URGENT_SELF_ONLY
|
||||
PLAYER_FIELD_LFG_BONUS_FACTION_ID = UNIT_END + 0xA55, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_LOOT_SPEC_ID = UNIT_END + 0xA56, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_OVERRIDE_ZONE_PVP_TYPE = UNIT_END + 0xA57, // Size: 1, Flags: PRIVATE, URGENT_SELF_ONLY
|
||||
PLAYER_FIELD_BAG_SLOT_FLAGS = UNIT_END + 0xA58, // Size: 4, Flags: PRIVATE
|
||||
PLAYER_FIELD_BANK_BAG_SLOT_FLAGS = UNIT_END + 0xA5C, // Size: 7, Flags: PRIVATE
|
||||
PLAYER_FIELD_INSERT_ITEMS_LEFT_TO_RIGHT = UNIT_END + 0xA63, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_QUEST_COMPLETED = UNIT_END + 0xA64, // Size: 1750, Flags: PRIVATE
|
||||
PLAYER_FIELD_HONOR = UNIT_END + 0x113A, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_FIELD_HONOR_NEXT_LEVEL = UNIT_END + 0x113B, // Size: 1, Flags: PRIVATE
|
||||
PLAYER_END = UNIT_END + 0x113C,
|
||||
PLAYER_QUEST_LOG = UNIT_END + 0x017, // Size: 1600, Flags: PARTY_MEMBER
|
||||
PLAYER_VISIBLE_ITEM = UNIT_END + 0x657, // Size: 38, Flags: PUBLIC
|
||||
PLAYER_CHOSEN_TITLE = UNIT_END + 0x67D, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FAKE_INEBRIATION = UNIT_END + 0x67E, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_VIRTUAL_PLAYER_REALM = UNIT_END + 0x67F, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_SPEC_ID = UNIT_END + 0x680, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_TAXI_MOUNT_ANIM_KIT_ID = UNIT_END + 0x681, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_AVG_ITEM_LEVEL = UNIT_END + 0x682, // Size: 4, Flags: PUBLIC
|
||||
PLAYER_FIELD_CURRENT_BATTLE_PET_BREED_QUALITY = UNIT_END + 0x686, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_FIELD_HONOR_LEVEL = UNIT_END + 0x687, // Size: 1, Flags: PUBLIC
|
||||
PLAYER_END = UNIT_END + 0x688,
|
||||
};
|
||||
|
||||
enum PlayerDynamicFields
|
||||
{
|
||||
PLAYER_DYNAMIC_FIELD_RESERACH_SITE = UNIT_DYNAMIC_END + 0x000, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_RESEARCH_SITE_PROGRESS = UNIT_DYNAMIC_END + 0x001, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_DAILY_QUESTS = UNIT_DYNAMIC_END + 0x002, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_AVAILABLE_QUEST_LINE_X_QUEST_ID = UNIT_DYNAMIC_END + 0x003, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_HEIRLOOMS = UNIT_DYNAMIC_END + 0x004, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS = UNIT_DYNAMIC_END + 0x005, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_TOYS = UNIT_DYNAMIC_END + 0x006, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_TRANSMOG = UNIT_DYNAMIC_END + 0x007, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG = UNIT_DYNAMIC_END + 0x008, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS = UNIT_DYNAMIC_END + 0x009, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_CHARACTER_RESTRICTIONS = UNIT_DYNAMIC_END + 0x00A, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_SPELL_PCT_MOD_BY_LABEL = UNIT_DYNAMIC_END + 0x00B, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_SPELL_FLAT_MOD_BY_LABEL = UNIT_DYNAMIC_END + 0x00C, // Flags: PRIVATE
|
||||
PLAYER_DYNAMIC_FIELD_ARENA_COOLDOWNS = UNIT_DYNAMIC_END + 0x00D, // Flags: PUBLIC
|
||||
PLAYER_DYNAMIC_END = UNIT_DYNAMIC_END + 0x00E,
|
||||
PLAYER_DYNAMIC_FIELD_ARENA_COOLDOWNS = UNIT_DYNAMIC_END + 0x000, // Flags: PUBLIC
|
||||
PLAYER_DYNAMIC_END = UNIT_DYNAMIC_END + 0x001,
|
||||
};
|
||||
|
||||
enum ActivePlayerField
|
||||
{
|
||||
ACTIVE_PLAYER_FIELD_INV_SLOT_HEAD = PLAYER_END + 0x000, // Size: 780, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_FARSIGHT = PLAYER_END + 0x30C, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID = PLAYER_END + 0x310, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_KNOWN_TITLES = PLAYER_END + 0x314, // Size: 12, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_COINAGE = PLAYER_END + 0x320, // Size: 2, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_XP = PLAYER_END + 0x322, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_NEXT_LEVEL_XP = PLAYER_END + 0x323, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_TRIAL_XP = PLAYER_END + 0x324, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SKILL_LINEID = PLAYER_END + 0x325, // Size: 896, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_CHARACTER_POINTS = PLAYER_END + 0x6A5, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MAX_TALENT_TIERS = PLAYER_END + 0x6A6, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_TRACK_CREATURES = PLAYER_END + 0x6A7, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_TRACK_RESOURCES = PLAYER_END + 0x6A8, // Size: 2, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_EXPERTISE = PLAYER_END + 0x6AA, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OFFHAND_EXPERTISE = PLAYER_END + 0x6AB, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_RANGED_EXPERTISE = PLAYER_END + 0x6AC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_COMBAT_RATING_EXPERTISE = PLAYER_END + 0x6AD, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BLOCK_PERCENTAGE = PLAYER_END + 0x6AE, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE = PLAYER_END + 0x6AF, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE_FROM_ATTRIBUTE = PLAYER_END + 0x6B0, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE = PLAYER_END + 0x6B1, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE_FROM_ATTRIBUTE = PLAYER_END + 0x6B2, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_CRIT_PERCENTAGE = PLAYER_END + 0x6B3, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_RANGED_CRIT_PERCENTAGE = PLAYER_END + 0x6B4, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE = PLAYER_END + 0x6B5, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SPELL_CRIT_PERCENTAGE1 = PLAYER_END + 0x6B6, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SHIELD_BLOCK = PLAYER_END + 0x6B7, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SHIELD_BLOCK_CRIT_PERCENTAGE = PLAYER_END + 0x6B8, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MASTERY = PLAYER_END + 0x6B9, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SPEED = PLAYER_END + 0x6BA, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_AVOIDANCE = PLAYER_END + 0x6BB, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_STURDINESS = PLAYER_END + 0x6BC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_VERSATILITY = PLAYER_END + 0x6BD, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_VERSATILITY_BONUS = PLAYER_END + 0x6BE, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_POWER_DAMAGE = PLAYER_END + 0x6BF, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_POWER_HEALING = PLAYER_END + 0x6C0, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_EXPLORED_ZONES = PLAYER_END + 0x6C1, // Size: 320, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_REST_INFO = PLAYER_END + 0x801, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS = PLAYER_END + 0x805, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = PLAYER_END + 0x80C, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = PLAYER_END + 0x813, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS = PLAYER_END + 0x81A, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_HEALING_PCT = PLAYER_END + 0x81B, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_PCT = PLAYER_END + 0x81C, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_PERIODIC_HEALING_DONE_PERCENT = PLAYER_END + 0x81D, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS = PLAYER_END + 0x81E, // Size: 3, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_WEAPON_ATK_SPEED_MULTIPLIERS = PLAYER_END + 0x821, // Size: 3, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_SPELL_POWER_PCT = PLAYER_END + 0x824, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_RESILIENCE_PERCENT = PLAYER_END + 0x825, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT = PLAYER_END + 0x826, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT = PLAYER_END + 0x827, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_TARGET_RESISTANCE = PLAYER_END + 0x828, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = PLAYER_END + 0x829, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_LOCAL_FLAGS = PLAYER_END + 0x82A, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BYTES = PLAYER_END + 0x82B, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_MEDALS = PLAYER_END + 0x82C, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BUYBACK_PRICE = PLAYER_END + 0x82D, // Size: 12, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BUYBACK_TIMESTAMP = PLAYER_END + 0x839, // Size: 12, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_KILLS = PLAYER_END + 0x845, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = PLAYER_END + 0x846, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_WATCHED_FACTION_INDEX = PLAYER_END + 0x847, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_COMBAT_RATING = PLAYER_END + 0x848, // Size: 32, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_ARENA_TEAM_INFO = PLAYER_END + 0x868, // Size: 54, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MAX_LEVEL = PLAYER_END + 0x89E, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_SCALING_PLAYER_LEVEL_DELTA = PLAYER_END + 0x89F, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MAX_CREATURE_SCALING_LEVEL = PLAYER_END + 0x8A0, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_NO_REAGENT_COST = PLAYER_END + 0x8A1, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PET_SPELL_POWER = PLAYER_END + 0x8A5, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PROFESSION_SKILL_LINE = PLAYER_END + 0x8A6, // Size: 2, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_UI_HIT_MODIFIER = PLAYER_END + 0x8A8, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = PLAYER_END + 0x8A9, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_HOME_REALM_TIME_OFFSET = PLAYER_END + 0x8AA, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_MOD_PET_HASTE = PLAYER_END + 0x8AB, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BYTES2 = PLAYER_END + 0x8AC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BYTES3 = PLAYER_END + 0x8AD, // Size: 1, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
ACTIVE_PLAYER_FIELD_LFG_BONUS_FACTION_ID = PLAYER_END + 0x8AE, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID = PLAYER_END + 0x8AF, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_OVERRIDE_ZONE_PVP_TYPE = PLAYER_END + 0x8B0, // Size: 1, Flags: PUBLIC, URGENT_SELF_ONLY
|
||||
ACTIVE_PLAYER_FIELD_BAG_SLOT_FLAGS = PLAYER_END + 0x8B1, // Size: 4, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_BANK_BAG_SLOT_FLAGS = PLAYER_END + 0x8B5, // Size: 7, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_INSERT_ITEMS_LEFT_TO_RIGHT = PLAYER_END + 0x8BC, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_QUEST_COMPLETED = PLAYER_END + 0x8BD, // Size: 1750, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_HONOR = PLAYER_END + 0xF93, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_HONOR_NEXT_LEVEL = PLAYER_END + 0xF94, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_TIER_MAX_FROM_WINS = PLAYER_END + 0xF95, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_FIELD_PVP_LAST_WEEKS_TIER_MAX_FROM_WINS = PLAYER_END + 0xF96, // Size: 1, Flags: PUBLIC
|
||||
ACTIVE_PLAYER_END = PLAYER_END + 0xF97,
|
||||
};
|
||||
|
||||
enum ActivePlayerDynamicField
|
||||
{
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_RESERACH_SITE = PLAYER_DYNAMIC_END + 0x000, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_RESEARCH_SITE_PROGRESS = PLAYER_DYNAMIC_END + 0x001, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_DAILY_QUESTS = PLAYER_DYNAMIC_END + 0x002, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_AVAILABLE_QUEST_LINE_X_QUEST_ID = PLAYER_DYNAMIC_END + 0x003, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS = PLAYER_DYNAMIC_END + 0x005, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS = PLAYER_DYNAMIC_END + 0x006, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_TOYS = PLAYER_DYNAMIC_END + 0x007, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG = PLAYER_DYNAMIC_END + 0x008, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG = PLAYER_DYNAMIC_END + 0x009, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS = PLAYER_DYNAMIC_END + 0x00A, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_CHARACTER_RESTRICTIONS = PLAYER_DYNAMIC_END + 0x00B, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_SPELL_PCT_MOD_BY_LABEL = PLAYER_DYNAMIC_END + 0x00C, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_SPELL_FLAT_MOD_BY_LABEL = PLAYER_DYNAMIC_END + 0x00D, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_FIELD_RESERACH = PLAYER_DYNAMIC_END + 0x00E, // Flags: PUBLIC
|
||||
ACTIVE_PLAYER_DYNAMIC_END = PLAYER_DYNAMIC_END + 0x00F,
|
||||
};
|
||||
|
||||
enum GameObjectFields
|
||||
{
|
||||
GAMEOBJECT_FIELD_CREATED_BY = OBJECT_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_DISPLAYID = OBJECT_END + 0x004, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_FLAGS = OBJECT_END + 0x005, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x006, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_FACTION = OBJECT_END + 0x00A, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_LEVEL = OBJECT_END + 0x00B, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_BYTES_1 = OBJECT_END + 0x00C, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_SPELL_VISUAL_ID = OBJECT_END + 0x00D, // Size: 1, Flags: PUBLIC, DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x00E, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_ID = OBJECT_END + 0x00F, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_KIT_ID = OBJECT_END + 0x010, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x011, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_END = OBJECT_END + 0x015,
|
||||
GAMEOBJECT_FIELD_GUILD_GUID = OBJECT_END + 0x004, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_DISPLAYID = OBJECT_END + 0x008, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_FLAGS = OBJECT_END + 0x009, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x00A, // Size: 4, Flags: PUBLIC
|
||||
GAMEOBJECT_FACTION = OBJECT_END + 0x00E, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_LEVEL = OBJECT_END + 0x00F, // Size: 1, Flags: PUBLIC
|
||||
GAMEOBJECT_BYTES_1 = OBJECT_END + 0x010, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_SPELL_VISUAL_ID = OBJECT_END + 0x011, // Size: 1, Flags: PUBLIC, DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_SPELL_VISUAL_ID = OBJECT_END + 0x012, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_ID = OBJECT_END + 0x013, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_ANIM_KIT_ID = OBJECT_END + 0x014, // Size: 1, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_STATE_WORLD_EFFECT_ID = OBJECT_END + 0x015, // Size: 4, Flags: DYNAMIC, URGENT
|
||||
GAMEOBJECT_FIELD_CUSTOM_PARAM = OBJECT_END + 0x019, // Size: 1, Flags: PUBLIC, URGENT
|
||||
GAMEOBJECT_END = OBJECT_END + 0x01A,
|
||||
};
|
||||
|
||||
enum GameObjectDynamicFields
|
||||
@@ -372,15 +414,16 @@ enum CorpseFields
|
||||
{
|
||||
CORPSE_FIELD_OWNER = OBJECT_END + 0x000, // Size: 4, Flags: PUBLIC
|
||||
CORPSE_FIELD_PARTY = OBJECT_END + 0x004, // Size: 4, Flags: PUBLIC
|
||||
CORPSE_FIELD_DISPLAY_ID = OBJECT_END + 0x008, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_ITEM = OBJECT_END + 0x009, // Size: 19, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_1 = OBJECT_END + 0x01C, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_2 = OBJECT_END + 0x01D, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_FLAGS = OBJECT_END + 0x01E, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x01F, // Size: 1, Flags: DYNAMIC
|
||||
CORPSE_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x020, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_CUSTOM_DISPLAY_OPTION = OBJECT_END + 0x021, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_END = OBJECT_END + 0x022,
|
||||
CORPSE_FIELD_GUILD_GUID = OBJECT_END + 0x008, // Size: 4, Flags: PUBLIC
|
||||
CORPSE_FIELD_DISPLAY_ID = OBJECT_END + 0x00C, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_ITEM = OBJECT_END + 0x00D, // Size: 19, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_1 = OBJECT_END + 0x020, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_BYTES_2 = OBJECT_END + 0x021, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_FLAGS = OBJECT_END + 0x022, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x023, // Size: 1, Flags: DYNAMIC
|
||||
CORPSE_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x024, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_FIELD_CUSTOM_DISPLAY_OPTION = OBJECT_END + 0x025, // Size: 1, Flags: PUBLIC
|
||||
CORPSE_END = OBJECT_END + 0x026,
|
||||
};
|
||||
|
||||
enum CorpseDynamicFields
|
||||
|
||||
@@ -891,7 +891,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetPowerType(POWER_ENERGY);
|
||||
else if (IsPetImp() || IsPetFelhunter() || IsPetVoidwalker() || IsPetSuccubus() || IsPetDoomguard() || IsPetFelguard()) // Warlock pets have energy (since 5.x)
|
||||
SetPowerType(POWER_ENERGY);
|
||||
else
|
||||
else
|
||||
SetPowerType(POWER_MANA);
|
||||
|
||||
// Damage
|
||||
@@ -901,8 +901,8 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
case SUMMON_PET:
|
||||
{
|
||||
// the damage bonus used for pets is either fire or shadow damage, whatever is higher
|
||||
int32 fire = GetOwner()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = GetOwner()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW);
|
||||
int32 fire = GetOwner()->GetUInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = GetOwner()->GetUInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW);
|
||||
int32 val = (fire > shadow) ? fire : shadow;
|
||||
if (val < 0)
|
||||
val = 0;
|
||||
@@ -1780,9 +1780,9 @@ Player* Pet::GetOwner() const
|
||||
return Minion::GetOwner()->ToPlayer();
|
||||
}
|
||||
|
||||
void Pet::SetDisplayId(uint32 modelId)
|
||||
void Pet::SetDisplayId(uint32 modelId, float displayScale /*= 1.f*/)
|
||||
{
|
||||
Guardian::SetDisplayId(modelId);
|
||||
Guardian::SetDisplayId(modelId, displayScale);
|
||||
|
||||
if (!isControlled())
|
||||
return;
|
||||
|
||||
@@ -52,7 +52,7 @@ class TC_GAME_API Pet : public Guardian
|
||||
void AddToWorld() override;
|
||||
void RemoveFromWorld() override;
|
||||
|
||||
void SetDisplayId(uint32 modelId) override;
|
||||
void SetDisplayId(uint32 modelId, float displayScale = 1.f) override;
|
||||
|
||||
PetType getPetType() const { return m_petType; }
|
||||
void setPetType(PetType type) { m_petType = type; }
|
||||
|
||||
@@ -81,14 +81,14 @@ CollectionMgr::~CollectionMgr()
|
||||
void CollectionMgr::LoadToys()
|
||||
{
|
||||
for (auto const& t : _toys)
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TOYS, t.first);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TOYS, t.first);
|
||||
}
|
||||
|
||||
bool CollectionMgr::AddToy(uint32 itemId, bool isFavourite /*= false*/)
|
||||
{
|
||||
if (UpdateAccountToys(itemId, isFavourite))
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TOYS, itemId);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TOYS, itemId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -204,8 +204,8 @@ void CollectionMgr::LoadHeirlooms()
|
||||
{
|
||||
for (auto const& item : _heirlooms)
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOMS, item.first);
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, item.second.flags);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS, item.first);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, item.second.flags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,8 +213,8 @@ void CollectionMgr::AddHeirloom(uint32 itemId, uint32 flags)
|
||||
{
|
||||
if (UpdateAccountHeirlooms(itemId, flags))
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOMS, itemId);
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, flags);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS, itemId);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, flags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,10 +255,10 @@ void CollectionMgr::UpgradeHeirloom(uint32 itemId, int32 castItem)
|
||||
item->AddBonuses(bonusId);
|
||||
|
||||
// Get heirloom offset to update only one part of dynamic field
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
uint16 offset = uint16(std::find(fields.begin(), fields.end(), itemId) - fields.begin());
|
||||
|
||||
player->SetDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, flags);
|
||||
player->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, flags);
|
||||
itr->second.flags = flags;
|
||||
itr->second.bonusId = bonusId;
|
||||
}
|
||||
@@ -295,11 +295,11 @@ void CollectionMgr::CheckHeirloomUpgrades(Item* item)
|
||||
|
||||
if (newItemId)
|
||||
{
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
std::vector<uint32> const& fields = player->GetDynamicValues(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS);
|
||||
uint16 offset = uint16(std::find(fields.begin(), fields.end(), itr->first) - fields.begin());
|
||||
|
||||
player->SetDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOMS, offset, newItemId);
|
||||
player->SetDynamicValue(PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, 0);
|
||||
player->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOMS, offset, newItemId);
|
||||
player->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_HEIRLOOM_FLAGS, offset, 0);
|
||||
|
||||
_heirlooms.erase(itr);
|
||||
_heirlooms[newItemId] = 0;
|
||||
@@ -460,11 +460,11 @@ void CollectionMgr::LoadItemAppearances()
|
||||
{
|
||||
boost::to_block_range(*_appearances, DynamicBitsetBlockOutputIterator([this](uint32 blockValue)
|
||||
{
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, blockValue);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, blockValue);
|
||||
}));
|
||||
|
||||
for (auto itr = _temporaryAppearances.begin(); itr != _temporaryAppearances.end(); ++itr)
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itr->first);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itr->first);
|
||||
}
|
||||
|
||||
void CollectionMgr::LoadAccountItemAppearances(PreparedQueryResult knownAppearances, PreparedQueryResult favoriteAppearances)
|
||||
@@ -738,18 +738,18 @@ void CollectionMgr::AddItemAppearance(ItemModifiedAppearanceEntry const* itemMod
|
||||
_appearances->resize(itemModifiedAppearance->ID + 1);
|
||||
numBlocks = _appearances->num_blocks() - numBlocks;
|
||||
while (numBlocks--)
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, 0);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, 0);
|
||||
}
|
||||
|
||||
_appearances->set(itemModifiedAppearance->ID);
|
||||
uint32 blockIndex = itemModifiedAppearance->ID / 32;
|
||||
uint32 bitIndex = itemModifiedAppearance->ID % 32;
|
||||
uint32 currentMask = _owner->GetPlayer()->GetDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex);
|
||||
_owner->GetPlayer()->SetDynamicValue(PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex, currentMask | (1 << bitIndex));
|
||||
uint32 currentMask = _owner->GetPlayer()->GetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex);
|
||||
_owner->GetPlayer()->SetDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_TRANSMOG, blockIndex, currentMask | (1 << bitIndex));
|
||||
auto temporaryAppearance = _temporaryAppearances.find(itemModifiedAppearance->ID);
|
||||
if (temporaryAppearance != _temporaryAppearances.end())
|
||||
{
|
||||
_owner->GetPlayer()->RemoveDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_owner->GetPlayer()->RemoveDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_temporaryAppearances.erase(temporaryAppearance);
|
||||
}
|
||||
|
||||
@@ -770,7 +770,7 @@ void CollectionMgr::AddTemporaryAppearance(ObjectGuid const& itemGuid, ItemModif
|
||||
{
|
||||
std::unordered_set<ObjectGuid>& itemsWithAppearance = _temporaryAppearances[itemModifiedAppearance->ID];
|
||||
if (itemsWithAppearance.empty())
|
||||
_owner->GetPlayer()->AddDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_owner->GetPlayer()->AddDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
|
||||
itemsWithAppearance.insert(itemGuid);
|
||||
}
|
||||
@@ -788,7 +788,7 @@ void CollectionMgr::RemoveTemporaryAppearance(Item* item)
|
||||
itr->second.erase(item->GetGUID());
|
||||
if (itr->second.empty())
|
||||
{
|
||||
_owner->GetPlayer()->RemoveDynamicValue(PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_owner->GetPlayer()->RemoveDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_CONDITIONAL_TRANSMOG, itemModifiedAppearance->ID);
|
||||
_temporaryAppearances.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -101,16 +101,23 @@ namespace WorldPackets
|
||||
|
||||
typedef std::deque<Mail*> PlayerMails;
|
||||
|
||||
#define PLAYER_MAX_SKILLS 128
|
||||
enum SkillFieldOffset
|
||||
#define PLAYER_MAX_SKILLS 256
|
||||
|
||||
template<typename SkillArrayType>
|
||||
constexpr std::size_t CalculateSkillFieldArraySize()
|
||||
{
|
||||
SKILL_ID_OFFSET = 0,
|
||||
SKILL_STEP_OFFSET = 64,
|
||||
SKILL_RANK_OFFSET = SKILL_STEP_OFFSET + 64,
|
||||
SUBSKILL_START_RANK_OFFSET = SKILL_RANK_OFFSET + 64,
|
||||
SKILL_MAX_RANK_OFFSET = SUBSKILL_START_RANK_OFFSET + 64,
|
||||
SKILL_TEMP_BONUS_OFFSET = SKILL_MAX_RANK_OFFSET + 64,
|
||||
SKILL_PERM_BONUS_OFFSET = SKILL_TEMP_BONUS_OFFSET + 64
|
||||
return PLAYER_MAX_SKILLS / sizeof(uint32) * sizeof(SkillArrayType);
|
||||
}
|
||||
|
||||
enum SkillFieldOffset : uint16
|
||||
{
|
||||
SKILL_ID_OFFSET = 0,
|
||||
SKILL_STEP_OFFSET = SKILL_ID_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_RANK_OFFSET = SKILL_STEP_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SUBSKILL_START_RANK_OFFSET = SKILL_RANK_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_MAX_RANK_OFFSET = SUBSKILL_START_RANK_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_TEMP_BONUS_OFFSET = SKILL_MAX_RANK_OFFSET + CalculateSkillFieldArraySize<uint16>(),
|
||||
SKILL_PERM_BONUS_OFFSET = SKILL_TEMP_BONUS_OFFSET + CalculateSkillFieldArraySize<uint16>()
|
||||
};
|
||||
|
||||
#define PLAYER_EXPLORED_ZONES_SIZE 320
|
||||
@@ -240,6 +247,7 @@ struct PlayerCurrency
|
||||
};
|
||||
|
||||
typedef std::unordered_map<uint32, PlayerSpellState> PlayerTalentMap;
|
||||
typedef std::array<uint32, MAX_PVP_TALENT_SLOTS> PlayerPvpTalentMap;
|
||||
typedef std::unordered_map<uint32, PlayerSpell*> PlayerSpellMap;
|
||||
typedef std::unordered_set<SpellModifier*> SpellModContainer;
|
||||
typedef std::unordered_map<uint32, PlayerCurrency> PlayerCurrenciesMap;
|
||||
@@ -391,7 +399,7 @@ enum PlayerFlags
|
||||
PLAYER_FLAGS_GM = 0x00000008,
|
||||
PLAYER_FLAGS_GHOST = 0x00000010,
|
||||
PLAYER_FLAGS_RESTING = 0x00000020,
|
||||
PLAYER_FLAGS_UNK6 = 0x00000040,
|
||||
PLAYER_FLAGS_VOICE_CHAT = 0x00000040,
|
||||
PLAYER_FLAGS_UNK7 = 0x00000080, // pre-3.0.3 PLAYER_FLAGS_FFA_PVP flag for FFA PVP state
|
||||
PLAYER_FLAGS_CONTESTED_PVP = 0x00000100, // Player has been involved in a PvP combat and will be attacked by contested guards
|
||||
PLAYER_FLAGS_IN_PVP = 0x00000200,
|
||||
@@ -422,7 +430,8 @@ enum PlayerFlags
|
||||
enum PlayerFlagsEx
|
||||
{
|
||||
PLAYER_FLAGS_EX_REAGENT_BANK_UNLOCKED = 0x0001,
|
||||
PLAYER_FLAGS_EX_MERCENARY_MODE = 0x0002
|
||||
PLAYER_FLAGS_EX_MERCENARY_MODE = 0x0002,
|
||||
PLAYER_FLAGS_EX_ARTIFACT_FORGE_CHEAT = 0x0004
|
||||
};
|
||||
|
||||
enum PlayerLocalFlags
|
||||
@@ -1001,10 +1010,6 @@ enum TalentLearnResult
|
||||
TALENT_FAILED_REST_AREA = 8
|
||||
};
|
||||
|
||||
static uint32 const DefaultTalentRowLevels[MAX_TALENT_TIERS] = { 15, 30, 45, 60, 75, 90, 100 };
|
||||
static uint32 const DKTalentRowLevels[MAX_TALENT_TIERS] = { 57, 58, 59, 60, 75, 90, 100 };
|
||||
static uint32 const DHTalentRowLevels[MAX_TALENT_TIERS] = { 99, 100, 102, 104, 106, 108, 110 };
|
||||
|
||||
struct TC_GAME_API SpecializationInfo
|
||||
{
|
||||
SpecializationInfo() : ResetTalentsCost(0), ResetTalentsTime(0), PrimarySpecialization(0), ActiveGroup(0)
|
||||
@@ -1012,7 +1017,7 @@ struct TC_GAME_API SpecializationInfo
|
||||
}
|
||||
|
||||
PlayerTalentMap Talents[MAX_SPECIALIZATIONS];
|
||||
PlayerTalentMap PvpTalents[MAX_SPECIALIZATIONS];
|
||||
PlayerPvpTalentMap PvpTalents[MAX_SPECIALIZATIONS];
|
||||
std::vector<uint32> Glyphs[MAX_SPECIALIZATIONS];
|
||||
uint32 ResetTalentsCost;
|
||||
time_t ResetTalentsTime;
|
||||
@@ -1033,7 +1038,7 @@ struct PlayerDynamicFieldSpellModByLabel
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
uint8 constexpr PLAYER_MAX_HONOR_LEVEL = 50;
|
||||
uint32 constexpr PLAYER_MAX_HONOR_LEVEL = 500;
|
||||
uint8 constexpr PLAYER_LEVEL_MIN_HONOR = 110;
|
||||
uint32 constexpr SPELL_PVP_RULES_ENABLED = 134735;
|
||||
|
||||
@@ -1188,7 +1193,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
static bool IsChildEquipmentPos(uint8 bag, uint8 slot);
|
||||
bool IsValidPos(uint16 pos, bool explicit_pos) const { return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
|
||||
bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos) const;
|
||||
uint8 GetInventorySlotCount() const { return GetByteValue(PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_NUM_BACKPACK_SLOTS); }
|
||||
uint8 GetInventorySlotCount() const { return GetByteValue(ACTIVE_PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_NUM_BACKPACK_SLOTS); }
|
||||
void SetInventorySlotCount(uint8 slots);
|
||||
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_BANK_BAG_SLOTS); }
|
||||
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_BANK_BAG_SLOTS, count); }
|
||||
@@ -1349,13 +1354,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
/*** QUEST SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
int32 GetQuestLevel(Quest const* quest) const
|
||||
{
|
||||
if (!quest)
|
||||
return getLevel();
|
||||
return quest->GetQuestLevel() > 0 ? quest->GetQuestLevel() : std::min<int32>(getLevel(), quest->GetQuestMaxScalingLevel());
|
||||
}
|
||||
|
||||
int32 GetQuestMinLevel(Quest const* quest) const;
|
||||
int32 GetQuestLevel(Quest const* quest) const;
|
||||
void PrepareQuestMenu(ObjectGuid guid);
|
||||
void SendPreparedQuest(WorldObject* source);
|
||||
bool IsActiveQuest(uint32 quest_id) const;
|
||||
@@ -1501,7 +1501,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE; }
|
||||
static bool IsValidClass(uint8 Class) { return ((1 << (Class - 1)) & CLASSMASK_ALL_PLAYABLE) != 0; }
|
||||
static bool IsValidRace(uint8 Race) { return ((1 << (Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0; }
|
||||
static bool IsValidRace(uint8 Race) { return ((UI64LIT(1) << (Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0; }
|
||||
static bool ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> const& customDisplay, bool create = false);
|
||||
|
||||
/*********************************************************/
|
||||
@@ -1530,7 +1530,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void setRegenTimerCount(uint32 time) {m_regenTimerCount = time;}
|
||||
void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;}
|
||||
|
||||
uint64 GetMoney() const { return GetUInt64Value(PLAYER_FIELD_COINAGE); }
|
||||
uint64 GetMoney() const { return GetUInt64Value(ACTIVE_PLAYER_FIELD_COINAGE); }
|
||||
bool ModifyMoney(int64 amount, bool sendError = true);
|
||||
bool HasEnoughMoney(uint64 amount) const { return (GetMoney() >= amount); }
|
||||
bool HasEnoughMoney(int64 amount) const;
|
||||
@@ -1622,8 +1622,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
std::string GetGuildName() const;
|
||||
|
||||
// Loot Spec
|
||||
void SetLootSpecId(uint32 id) { SetUInt32Value(PLAYER_FIELD_LOOT_SPEC_ID, id); }
|
||||
uint32 GetLootSpecId() const { return GetUInt32Value(PLAYER_FIELD_LOOT_SPEC_ID); }
|
||||
void SetLootSpecId(uint32 id) { SetUInt32Value(ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID, id); }
|
||||
uint32 GetLootSpecId() const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_LOOT_SPEC_ID); }
|
||||
|
||||
// Talents
|
||||
uint32 GetTalentResetCost() const { return _specializationInfo.ResetTalentsCost; }
|
||||
@@ -1645,11 +1645,10 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
bool AddTalent(TalentEntry const* talent, uint8 spec, bool learning);
|
||||
bool HasTalent(uint32 spell_id, uint8 spec) const;
|
||||
void RemoveTalent(TalentEntry const* talent);
|
||||
uint32 CalculateTalentsTiers() const;
|
||||
void ResetTalentSpecialization();
|
||||
|
||||
TalentLearnResult LearnPvpTalent(uint32 talentID, int32* spellOnCooldown);
|
||||
bool AddPvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup, bool learning);
|
||||
TalentLearnResult LearnPvpTalent(uint32 talentID, uint8 slot, int32* spellOnCooldown);
|
||||
bool AddPvpTalent(PvpTalentEntry const* talent, uint8 activeTalentGroup, uint8 slot);
|
||||
void RemovePvpTalent(PvpTalentEntry const* talent);
|
||||
void TogglePvpTalents(bool enable);
|
||||
bool HasPvpTalent(uint32 talentID, uint8 activeTalentGroup) const;
|
||||
@@ -1664,14 +1663,14 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
PlayerTalentMap const* GetTalentMap(uint8 spec) const { return &_specializationInfo.Talents[spec]; }
|
||||
PlayerTalentMap* GetTalentMap(uint8 spec) { return &_specializationInfo.Talents[spec]; }
|
||||
PlayerTalentMap const* GetPvpTalentMap(uint8 spec) const { return &_specializationInfo.PvpTalents[spec]; }
|
||||
PlayerTalentMap* GetPvpTalentMap(uint8 spec) { return &_specializationInfo.PvpTalents[spec]; }
|
||||
PlayerPvpTalentMap const& GetPvpTalentMap(uint8 spec) const { return _specializationInfo.PvpTalents[spec]; }
|
||||
PlayerPvpTalentMap& GetPvpTalentMap(uint8 spec) { return _specializationInfo.PvpTalents[spec]; }
|
||||
std::vector<uint32> const& GetGlyphs(uint8 spec) const { return _specializationInfo.Glyphs[spec]; }
|
||||
std::vector<uint32>& GetGlyphs(uint8 spec) { return _specializationInfo.Glyphs[spec]; }
|
||||
ActionButtonList const& GetActionButtons() const { return m_actionButtons; }
|
||||
|
||||
uint32 GetFreePrimaryProfessionPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS); }
|
||||
void SetFreePrimaryProfessions(uint16 profs) { SetUInt32Value(PLAYER_CHARACTER_POINTS, profs); }
|
||||
uint32 GetFreePrimaryProfessionPoints() const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_CHARACTER_POINTS); }
|
||||
void SetFreePrimaryProfessions(uint16 profs) { SetUInt32Value(ACTIVE_PLAYER_FIELD_CHARACTER_POINTS, profs); }
|
||||
void InitPrimaryProfessions();
|
||||
|
||||
PlayerSpellMap const& GetSpellMap() const { return m_spells; }
|
||||
@@ -1756,7 +1755,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void SetGuildLevel(uint32 level) { SetUInt32Value(PLAYER_GUILDLEVEL, level); }
|
||||
uint32 GetGuildLevel() const { return GetUInt32Value(PLAYER_GUILDLEVEL); }
|
||||
void SetGuildIdInvited(ObjectGuid::LowType GuildId) { m_GuildIdInvited = GuildId; }
|
||||
ObjectGuid::LowType GetGuildId() const { return GetUInt64Value(OBJECT_FIELD_DATA); /* return only lower part */ }
|
||||
ObjectGuid::LowType GetGuildId() const { return GetUInt64Value(UNIT_FIELD_GUILD_GUID); /* return only lower part */ }
|
||||
Guild* GetGuild();
|
||||
Guild const* GetGuild() const;
|
||||
static ObjectGuid::LowType GetGuildIdFromDB(ObjectGuid guid);
|
||||
@@ -1769,8 +1768,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value);
|
||||
static uint32 GetArenaTeamIdFromDB(ObjectGuid guid, uint8 slot);
|
||||
static void LeaveAllArenaTeams(ObjectGuid guid);
|
||||
uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
|
||||
uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
||||
uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_ARENA_TEAM_INFO + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); }
|
||||
uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(ACTIVE_PLAYER_FIELD_ARENA_TEAM_INFO + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); }
|
||||
void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; }
|
||||
uint32 GetArenaTeamIdInvited() const { return m_ArenaTeamIdInvited; }
|
||||
uint32 GetRBGPersonalRating() const { return 0; }
|
||||
@@ -1787,9 +1786,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
static Difficulty CheckLoadedLegacyRaidDifficultyID(Difficulty difficulty);
|
||||
void SendRaidGroupOnlyMessage(RaidGroupReason reason, int32 delay) const;
|
||||
|
||||
bool UpdateSkill(uint32 skill_id, uint32 step);
|
||||
bool UpdateSkillPro(uint16 skillId, int32 chance, uint32 step);
|
||||
|
||||
bool UpdateCraftSkill(uint32 spellid);
|
||||
bool UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator = 1);
|
||||
bool UpdateFishingSkill();
|
||||
@@ -1929,6 +1926,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
uint16 GetSkillStep(uint16 skill) const; // 0...6
|
||||
bool HasSkill(uint32 skill) const;
|
||||
void LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue);
|
||||
int32 FindProfessionSlotFor(uint32 skillId) const;
|
||||
|
||||
WorldLocation& GetTeleportDest() { return m_teleport_dest; }
|
||||
bool IsBeingTeleported() const { return mSemaphoreTeleport_Near || mSemaphoreTeleport_Far; }
|
||||
@@ -1985,15 +1983,11 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void RestoreHealthAfterDuel() { SetHealth(healthBeforeDuel); }
|
||||
void RestoreManaAfterDuel() { SetPower(POWER_MANA, manaBeforeDuel); }
|
||||
|
||||
uint32 GetPrestigeLevel() const { return GetUInt32Value(PLAYER_FIELD_PRESTIGE); }
|
||||
uint32 GetHonorLevel() const { return GetUInt32Value(PLAYER_FIELD_HONOR_LEVEL); }
|
||||
void AddHonorXP(uint32 xp);
|
||||
void SetHonorLevel(uint8 honorLevel);
|
||||
void Prestige();
|
||||
bool CanPrestige() const;
|
||||
bool IsMaxPrestige() const;
|
||||
bool IsMaxHonorLevelAndPrestige() const { return IsMaxPrestige() && GetHonorLevel() == PLAYER_MAX_HONOR_LEVEL; }
|
||||
// Updates PLAYER_FIELD_HONOR_NEXT_LEVEL based on PLAYER_FIELD_HONOR_LEVEL and the smallest value of PLAYER_FIELD_PRESTIGE and (PRESTIGE_COLUMN_COUNT - 1)
|
||||
bool IsMaxHonorLevel() const { return GetHonorLevel() == PLAYER_MAX_HONOR_LEVEL; }
|
||||
// Updates PLAYER_FIELD_HONOR_NEXT_LEVEL based on PLAYER_FIELD_HONOR_LEVEL
|
||||
void UpdateHonorNextLevel();
|
||||
//End of PvP System
|
||||
|
||||
@@ -2010,7 +2004,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
int32 CalculateCorpseReclaimDelay(bool load = false) const;
|
||||
void SendCorpseReclaimDelay(uint32 delay) const;
|
||||
|
||||
uint32 GetBlockPercent() const override { return GetUInt32Value(PLAYER_SHIELD_BLOCK); }
|
||||
uint32 GetBlockPercent() const override { return GetUInt32Value(ACTIVE_PLAYER_FIELD_SHIELD_BLOCK); }
|
||||
bool CanParry() const { return m_canParry; }
|
||||
void SetCanParry(bool value);
|
||||
bool CanBlock() const { return m_canBlock; }
|
||||
@@ -2727,7 +2721,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
std::unordered_map<ObjectGuid /*LootObject*/, ObjectGuid /*world object*/> m_AELootView;
|
||||
|
||||
void _InitHonorLevelOnLoadFromDB(uint32 /*honor*/, uint32 /*honorLevel*/, uint32 /*prestigeLevel*/);
|
||||
void _InitHonorLevelOnLoadFromDB(uint32 honor, uint32 honorLevel);
|
||||
std::unique_ptr<RestMgr> _restMgr;
|
||||
|
||||
bool _usePvpItemLevels;
|
||||
|
||||
@@ -111,13 +111,13 @@ void PlayerTaxi::AppendTaximaskTo(WorldPackets::Taxi::ShowTaxiNodes& data, bool
|
||||
{
|
||||
if (all)
|
||||
{
|
||||
data.CanLandNodes = &sTaxiNodesMask; // all existed nodes
|
||||
data.CanUseNodes = &sTaxiNodesMask;
|
||||
data.CanLandNodes = sTaxiNodesMask; // all existed nodes
|
||||
data.CanUseNodes = sTaxiNodesMask;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.CanLandNodes = &m_taximask; // known nodes
|
||||
data.CanUseNodes = &m_taximask;
|
||||
data.CanLandNodes = m_taximask; // known nodes
|
||||
data.CanUseNodes = m_taximask;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,13 +44,13 @@ class TC_GAME_API PlayerTaxi
|
||||
|
||||
bool IsTaximaskNodeKnown(uint32 nodeidx) const
|
||||
{
|
||||
uint8 field = uint8((nodeidx - 1) / 8);
|
||||
uint32 field = uint32((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx-1) % 8);
|
||||
return (m_taximask[field] & submask) == submask;
|
||||
}
|
||||
bool SetTaximaskNode(uint32 nodeidx)
|
||||
{
|
||||
uint8 field = uint8((nodeidx - 1) / 8);
|
||||
uint32 field = uint32((nodeidx - 1) / 8);
|
||||
uint32 submask = 1 << ((nodeidx- 1) % 8);
|
||||
if ((m_taximask[field] & submask) != submask)
|
||||
{
|
||||
|
||||
@@ -44,17 +44,17 @@ void RestMgr::SetRestBonus(RestTypes restType, float restBonus)
|
||||
|
||||
rest_rested_offset = REST_RESTED_XP;
|
||||
rest_state_offset = REST_STATE_XP;
|
||||
next_level_xp_field = PLAYER_NEXT_LEVEL_XP;
|
||||
next_level_xp_field = ACTIVE_PLAYER_FIELD_NEXT_LEVEL_XP;
|
||||
affectedByRaF = true;
|
||||
break;
|
||||
case REST_TYPE_HONOR:
|
||||
// Reset restBonus (Honor only) for players with max honor level.
|
||||
if (_player->IsMaxHonorLevelAndPrestige())
|
||||
if (_player->IsMaxHonorLevel())
|
||||
restBonus = 0;
|
||||
|
||||
rest_rested_offset = REST_RESTED_HONOR;
|
||||
rest_state_offset = REST_STATE_HONOR;
|
||||
next_level_xp_field = PLAYER_FIELD_HONOR_NEXT_LEVEL;
|
||||
next_level_xp_field = ACTIVE_PLAYER_FIELD_HONOR_NEXT_LEVEL;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -72,17 +72,17 @@ void RestMgr::SetRestBonus(RestTypes restType, float restBonus)
|
||||
|
||||
// update data for client
|
||||
if (affectedByRaF && _player->GetsRecruitAFriendBonus(true) && (_player->GetSession()->IsARecruiter() || _player->GetSession()->GetRecruiterId() != 0))
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RAF_LINKED);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RAF_LINKED);
|
||||
else
|
||||
{
|
||||
if (_restBonus[restType] > 10)
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RESTED);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_RESTED);
|
||||
else if (_restBonus[restType] <= 1)
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_NOT_RAF_LINKED);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_state_offset, REST_STATE_NOT_RAF_LINKED);
|
||||
}
|
||||
|
||||
// RestTickUpdate
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + rest_rested_offset, uint32(_restBonus[restType]));
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + rest_rested_offset, uint32(_restBonus[restType]));
|
||||
}
|
||||
|
||||
void RestMgr::AddRestBonus(RestTypes restType, float restBonus)
|
||||
@@ -153,8 +153,8 @@ void RestMgr::Update(time_t now)
|
||||
void RestMgr::LoadRestBonus(RestTypes restType, PlayerRestState state, float restBonus)
|
||||
{
|
||||
_restBonus[restType] = restBonus;
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + restType * 2, state);
|
||||
_player->SetUInt32Value(PLAYER_FIELD_REST_INFO + restType * 2 + 1, uint32(restBonus));
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + restType * 2, state);
|
||||
_player->SetUInt32Value(ACTIVE_PLAYER_FIELD_REST_INFO + restType * 2 + 1, uint32(restBonus));
|
||||
}
|
||||
|
||||
float RestMgr::CalcExtraPerSec(RestTypes restType, float bubble) const
|
||||
@@ -162,9 +162,9 @@ float RestMgr::CalcExtraPerSec(RestTypes restType, float bubble) const
|
||||
switch (restType)
|
||||
{
|
||||
case REST_TYPE_HONOR:
|
||||
return float(_player->GetUInt32Value(PLAYER_FIELD_HONOR_NEXT_LEVEL)) / 72000.0f * bubble;
|
||||
return float(_player->GetUInt32Value(ACTIVE_PLAYER_FIELD_HONOR_NEXT_LEVEL)) / 72000.0f * bubble;
|
||||
case REST_TYPE_XP:
|
||||
return float(_player->GetUInt32Value(PLAYER_NEXT_LEVEL_XP)) / 72000.0f * bubble;
|
||||
return float(_player->GetUInt32Value(ACTIVE_PLAYER_FIELD_NEXT_LEVEL_XP)) / 72000.0f * bubble;
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "DB2Stores.h"
|
||||
#include "Config.h"
|
||||
#include "Util.h"
|
||||
#include <boost/graph/depth_first_search.hpp>
|
||||
#include <boost/graph/dijkstra_shortest_paths.hpp>
|
||||
#include <boost/property_map/transform_value_property_map.hpp>
|
||||
|
||||
@@ -32,7 +33,7 @@ TaxiPathGraph& TaxiPathGraph::Instance()
|
||||
|
||||
void TaxiPathGraph::Initialize()
|
||||
{
|
||||
if (GetVertexCount() > 0)
|
||||
if (boost::num_vertices(m_graph) > 0)
|
||||
return;
|
||||
|
||||
std::vector<std::pair<edge, EdgeCost>> edges;
|
||||
@@ -47,7 +48,7 @@ void TaxiPathGraph::Initialize()
|
||||
}
|
||||
|
||||
// create graph
|
||||
m_graph = Graph(GetVertexCount());
|
||||
m_graph = Graph(m_nodesByVertex.size());
|
||||
WeightMap weightmap = boost::get(boost::edge_weight, m_graph);
|
||||
|
||||
for (std::size_t j = 0; j < edges.size(); ++j)
|
||||
@@ -59,21 +60,22 @@ void TaxiPathGraph::Initialize()
|
||||
|
||||
uint32 TaxiPathGraph::GetNodeIDFromVertexID(vertex_descriptor vertexID)
|
||||
{
|
||||
if (vertexID < m_vertices.size())
|
||||
return m_vertices[vertexID]->ID;
|
||||
if (vertexID < m_nodesByVertex.size())
|
||||
return m_nodesByVertex[vertexID]->ID;
|
||||
|
||||
return std::numeric_limits<uint32>::max();
|
||||
}
|
||||
|
||||
TaxiPathGraph::vertex_descriptor TaxiPathGraph::GetVertexIDFromNodeID(TaxiNodesEntry const* node)
|
||||
{
|
||||
return node->CharacterBitNumber;
|
||||
auto itr = m_verticesByNode.find(node->ID);
|
||||
return itr != m_verticesByNode.end() ? itr->second : std::numeric_limits<vertex_descriptor>::max();
|
||||
}
|
||||
|
||||
std::size_t TaxiPathGraph::GetVertexCount()
|
||||
void GetTaxiMapPosition(DBCPosition3D const& position, int32 mapId, DBCPosition2D* uiMapPosition, int32* uiMapId)
|
||||
{
|
||||
//So we can use this function for readability, we define either max defined vertices or already loaded in graph count
|
||||
return std::max(boost::num_vertices(m_graph), m_vertices.size());
|
||||
if (!DB2Manager::GetUiMapPosition(position.X, position.Y, position.Z, mapId, 0, 0, 0, UI_MAP_SYSTEM_ADVENTURE, false, uiMapId, uiMapPosition))
|
||||
DB2Manager::GetUiMapPosition(position.X, position.Y, position.Z, mapId, 0, 0, 0, UI_MAP_SYSTEM_TAXI, false, uiMapId, uiMapPosition);
|
||||
}
|
||||
|
||||
void TaxiPathGraph::AddVerticeAndEdgeFromNodeInfo(TaxiNodesEntry const* from, TaxiNodesEntry const* to, uint32 pathId, std::vector<std::pair<edge, EdgeCost>>& edges)
|
||||
@@ -104,22 +106,21 @@ void TaxiPathGraph::AddVerticeAndEdgeFromNodeInfo(TaxiNodesEntry const* from, Ta
|
||||
if (nodes[i - 1]->Flags & TAXI_PATH_NODE_FLAG_TELEPORT)
|
||||
continue;
|
||||
|
||||
uint32 map1, map2;
|
||||
int32 uiMap1, uiMap2;
|
||||
DBCPosition2D pos1, pos2;
|
||||
|
||||
DB2Manager::DeterminaAlternateMapPosition(nodes[i - 1]->ContinentID, nodes[i - 1]->Loc.X, nodes[i - 1]->Loc.Y, nodes[i - 1]->Loc.Z, &map1, &pos1);
|
||||
DB2Manager::DeterminaAlternateMapPosition(nodes[i]->ContinentID, nodes[i]->Loc.X, nodes[i]->Loc.Y, nodes[i]->Loc.Z, &map2, &pos2);
|
||||
GetTaxiMapPosition(nodes[i - 1]->Loc, nodes[i - 1]->ContinentID, &pos1, &uiMap1);
|
||||
GetTaxiMapPosition(nodes[i]->Loc, nodes[i]->ContinentID, &pos2, &uiMap2);
|
||||
|
||||
if (map1 != map2)
|
||||
if (uiMap1 != uiMap2)
|
||||
continue;
|
||||
|
||||
totalDist += std::sqrt(
|
||||
std::pow(pos2.X - pos1.X, 2) +
|
||||
std::pow(pos2.Y - pos1.Y, 2) +
|
||||
std::pow(nodes[i]->Loc.Z - nodes[i - 1]->Loc.Z, 2));
|
||||
std::pow(pos2.Y - pos1.Y, 2));
|
||||
}
|
||||
|
||||
uint32 dist = uint32(totalDist);
|
||||
uint32 dist = uint32(totalDist * 32767.0f);
|
||||
if (dist > 0xFFFF)
|
||||
dist = 0xFFFF;
|
||||
|
||||
@@ -176,14 +177,50 @@ std::size_t TaxiPathGraph::GetCompleteNodeRoute(TaxiNodesEntry const* from, Taxi
|
||||
return shortestPath.size();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct DiscoverVertexVisitor : public boost::base_visitor<DiscoverVertexVisitor<T>>
|
||||
{
|
||||
using event_filter = boost::on_discover_vertex;
|
||||
|
||||
DiscoverVertexVisitor(T&& func) : _func(std::forward<T>(func)) { }
|
||||
|
||||
template <class Vertex, class Graph>
|
||||
void operator()(Vertex v, Graph& /*g*/)
|
||||
{
|
||||
_func(v);
|
||||
}
|
||||
|
||||
private:
|
||||
T _func;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline auto make_discover_vertex_dfs_visitor(T&& t)
|
||||
{
|
||||
return boost::make_dfs_visitor(DiscoverVertexVisitor<T>(std::forward<T>(t)));
|
||||
}
|
||||
|
||||
void TaxiPathGraph::GetReachableNodesMask(TaxiNodesEntry const* from, TaxiMask* mask)
|
||||
{
|
||||
boost::vector_property_map<boost::default_color_type> color(boost::num_vertices(m_graph));
|
||||
std::fill(color.storage_begin(), color.storage_end(), boost::white_color);
|
||||
boost::depth_first_visit(m_graph, GetVertexIDFromNodeID(from), make_discover_vertex_dfs_visitor([this, mask](vertex_descriptor vertex)
|
||||
{
|
||||
if (TaxiNodesEntry const* taxiNode = sTaxiNodesStore.LookupEntry(GetNodeIDFromVertexID(vertex)))
|
||||
(*mask)[(taxiNode->ID - 1) / 8] |= 1 << ((taxiNode->ID - 1) % 8);
|
||||
}), color);
|
||||
}
|
||||
|
||||
TaxiPathGraph::vertex_descriptor TaxiPathGraph::CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesEntry const* node)
|
||||
{
|
||||
//Check if we need a new one or if it may be already created
|
||||
if (m_vertices.size() <= node->CharacterBitNumber)
|
||||
m_vertices.resize(node->CharacterBitNumber + 1);
|
||||
auto itr = m_verticesByNode.find(node->ID);
|
||||
if (itr == m_verticesByNode.end())
|
||||
{
|
||||
itr = m_verticesByNode.emplace(node->ID, m_nodesByVertex.size()).first;
|
||||
m_nodesByVertex.push_back(node);
|
||||
}
|
||||
|
||||
m_vertices[node->CharacterBitNumber] = node;
|
||||
return node->CharacterBitNumber;
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
uint32 TaxiPathGraph::EdgeCost::EvaluateDistance(Player const* player) const
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
|
||||
#include "Position.h"
|
||||
#include "Define.h"
|
||||
#include "DBCEnums.h"
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
class Player;
|
||||
struct TaxiNodesEntry;
|
||||
@@ -32,6 +35,7 @@ public:
|
||||
|
||||
void Initialize();
|
||||
std::size_t GetCompleteNodeRoute(TaxiNodesEntry const* from, TaxiNodesEntry const* to, Player const* player, std::vector<uint32>& shortestPath);
|
||||
void GetReachableNodesMask(TaxiNodesEntry const* from, TaxiMask* mask);
|
||||
|
||||
private:
|
||||
struct EdgeCost
|
||||
@@ -53,10 +57,10 @@ private:
|
||||
vertex_descriptor GetVertexIDFromNodeID(TaxiNodesEntry const* node);
|
||||
uint32 GetNodeIDFromVertexID(vertex_descriptor vertexID);
|
||||
vertex_descriptor CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesEntry const* node);
|
||||
std::size_t GetVertexCount();
|
||||
|
||||
Graph m_graph;
|
||||
std::vector<TaxiNodesEntry const*> m_vertices;
|
||||
std::vector<TaxiNodesEntry const*> m_nodesByVertex;
|
||||
std::unordered_map<uint32, vertex_descriptor> m_verticesByNode;
|
||||
|
||||
TaxiPathGraph(TaxiPathGraph const&) = delete;
|
||||
TaxiPathGraph& operator=(TaxiPathGraph const&) = delete;
|
||||
|
||||
@@ -38,7 +38,9 @@ Transport::Transport() : GameObject(),
|
||||
_triggeredArrivalEvent(false), _triggeredDepartureEvent(false),
|
||||
_passengerTeleportItr(_passengers.begin()), _delayedAddModel(false), _delayedTeleport(false)
|
||||
{
|
||||
m_updateFlag = UPDATEFLAG_TRANSPORT | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION;
|
||||
m_updateFlag.ServerTime = true;
|
||||
m_updateFlag.Stationary = true;
|
||||
m_updateFlag.Rotation = true;
|
||||
}
|
||||
|
||||
Transport::~Transport()
|
||||
|
||||
@@ -160,9 +160,9 @@ void Player::ApplySpellPowerBonus(int32 amount, bool apply)
|
||||
apply = _ModifyUInt32(apply, m_baseSpellPower, amount);
|
||||
|
||||
// For speed just update for client
|
||||
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
|
||||
ApplyModUInt32Value(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
|
||||
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, amount, apply);
|
||||
ApplyModUInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, amount, apply);
|
||||
|
||||
if (HasAuraType(SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT))
|
||||
{
|
||||
@@ -176,18 +176,18 @@ void Player::UpdateSpellDamageAndHealingBonus()
|
||||
// Magic damage modifiers implemented in Unit::SpellDamageBonusDone
|
||||
// This information for client side use only
|
||||
// Get healing bonus for all schools
|
||||
SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL));
|
||||
SetStatInt32Value(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL));
|
||||
// Get damage bonus for all schools
|
||||
Unit::AuraEffectList const& modDamageAuras = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE);
|
||||
for (uint16 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
{
|
||||
SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, std::accumulate(modDamageAuras.begin(), modDamageAuras.end(), 0, [i](int32 negativeMod, AuraEffect const* aurEff)
|
||||
SetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, std::accumulate(modDamageAuras.begin(), modDamageAuras.end(), 0, [i](int32 negativeMod, AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetAmount() < 0 && aurEff->GetMiscValue() & (1 << i))
|
||||
negativeMod += aurEff->GetAmount();
|
||||
return negativeMod;
|
||||
}));
|
||||
SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)) - GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i));
|
||||
SetStatInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)) - GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i));
|
||||
}
|
||||
|
||||
if (HasAuraType(SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT))
|
||||
@@ -231,7 +231,7 @@ bool Player::UpdateAllStats()
|
||||
|
||||
void Player::ApplySpellPenetrationBonus(int32 amount, bool apply)
|
||||
{
|
||||
ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -amount, apply);
|
||||
ApplyModInt32Value(ACTIVE_PLAYER_FIELD_MOD_TARGET_RESISTANCE, -amount, apply);
|
||||
m_spellPenetrationItemMod += apply ? amount : -amount;
|
||||
}
|
||||
|
||||
@@ -239,8 +239,7 @@ void Player::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
Unit::UpdateResistances(school);
|
||||
|
||||
Pet* pet = GetPet();
|
||||
if (pet)
|
||||
@@ -255,6 +254,7 @@ void Player::UpdateArmor()
|
||||
UnitMods unitMod = UNIT_MOD_ARMOR;
|
||||
|
||||
float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
|
||||
float baseValue = value;
|
||||
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
|
||||
value += GetModifierValue(unitMod, TOTAL_VALUE);
|
||||
|
||||
@@ -268,7 +268,7 @@ void Player::UpdateArmor()
|
||||
|
||||
value *= GetModifierValue(unitMod, TOTAL_PCT);
|
||||
|
||||
SetArmor(int32(value));
|
||||
SetArmor(int32(baseValue), int32(value - baseValue));
|
||||
|
||||
Pet* pet = GetPet();
|
||||
if (pet)
|
||||
@@ -360,11 +360,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 minSpellPower = GetInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS);
|
||||
int32 minSpellPower = GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_POS);
|
||||
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
minSpellPower = std::min(minSpellPower, GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i));
|
||||
minSpellPower = std::min(minSpellPower, GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i));
|
||||
|
||||
val2 = CalculatePct(float(minSpellPower), GetFloatValue(PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT));
|
||||
val2 = CalculatePct(float(minSpellPower), GetFloatValue(ACTIVE_PLAYER_FIELD_OVERRIDE_AP_BY_SPELL_POWER_PERCENT));
|
||||
}
|
||||
|
||||
SetModifierValue(unitMod, BASE_VALUE, val2);
|
||||
@@ -488,7 +488,7 @@ void Player::UpdateBlockPercentage()
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_BLOCK_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
void Player::UpdateCritPercentage(WeaponAttackType attType)
|
||||
@@ -501,18 +501,18 @@ void Player::UpdateCritPercentage(WeaponAttackType attType)
|
||||
{
|
||||
case OFF_ATTACK:
|
||||
modGroup = OFFHAND_CRIT_PERCENTAGE;
|
||||
index = PLAYER_OFFHAND_CRIT_PERCENTAGE;
|
||||
index = ACTIVE_PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE;
|
||||
cr = CR_CRIT_MELEE;
|
||||
break;
|
||||
case RANGED_ATTACK:
|
||||
modGroup = RANGED_CRIT_PERCENTAGE;
|
||||
index = PLAYER_RANGED_CRIT_PERCENTAGE;
|
||||
index = ACTIVE_PLAYER_FIELD_RANGED_CRIT_PERCENTAGE;
|
||||
cr = CR_CRIT_RANGED;
|
||||
break;
|
||||
case BASE_ATTACK:
|
||||
default:
|
||||
modGroup = CRIT_PERCENTAGE;
|
||||
index = PLAYER_CRIT_PERCENTAGE;
|
||||
index = ACTIVE_PLAYER_FIELD_CRIT_PERCENTAGE;
|
||||
cr = CR_CRIT_MELEE;
|
||||
break;
|
||||
}
|
||||
@@ -545,13 +545,13 @@ void Player::UpdateMastery()
|
||||
{
|
||||
if (!CanUseMastery())
|
||||
{
|
||||
SetFloatValue(PLAYER_MASTERY, 0.0f);
|
||||
SetFloatValue(ACTIVE_PLAYER_FIELD_MASTERY, 0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
|
||||
value += GetRatingBonusValue(CR_MASTERY);
|
||||
SetFloatValue(PLAYER_MASTERY, value);
|
||||
SetFloatValue(ACTIVE_PLAYER_FIELD_MASTERY, value);
|
||||
|
||||
ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID));
|
||||
if (!chrSpec)
|
||||
@@ -579,7 +579,7 @@ void Player::UpdateMastery()
|
||||
void Player::UpdateVersatilityDamageDone()
|
||||
{
|
||||
// No proof that CR_VERSATILITY_DAMAGE_DONE is allways = PLAYER_VERSATILITY
|
||||
SetUInt32Value(PLAYER_VERSATILITY, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_VERSATILITY_DAMAGE_DONE));
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_VERSATILITY, GetUInt32Value(ACTIVE_PLAYER_FIELD_COMBAT_RATING + CR_VERSATILITY_DAMAGE_DONE));
|
||||
|
||||
if (getClass() == CLASS_HUNTER)
|
||||
UpdateDamagePhysical(RANGED_ATTACK);
|
||||
@@ -596,7 +596,7 @@ void Player::UpdateHealingDonePercentMod()
|
||||
for (AuraEffect const* auraEffect : GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT))
|
||||
AddPct(value, auraEffect->GetAmount());
|
||||
|
||||
SetStatFloatValue(PLAYER_FIELD_MOD_HEALING_DONE_PCT, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_PCT, value);
|
||||
}
|
||||
|
||||
const float m_diminishing_k[MAX_CLASSES] =
|
||||
@@ -651,7 +651,7 @@ void Player::UpdateParryPercentage()
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
}
|
||||
SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
void Player::UpdateDodgePercentage()
|
||||
@@ -686,7 +686,7 @@ void Player::UpdateDodgePercentage()
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
|
||||
|
||||
value = value < 0.0f ? 0.0f : value;
|
||||
SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
|
||||
SetStatFloatValue(ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE, value);
|
||||
}
|
||||
|
||||
void Player::UpdateSpellCritChance()
|
||||
@@ -700,13 +700,13 @@ void Player::UpdateSpellCritChance()
|
||||
crit += GetRatingBonusValue(CR_CRIT_SPELL);
|
||||
|
||||
// Store crit value
|
||||
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1, crit);
|
||||
SetFloatValue(ACTIVE_PLAYER_FIELD_SPELL_CRIT_PERCENTAGE1, crit);
|
||||
}
|
||||
|
||||
void Player::UpdateArmorPenetration(int32 amount)
|
||||
{
|
||||
// Store Rating Value
|
||||
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_ARMOR_PENETRATION, amount);
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_COMBAT_RATING + CR_ARMOR_PENETRATION, amount);
|
||||
}
|
||||
|
||||
void Player::UpdateMeleeHitChances()
|
||||
@@ -746,10 +746,10 @@ void Player::UpdateExpertise(WeaponAttackType attack)
|
||||
switch (attack)
|
||||
{
|
||||
case BASE_ATTACK:
|
||||
SetUInt32Value(PLAYER_EXPERTISE, expertise);
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_EXPERTISE, expertise);
|
||||
break;
|
||||
case OFF_ATTACK:
|
||||
SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, expertise);
|
||||
SetUInt32Value(ACTIVE_PLAYER_FIELD_OFFHAND_EXPERTISE, expertise);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -855,21 +855,11 @@ bool Creature::UpdateAllStats()
|
||||
return true;
|
||||
}
|
||||
|
||||
void Creature::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
}
|
||||
else
|
||||
UpdateArmor();
|
||||
}
|
||||
|
||||
void Creature::UpdateArmor()
|
||||
{
|
||||
float baseValue = GetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE);
|
||||
float value = GetTotalAuraModValue(UNIT_MOD_ARMOR);
|
||||
SetArmor(int32(value));
|
||||
SetArmor(int32(baseValue), int32(value - baseValue));
|
||||
}
|
||||
|
||||
void Creature::UpdateMaxHealth()
|
||||
@@ -1077,13 +1067,18 @@ void Guardian::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
float baseValue = GetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + school), BASE_VALUE);
|
||||
float bonusValue = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school)) - baseValue;
|
||||
|
||||
// hunter and warlock pets gain 40% of owner's resistance
|
||||
if (IsPet())
|
||||
value += float(CalculatePct(m_owner->GetResistance(SpellSchools(school)), 40));
|
||||
{
|
||||
baseValue += float(CalculatePct(m_owner->GetResistance(SpellSchools(school)), 40));
|
||||
bonusValue += float(CalculatePct(m_owner->GetBonusResistanceMod(SpellSchools(school)), 40));
|
||||
}
|
||||
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
SetResistance(SpellSchools(school), int32(baseValue));
|
||||
SetBonusResistanceMod(SpellSchools(school), int32(bonusValue));
|
||||
}
|
||||
else
|
||||
UpdateArmor();
|
||||
@@ -1091,6 +1086,7 @@ void Guardian::UpdateResistances(uint32 school)
|
||||
|
||||
void Guardian::UpdateArmor()
|
||||
{
|
||||
float baseValue = 0.0f;
|
||||
float value = 0.0f;
|
||||
float bonus_armor = 0.0f;
|
||||
UnitMods unitMod = UNIT_MOD_ARMOR;
|
||||
@@ -1102,11 +1098,12 @@ void Guardian::UpdateArmor()
|
||||
bonus_armor = m_owner->GetArmor();
|
||||
|
||||
value = GetModifierValue(unitMod, BASE_VALUE);
|
||||
baseValue = value;
|
||||
value *= GetModifierValue(unitMod, BASE_PCT);
|
||||
value += GetModifierValue(unitMod, TOTAL_VALUE) + bonus_armor;
|
||||
value *= GetModifierValue(unitMod, TOTAL_PCT);
|
||||
|
||||
SetArmor(int32(value));
|
||||
SetArmor(int32(baseValue), int32(value - baseValue));
|
||||
}
|
||||
|
||||
void Guardian::UpdateMaxHealth()
|
||||
@@ -1186,8 +1183,8 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
//demons benefit from warlocks shadow or fire damage
|
||||
else if (IsPet())
|
||||
{
|
||||
int32 fire = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
|
||||
int32 fire = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
|
||||
int32 maximum = (fire > shadow) ? fire : shadow;
|
||||
if (maximum < 0)
|
||||
maximum = 0;
|
||||
@@ -1197,7 +1194,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
//water elementals benefit from mage's frost damage
|
||||
else if (GetEntry() == ENTRY_WATER_ELEMENTAL)
|
||||
{
|
||||
int32 frost = owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) - owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST);
|
||||
int32 frost = owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) - owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST);
|
||||
if (frost < 0)
|
||||
frost = 0;
|
||||
SetBonusDamage(int32(frost * 0.4f));
|
||||
@@ -1230,14 +1227,14 @@ void Guardian::UpdateDamagePhysical(WeaponAttackType attType)
|
||||
//force of nature
|
||||
if (GetEntry() == ENTRY_TREANT)
|
||||
{
|
||||
int32 spellDmg = m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE) - m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE);
|
||||
int32 spellDmg = m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE) - m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE);
|
||||
if (spellDmg > 0)
|
||||
bonusDamage = spellDmg * 0.09f;
|
||||
}
|
||||
//greater fire elemental
|
||||
else if (GetEntry() == ENTRY_FIRE_ELEMENTAL)
|
||||
{
|
||||
int32 spellDmg = m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - m_owner->GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 spellDmg = m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE) - m_owner->GetInt32Value(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
if (spellDmg > 0)
|
||||
bonusDamage = spellDmg * 0.4f;
|
||||
}
|
||||
@@ -1266,5 +1263,5 @@ void Guardian::SetBonusDamage(int32 damage)
|
||||
{
|
||||
m_bonusSpellDamage = damage;
|
||||
if (GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
GetOwner()->SetUInt32Value(PLAYER_PET_SPELL_POWER, damage);
|
||||
GetOwner()->SetUInt32Value(ACTIVE_PLAYER_FIELD_PET_SPELL_POWER, damage);
|
||||
}
|
||||
|
||||
@@ -111,13 +111,13 @@ bool DispelableAura::RollDispel() const
|
||||
}
|
||||
|
||||
DamageInfo::DamageInfo(Unit* attacker, Unit* victim, uint32 damage, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType)
|
||||
: m_attacker(attacker), m_victim(victim), m_damage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
|
||||
: m_attacker(attacker), m_victim(victim), m_damage(damage), m_originalDamage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
|
||||
m_absorb(0), m_resist(0), m_block(0), m_hitMask(0)
|
||||
{
|
||||
}
|
||||
|
||||
DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo)
|
||||
: m_attacker(dmgInfo.attacker), m_victim(dmgInfo.target), m_damage(dmgInfo.damage), m_spellInfo(nullptr), m_schoolMask(SpellSchoolMask(dmgInfo.damageSchoolMask)),
|
||||
: m_attacker(dmgInfo.attacker), m_victim(dmgInfo.target), m_damage(dmgInfo.damage), m_originalDamage(dmgInfo.damage), m_spellInfo(nullptr), m_schoolMask(SpellSchoolMask(dmgInfo.damageSchoolMask)),
|
||||
m_damageType(DIRECT_DAMAGE), m_attackType(dmgInfo.attackType), m_absorb(dmgInfo.absorb), m_resist(dmgInfo.resist), m_block(dmgInfo.blocked_amount), m_hitMask(0)
|
||||
{
|
||||
switch (dmgInfo.TargetState)
|
||||
@@ -171,7 +171,7 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo)
|
||||
}
|
||||
|
||||
DamageInfo::DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType, uint32 hitMask)
|
||||
: m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage),
|
||||
: m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage), m_originalDamage(spellNonMeleeDamage.originalDamage),
|
||||
m_spellInfo(sSpellMgr->GetSpellInfo(spellNonMeleeDamage.SpellID)), m_schoolMask(SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType),
|
||||
m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(hitMask)
|
||||
{
|
||||
@@ -226,7 +226,7 @@ uint32 DamageInfo::GetHitMask() const
|
||||
}
|
||||
|
||||
HealInfo::HealInfo(Unit* healer, Unit* target, uint32 heal, SpellInfo const* spellInfo, SpellSchoolMask schoolMask)
|
||||
: _healer(healer), _target(target), _heal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
|
||||
: _healer(healer), _target(target), _heal(heal), _originalHeal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -279,8 +279,8 @@ SpellSchoolMask ProcEventInfo::GetSchoolMask() const
|
||||
}
|
||||
|
||||
SpellNonMeleeDamage::SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _SpellXSpellVisualID, uint32 _schoolMask, ObjectGuid _castId)
|
||||
: target(_target), attacker(_attacker), castId(_castId), SpellID(_SpellID), SpellXSpellVisualID(_SpellXSpellVisualID), damage(0), schoolMask(_schoolMask),
|
||||
absorb(0), resist(0), periodicLog(false), blocked(0), HitInfo(0), cleanDamage(0), fullBlock(false), preHitHealth(_target->GetHealth())
|
||||
: target(_target), attacker(_attacker), castId(_castId), SpellID(_SpellID), SpellXSpellVisualID(_SpellXSpellVisualID), damage(0), originalDamage(0),
|
||||
schoolMask(_schoolMask), absorb(0), resist(0), periodicLog(false), blocked(0), HitInfo(0), cleanDamage(0), fullBlock(false), preHitHealth(_target->GetHealth())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ Unit::Unit(bool isWorldObject) :
|
||||
m_objectType |= TYPEMASK_UNIT;
|
||||
m_objectTypeId = TYPEID_UNIT;
|
||||
|
||||
m_updateFlag = UPDATEFLAG_LIVING;
|
||||
m_updateFlag.MovementUpdate = true;
|
||||
|
||||
for (uint32 i = 0; i < MAX_ATTACK; ++i)
|
||||
{
|
||||
@@ -1181,6 +1181,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
damage = 0;
|
||||
|
||||
damageInfo->damage = damage;
|
||||
damageInfo->originalDamage = damage;
|
||||
DamageInfo dmgInfo(*damageInfo, SPELL_DIRECT_DAMAGE, BASE_ATTACK, PROC_HIT_NONE);
|
||||
CalcAbsorbResist(dmgInfo);
|
||||
damageInfo->absorb = dmgInfo.GetAbsorb();
|
||||
@@ -1227,6 +1228,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
damageInfo->damageSchoolMask = GetMeleeDamageSchoolMask();
|
||||
damageInfo->attackType = attackType;
|
||||
damageInfo->damage = 0;
|
||||
damageInfo->originalDamage = 0;
|
||||
damageInfo->cleanDamage = 0;
|
||||
damageInfo->absorb = 0;
|
||||
damageInfo->resist = 0;
|
||||
@@ -1295,17 +1297,20 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
case MELEE_HIT_EVADE:
|
||||
damageInfo->HitInfo |= HITINFO_MISS | HITINFO_SWINGNOHITSOUND;
|
||||
damageInfo->TargetState = VICTIMSTATE_EVADES;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
damageInfo->cleanDamage = 0;
|
||||
return;
|
||||
case MELEE_HIT_MISS:
|
||||
damageInfo->HitInfo |= HITINFO_MISS;
|
||||
damageInfo->TargetState = VICTIMSTATE_INTACT;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
damageInfo->cleanDamage = 0;
|
||||
break;
|
||||
case MELEE_HIT_NORMAL:
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
break;
|
||||
case MELEE_HIT_CRIT:
|
||||
{
|
||||
@@ -1320,21 +1325,26 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
|
||||
if (mod != 0)
|
||||
AddPct(damageInfo->damage, mod);
|
||||
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
break;
|
||||
}
|
||||
case MELEE_HIT_PARRY:
|
||||
damageInfo->TargetState = VICTIMSTATE_PARRY;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->cleanDamage += damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
break;
|
||||
case MELEE_HIT_DODGE:
|
||||
damageInfo->TargetState = VICTIMSTATE_DODGE;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
damageInfo->cleanDamage += damageInfo->damage;
|
||||
damageInfo->damage = 0;
|
||||
break;
|
||||
case MELEE_HIT_BLOCK:
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->HitInfo |= HITINFO_BLOCK;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
// 30% damage blocked, double blocked amount if block is critical
|
||||
damageInfo->blocked_amount = CalculatePct(damageInfo->damage, damageInfo->target->isBlockCritical() ? damageInfo->target->GetBlockPercent() * 2 : damageInfo->target->GetBlockPercent());
|
||||
damageInfo->damage -= damageInfo->blocked_amount;
|
||||
@@ -1344,6 +1354,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
{
|
||||
damageInfo->HitInfo |= HITINFO_GLANCING;
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
int32 leveldif = int32(victim->getLevel()) - int32(getLevel());
|
||||
if (leveldif > 3)
|
||||
leveldif = 3;
|
||||
@@ -1358,6 +1369,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
// 150% normal damage
|
||||
damageInfo->damage += (damageInfo->damage / 2);
|
||||
damageInfo->originalDamage = damageInfo->damage;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1372,6 +1384,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
|
||||
resilienceReduction = damageInfo->damage - resilienceReduction;
|
||||
damageInfo->damage -= resilienceReduction;
|
||||
damageInfo->cleanDamage += resilienceReduction;
|
||||
damageInfo->originalDamage -= resilienceReduction;
|
||||
|
||||
// Calculate absorb resist
|
||||
if (int32(damageInfo->damage) > 0)
|
||||
@@ -1514,7 +1527,6 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
DamageInfo damageInfo(this, victim, damage, spellInfo, spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK);
|
||||
victim->CalcAbsorbResist(damageInfo);
|
||||
damage = damageInfo.GetDamage();
|
||||
// No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that
|
||||
victim->DealDamageMods(this, damage, nullptr);
|
||||
|
||||
WorldPackets::CombatLog::SpellDamageShield damageShield;
|
||||
@@ -1522,6 +1534,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
damageShield.Defender = GetGUID();
|
||||
damageShield.SpellID = spellInfo->Id;
|
||||
damageShield.TotalDamage = damage;
|
||||
damageShield.OriginalDamage = damageInfo.GetOriginalDamage();
|
||||
damageShield.OverKill = std::max(int32(damage) - int32(GetHealth()), 0);
|
||||
damageShield.SchoolMask = spellInfo->SchoolMask;
|
||||
damageShield.LogAbsorbed = damageInfo.GetAbsorb();
|
||||
@@ -1881,6 +1894,7 @@ void Unit::CalcAbsorbResist(DamageInfo& damageInfo)
|
||||
CleanDamage cleanDamage = CleanDamage(splitDamage, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
|
||||
DealDamage(caster, splitDamage, &cleanDamage, DIRECT_DAMAGE, damageInfo.GetSchoolMask(), (*itr)->GetSpellInfo(), false);
|
||||
log.damage = splitDamage;
|
||||
log.originalDamage = splitDamage;
|
||||
log.absorb = split_absorb;
|
||||
SendSpellNonMeleeDamageLog(&log);
|
||||
|
||||
@@ -2016,6 +2030,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA
|
||||
damageInfo.damageSchoolMask = GetMeleeDamageSchoolMask();
|
||||
damageInfo.attackType = attType;
|
||||
damageInfo.damage = 0;
|
||||
damageInfo.originalDamage = 0;
|
||||
damageInfo.cleanDamage = 0;
|
||||
damageInfo.absorb = 0;
|
||||
damageInfo.resist = 0;
|
||||
@@ -2573,7 +2588,7 @@ float Unit::GetUnitDodgeChance(WeaponAttackType attType, Unit const* victim) con
|
||||
float chance = 0.0f;
|
||||
float levelBonus = 0.0f;
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
chance = victim->GetFloatValue(PLAYER_DODGE_PERCENTAGE);
|
||||
chance = victim->GetFloatValue(ACTIVE_PLAYER_FIELD_DODGE_PERCENTAGE);
|
||||
else
|
||||
{
|
||||
if (!victim->IsTotem())
|
||||
@@ -2617,7 +2632,7 @@ float Unit::GetUnitParryChance(WeaponAttackType attType, Unit const* victim) con
|
||||
tmpitem = playerVictim->GetWeaponForAttack(OFF_ATTACK, true);
|
||||
|
||||
if (tmpitem)
|
||||
chance = playerVictim->GetFloatValue(PLAYER_PARRY_PERCENTAGE);
|
||||
chance = playerVictim->GetFloatValue(ACTIVE_PLAYER_FIELD_PARRY_PERCENTAGE);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2666,7 +2681,7 @@ float Unit::GetUnitBlockChance(WeaponAttackType /*attType*/, Unit const* victim)
|
||||
{
|
||||
Item* tmpitem = playerVictim->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
if (tmpitem && !tmpitem->IsBroken() && tmpitem->GetTemplate()->GetInventoryType() == INVTYPE_SHIELD)
|
||||
chance = playerVictim->GetFloatValue(PLAYER_BLOCK_PERCENTAGE);
|
||||
chance = playerVictim->GetFloatValue(ACTIVE_PLAYER_FIELD_BLOCK_PERCENTAGE);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2693,13 +2708,13 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, Unit const* victi
|
||||
switch (attackType)
|
||||
{
|
||||
case BASE_ATTACK:
|
||||
chance = GetFloatValue(PLAYER_CRIT_PERCENTAGE);
|
||||
chance = GetFloatValue(ACTIVE_PLAYER_FIELD_CRIT_PERCENTAGE);
|
||||
break;
|
||||
case OFF_ATTACK:
|
||||
chance = GetFloatValue(PLAYER_OFFHAND_CRIT_PERCENTAGE);
|
||||
chance = GetFloatValue(ACTIVE_PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE);
|
||||
break;
|
||||
case RANGED_ATTACK:
|
||||
chance = GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE);
|
||||
chance = GetFloatValue(ACTIVE_PLAYER_FIELD_RANGED_CRIT_PERCENTAGE);
|
||||
break;
|
||||
// Just for good manner
|
||||
default:
|
||||
@@ -4724,26 +4739,6 @@ int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo
|
||||
});
|
||||
}
|
||||
|
||||
float Unit::GetResistanceBuffMods(SpellSchools school, bool positive) const
|
||||
{
|
||||
return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school);
|
||||
}
|
||||
|
||||
void Unit::SetResistanceBuffMods(SpellSchools school, bool positive, float val)
|
||||
{
|
||||
SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val);
|
||||
}
|
||||
|
||||
void Unit::ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
|
||||
{
|
||||
ApplyModSignedFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply);
|
||||
}
|
||||
|
||||
void Unit::ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply)
|
||||
{
|
||||
ApplyPercentModFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply);
|
||||
}
|
||||
|
||||
void Unit::InitStatBuffMods()
|
||||
{
|
||||
for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
||||
@@ -5005,6 +5000,7 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const* log)
|
||||
packet.CastID = log->castId;
|
||||
packet.SpellID = log->SpellID;
|
||||
packet.Damage = log->damage;
|
||||
packet.OriginalDamage = log->originalDamage;
|
||||
if (log->damage > log->preHitHealth)
|
||||
packet.Overkill = log->damage - log->preHitHealth;
|
||||
else
|
||||
@@ -5017,9 +5013,9 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const* log)
|
||||
packet.Periodic = log->periodicLog;
|
||||
packet.Flags = log->HitInfo;
|
||||
|
||||
WorldPackets::Spells::SandboxScalingData sandboxScalingData;
|
||||
if (sandboxScalingData.GenerateDataForUnits(log->attacker, log->target))
|
||||
packet.SandboxScaling = sandboxScalingData;
|
||||
WorldPackets::Spells::ContentTuningParams contentTuningParams;
|
||||
if (contentTuningParams.GenerateDataForUnits(log->attacker, log->target))
|
||||
packet.ContentTuning = contentTuningParams;
|
||||
|
||||
SendCombatLogMessage(&packet);
|
||||
}
|
||||
@@ -5045,10 +5041,10 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* info)
|
||||
data.SpellID = aura->GetId();
|
||||
data.LogData.Initialize(this);
|
||||
|
||||
/// @todo: should send more logs in one packet when multistrike
|
||||
WorldPackets::CombatLog::SpellPeriodicAuraLog::SpellLogEffect spellLogEffect;
|
||||
spellLogEffect.Effect = aura->GetAuraType();
|
||||
spellLogEffect.Amount = info->damage;
|
||||
spellLogEffect.OriginalDamage = info->originalDamage;
|
||||
spellLogEffect.OverHealOrKill = info->overDamage;
|
||||
spellLogEffect.SchoolMaskOrPower = aura->GetSpellInfo()->GetSchoolMask();
|
||||
spellLogEffect.AbsorbedOrAmplitude = info->absorb;
|
||||
@@ -5056,10 +5052,10 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* info)
|
||||
spellLogEffect.Crit = info->critical;
|
||||
/// @todo: implement debug info
|
||||
|
||||
WorldPackets::Spells::SandboxScalingData sandboxScalingData;
|
||||
WorldPackets::Spells::ContentTuningParams contentTuningParams;
|
||||
if (Unit* caster = ObjectAccessor::GetUnit(*this, aura->GetCasterGUID()))
|
||||
if (sandboxScalingData.GenerateDataForUnits(caster, this))
|
||||
spellLogEffect.SandboxScaling = sandboxScalingData;
|
||||
if (contentTuningParams.GenerateDataForUnits(caster, this))
|
||||
spellLogEffect.ContentTuning = contentTuningParams;
|
||||
|
||||
data.Effects.push_back(spellLogEffect);
|
||||
|
||||
@@ -5101,6 +5097,7 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo)
|
||||
packet.AttackerGUID = damageInfo->attacker->GetGUID();
|
||||
packet.VictimGUID = damageInfo->target->GetGUID();
|
||||
packet.Damage = damageInfo->damage;
|
||||
packet.OriginalDamage = damageInfo->originalDamage;
|
||||
int32 overkill = damageInfo->damage - damageInfo->target->GetHealth();
|
||||
packet.OverDamage = (overkill < 0 ? -1 : overkill);
|
||||
|
||||
@@ -5116,9 +5113,9 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo)
|
||||
|
||||
packet.LogData.Initialize(damageInfo->attacker);
|
||||
|
||||
WorldPackets::Spells::SandboxScalingData sandboxScalingData;
|
||||
if (sandboxScalingData.GenerateDataForUnits(damageInfo->attacker, damageInfo->target))
|
||||
packet.SandboxScaling = sandboxScalingData;
|
||||
WorldPackets::Spells::ContentTuningParams contentTuningParams;
|
||||
if (contentTuningParams.GenerateDataForUnits(damageInfo->attacker, damageInfo->target))
|
||||
packet.ContentTuning = contentTuningParams;
|
||||
|
||||
SendCombatLogMessage(&packet);
|
||||
}
|
||||
@@ -5130,6 +5127,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType
|
||||
dmgInfo.attacker = this;
|
||||
dmgInfo.target = target;
|
||||
dmgInfo.damage = Damage - AbsorbDamage - Resist - BlockedAmount;
|
||||
dmgInfo.originalDamage = Damage;
|
||||
dmgInfo.damageSchoolMask = damageSchoolMask;
|
||||
dmgInfo.absorb = AbsorbDamage;
|
||||
dmgInfo.resist = Resist;
|
||||
@@ -5899,7 +5897,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
{
|
||||
SetCritterGUID(minion->GetGUID());
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
minion->SetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID, GetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID));
|
||||
minion->SetGuidValue(UNIT_FIELD_BATTLE_PET_COMPANION_GUID, GetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID));
|
||||
}
|
||||
|
||||
// PvP, FFAPvP
|
||||
@@ -6354,32 +6352,12 @@ void Unit::SendHealSpellLog(HealInfo& healInfo, bool critical /*= false*/)
|
||||
|
||||
spellHealLog.TargetGUID = healInfo.GetTarget()->GetGUID();
|
||||
spellHealLog.CasterGUID = healInfo.GetHealer()->GetGUID();
|
||||
|
||||
spellHealLog.SpellID = healInfo.GetSpellInfo()->Id;
|
||||
spellHealLog.Health = healInfo.GetHeal();
|
||||
spellHealLog.OriginalHeal = healInfo.GetOriginalHeal();
|
||||
spellHealLog.OverHeal = int32(healInfo.GetHeal()) - healInfo.GetEffectiveHeal();
|
||||
spellHealLog.Absorbed = healInfo.GetAbsorb();
|
||||
|
||||
spellHealLog.Crit = critical;
|
||||
|
||||
/// @todo: 6.x Has to be implemented
|
||||
/*
|
||||
packet.ReadBit("Multistrike");
|
||||
|
||||
var hasCritRollMade = packet.ReadBit("HasCritRollMade");
|
||||
var hasCritRollNeeded = packet.ReadBit("HasCritRollNeeded");
|
||||
var hasLogData = packet.ReadBit("HasLogData");
|
||||
|
||||
if (hasCritRollMade)
|
||||
packet.ReadSingle("CritRollMade");
|
||||
|
||||
if (hasCritRollNeeded)
|
||||
packet.ReadSingle("CritRollNeeded");
|
||||
|
||||
if (hasLogData)
|
||||
SpellParsers.ReadSpellCastLogData(packet);
|
||||
*/
|
||||
|
||||
spellHealLog.LogData.Initialize(healInfo.GetTarget());
|
||||
SendCombatLogMessage(&spellHealLog);
|
||||
}
|
||||
@@ -6514,7 +6492,7 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_SPELL_SCHOOL; ++i)
|
||||
if (spellProto->GetSchoolMask() & (1 << i))
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
}
|
||||
else
|
||||
maxModDamagePercentSchool = GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, spellProto->GetSchoolMask());
|
||||
@@ -6654,7 +6632,7 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
float overrideSP = GetFloatValue(PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
float overrideSP = GetFloatValue(ACTIVE_PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
if (overrideSP > 0.0f)
|
||||
return int32(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), overrideSP) + 0.5f);
|
||||
}
|
||||
@@ -6734,7 +6712,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
|
||||
crit_chance = 0.0f;
|
||||
// For other schools
|
||||
else if (GetTypeId() == TYPEID_PLAYER)
|
||||
crit_chance = GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1);
|
||||
crit_chance = GetFloatValue(ACTIVE_PLAYER_FIELD_SPELL_CRIT_PERCENTAGE1);
|
||||
else
|
||||
crit_chance = (float)m_baseSpellCritChance;
|
||||
// taken
|
||||
@@ -6975,7 +6953,7 @@ float Unit::SpellHealingPctDone(Unit* /*victim*/, SpellInfo const* spellProto) c
|
||||
return 1.0f;
|
||||
|
||||
if (IsPlayer())
|
||||
return GetFloatValue(PLAYER_FIELD_MOD_HEALING_DONE_PCT);
|
||||
return GetFloatValue(ACTIVE_PLAYER_FIELD_MOD_HEALING_DONE_PCT);
|
||||
|
||||
float DoneTotalMod = 1.0f;
|
||||
|
||||
@@ -7074,7 +7052,7 @@ int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
float overrideSP = GetFloatValue(PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
float overrideSP = GetFloatValue(ACTIVE_PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT);
|
||||
if (overrideSP > 0.0f)
|
||||
return int32(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), overrideSP) + 0.5f);
|
||||
}
|
||||
@@ -7346,7 +7324,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
|
||||
{
|
||||
for (uint32 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
if (spellProto->GetSchoolMask() & (1 << i))
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(ACTIVE_PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
|
||||
}
|
||||
else
|
||||
maxModDamagePercentSchool = GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, spellProto->GetSchoolMask());
|
||||
@@ -9337,6 +9315,19 @@ Stats Unit::GetStatByAuraGroup(UnitMods unitMod) const
|
||||
return stat;
|
||||
}
|
||||
|
||||
void Unit::UpdateResistances(uint32 school)
|
||||
{
|
||||
if (school > SPELL_SCHOOL_NORMAL)
|
||||
{
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_RESISTANCE_START + school);
|
||||
|
||||
SetResistance(SpellSchools(school), int32(m_auraModifiersGroup[unitMod][BASE_VALUE]));
|
||||
SetBonusResistanceMod(SpellSchools(school), int32(GetTotalAuraModValue(unitMod) - GetResistance(SpellSchools(school))));
|
||||
}
|
||||
else
|
||||
UpdateArmor();
|
||||
}
|
||||
|
||||
float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const
|
||||
{
|
||||
if (attType == RANGED_ATTACK)
|
||||
@@ -10340,9 +10331,11 @@ bool Unit::IsPolymorphed() const
|
||||
return spellInfo->GetSpellSpecific() == SPELL_SPECIFIC_MAGE_POLYMORPH;
|
||||
}
|
||||
|
||||
void Unit::SetDisplayId(uint32 modelId)
|
||||
void Unit::SetDisplayId(uint32 modelId, float displayScale /*= 1.f*/)
|
||||
{
|
||||
SetUInt32Value(UNIT_FIELD_DISPLAYID, modelId);
|
||||
SetFloatValue(UNIT_FIELD_DISPLAY_SCALE, displayScale);
|
||||
|
||||
// Set Gender by modelId
|
||||
if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
|
||||
@@ -10365,7 +10358,7 @@ void Unit::RestoreDisplayId(bool ignorePositiveAurasPreventingMounting /*= false
|
||||
if (!ignorePositiveAurasPreventingMounting)
|
||||
handledAura = (*i);
|
||||
else if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*i)->GetMiscValue()))
|
||||
if (!IsDisallowedMountForm((*i)->GetId(), FORM_NONE, sObjectMgr->ChooseDisplayId(ci)))
|
||||
if (!IsDisallowedMountForm((*i)->GetId(), FORM_NONE, ObjectMgr::ChooseDisplayId(ci)->CreatureDisplayID))
|
||||
handledAura = (*i);
|
||||
}
|
||||
// prefer negative auras
|
||||
@@ -11686,7 +11679,7 @@ bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading /*= fa
|
||||
return false;
|
||||
|
||||
m_vehicleKit = new Vehicle(this, vehInfo, creatureEntry);
|
||||
m_updateFlag |= UPDATEFLAG_VEHICLE;
|
||||
m_updateFlag.Vehicle = true;
|
||||
m_unitTypeMask |= UNIT_MASK_VEHICLE;
|
||||
|
||||
if (!loading)
|
||||
@@ -11708,7 +11701,7 @@ void Unit::RemoveVehicleKit(bool onRemoveFromWorld /*= false*/)
|
||||
|
||||
m_vehicleKit = NULL;
|
||||
|
||||
m_updateFlag &= ~UPDATEFLAG_VEHICLE;
|
||||
m_updateFlag.Vehicle = false;
|
||||
m_unitTypeMask &= ~UNIT_MASK_VEHICLE;
|
||||
RemoveFlag64(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK | UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
}
|
||||
@@ -13121,15 +13114,17 @@ void Unit::SendClearTarget()
|
||||
SendMessageToSet(breakTarget.Write(), false);
|
||||
}
|
||||
|
||||
uint32 Unit::GetResistance(SpellSchoolMask mask) const
|
||||
int32 Unit::GetResistance(SpellSchoolMask mask) const
|
||||
{
|
||||
int32 resist = -1;
|
||||
Optional<int32> resist;
|
||||
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
|
||||
if (mask & (1 << i) && (resist < 0 || resist > int32(GetResistance(SpellSchools(i)))))
|
||||
resist = int32(GetResistance(SpellSchools(i)));
|
||||
{
|
||||
int32 schoolResistance = GetResistance(SpellSchools(i)) + GetBonusResistanceMod(SpellSchools(i));
|
||||
if (mask & (1 << i) && (!resist || *resist > schoolResistance))
|
||||
resist = schoolResistance;
|
||||
}
|
||||
|
||||
// resist value will never be negative here
|
||||
return uint32(resist);
|
||||
return resist ? *resist : 0;
|
||||
}
|
||||
|
||||
void CharmInfo::SetIsCommandAttack(bool val)
|
||||
@@ -13673,7 +13668,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
if (target == this)
|
||||
visibleFlag |= UF_FLAG_PRIVATE;
|
||||
else if (GetTypeId() == TYPEID_PLAYER)
|
||||
valCount = PLAYER_FIELD_END_NOT_SELF;
|
||||
valCount = PLAYER_END;
|
||||
|
||||
std::size_t blockCount = UpdateMask::GetBlockCount(valCount);
|
||||
|
||||
@@ -13721,8 +13716,6 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
// FIXME: Some values at server stored in float format but must be sent to client in uint32 format
|
||||
// there are some float values which may be negative or can't get negative due to other checks
|
||||
else if ((index >= UNIT_FIELD_NEGSTAT && index < UNIT_FIELD_NEGSTAT + MAX_STATS) ||
|
||||
(index >= UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE && index < (UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + MAX_SPELL_SCHOOL)) ||
|
||||
(index >= UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE && index < (UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + MAX_SPELL_SCHOOL)) ||
|
||||
(index >= UNIT_FIELD_POSSTAT && index < UNIT_FIELD_POSSTAT + MAX_STATS))
|
||||
{
|
||||
*data << uint32(m_floatValues[index]);
|
||||
@@ -13756,7 +13749,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
|
||||
|
||||
if (cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
|
||||
if (target->IsGameMaster())
|
||||
displayId = cinfo->GetFirstVisibleModel();
|
||||
displayId = cinfo->GetFirstVisibleModel()->CreatureDisplayID;
|
||||
}
|
||||
|
||||
*data << uint32(displayId);
|
||||
|
||||
@@ -576,6 +576,7 @@ class TC_GAME_API DamageInfo
|
||||
Unit* const m_attacker;
|
||||
Unit* const m_victim;
|
||||
uint32 m_damage;
|
||||
uint32 const m_originalDamage;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
SpellSchoolMask const m_schoolMask;
|
||||
DamageEffectType const m_damageType;
|
||||
@@ -601,6 +602,7 @@ class TC_GAME_API DamageInfo
|
||||
DamageEffectType GetDamageType() const { return m_damageType; }
|
||||
WeaponAttackType GetAttackType() const { return m_attackType; }
|
||||
uint32 GetDamage() const { return m_damage; }
|
||||
uint32 GetOriginalDamage() const { return m_originalDamage; }
|
||||
uint32 GetAbsorb() const { return m_absorb; }
|
||||
uint32 GetResist() const { return m_resist; }
|
||||
uint32 GetBlock() const { return m_block; }
|
||||
@@ -614,6 +616,7 @@ class TC_GAME_API HealInfo
|
||||
Unit* const _healer;
|
||||
Unit* const _target;
|
||||
uint32 _heal;
|
||||
uint32 const _originalHeal;
|
||||
uint32 _effectiveHeal;
|
||||
uint32 _absorb;
|
||||
SpellInfo const* const _spellInfo;
|
||||
@@ -629,6 +632,7 @@ class TC_GAME_API HealInfo
|
||||
Unit* GetHealer() const { return _healer; }
|
||||
Unit* GetTarget() const { return _target; }
|
||||
uint32 GetHeal() const { return _heal; }
|
||||
uint32 GetOriginalHeal() const { return _originalHeal; }
|
||||
uint32 GetEffectiveHeal() const { return _effectiveHeal; }
|
||||
uint32 GetAbsorb() const { return _absorb; }
|
||||
SpellInfo const* GetSpellInfo() const { return _spellInfo; };
|
||||
@@ -682,6 +686,7 @@ struct CalcDamageInfo
|
||||
Unit *target; // Target for damage
|
||||
uint32 damageSchoolMask;
|
||||
uint32 damage;
|
||||
uint32 originalDamage;
|
||||
uint32 absorb;
|
||||
uint32 resist;
|
||||
uint32 blocked_amount;
|
||||
@@ -706,6 +711,7 @@ struct TC_GAME_API SpellNonMeleeDamage
|
||||
uint32 SpellID;
|
||||
uint32 SpellXSpellVisualID;
|
||||
uint32 damage;
|
||||
uint32 originalDamage;
|
||||
uint32 schoolMask;
|
||||
uint32 absorb;
|
||||
uint32 resist;
|
||||
@@ -720,11 +726,12 @@ struct TC_GAME_API SpellNonMeleeDamage
|
||||
|
||||
struct SpellPeriodicAuraLogInfo
|
||||
{
|
||||
SpellPeriodicAuraLogInfo(AuraEffect const* _auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
|
||||
: auraEff(_auraEff), damage(_damage), overDamage(_overDamage), absorb(_absorb), resist(_resist), multiplier(_multiplier), critical(_critical){ }
|
||||
SpellPeriodicAuraLogInfo(AuraEffect const* _auraEff, uint32 _damage, uint32 _originalDamage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
|
||||
: auraEff(_auraEff), damage(_damage), originalDamage(_originalDamage), overDamage(_overDamage), absorb(_absorb), resist(_resist), multiplier(_multiplier), critical(_critical){ }
|
||||
|
||||
AuraEffect const* auraEff;
|
||||
uint32 damage;
|
||||
uint32 originalDamage;
|
||||
uint32 overDamage; // overkill/overheal
|
||||
uint32 absorb;
|
||||
uint32 resist;
|
||||
@@ -1033,12 +1040,18 @@ class TC_GAME_API Unit : public WorldObject
|
||||
|
||||
float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT+stat)); }
|
||||
void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT+stat, val); }
|
||||
uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL); }
|
||||
void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); }
|
||||
uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL) + GetBonusResistanceMod(SPELL_SCHOOL_NORMAL); }
|
||||
void SetArmor(int32 val, int32 bonusVal)
|
||||
{
|
||||
SetResistance(SPELL_SCHOOL_NORMAL, val);
|
||||
SetBonusResistanceMod(SPELL_SCHOOL_NORMAL, bonusVal);
|
||||
}
|
||||
|
||||
uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); }
|
||||
uint32 GetResistance(SpellSchoolMask mask) const;
|
||||
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school, val); }
|
||||
int32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES + school); }
|
||||
int32 GetBonusResistanceMod(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_BONUS_RESISTANCE_MODS + school); }
|
||||
int32 GetResistance(SpellSchoolMask mask) const;
|
||||
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES + school, val); }
|
||||
void SetBonusResistanceMod(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_BONUS_RESISTANCE_MODS + school, val); }
|
||||
|
||||
uint64 GetHealth() const { return GetUInt64Value(UNIT_FIELD_HEALTH); }
|
||||
uint64 GetMaxHealth() const { return GetUInt64Value(UNIT_FIELD_MAXHEALTH); }
|
||||
@@ -1533,10 +1546,6 @@ class TC_GAME_API Unit : public WorldObject
|
||||
int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
|
||||
int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
|
||||
|
||||
float GetResistanceBuffMods(SpellSchools school, bool positive) const;
|
||||
void SetResistanceBuffMods(SpellSchools school, bool positive, float val);
|
||||
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply);
|
||||
void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply);
|
||||
void InitStatBuffMods();
|
||||
void ApplyStatBuffMod(Stats stat, float val, bool apply);
|
||||
void ApplyStatPercentBuffMod(Stats stat, float val, bool apply);
|
||||
@@ -1620,7 +1629,7 @@ class TC_GAME_API Unit : public WorldObject
|
||||
void SetCanModifyStats(bool modifyStats) { m_canModifyStats = modifyStats; }
|
||||
virtual bool UpdateStats(Stats stat) = 0;
|
||||
virtual bool UpdateAllStats() = 0;
|
||||
virtual void UpdateResistances(uint32 school) = 0;
|
||||
virtual void UpdateResistances(uint32 school);
|
||||
virtual void UpdateAllResistances();
|
||||
virtual void UpdateArmor() = 0;
|
||||
virtual void UpdateMaxHealth() = 0;
|
||||
@@ -1675,10 +1684,11 @@ class TC_GAME_API Unit : public WorldObject
|
||||
void UpdateInterruptMask();
|
||||
|
||||
uint32 GetDisplayId() const { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
|
||||
virtual void SetDisplayId(uint32 modelId);
|
||||
virtual void SetDisplayId(uint32 modelId, float displayScale = 1.f);
|
||||
uint32 GetNativeDisplayId() const { return GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID); }
|
||||
float GetNativeDisplayScale() const { return GetFloatValue(UNIT_FIELD_NATIVE_X_DISPLAY_SCALE); }
|
||||
void RestoreDisplayId(bool ignorePositiveAurasPreventingMounting = false);
|
||||
void SetNativeDisplayId(uint32 modelId) { SetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID, modelId); }
|
||||
void SetNativeDisplayId(uint32 displayId, float displayScale = 1.f) { SetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID, displayId); SetFloatValue(UNIT_FIELD_NATIVE_X_DISPLAY_SCALE, displayScale); }
|
||||
void setTransForm(uint32 spellid) { m_transform = spellid;}
|
||||
uint32 getTransForm() const { return m_transform;}
|
||||
|
||||
|
||||
@@ -147,8 +147,8 @@ void AreaTriggerDataStore::LoadAreaTriggerTemplates()
|
||||
while (templates->NextRow());
|
||||
}
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
if (QueryResult areatriggerSpellMiscs = WorldDatabase.Query("SELECT SpellMiscId, AreaTriggerId, MoveCurveId, ScaleCurveId, MorphCurveId, FacingCurveId, DecalPropertiesId, TimeToTarget, TimeToTargetScale FROM `spell_areatrigger`"))
|
||||
// 0 1 2 3 4 5 6 7 8 9 10
|
||||
if (QueryResult areatriggerSpellMiscs = WorldDatabase.Query("SELECT SpellMiscId, AreaTriggerId, MoveCurveId, ScaleCurveId, MorphCurveId, FacingCurveId, AnimId, AnimKitId, DecalPropertiesId, TimeToTarget, TimeToTargetScale FROM `spell_areatrigger`"))
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -182,10 +182,13 @@ void AreaTriggerDataStore::LoadAreaTriggerTemplates()
|
||||
|
||||
#undef VALIDATE_AND_SET_CURVE
|
||||
|
||||
miscTemplate.DecalPropertiesId = areatriggerSpellMiscFields[6].GetUInt32();
|
||||
miscTemplate.AnimId = areatriggerSpellMiscFields[6].GetInt32();
|
||||
miscTemplate.AnimKitId = areatriggerSpellMiscFields[7].GetInt32();
|
||||
|
||||
miscTemplate.TimeToTarget = areatriggerSpellMiscFields[7].GetUInt32();
|
||||
miscTemplate.TimeToTargetScale = areatriggerSpellMiscFields[8].GetUInt32();
|
||||
miscTemplate.DecalPropertiesId = areatriggerSpellMiscFields[8].GetUInt32();
|
||||
|
||||
miscTemplate.TimeToTarget = areatriggerSpellMiscFields[9].GetUInt32();
|
||||
miscTemplate.TimeToTargetScale = areatriggerSpellMiscFields[10].GetUInt32();
|
||||
|
||||
miscTemplate.SplinePoints = std::move(splinesBySpellMisc[miscTemplate.MiscId]);
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ void ConversationDataStore::LoadConversationTemplates()
|
||||
TC_LOG_INFO("server.loading", ">> Loaded 0 Conversation actors. DB table `conversation_actors` is empty.");
|
||||
}
|
||||
|
||||
if (QueryResult templates = WorldDatabase.Query("SELECT Id, FirstLineId, LastLineEndTime, ScriptName FROM conversation_template"))
|
||||
if (QueryResult templates = WorldDatabase.Query("SELECT Id, FirstLineId, LastLineEndTime, TextureKitId, ScriptName FROM conversation_template"))
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
@@ -162,7 +162,8 @@ void ConversationDataStore::LoadConversationTemplates()
|
||||
conversationTemplate.Id = fields[0].GetUInt32();
|
||||
conversationTemplate.FirstLineId = fields[1].GetUInt32();
|
||||
conversationTemplate.LastLineEndTime = fields[2].GetUInt32();
|
||||
conversationTemplate.ScriptId = sObjectMgr->GetScriptId(fields[3].GetString());
|
||||
conversationTemplate.TextureKitId = fields[3].GetUInt32();
|
||||
conversationTemplate.ScriptId = sObjectMgr->GetScriptId(fields[4].GetString());
|
||||
|
||||
conversationTemplate.Actors = std::move(actorsByConversation[conversationTemplate.Id]);
|
||||
conversationTemplate.ActorGuids = std::move(actorGuidsByConversation[conversationTemplate.Id]);
|
||||
@@ -184,7 +185,7 @@ void ConversationDataStore::LoadConversationTemplates()
|
||||
currentConversationLine = sConversationLineStore.AssertEntry(currentConversationLine->NextConversationLineID);
|
||||
}
|
||||
|
||||
_conversationTemplateStore[conversationTemplate.Id] = conversationTemplate;
|
||||
_conversationTemplateStore[conversationTemplate.Id] = std::move(conversationTemplate);
|
||||
}
|
||||
while (templates->NextRow());
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ enum ConversationLineFlags
|
||||
CONVERSATION_LINE_FLAG_NOTIFY_STARTED = 0x1 // Client will send CMSG_CONVERSATION_LINE_STARTED when it runs this line
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct ConversationActorTemplate
|
||||
{
|
||||
uint32 Id;
|
||||
@@ -36,6 +35,7 @@ struct ConversationActorTemplate
|
||||
uint32 CreatureModelId;
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct ConversationLineTemplate
|
||||
{
|
||||
uint32 Id; // Link to ConversationLine.db2
|
||||
@@ -52,6 +52,7 @@ struct ConversationTemplate
|
||||
uint32 Id;
|
||||
uint32 FirstLineId; // Link to ConversationLine.db2
|
||||
uint32 LastLineEndTime; // Time in ms after conversation creation the last line fades out
|
||||
uint32 TextureKitId; // Background texture
|
||||
|
||||
std::vector<ConversationActorTemplate const*> Actors;
|
||||
std::vector<ObjectGuid::LowType> ActorGuids;
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "VMapFactory.h"
|
||||
#include "World.h"
|
||||
#include <G3D/g3dmath.h>
|
||||
#include <numeric>
|
||||
|
||||
ScriptMapMap sSpellScripts;
|
||||
ScriptMapMap sEventScripts;
|
||||
@@ -171,30 +172,37 @@ ExtendedPlayerName ExtractExtendedPlayerName(std::string const& name)
|
||||
|
||||
LanguageDesc lang_description[LANGUAGES_COUNT] =
|
||||
{
|
||||
{ LANG_ADDON, 0, 0 },
|
||||
{ LANG_UNIVERSAL, 0, 0 },
|
||||
{ LANG_ORCISH, 669, SKILL_LANG_ORCISH },
|
||||
{ LANG_DARNASSIAN, 671, SKILL_LANG_DARNASSIAN },
|
||||
{ LANG_TAURAHE, 670, SKILL_LANG_TAURAHE },
|
||||
{ LANG_DWARVISH, 672, SKILL_LANG_DWARVEN },
|
||||
{ LANG_COMMON, 668, SKILL_LANG_COMMON },
|
||||
{ LANG_DEMONIC, 815, SKILL_LANG_DEMON_TONGUE },
|
||||
{ LANG_TITAN, 816, SKILL_LANG_TITAN },
|
||||
{ LANG_THALASSIAN, 813, SKILL_LANG_THALASSIAN },
|
||||
{ LANG_DRACONIC, 814, SKILL_LANG_DRACONIC },
|
||||
{ LANG_KALIMAG, 817, SKILL_LANG_OLD_TONGUE },
|
||||
{ LANG_GNOMISH, 7340, SKILL_LANG_GNOMISH },
|
||||
{ LANG_TROLL, 7341, SKILL_LANG_TROLL },
|
||||
{ LANG_GUTTERSPEAK, 17737, SKILL_LANG_FORSAKEN },
|
||||
{ LANG_DRAENEI, 29932, SKILL_LANG_DRAENEI },
|
||||
{ LANG_ZOMBIE, 0, 0 },
|
||||
{ LANG_GNOMISH_BINARY, 0, 0 },
|
||||
{ LANG_GOBLIN_BINARY, 0, 0 },
|
||||
{ LANG_WORGEN, 69270, SKILL_LANG_GILNEAN },
|
||||
{ LANG_GOBLIN, 69269, SKILL_LANG_GOBLIN },
|
||||
{ LANG_PANDAREN_NEUTRAL, 108127, SKILL_LANG_PANDAREN_NEUTRAL },
|
||||
{ LANG_PANDAREN_ALLIANCE, 108130, SKILL_LANG_PANDAREN_ALLIANCE },
|
||||
{ LANG_PANDAREN_HORDE, 108131, SKILL_LANG_PANDAREN_HORDE }
|
||||
{ LANG_ADDON, 0, 0 },
|
||||
{ LANG_ADDON_LOGGED, 0, 0 },
|
||||
{ LANG_UNIVERSAL, 0, 0 },
|
||||
{ LANG_ORCISH, 669, SKILL_LANGUAGE_ORCISH },
|
||||
{ LANG_DARNASSIAN, 671, SKILL_LANGUAGE_DARNASSIAN },
|
||||
{ LANG_TAURAHE, 670, SKILL_LANGUAGE_TAURAHE },
|
||||
{ LANG_DWARVISH, 672, SKILL_LANGUAGE_DWARVEN },
|
||||
{ LANG_COMMON, 668, SKILL_LANGUAGE_COMMON },
|
||||
{ LANG_DEMONIC, 815, SKILL_LANGUAGE_DEMON_TONGUE },
|
||||
{ LANG_TITAN, 816, SKILL_LANGUAGE_TITAN },
|
||||
{ LANG_THALASSIAN, 813, SKILL_LANGUAGE_THALASSIAN },
|
||||
{ LANG_DRACONIC, 814, SKILL_LANGUAGE_DRACONIC },
|
||||
{ LANG_KALIMAG, 265462, SKILL_LANGUAGE_OLD_TONGUE },
|
||||
{ LANG_GNOMISH, 7340, SKILL_LANGUAGE_GNOMISH },
|
||||
{ LANG_TROLL, 7341, SKILL_LANGUAGE_TROLL },
|
||||
{ LANG_GUTTERSPEAK, 17737, SKILL_LANGUAGE_FORSAKEN },
|
||||
{ LANG_DRAENEI, 29932, SKILL_LANGUAGE_DRAENEI },
|
||||
{ LANG_ZOMBIE, 265467, 0 },
|
||||
{ LANG_GNOMISH_BINARY, 265460, 0 },
|
||||
{ LANG_GOBLIN_BINARY, 265461, 0 },
|
||||
{ LANG_WORGEN, 69270, SKILL_LANGUAGE_GILNEAN },
|
||||
{ LANG_GOBLIN, 69269, SKILL_LANGUAGE_GOBLIN },
|
||||
{ LANG_PANDAREN_NEUTRAL, 108127, SKILL_LANGUAGE_PANDAREN_NEUTRAL },
|
||||
{ LANG_PANDAREN_ALLIANCE, 108130, 0 },
|
||||
{ LANG_PANDAREN_HORDE, 108131, 0 },
|
||||
{ LANG_SPRITE, 265466, 0 },
|
||||
{ LANG_SHATH_YAR, 265465, 0 },
|
||||
{ LANG_NERGLISH, 265464, 0 },
|
||||
{ LANG_MOONKIN, 265463, 0 },
|
||||
{ LANG_SHALASSIAN, 262439, SKILL_LANGUAGE_SHALASSIAN },
|
||||
{ LANG_THALASSIAN_2, 262454, SKILL_LANGUAGE_THALASSIAN_2 }
|
||||
};
|
||||
|
||||
LanguageDesc const* GetLanguageDescByID(uint32 lang)
|
||||
@@ -404,21 +412,21 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
|
||||
// 9 10 11 12 13 14 15 16 17 18 19 20
|
||||
"modelid4, name, femaleName, subname, TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, "
|
||||
// 21 22 23 24 25 26 27 28 29 30 31
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, name, femaleName, subname, "
|
||||
// 9 10 11 12 13 14 15 16
|
||||
"TitleAlt, IconName, gossip_menu_id, minlevel, maxlevel, HealthScalingExpansion, RequiredExpansion, VignetteID, "
|
||||
// 17 18 19 20 21 22 23 24 25 26 27
|
||||
"faction, npcflag, speed_walk, speed_run, scale, rank, dmgschool, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, "
|
||||
// 32 33 34 35 36 37 38 39
|
||||
// 28 29 30 31 32 33 34 35
|
||||
"unit_class, unit_flags, unit_flags2, unit_flags3, dynamicflags, family, trainer_class, type, "
|
||||
// 40 41 42 43 44 45 46 47 48 49 50
|
||||
// 36 37 38 39 40 41 42 43 44 45 46
|
||||
"type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, "
|
||||
// 51 52 53 54 55 56 57 58 59 60 61 62 63
|
||||
// 47 48 49 50 51 52 53 54 55 56 57 58 59
|
||||
"spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, "
|
||||
// 64 65 66 67 68 69 70 71 72
|
||||
// 60 61 62 63 64 65 66 67 68
|
||||
"InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, "
|
||||
// 73 74 75 76 77 78
|
||||
// 69 70 71 72 73 74
|
||||
"RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template");
|
||||
|
||||
if (!result)
|
||||
@@ -435,6 +443,9 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
// We load the creature models after loading but before checking
|
||||
LoadCreatureTemplateModels();
|
||||
|
||||
// Checking needs to be done after loading because of the difficulty self referencing
|
||||
for (CreatureTemplateContainer::const_iterator itr = _creatureTemplateStore.begin(); itr != _creatureTemplateStore.end(); ++itr)
|
||||
CheckCreatureTemplate(&itr->second);
|
||||
@@ -456,72 +467,121 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields)
|
||||
for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i)
|
||||
creatureTemplate.KillCredit[i] = fields[4 + i].GetUInt32();
|
||||
|
||||
creatureTemplate.Modelid1 = fields[6].GetUInt32();
|
||||
creatureTemplate.Modelid2 = fields[7].GetUInt32();
|
||||
creatureTemplate.Modelid3 = fields[8].GetUInt32();
|
||||
creatureTemplate.Modelid4 = fields[9].GetUInt32();
|
||||
creatureTemplate.Name = fields[10].GetString();
|
||||
creatureTemplate.FemaleName = fields[11].GetString();
|
||||
creatureTemplate.SubName = fields[12].GetString();
|
||||
creatureTemplate.TitleAlt = fields[13].GetString();
|
||||
creatureTemplate.IconName = fields[14].GetString();
|
||||
creatureTemplate.GossipMenuId = fields[15].GetUInt32();
|
||||
creatureTemplate.minlevel = fields[16].GetInt16();
|
||||
creatureTemplate.maxlevel = fields[17].GetInt16();
|
||||
creatureTemplate.HealthScalingExpansion = fields[18].GetInt32();
|
||||
creatureTemplate.RequiredExpansion = fields[19].GetUInt32();
|
||||
creatureTemplate.VignetteID = fields[20].GetUInt32();
|
||||
creatureTemplate.faction = fields[21].GetUInt16();
|
||||
creatureTemplate.npcflag = fields[22].GetUInt64();
|
||||
creatureTemplate.speed_walk = fields[23].GetFloat();
|
||||
creatureTemplate.speed_run = fields[24].GetFloat();
|
||||
creatureTemplate.scale = fields[25].GetFloat();
|
||||
creatureTemplate.rank = uint32(fields[26].GetUInt8());
|
||||
creatureTemplate.dmgschool = uint32(fields[27].GetInt8());
|
||||
creatureTemplate.BaseAttackTime = fields[28].GetUInt32();
|
||||
creatureTemplate.RangeAttackTime = fields[29].GetUInt32();
|
||||
creatureTemplate.BaseVariance = fields[30].GetFloat();
|
||||
creatureTemplate.RangeVariance = fields[31].GetFloat();
|
||||
creatureTemplate.unit_class = uint32(fields[32].GetUInt8());
|
||||
creatureTemplate.unit_flags = fields[33].GetUInt32();
|
||||
creatureTemplate.unit_flags2 = fields[34].GetUInt32();
|
||||
creatureTemplate.unit_flags3 = fields[35].GetUInt32();
|
||||
creatureTemplate.dynamicflags = fields[36].GetUInt32();
|
||||
creatureTemplate.family = CreatureFamily(fields[37].GetUInt8());
|
||||
creatureTemplate.trainer_class = uint32(fields[38].GetUInt8());
|
||||
creatureTemplate.type = uint32(fields[39].GetUInt8());
|
||||
creatureTemplate.type_flags = fields[40].GetUInt32();
|
||||
creatureTemplate.type_flags2 = fields[41].GetUInt32();
|
||||
creatureTemplate.lootid = fields[42].GetUInt32();
|
||||
creatureTemplate.pickpocketLootId = fields[43].GetUInt32();
|
||||
creatureTemplate.SkinLootId = fields[44].GetUInt32();
|
||||
creatureTemplate.Name = fields[6].GetString();
|
||||
creatureTemplate.FemaleName = fields[7].GetString();
|
||||
creatureTemplate.SubName = fields[8].GetString();
|
||||
creatureTemplate.TitleAlt = fields[9].GetString();
|
||||
creatureTemplate.IconName = fields[10].GetString();
|
||||
creatureTemplate.GossipMenuId = fields[11].GetUInt32();
|
||||
creatureTemplate.minlevel = fields[12].GetInt16();
|
||||
creatureTemplate.maxlevel = fields[13].GetInt16();
|
||||
creatureTemplate.HealthScalingExpansion = fields[14].GetInt32();
|
||||
creatureTemplate.RequiredExpansion = fields[15].GetUInt32();
|
||||
creatureTemplate.VignetteID = fields[16].GetUInt32();
|
||||
creatureTemplate.faction = fields[17].GetUInt16();
|
||||
creatureTemplate.npcflag = fields[18].GetUInt64();
|
||||
creatureTemplate.speed_walk = fields[19].GetFloat();
|
||||
creatureTemplate.speed_run = fields[20].GetFloat();
|
||||
creatureTemplate.scale = fields[21].GetFloat();
|
||||
creatureTemplate.rank = uint32(fields[22].GetUInt8());
|
||||
creatureTemplate.dmgschool = uint32(fields[23].GetInt8());
|
||||
creatureTemplate.BaseAttackTime = fields[24].GetUInt32();
|
||||
creatureTemplate.RangeAttackTime = fields[25].GetUInt32();
|
||||
creatureTemplate.BaseVariance = fields[26].GetFloat();
|
||||
creatureTemplate.RangeVariance = fields[27].GetFloat();
|
||||
creatureTemplate.unit_class = uint32(fields[28].GetUInt8());
|
||||
creatureTemplate.unit_flags = fields[29].GetUInt32();
|
||||
creatureTemplate.unit_flags2 = fields[30].GetUInt32();
|
||||
creatureTemplate.unit_flags3 = fields[31].GetUInt32();
|
||||
creatureTemplate.dynamicflags = fields[32].GetUInt32();
|
||||
creatureTemplate.family = CreatureFamily(fields[33].GetUInt8());
|
||||
creatureTemplate.trainer_class = uint32(fields[34].GetUInt8());
|
||||
creatureTemplate.type = uint32(fields[35].GetUInt8());
|
||||
creatureTemplate.type_flags = fields[36].GetUInt32();
|
||||
creatureTemplate.type_flags2 = fields[37].GetUInt32();
|
||||
creatureTemplate.lootid = fields[38].GetUInt32();
|
||||
creatureTemplate.pickpocketLootId = fields[39].GetUInt32();
|
||||
creatureTemplate.SkinLootId = fields[40].GetUInt32();
|
||||
|
||||
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
creatureTemplate.resistance[i] = fields[45 + i - 1].GetInt16();
|
||||
creatureTemplate.resistance[i] = fields[41 + i - 1].GetInt16();
|
||||
|
||||
for (uint8 i = 0; i < MAX_CREATURE_SPELLS; ++i)
|
||||
creatureTemplate.spells[i] = fields[51 + i].GetUInt32();
|
||||
creatureTemplate.spells[i] = fields[47 + i].GetUInt32();
|
||||
|
||||
creatureTemplate.VehicleId = fields[59].GetUInt32();
|
||||
creatureTemplate.mingold = fields[60].GetUInt32();
|
||||
creatureTemplate.maxgold = fields[61].GetUInt32();
|
||||
creatureTemplate.AIName = fields[62].GetString();
|
||||
creatureTemplate.MovementType = uint32(fields[63].GetUInt8());
|
||||
creatureTemplate.InhabitType = uint32(fields[64].GetUInt8());
|
||||
creatureTemplate.HoverHeight = fields[65].GetFloat();
|
||||
creatureTemplate.ModHealth = fields[66].GetFloat();
|
||||
creatureTemplate.ModHealthExtra = fields[67].GetFloat();
|
||||
creatureTemplate.ModMana = fields[68].GetFloat();
|
||||
creatureTemplate.ModManaExtra = fields[69].GetFloat();
|
||||
creatureTemplate.ModArmor = fields[70].GetFloat();
|
||||
creatureTemplate.ModDamage = fields[71].GetFloat();
|
||||
creatureTemplate.ModExperience = fields[72].GetFloat();
|
||||
creatureTemplate.RacialLeader = fields[73].GetBool();
|
||||
creatureTemplate.movementId = fields[74].GetUInt32();
|
||||
creatureTemplate.RegenHealth = fields[75].GetBool();
|
||||
creatureTemplate.MechanicImmuneMask = fields[76].GetUInt32();
|
||||
creatureTemplate.flags_extra = fields[77].GetUInt32();
|
||||
creatureTemplate.ScriptID = GetScriptId(fields[78].GetString());
|
||||
creatureTemplate.VehicleId = fields[55].GetUInt32();
|
||||
creatureTemplate.mingold = fields[56].GetUInt32();
|
||||
creatureTemplate.maxgold = fields[57].GetUInt32();
|
||||
creatureTemplate.AIName = fields[58].GetString();
|
||||
creatureTemplate.MovementType = uint32(fields[59].GetUInt8());
|
||||
creatureTemplate.InhabitType = uint32(fields[60].GetUInt8());
|
||||
creatureTemplate.HoverHeight = fields[61].GetFloat();
|
||||
creatureTemplate.ModHealth = fields[62].GetFloat();
|
||||
creatureTemplate.ModHealthExtra = fields[63].GetFloat();
|
||||
creatureTemplate.ModMana = fields[64].GetFloat();
|
||||
creatureTemplate.ModManaExtra = fields[65].GetFloat();
|
||||
creatureTemplate.ModArmor = fields[66].GetFloat();
|
||||
creatureTemplate.ModDamage = fields[67].GetFloat();
|
||||
creatureTemplate.ModExperience = fields[68].GetFloat();
|
||||
creatureTemplate.RacialLeader = fields[69].GetBool();
|
||||
creatureTemplate.movementId = fields[70].GetUInt32();
|
||||
creatureTemplate.RegenHealth = fields[71].GetBool();
|
||||
creatureTemplate.MechanicImmuneMask = fields[72].GetUInt32();
|
||||
creatureTemplate.flags_extra = fields[73].GetUInt32();
|
||||
creatureTemplate.ScriptID = GetScriptId(fields[74].GetString());
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadCreatureTemplateModels()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult result = WorldDatabase.Query("SELECT CreatureID, CreatureDisplayID, DisplayScale, Probability FROM creature_template_model ORDER BY Idx ASC");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
TC_LOG_INFO("server.loading", ">> Loaded 0 creature template model definitions. DB table `creature_template_model` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 creatureId = fields[0].GetUInt32();
|
||||
uint32 creatureDisplayId = fields[1].GetUInt32();
|
||||
float displayScale = fields[2].GetFloat();
|
||||
float probability = fields[3].GetFloat();
|
||||
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate(creatureId);
|
||||
if (!cInfo)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature template (Entry: %u) does not exist but has a record in `creature_template_model`", creatureId);
|
||||
continue;
|
||||
}
|
||||
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(creatureDisplayId);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing CreatureDisplayID id (%u), this can crash the client.", creatureId, creatureDisplayId);
|
||||
continue;
|
||||
}
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(creatureDisplayId);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `CreatureDisplayID` = %u listed by creature (Entry: %u).", creatureDisplayId, creatureId);
|
||||
|
||||
if (displayScale <= 0.0f)
|
||||
displayScale = 1.0f;
|
||||
|
||||
const_cast<CreatureTemplate*>(cInfo)->Models.emplace_back(creatureDisplayId, displayScale, probability);
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u creature template models in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadCreatureTemplateAddons()
|
||||
@@ -860,76 +920,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
const_cast<CreatureTemplate*>(cInfo)->faction = sFactionTemplateStore.AssertEntry(35)->ID; // this might seem stupid but all shit will would break if faction 35 did not exist
|
||||
}
|
||||
|
||||
// used later for scale
|
||||
CreatureDisplayInfoEntry const* displayScaleEntry = nullptr;
|
||||
|
||||
if (cInfo->Modelid1)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid1);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid1 = 0;
|
||||
}
|
||||
else
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid1);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (cInfo->Modelid2)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid2);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid2 = 0;
|
||||
}
|
||||
else if (!displayScaleEntry)
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (cInfo->Modelid3)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid3);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid3 = 0;
|
||||
}
|
||||
else if (!displayScaleEntry)
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid3);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (cInfo->Modelid4)
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid4);
|
||||
if (!displayEntry)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4);
|
||||
const_cast<CreatureTemplate*>(cInfo)->Modelid4 = 0;
|
||||
}
|
||||
else if (!displayScaleEntry)
|
||||
displayScaleEntry = displayEntry;
|
||||
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);
|
||||
if (!modelInfo)
|
||||
TC_LOG_ERROR("sql.sql", "No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry);
|
||||
}
|
||||
|
||||
if (!displayScaleEntry)
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry);
|
||||
|
||||
for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k)
|
||||
{
|
||||
if (cInfo->KillCredit[k])
|
||||
@@ -942,6 +932,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if (!cInfo->Models.size())
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) does not have any existing display id in creature_template_model.", cInfo->Entry);
|
||||
else if (std::accumulate(cInfo->Models.begin(), cInfo->Models.end(), 0.0f, [](float sum, CreatureModel const& model) { return sum + model.Probability; }) <= 0.0f)
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has zero total chance for all models in creature_template_model.", cInfo->Entry);
|
||||
|
||||
if (!cInfo->unit_class || ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
|
||||
@@ -1022,15 +1017,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
const_cast<CreatureTemplate*>(cInfo)->MovementType = IDLE_MOTION_TYPE;
|
||||
}
|
||||
|
||||
/// if not set custom creature scale then load scale from CreatureDisplayInfo.dbc
|
||||
if (cInfo->scale <= 0.0f)
|
||||
{
|
||||
if (displayScaleEntry)
|
||||
const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->CreatureModelScale;
|
||||
else
|
||||
const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f;
|
||||
}
|
||||
|
||||
if (cInfo->HealthScalingExpansion < EXPANSION_LEVEL_CURRENT || cInfo->HealthScalingExpansion > (MAX_EXPANSIONS - 1))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature_template` lists creature (ID: %u) with invalid `HealthScalingExpansion` %i. Ignored and set to 0.", cInfo->Entry, cInfo->HealthScalingExpansion);
|
||||
@@ -1402,14 +1388,16 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= nullptr*/)
|
||||
CreatureModel const* ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= nullptr*/)
|
||||
{
|
||||
// Load creature model (display id)
|
||||
if (data && data->displayid)
|
||||
return data->displayid;
|
||||
if (CreatureModel const* model = cinfo->GetModelWithDisplayId(data->displayid))
|
||||
return model;
|
||||
|
||||
if (!(cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER))
|
||||
return cinfo->GetRandomValidModelId();
|
||||
if (CreatureModel const* model = cinfo->GetRandomValidModel())
|
||||
return model;
|
||||
|
||||
// Triggers by default receive the invisible model
|
||||
return cinfo->GetFirstInvisibleModel();
|
||||
@@ -1442,9 +1430,9 @@ void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cInfo, uint64& npcFl
|
||||
}
|
||||
}
|
||||
|
||||
CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID) const
|
||||
CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(CreatureModel* model, CreatureTemplate const* creatureTemplate) const
|
||||
{
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID);
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(model->CreatureDisplayID);
|
||||
if (!modelInfo)
|
||||
return nullptr;
|
||||
|
||||
@@ -1453,11 +1441,20 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
|
||||
{
|
||||
CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->displayId_other_gender);
|
||||
if (!minfo_tmp)
|
||||
TC_LOG_ERROR("sql.sql", "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->displayId_other_gender);
|
||||
TC_LOG_ERROR("sql.sql", "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", model->CreatureDisplayID, modelInfo->displayId_other_gender);
|
||||
else
|
||||
{
|
||||
// DisplayID changed
|
||||
*displayID = modelInfo->displayId_other_gender;
|
||||
model->CreatureDisplayID = modelInfo->displayId_other_gender;
|
||||
if (creatureTemplate)
|
||||
{
|
||||
auto itr = std::find_if(creatureTemplate->Models.begin(), creatureTemplate->Models.end(), [&](CreatureModel const& templateModel)
|
||||
{
|
||||
return templateModel.CreatureDisplayID == modelInfo->displayId_other_gender;
|
||||
});
|
||||
if (itr != creatureTemplate->Models.end())
|
||||
*model = *itr;
|
||||
}
|
||||
return minfo_tmp;
|
||||
}
|
||||
}
|
||||
@@ -3492,13 +3489,13 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 raceMask = fields[0].GetUInt32();
|
||||
uint64 raceMask = fields[0].GetUInt64();
|
||||
uint32 classMask = fields[1].GetUInt32();
|
||||
uint32 spellId = fields[2].GetUInt32();
|
||||
|
||||
if (raceMask != 0 && !(raceMask & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `playercreateinfo_spell_custom` table, ignoring.", raceMask);
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask " UI64FMTD " in `playercreateinfo_spell_custom` table, ignoring.", raceMask);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3510,7 +3507,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
|
||||
for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
|
||||
{
|
||||
if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
|
||||
if (raceMask == 0 || ((UI64LIT(1) << (raceIndex - 1)) & raceMask))
|
||||
{
|
||||
for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
|
||||
{
|
||||
@@ -3552,13 +3549,13 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 raceMask = fields[0].GetUInt32();
|
||||
uint64 raceMask = fields[0].GetUInt64();
|
||||
uint32 classMask = fields[1].GetUInt32();
|
||||
uint32 spellId = fields[2].GetUInt32();
|
||||
|
||||
if (raceMask != 0 && !(raceMask & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask %u in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
|
||||
TC_LOG_ERROR("sql.sql", "Wrong race mask " UI64FMTD " in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3570,7 +3567,7 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
|
||||
for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
|
||||
{
|
||||
if (raceMask == 0 || ((1 << (raceIndex - 1)) & raceMask))
|
||||
if (raceMask == 0 || ((UI64LIT(1) << (raceIndex - 1)) & raceMask))
|
||||
{
|
||||
for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
|
||||
{
|
||||
@@ -3924,35 +3921,35 @@ void ObjectMgr::LoadQuests()
|
||||
mExclusiveQuestGroups.clear();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT "
|
||||
//0 1 2 3 4 5 6 7 8 9 10 11
|
||||
"ID, QuestType, QuestLevel, MaxScalingLevel, QuestPackageID, MinLevel, QuestSortID, QuestInfoID, SuggestedGroupNum, RewardNextQuest, RewardXPDifficulty, RewardXPMultiplier, "
|
||||
//12 13 14 15 16 17 18 19 20 21 22
|
||||
//0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
"ID, QuestType, QuestLevel, ScalingFactionGroup, MaxScalingLevel, QuestPackageID, MinLevel, QuestSortID, QuestInfoID, SuggestedGroupNum, RewardNextQuest, RewardXPDifficulty, RewardXPMultiplier, "
|
||||
//13 14 15 16 17 18 19 20 21 22 23
|
||||
"RewardMoney, RewardMoneyDifficulty, RewardMoneyMultiplier, RewardBonusMoney, RewardDisplaySpell1, RewardDisplaySpell2, RewardDisplaySpell3, RewardSpell, RewardHonor, RewardKillHonor, StartItem, "
|
||||
//23 24 25 26 27
|
||||
"RewardArtifactXPDifficulty, RewardArtifactXPMultiplier, RewardArtifactCategoryID, Flags, FlagsEx, "
|
||||
//28 29 30 31 32 33 34 35
|
||||
//24 25 26 27 28 29
|
||||
"RewardArtifactXPDifficulty, RewardArtifactXPMultiplier, RewardArtifactCategoryID, Flags, FlagsEx, FlagsEx2, "
|
||||
//30 31 32 33 34 35 36 37
|
||||
"RewardItem1, RewardAmount1, ItemDrop1, ItemDropQuantity1, RewardItem2, RewardAmount2, ItemDrop2, ItemDropQuantity2, "
|
||||
//36 37 38 39 40 41 42 43
|
||||
//38 39 40 41 42 43 44 45
|
||||
"RewardItem3, RewardAmount3, ItemDrop3, ItemDropQuantity3, RewardItem4, RewardAmount4, ItemDrop4, ItemDropQuantity4, "
|
||||
//44 45 46 47 48 49
|
||||
//46 47 48 49 50 51
|
||||
"RewardChoiceItemID1, RewardChoiceItemQuantity1, RewardChoiceItemDisplayID1, RewardChoiceItemID2, RewardChoiceItemQuantity2, RewardChoiceItemDisplayID2, "
|
||||
//50 51 52 53 54 55
|
||||
//52 53 54 55 56 57
|
||||
"RewardChoiceItemID3, RewardChoiceItemQuantity3, RewardChoiceItemDisplayID3, RewardChoiceItemID4, RewardChoiceItemQuantity4, RewardChoiceItemDisplayID4, "
|
||||
//56 57 58 59 60 61
|
||||
//58 59 60 61 62 63
|
||||
"RewardChoiceItemID5, RewardChoiceItemQuantity5, RewardChoiceItemDisplayID5, RewardChoiceItemID6, RewardChoiceItemQuantity6, RewardChoiceItemDisplayID6, "
|
||||
//62 63 64 65 66 67 68 69 70 71
|
||||
"POIContinent, POIx, POIy, POIPriority, RewardTitle, RewardArenaPoints, RewardSkillLineID, RewardNumSkillUps, PortraitGiver, PortraitTurnIn, "
|
||||
//72 73 74 75 76 77 78 79
|
||||
//64 65 66 67 68 69 70 71 72 73 74
|
||||
"POIContinent, POIx, POIy, POIPriority, RewardTitle, RewardArenaPoints, RewardSkillLineID, RewardNumSkillUps, PortraitGiver, PortraitGiverMount, PortraitTurnIn, "
|
||||
//75 76 77 78 79 80 81 82
|
||||
"RewardFactionID1, RewardFactionValue1, RewardFactionOverride1, RewardFactionCapIn1, RewardFactionID2, RewardFactionValue2, RewardFactionOverride2, RewardFactionCapIn2, "
|
||||
//80 81 82 83 84 85 86 87
|
||||
//83 84 85 86 87 88 89 90
|
||||
"RewardFactionID3, RewardFactionValue3, RewardFactionOverride3, RewardFactionCapIn3, RewardFactionID4, RewardFactionValue4, RewardFactionOverride4, RewardFactionCapIn4, "
|
||||
//88 89 90 91 92
|
||||
//91 92 93 94 95
|
||||
"RewardFactionID5, RewardFactionValue5, RewardFactionOverride5, RewardFactionCapIn5, RewardFactionFlags, "
|
||||
//93 94 95 96 97 98 99 100
|
||||
//96 97 98 99 100 101 102 103
|
||||
"RewardCurrencyID1, RewardCurrencyQty1, RewardCurrencyID2, RewardCurrencyQty2, RewardCurrencyID3, RewardCurrencyQty3, RewardCurrencyID4, RewardCurrencyQty4, "
|
||||
//101 102 103 104 105 106 107
|
||||
"AcceptedSoundKitID, CompleteSoundKitID, AreaGroupID, TimeAllowed, AllowableRaces, QuestRewardID, Expansion, "
|
||||
//108 109 110 111 112 113 114 115 116
|
||||
//104 105 106 107 108 109 110
|
||||
"AcceptedSoundKitID, CompleteSoundKitID, AreaGroupID, TimeAllowed, AllowableRaces, TreasurePickerID, Expansion, "
|
||||
//111 112 113 114 115 116 117 118 119
|
||||
"LogTitle, LogDescription, QuestDescription, AreaDescription, PortraitGiverText, PortraitGiverName, PortraitTurnInText, PortraitTurnInName, QuestCompletionLog"
|
||||
" FROM quest_template");
|
||||
if (!result)
|
||||
@@ -6174,7 +6171,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
|
||||
if (!node || node->ContinentID != mapid || !(node->Flags & requireFlag))
|
||||
continue;
|
||||
|
||||
uint8 field = (uint8)((node->ID - 1) / 8);
|
||||
uint32 field = uint32((node->ID - 1) / 8);
|
||||
uint32 submask = 1 << ((node->ID - 1) % 8);
|
||||
|
||||
// skip not taxi network nodes
|
||||
@@ -6227,7 +6224,8 @@ void ObjectMgr::GetTaxiPath(uint32 source, uint32 destination, uint32 &path, uin
|
||||
|
||||
uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt_team /* = false */)
|
||||
{
|
||||
uint32 mount_id = 0;
|
||||
CreatureModel mountModel;
|
||||
CreatureTemplate const* mount_info = nullptr;
|
||||
|
||||
// select mount creature id
|
||||
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(id);
|
||||
@@ -6247,22 +6245,23 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
|
||||
mount_entry = team == ALLIANCE ? node->MountCreatureID[0] : node->MountCreatureID[1];
|
||||
}
|
||||
|
||||
CreatureTemplate const* mount_info = GetCreatureTemplate(mount_entry);
|
||||
mount_info = GetCreatureTemplate(mount_entry);
|
||||
if (mount_info)
|
||||
{
|
||||
mount_id = mount_info->GetRandomValidModelId();
|
||||
if (!mount_id)
|
||||
CreatureModel const* model = mount_info->GetRandomValidModel();
|
||||
if (!model)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
|
||||
return 0;
|
||||
}
|
||||
mountModel = *model;
|
||||
}
|
||||
}
|
||||
|
||||
// minfo is not actually used but the mount_id was updated
|
||||
GetCreatureModelRandomGender(&mount_id);
|
||||
GetCreatureModelRandomGender(&mountModel, mount_info);
|
||||
|
||||
return mount_id;
|
||||
return mountModel.CreatureDisplayID;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGraveyardZones()
|
||||
@@ -7027,8 +7026,8 @@ void ObjectMgr::LoadGameObjectTemplate()
|
||||
"Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11, Data12, "
|
||||
// 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
||||
"Data13, Data14, Data15, Data16, Data17, Data18, Data19, Data20, Data21, Data22, Data23, Data24, Data25, Data26, Data27, Data28, "
|
||||
// 37 38 39 40 41 42 43
|
||||
"Data29, Data30, Data31, Data32, RequiredLevel, AIName, ScriptName "
|
||||
// 37 38 39 40 41 42 43 44
|
||||
"Data29, Data30, Data31, Data32, Data33, RequiredLevel, AIName, ScriptName "
|
||||
"FROM gameobject_template");
|
||||
|
||||
if (!result)
|
||||
@@ -7058,9 +7057,9 @@ void ObjectMgr::LoadGameObjectTemplate()
|
||||
for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i)
|
||||
got.raw.data[i] = fields[8 + i].GetUInt32();
|
||||
|
||||
got.RequiredLevel = fields[41].GetInt32();
|
||||
got.AIName = fields[42].GetString();
|
||||
got.ScriptId = GetScriptId(fields[43].GetString());
|
||||
got.RequiredLevel = fields[42].GetInt32();
|
||||
got.AIName = fields[43].GetString();
|
||||
got.ScriptId = GetScriptId(fields[44].GetString());
|
||||
|
||||
// Checks
|
||||
|
||||
@@ -7696,8 +7695,8 @@ void ObjectMgr::LoadQuestPOI()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
||||
QueryResult result = WorldDatabase.Query("SELECT QuestID, BlobIndex, Idx1, ObjectiveIndex, QuestObjectiveID, QuestObjectID, MapID, WorldMapAreaId, Floor, Priority, Flags, WorldEffectID, PlayerConditionID, WoDUnk1, AlwaysAllowMergingBlobs FROM quest_poi order by QuestID, Idx1");
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
QueryResult result = WorldDatabase.Query("SELECT QuestID, BlobIndex, Idx1, ObjectiveIndex, QuestObjectiveID, QuestObjectID, MapID, UiMapID, Priority, Flags, WorldEffectID, PlayerConditionID, SpawnTrackingID, AlwaysAllowMergingBlobs FROM quest_poi order by QuestID, Idx1");
|
||||
if (!result)
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
|
||||
@@ -7737,33 +7736,32 @@ void ObjectMgr::LoadQuestPOI()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
int32 QuestID = fields[0].GetInt32();
|
||||
int32 BlobIndex = fields[1].GetInt32();
|
||||
int32 Idx1 = fields[2].GetInt32();
|
||||
int32 ObjectiveIndex = fields[3].GetInt32();
|
||||
int32 QuestObjectiveID = fields[4].GetInt32();
|
||||
int32 QuestObjectID = fields[5].GetInt32();
|
||||
int32 MapID = fields[6].GetInt32();
|
||||
int32 WorldMapAreaId = fields[7].GetInt32();
|
||||
int32 Floor = fields[8].GetInt32();
|
||||
int32 Priority = fields[9].GetInt32();
|
||||
int32 Flags = fields[10].GetInt32();
|
||||
int32 WorldEffectID = fields[11].GetInt32();
|
||||
int32 PlayerConditionID = fields[12].GetInt32();
|
||||
int32 WoDUnk1 = fields[13].GetInt32();
|
||||
bool AlwaysAllowMergingBlobs = fields[14].GetBool();
|
||||
int32 questID = fields[0].GetInt32();
|
||||
int32 blobIndex = fields[1].GetInt32();
|
||||
int32 idx1 = fields[2].GetInt32();
|
||||
int32 objectiveIndex = fields[3].GetInt32();
|
||||
int32 questObjectiveID = fields[4].GetInt32();
|
||||
int32 questObjectID = fields[5].GetInt32();
|
||||
int32 mapID = fields[6].GetInt32();
|
||||
int32 uiMapID = fields[7].GetInt32();
|
||||
int32 priority = fields[8].GetInt32();
|
||||
int32 flags = fields[9].GetInt32();
|
||||
int32 worldEffectID = fields[10].GetInt32();
|
||||
int32 playerConditionID = fields[11].GetInt32();
|
||||
int32 spawnTrackingID = fields[12].GetInt32();
|
||||
bool alwaysAllowMergingBlobs = fields[13].GetBool();
|
||||
|
||||
if (!sObjectMgr->GetQuestTemplate(QuestID))
|
||||
TC_LOG_ERROR("sql.sql", "`quest_poi` quest id (%u) Idx1 (%u) does not exist in `quest_template`", QuestID, Idx1);
|
||||
if (!sObjectMgr->GetQuestTemplate(questID))
|
||||
TC_LOG_ERROR("sql.sql", "`quest_poi` quest id (%u) Idx1 (%u) does not exist in `quest_template`", questID, idx1);
|
||||
|
||||
QuestPOI POI(BlobIndex, ObjectiveIndex, QuestObjectiveID, QuestObjectID, MapID, WorldMapAreaId, Floor, Priority, Flags, WorldEffectID, PlayerConditionID, WoDUnk1, AlwaysAllowMergingBlobs);
|
||||
if (QuestID < int32(POIs.size()) && Idx1 < int32(POIs[QuestID].size()))
|
||||
QuestPOI POI(blobIndex, objectiveIndex, questObjectiveID, questObjectID, mapID, uiMapID, priority, flags, worldEffectID, playerConditionID, spawnTrackingID, alwaysAllowMergingBlobs);
|
||||
if (questID < int32(POIs.size()) && idx1 < int32(POIs[questID].size()))
|
||||
{
|
||||
POI.points = POIs[QuestID][Idx1];
|
||||
_questPOIStore[QuestID].push_back(POI);
|
||||
POI.points = POIs[questID][idx1];
|
||||
_questPOIStore[questID].push_back(POI);
|
||||
}
|
||||
else
|
||||
TC_LOG_ERROR("sql.sql", "Table quest_poi references unknown quest points for quest %i POI id %i", QuestID, BlobIndex);
|
||||
TC_LOG_ERROR("sql.sql", "Table quest_poi references unknown quest points for quest %i POI id %i", questID, blobIndex);
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
@@ -8578,7 +8576,7 @@ void ObjectMgr::LoadMailLevelRewards()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint8 level = fields[0].GetUInt8();
|
||||
uint32 raceMask = fields[1].GetUInt32();
|
||||
uint64 raceMask = fields[1].GetUInt64();
|
||||
uint32 mailTemplateId = fields[2].GetUInt32();
|
||||
uint32 senderEntry = fields[3].GetUInt32();
|
||||
|
||||
@@ -8590,7 +8588,7 @@ void ObjectMgr::LoadMailLevelRewards()
|
||||
|
||||
if (!(raceMask & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `mail_level_reward` has raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level);
|
||||
TC_LOG_ERROR("sql.sql", "Table `mail_level_reward` has raceMask (" UI64FMTD ") for level %u that not include any player races, ignoring.", raceMask, level);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -8669,18 +8667,6 @@ void ObjectMgr::LoadTrainers()
|
||||
if (!allReqValid)
|
||||
continue;
|
||||
|
||||
spell.LearnedSpellId = spell.SpellId;
|
||||
for (SpellEffectInfo const* spellEffect : spellInfo->GetEffectsForDifficulty(DIFFICULTY_NONE))
|
||||
{
|
||||
if (spellEffect && spellEffect->IsEffect(SPELL_EFFECT_LEARN_SPELL))
|
||||
{
|
||||
ASSERT(spell.LearnedSpellId == spell.SpellId,
|
||||
"Only one learned spell is currently supported - spell %u already teaches %u but it tried to overwrite it with %u",
|
||||
spell.SpellId, spell.LearnedSpellId, spellEffect->TriggerSpell);
|
||||
spell.LearnedSpellId = spellEffect->TriggerSpell;
|
||||
}
|
||||
}
|
||||
|
||||
spellsByTrainer[trainerId].push_back(spell);
|
||||
|
||||
} while (trainerSpellsResult->NextRow());
|
||||
@@ -9282,8 +9268,8 @@ CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unit
|
||||
void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
QueryResult result = WorldDatabase.Query("SELECT level, class, basemana, basearmor, attackpower, rangedattackpower, damage_base, damage_exp1, damage_exp2, damage_exp3, damage_exp4, damage_exp5 FROM creature_classlevelstats");
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult result = WorldDatabase.Query("SELECT level, class, basemana, basearmor, attackpower, rangedattackpower FROM creature_classlevelstats");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -9581,7 +9567,7 @@ void ObjectMgr::LoadTerrainWorldMaps()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1
|
||||
QueryResult result = WorldDatabase.Query("SELECT TerrainSwapMap, WorldMapArea FROM `terrain_worldmap`");
|
||||
QueryResult result = WorldDatabase.Query("SELECT TerrainSwapMap, UiMapPhaseId FROM `terrain_worldmap`");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -9595,7 +9581,7 @@ void ObjectMgr::LoadTerrainWorldMaps()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 mapId = fields[0].GetUInt32();
|
||||
uint32 worldMapArea = fields[1].GetUInt32();
|
||||
uint32 uiMapPhaseId = fields[1].GetUInt32();
|
||||
|
||||
if (!sMapStore.LookupEntry(mapId))
|
||||
{
|
||||
@@ -9603,15 +9589,15 @@ void ObjectMgr::LoadTerrainWorldMaps()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sWorldMapAreaStore.LookupEntry(worldMapArea))
|
||||
if (!sDB2Manager.IsUiMapPhase(uiMapPhaseId))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "WorldMapArea %u defined in `terrain_worldmap` does not exist, skipped.", worldMapArea);
|
||||
TC_LOG_ERROR("sql.sql", "Phase %u defined in `terrain_worldmap` is not a valid terrain swap phase, skipped.", uiMapPhaseId);
|
||||
continue;
|
||||
}
|
||||
|
||||
TerrainSwapInfo* terrainSwapInfo = &_terrainSwapInfoById[mapId];
|
||||
terrainSwapInfo->Id = mapId;
|
||||
terrainSwapInfo->UiWorldMapAreaIDSwaps.push_back(worldMapArea);
|
||||
terrainSwapInfo->UiMapPhaseIDs.push_back(uiMapPhaseId);
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
@@ -9758,11 +9744,6 @@ TerrainSwapInfo const* ObjectMgr::GetTerrainSwapInfo(uint32 terrainSwapId) const
|
||||
return Trinity::Containers::MapGetValuePtr(_terrainSwapInfoById, terrainSwapId);
|
||||
}
|
||||
|
||||
std::vector<TerrainSwapInfo*> const* ObjectMgr::GetTerrainSwapsForMap(uint32 mapId) const
|
||||
{
|
||||
return Trinity::Containers::MapGetValuePtr(_terrainSwapInfoByMap, mapId);
|
||||
}
|
||||
|
||||
GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) const
|
||||
{
|
||||
GameObjectTemplateContainer::const_iterator itr = _gameObjectTemplateStore.find(entry);
|
||||
@@ -10104,7 +10085,7 @@ void ObjectMgr::LoadPlayerChoices()
|
||||
uint32 oldMSTime = getMSTime();
|
||||
_playerChoices.clear();
|
||||
|
||||
QueryResult choices = WorldDatabase.Query("SELECT ChoiceId, UiTextureKitId, Question, HideWarboardHeader FROM playerchoice");
|
||||
QueryResult choices = WorldDatabase.Query("SELECT ChoiceId, UiTextureKitId, Question, HideWarboardHeader, KeepOpenAfterChoice FROM playerchoice");
|
||||
|
||||
if (!choices)
|
||||
{
|
||||
@@ -10129,10 +10110,11 @@ void ObjectMgr::LoadPlayerChoices()
|
||||
choice.UiTextureKitId = fields[1].GetInt32();
|
||||
choice.Question = fields[2].GetString();
|
||||
choice.HideWarboardHeader = fields[3].GetBool();
|
||||
choice.KeepOpenAfterChoice = fields[4].GetBool();
|
||||
|
||||
} while (choices->NextRow());
|
||||
|
||||
if (QueryResult responses = WorldDatabase.Query("SELECT ChoiceId, ResponseId, ChoiceArtFileId, Header, Answer, Description, Confirmation FROM playerchoice_response ORDER BY `Index` ASC"))
|
||||
if (QueryResult responses = WorldDatabase.Query("SELECT ChoiceId, ResponseId, ChoiceArtFileId, Flags, WidgetSetID, GroupID, Header, Answer, Description, Confirmation FROM playerchoice_response ORDER BY `Index` ASC"))
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -10153,10 +10135,13 @@ void ObjectMgr::LoadPlayerChoices()
|
||||
PlayerChoiceResponse& response = choice->Responses.back();
|
||||
response.ResponseId = responseId;
|
||||
response.ChoiceArtFileId = fields[2].GetInt32();
|
||||
response.Header = fields[3].GetString();
|
||||
response.Answer = fields[4].GetString();
|
||||
response.Description = fields[5].GetString();
|
||||
response.Confirmation = fields[6].GetString();
|
||||
response.Flags = fields[3].GetInt32();
|
||||
response.WidgetSetID = fields[4].GetUInt32();
|
||||
response.GroupID = fields[5].GetUInt8();
|
||||
response.Header = fields[6].GetString();
|
||||
response.Answer = fields[7].GetString();
|
||||
response.Description = fields[8].GetString();
|
||||
response.Confirmation = fields[9].GetString();
|
||||
++responseCount;
|
||||
|
||||
} while (responses->NextRow());
|
||||
|
||||
@@ -609,9 +609,9 @@ struct PetLevelInfo
|
||||
struct MailLevelReward
|
||||
{
|
||||
MailLevelReward() : raceMask(0), mailTemplateId(0), senderEntry(0) { }
|
||||
MailLevelReward(uint32 _raceMask, uint32 _mailTemplateId, uint32 _senderEntry) : raceMask(_raceMask), mailTemplateId(_mailTemplateId), senderEntry(_senderEntry) { }
|
||||
MailLevelReward(uint64 _raceMask, uint32 _mailTemplateId, uint32 _senderEntry) : raceMask(_raceMask), mailTemplateId(_mailTemplateId), senderEntry(_senderEntry) { }
|
||||
|
||||
uint32 raceMask;
|
||||
uint64 raceMask;
|
||||
uint32 mailTemplateId;
|
||||
uint32 senderEntry;
|
||||
};
|
||||
@@ -710,20 +710,19 @@ struct QuestPOI
|
||||
int32 QuestObjectiveID;
|
||||
int32 QuestObjectID;
|
||||
int32 MapID;
|
||||
int32 WorldMapAreaID;
|
||||
int32 Floor;
|
||||
int32 UiMapID;
|
||||
int32 Priority;
|
||||
int32 Flags;
|
||||
int32 WorldEffectID;
|
||||
int32 PlayerConditionID;
|
||||
int32 UnkWoD1;
|
||||
int32 SpawnTrackingID;
|
||||
std::vector<QuestPOIPoint> points;
|
||||
bool AlwaysAllowMergingBlobs;
|
||||
|
||||
QuestPOI() : BlobIndex(0), ObjectiveIndex(0), QuestObjectiveID(0), QuestObjectID(0), MapID(0), WorldMapAreaID(0), Floor(0), Priority(0), Flags(0), WorldEffectID(0), PlayerConditionID(0), UnkWoD1(0), AlwaysAllowMergingBlobs(false){ }
|
||||
QuestPOI(int32 _BlobIndex, int32 _ObjectiveIndex, int32 _QuestObjectiveID, int32 _QuestObjectID, int32 _MapID, int32 _WorldMapAreaID, int32 _Foor, int32 _Priority, int32 _Flags, int32 _WorldEffectID, int32 _PlayerConditionID, int32 _UnkWoD1, bool _AlwaysAllowMergingBlobs) :
|
||||
BlobIndex(_BlobIndex), ObjectiveIndex(_ObjectiveIndex), QuestObjectiveID(_QuestObjectiveID), QuestObjectID(_QuestObjectID), MapID(_MapID), WorldMapAreaID(_WorldMapAreaID),
|
||||
Floor(_Foor), Priority(_Priority), Flags(_Flags), WorldEffectID(_WorldEffectID), PlayerConditionID(_PlayerConditionID), UnkWoD1(_UnkWoD1), AlwaysAllowMergingBlobs(_AlwaysAllowMergingBlobs) { }
|
||||
QuestPOI() : BlobIndex(0), ObjectiveIndex(0), QuestObjectiveID(0), QuestObjectID(0), MapID(0), UiMapID(0), Priority(0), Flags(0), WorldEffectID(0), PlayerConditionID(0), SpawnTrackingID(0), AlwaysAllowMergingBlobs(false){ }
|
||||
QuestPOI(int32 blobIndex, int32 objectiveIndex, int32 questObjectiveID, int32 questObjectID, int32 mapID, int32 uiMapID, int32 priority, int32 flags, int32 worldEffectID, int32 playerConditionID, int32 spawnTrackingID, bool alwaysAllowMergingBlobs) :
|
||||
BlobIndex(blobIndex), ObjectiveIndex(objectiveIndex), QuestObjectiveID(questObjectiveID), QuestObjectID(questObjectID), MapID(mapID), UiMapID(uiMapID),
|
||||
Priority(priority), Flags(flags), WorldEffectID(worldEffectID), PlayerConditionID(playerConditionID), SpawnTrackingID(spawnTrackingID), AlwaysAllowMergingBlobs(alwaysAllowMergingBlobs) { }
|
||||
};
|
||||
|
||||
typedef std::vector<QuestPOI> QuestPOIVector;
|
||||
@@ -794,6 +793,9 @@ struct PlayerChoiceResponse
|
||||
{
|
||||
int32 ResponseId;
|
||||
int32 ChoiceArtFileId;
|
||||
int32 Flags;
|
||||
uint32 WidgetSetID;
|
||||
uint8 GroupID;
|
||||
std::string Header;
|
||||
std::string Answer;
|
||||
std::string Description;
|
||||
@@ -808,6 +810,7 @@ struct PlayerChoice
|
||||
std::string Question;
|
||||
std::vector<PlayerChoiceResponse> Responses;
|
||||
bool HideWarboardHeader;
|
||||
bool KeepOpenAfterChoice;
|
||||
|
||||
PlayerChoiceResponse const* GetResponse(int32 responseId) const
|
||||
{
|
||||
@@ -885,7 +888,7 @@ typedef std::unordered_map<uint64, DungeonEncounterList> DungeonEncounterContain
|
||||
struct TerrainSwapInfo
|
||||
{
|
||||
uint32 Id;
|
||||
std::vector<uint32> UiWorldMapAreaIDSwaps;
|
||||
std::vector<uint32> UiMapPhaseIDs;
|
||||
};
|
||||
|
||||
struct PhaseInfoStruct
|
||||
@@ -959,8 +962,8 @@ class TC_GAME_API ObjectMgr
|
||||
CreatureTemplate const* GetCreatureTemplate(uint32 entry) const;
|
||||
CreatureTemplateContainer const* GetCreatureTemplates() const { return &_creatureTemplateStore; }
|
||||
CreatureModelInfo const* GetCreatureModelInfo(uint32 modelId) const;
|
||||
CreatureModelInfo const* GetCreatureModelRandomGender(uint32* displayID) const;
|
||||
static uint32 ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = nullptr);
|
||||
CreatureModelInfo const* GetCreatureModelRandomGender(CreatureModel* mode, CreatureTemplate const* creatureTemplate) const;
|
||||
static CreatureModel const* ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = nullptr);
|
||||
static void ChooseCreatureFlags(CreatureTemplate const* cInfo, uint64& npcFlags, uint32& unitFlags, uint32& unitFlags2, uint32& unitFlags3, uint32& dynamicFlags, CreatureData const* data = nullptr);
|
||||
EquipmentInfo const* GetEquipmentInfo(uint32 entry, int8& id) const;
|
||||
CreatureAddon const* GetCreatureAddon(ObjectGuid::LowType lowguid) const;
|
||||
@@ -1182,6 +1185,7 @@ class TC_GAME_API ObjectMgr
|
||||
void LoadCreatureClassLevelStats();
|
||||
void LoadCreatureLocales();
|
||||
void LoadCreatureTemplates();
|
||||
void LoadCreatureTemplateModels();
|
||||
void LoadCreatureTemplateAddons();
|
||||
void LoadCreatureTemplate(Field* fields);
|
||||
void LoadCreatureScalingData();
|
||||
@@ -1308,7 +1312,7 @@ class TC_GAME_API ObjectMgr
|
||||
|
||||
ExclusiveQuestGroups mExclusiveQuestGroups;
|
||||
|
||||
MailLevelReward const* GetMailLevelReward(uint8 level, uint32 raceMask)
|
||||
MailLevelReward const* GetMailLevelReward(uint8 level, uint64 raceMask)
|
||||
{
|
||||
MailLevelRewardContainer::const_iterator map_itr = _mailLevelRewardStore.find(level);
|
||||
if (map_itr == _mailLevelRewardStore.end())
|
||||
@@ -1666,7 +1670,7 @@ class TC_GAME_API ObjectMgr
|
||||
PhaseInfoStruct const* GetPhaseInfo(uint32 phaseId) const;
|
||||
std::vector<PhaseAreaInfo> const* GetPhasesForArea(uint32 areaId) const;
|
||||
TerrainSwapInfo const* GetTerrainSwapInfo(uint32 terrainSwapId) const;
|
||||
std::vector<TerrainSwapInfo*> const* GetTerrainSwapsForMap(uint32 mapId) const;
|
||||
std::unordered_map<uint32, std::vector<TerrainSwapInfo*>> const& GetTerrainSwaps() const { return _terrainSwapInfoByMap; }
|
||||
|
||||
private:
|
||||
std::unordered_map<uint32, PhaseInfoStruct> _phaseInfoById;
|
||||
|
||||
@@ -98,6 +98,9 @@ void WorldSession::SendFeatureSystemStatusGlueScreen()
|
||||
features.BpayStoreDisabledByParentalControls = false;
|
||||
features.CharUndeleteEnabled = sWorld->getBoolConfig(CONFIG_FEATURE_SYSTEM_CHARACTER_UNDELETE_ENABLED);
|
||||
features.BpayStoreEnabled = sWorld->getBoolConfig(CONFIG_FEATURE_SYSTEM_BPAY_STORE_ENABLED);
|
||||
features.MaxCharactersPerRealm = sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM);
|
||||
features.MinimumExpansionLevel = EXPANSION_CLASSIC;
|
||||
features.MaximumExpansionLevel = sWorld->getIntConfig(CONFIG_EXPANSION);
|
||||
|
||||
SendPacket(features.Write());
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ void WorldSession::HandleCageBattlePet(WorldPackets::BattlePet::CageBattlePet& c
|
||||
|
||||
void WorldSession::HandleBattlePetSummon(WorldPackets::BattlePet::BattlePetSummon& battlePetSummon)
|
||||
{
|
||||
if (_player->GetGuidValue(PLAYER_FIELD_SUMMONED_BATTLE_PET_ID) != battlePetSummon.PetGuid)
|
||||
if (_player->GetGuidValue(ACTIVE_PLAYER_FIELD_SUMMONED_BATTLE_PET_ID) != battlePetSummon.PetGuid)
|
||||
GetBattlePetMgr()->SummonPet(battlePetSummon.PetGuid);
|
||||
else
|
||||
GetBattlePetMgr()->DismissPet();
|
||||
|
||||
@@ -79,8 +79,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPackets::Calendar::CalendarGet
|
||||
WorldPackets::Calendar::CalendarSendCalendarEventInfo eventInfo;
|
||||
eventInfo.EventID = event->GetEventId();
|
||||
eventInfo.Date = event->GetDate();
|
||||
Guild* guild = sGuildMgr->GetGuildById(event->GetGuildId());
|
||||
eventInfo.EventGuildID = guild ? guild->GetGUID() : ObjectGuid::Empty;
|
||||
eventInfo.EventClubID = event->GetGuildId();
|
||||
eventInfo.EventName = event->GetTitle();
|
||||
eventInfo.EventType = event->GetType();
|
||||
eventInfo.Flags = event->GetFlags();
|
||||
@@ -124,10 +123,10 @@ void WorldSession::HandleCalendarGetEvent(WorldPackets::Calendar::CalendarGetEve
|
||||
sCalendarMgr->SendCalendarCommandResult(_player->GetGUID(), CALENDAR_ERROR_EVENT_INVALID);
|
||||
}
|
||||
|
||||
void WorldSession::HandleCalendarGuildFilter(WorldPackets::Calendar::CalendarGuildFilter& calendarGuildFilter)
|
||||
void WorldSession::HandleCalendarCommunityFilter(WorldPackets::Calendar::CalendarCommunityFilter& calendarCommunityFilter)
|
||||
{
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId()))
|
||||
guild->MassInviteToEvent(this, calendarGuildFilter.MinLevel, calendarGuildFilter.MaxLevel, calendarGuildFilter.MaxRankOrder);
|
||||
guild->MassInviteToEvent(this, calendarCommunityFilter.MinLevel, calendarCommunityFilter.MaxLevel, calendarCommunityFilter.MaxRankOrder);
|
||||
}
|
||||
|
||||
void WorldSession::HandleCalendarAddEvent(WorldPackets::Calendar::CalendarAddEvent& calendarAddEvent)
|
||||
|
||||
@@ -146,9 +146,6 @@ void WorldSession::HandleChannelPlayerCommand(WorldPackets::Channel::ChannelPlay
|
||||
case CMSG_CHAT_CHANNEL_MODERATOR:
|
||||
channel->SetModerator(GetPlayer(), packet.Name);
|
||||
break;
|
||||
case CMSG_CHAT_CHANNEL_MUTE:
|
||||
channel->SetMute(GetPlayer(), packet.Name);
|
||||
break;
|
||||
case CMSG_CHAT_CHANNEL_SET_OWNER:
|
||||
channel->SetOwner(GetPlayer(), packet.Name);
|
||||
break;
|
||||
@@ -161,9 +158,6 @@ void WorldSession::HandleChannelPlayerCommand(WorldPackets::Channel::ChannelPlay
|
||||
case CMSG_CHAT_CHANNEL_UNMODERATOR:
|
||||
channel->UnsetModerator(GetPlayer(), packet.Name);
|
||||
break;
|
||||
case CMSG_CHAT_CHANNEL_UNMUTE:
|
||||
channel->UnsetMute(GetPlayer(), packet.Name);
|
||||
break;
|
||||
case CMSG_CHAT_CHANNEL_UNSILENCE_ALL:
|
||||
channel->UnsilenceAll(GetPlayer(), packet.Name);
|
||||
break;
|
||||
|
||||
@@ -349,6 +349,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
|
||||
while (result->NextRow());
|
||||
}
|
||||
|
||||
charEnum.IsTestDemonHunterCreationAllowed = canAlwaysCreateDemonHunter;
|
||||
charEnum.IsDemonHunterCreationAllowed = GetAccountExpansion() >= EXPANSION_LEGION || canAlwaysCreateDemonHunter;
|
||||
charEnum.IsAlliedRacesCreationAllowed = GetAccountExpansion() >= EXPANSION_BATTLE_FOR_AZEROTH;
|
||||
|
||||
@@ -506,8 +507,8 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
|
||||
if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK))
|
||||
{
|
||||
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
||||
if ((1 << (charCreate.CreateInfo->Race - 1)) & raceMaskDisabled)
|
||||
uint64 raceMaskDisabled = sWorld->GetUInt64Config(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
||||
if ((UI64LIT(1) << (charCreate.CreateInfo->Race - 1)) & raceMaskDisabled)
|
||||
{
|
||||
SendCharCreate(CHAR_CREATE_DISABLED);
|
||||
return;
|
||||
@@ -733,7 +734,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
|
||||
LoginDatabase.CommitTransaction(trans);
|
||||
|
||||
SendCharCreate(CHAR_CREATE_SUCCESS);
|
||||
SendCharCreate(CHAR_CREATE_SUCCESS, newChar.GetGUID());
|
||||
|
||||
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Create Character: %s %s", GetAccountId(), GetRemoteAddress().c_str(), createInfo->Name.c_str(), newChar.GetGUID().ToString().c_str());
|
||||
sScriptMgr->OnPlayerCreate(&newChar);
|
||||
@@ -972,16 +973,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
WorldPackets::BattlePet::BattlePetJournalLockAcquired lock;
|
||||
SendPacket(lock.Write());
|
||||
|
||||
WorldPackets::Artifact::ArtifactKnowledge artifactKnowledge;
|
||||
artifactKnowledge.ArtifactCategoryID = ARTIFACT_CATEGORY_PRIMARY;
|
||||
artifactKnowledge.KnowledgeLevel = sWorld->getIntConfig(CONFIG_CURRENCY_START_ARTIFACT_KNOWLEDGE);
|
||||
SendPacket(artifactKnowledge.Write());
|
||||
|
||||
WorldPackets::Artifact::ArtifactKnowledge artifactKnowledgeFishingPole;
|
||||
artifactKnowledgeFishingPole.ArtifactCategoryID = ARTIFACT_CATEGORY_FISHING;
|
||||
artifactKnowledgeFishingPole.KnowledgeLevel = 0;
|
||||
SendPacket(artifactKnowledgeFishingPole.Write());
|
||||
|
||||
pCurrChar->SendInitialPacketsBeforeAddToMap();
|
||||
|
||||
//Show cinematic at the first time that player login
|
||||
@@ -1234,7 +1225,7 @@ void WorldSession::HandleTutorialFlag(WorldPackets::Misc::TutorialSetFlag& packe
|
||||
|
||||
void WorldSession::HandleSetWatchedFactionOpcode(WorldPackets::Character::SetWatchedFaction& packet)
|
||||
{
|
||||
GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, packet.FactionIndex);
|
||||
GetPlayer()->SetUInt32Value(ACTIVE_PLAYER_FIELD_WATCHED_FACTION_INDEX, packet.FactionIndex);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetFactionInactiveOpcode(WorldPackets::Character::SetFactionInactive& packet)
|
||||
@@ -1834,8 +1825,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr<WorldPa
|
||||
|
||||
if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK))
|
||||
{
|
||||
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
||||
if ((1 << (factionChangeInfo->RaceID - 1)) & raceMaskDisabled)
|
||||
uint64 raceMaskDisabled = sWorld->GetUInt64Config(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
||||
if ((UI64LIT(1) << (factionChangeInfo->RaceID - 1)) & raceMaskDisabled)
|
||||
{
|
||||
SendCharFactionChange(CHAR_CREATE_ERROR, factionChangeInfo.get());
|
||||
return;
|
||||
@@ -1962,7 +1953,7 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr<WorldPa
|
||||
trans->Append(stmt);
|
||||
|
||||
// Race specific languages
|
||||
if (factionChangeInfo->RaceID != RACE_ORC && factionChangeInfo->RaceID != RACE_HUMAN)
|
||||
if (factionChangeInfo->RaceID != RACE_ORC && factionChangeInfo->RaceID != RACE_HUMAN && factionChangeInfo->RaceID != RACE_MAGHAR_ORC)
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE);
|
||||
stmt->setUInt64(0, lowGuid);
|
||||
@@ -1970,6 +1961,7 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr<WorldPa
|
||||
switch (factionChangeInfo->RaceID)
|
||||
{
|
||||
case RACE_DWARF:
|
||||
case RACE_DARK_IRON_DWARF:
|
||||
stmt->setUInt16(1, 111);
|
||||
break;
|
||||
case RACE_DRAENEI:
|
||||
@@ -2351,7 +2343,7 @@ void WorldSession::HandleReorderCharacters(WorldPackets::Character::ReorderChara
|
||||
void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic& /*packet*/)
|
||||
{
|
||||
// Only players that has not yet gained any experience can use this
|
||||
if (_player->GetUInt32Value(PLAYER_XP))
|
||||
if (_player->GetUInt32Value(ACTIVE_PLAYER_FIELD_XP))
|
||||
return;
|
||||
|
||||
if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass()))
|
||||
@@ -2485,10 +2477,11 @@ void WorldSession::HandleCharUndeleteOpcode(WorldPackets::Character::UndeleteCha
|
||||
}));
|
||||
}
|
||||
|
||||
void WorldSession::SendCharCreate(ResponseCodes result)
|
||||
void WorldSession::SendCharCreate(ResponseCodes result, ObjectGuid const& guid /*= ObjectGuid::Empty*/)
|
||||
{
|
||||
WorldPackets::Character::CreateChar response;
|
||||
response.Code = result;
|
||||
response.Guid = guid;
|
||||
|
||||
SendPacket(response.Write());
|
||||
}
|
||||
|
||||
@@ -413,41 +413,12 @@ void WorldSession::HandleChatMessage(ChatMsg type, uint32 lang, std::string msg,
|
||||
|
||||
void WorldSession::HandleChatAddonMessageOpcode(WorldPackets::Chat::ChatAddonMessage& chatAddonMessage)
|
||||
{
|
||||
ChatMsg type;
|
||||
|
||||
switch (chatAddonMessage.GetOpcode())
|
||||
{
|
||||
case CMSG_CHAT_ADDON_MESSAGE_GUILD:
|
||||
type = CHAT_MSG_GUILD;
|
||||
break;
|
||||
case CMSG_CHAT_ADDON_MESSAGE_OFFICER:
|
||||
type = CHAT_MSG_OFFICER;
|
||||
break;
|
||||
case CMSG_CHAT_ADDON_MESSAGE_PARTY:
|
||||
type = CHAT_MSG_PARTY;
|
||||
break;
|
||||
case CMSG_CHAT_ADDON_MESSAGE_RAID:
|
||||
type = CHAT_MSG_RAID;
|
||||
break;
|
||||
case CMSG_CHAT_ADDON_MESSAGE_INSTANCE_CHAT:
|
||||
type = CHAT_MSG_INSTANCE_CHAT;
|
||||
break;
|
||||
default:
|
||||
TC_LOG_ERROR("network", "HandleChatAddonMessageOpcode: Unknown addon chat opcode (%u)", chatAddonMessage.GetOpcode());
|
||||
return;
|
||||
}
|
||||
|
||||
HandleChatAddonMessage(type, chatAddonMessage.Prefix, chatAddonMessage.Text);
|
||||
HandleChatAddonMessage(chatAddonMessage.Params.Type, chatAddonMessage.Params.Prefix, chatAddonMessage.Params.Text);
|
||||
}
|
||||
|
||||
void WorldSession::HandleChatAddonMessageWhisperOpcode(WorldPackets::Chat::ChatAddonMessageWhisper& chatAddonMessageWhisper)
|
||||
void WorldSession::HandleChatAddonMessageTargetedOpcode(WorldPackets::Chat::ChatAddonMessageTargeted& chatAddonMessageTargeted)
|
||||
{
|
||||
HandleChatAddonMessage(CHAT_MSG_WHISPER, chatAddonMessageWhisper.Prefix, chatAddonMessageWhisper.Text, chatAddonMessageWhisper.Target);
|
||||
}
|
||||
|
||||
void WorldSession::HandleChatAddonMessageChannelOpcode(WorldPackets::Chat::ChatAddonMessageChannel& chatAddonMessageChannel)
|
||||
{
|
||||
HandleChatAddonMessage(CHAT_MSG_CHANNEL, chatAddonMessageChannel.Prefix, chatAddonMessageChannel.Text, chatAddonMessageChannel.Target);
|
||||
HandleChatAddonMessage(chatAddonMessageTargeted.Params.Type, chatAddonMessageTargeted.Params.Prefix, chatAddonMessageTargeted.Params.Text, chatAddonMessageTargeted.Target);
|
||||
}
|
||||
|
||||
void WorldSession::HandleChatAddonMessage(ChatMsg type, std::string prefix, std::string text, std::string target /*= ""*/)
|
||||
|
||||
@@ -49,7 +49,7 @@ void WorldSession::HandleCanDuel(WorldPackets::Duel::CanDuel& packet)
|
||||
|
||||
void WorldSession::HandleDuelResponseOpcode(WorldPackets::Duel::DuelResponse& duelResponse)
|
||||
{
|
||||
if (duelResponse.Accepted)
|
||||
if (duelResponse.Accepted && !duelResponse.Forfeited)
|
||||
HandleDuelAccepted();
|
||||
else
|
||||
HandleDuelCancelled();
|
||||
|
||||
@@ -73,11 +73,16 @@ void WorldSession::HandleHotfixRequest(WorldPackets::Hotfix::HotfixRequest& hotf
|
||||
WorldPackets::Hotfix::HotfixResponse::HotfixData hotfixData;
|
||||
hotfixData.ID = hotfixId;
|
||||
hotfixData.RecordID = *hotfix;
|
||||
if (storage->HasRecord(hotfixData.RecordID))
|
||||
if (storage && storage->HasRecord(hotfixData.RecordID))
|
||||
{
|
||||
hotfixData.Data = boost::in_place();
|
||||
storage->WriteRecord(hotfixData.RecordID, GetSessionDbcLocale(), *hotfixData.Data);
|
||||
}
|
||||
else if (std::vector<uint8> const* blobData = sDB2Manager.GetHotfixBlobData(PAIR64_HIPART(hotfixId), *hotfix))
|
||||
{
|
||||
hotfixData.Data = boost::in_place();
|
||||
hotfixData.Data->append(blobData->data(), blobData->size());
|
||||
}
|
||||
|
||||
hotfixQueryResponse.Hotfixes.emplace_back(std::move(hotfixData));
|
||||
}
|
||||
|
||||
@@ -62,6 +62,10 @@ void WorldSession::HandleInspectOpcode(WorldPackets::Inspect::Inspect& inspect)
|
||||
if (v.second != PLAYERSPELL_REMOVED)
|
||||
inspectResult.Talents.push_back(v.first);
|
||||
}
|
||||
|
||||
PlayerPvpTalentMap const& pvpTalents = player->GetPvpTalentMap(player->GetActiveTalentGroup());
|
||||
for (std::size_t i = 0; i < pvpTalents.size(); ++i)
|
||||
inspectResult.PvpTalents[i] = pvpTalents[i];
|
||||
}
|
||||
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId()))
|
||||
@@ -97,9 +101,9 @@ void WorldSession::HandleRequestHonorStatsOpcode(WorldPackets::Inspect::RequestH
|
||||
|
||||
WorldPackets::Inspect::InspectHonorStats honorStats;
|
||||
honorStats.PlayerGUID = request.TargetGUID;
|
||||
honorStats.LifetimeHK = player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS);
|
||||
honorStats.YesterdayHK = player->GetUInt16Value(PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_YESTERDAY_KILLS);
|
||||
honorStats.TodayHK = player->GetUInt16Value(PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_TODAY_KILLS);
|
||||
honorStats.LifetimeHK = player->GetUInt32Value(ACTIVE_PLAYER_FIELD_LIFETIME_HONORABLE_KILLS);
|
||||
honorStats.YesterdayHK = player->GetUInt16Value(ACTIVE_PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_YESTERDAY_KILLS);
|
||||
honorStats.TodayHK = player->GetUInt16Value(ACTIVE_PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_TODAY_KILLS);
|
||||
honorStats.LifetimeMaxRank = 0; /// @todo
|
||||
|
||||
SendPacket(honorStats.Write());
|
||||
|
||||
@@ -516,7 +516,7 @@ void WorldSession::HandleBuybackItem(WorldPackets::Item::BuyBackItem& packet)
|
||||
Item* pItem = _player->GetItemFromBuyBackSlot(packet.Slot);
|
||||
if (pItem)
|
||||
{
|
||||
uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + packet.Slot - BUYBACK_SLOT_START);
|
||||
uint32 price = _player->GetUInt32Value(ACTIVE_PLAYER_FIELD_BUYBACK_PRICE + packet.Slot - BUYBACK_SLOT_START);
|
||||
if (!_player->HasEnoughMoney(uint64(price)))
|
||||
{
|
||||
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0);
|
||||
|
||||
@@ -756,7 +756,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPackets::Character::SetActionB
|
||||
return;
|
||||
}
|
||||
|
||||
GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES, packet.Mask);
|
||||
GetPlayer()->SetByteValue(ACTIVE_PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES, packet.Mask);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePlayedTime(WorldPackets::Character::RequestPlayedTime& packet)
|
||||
@@ -824,11 +824,11 @@ void WorldSession::HandleFarSightOpcode(WorldPackets::Misc::FarSight& packet)
|
||||
{
|
||||
if (packet.Enable)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "Added FarSight %s to %s", _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str(), _player->GetGUID().ToString().c_str());
|
||||
TC_LOG_DEBUG("network", "Added FarSight %s to %s", _player->GetGuidValue(ACTIVE_PLAYER_FIELD_FARSIGHT).ToString().c_str(), _player->GetGUID().ToString().c_str());
|
||||
if (WorldObject* target = _player->GetViewpoint())
|
||||
_player->SetSeer(target);
|
||||
else
|
||||
TC_LOG_DEBUG("network", "Player %s (%s) requests non-existing seer %s", _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str());
|
||||
TC_LOG_DEBUG("network", "Player %s (%s) requests non-existing seer %s", _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->GetGuidValue(ACTIVE_PLAYER_FIELD_FARSIGHT).ToString().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1152,12 +1152,6 @@ void WorldSession::HandleMountSetFavorite(WorldPackets::Misc::MountSetFavorite&
|
||||
_collectionMgr->MountSetFavorite(mountSetFavorite.MountSpellID, mountSetFavorite.IsFavorite);
|
||||
}
|
||||
|
||||
void WorldSession::HandlePvpPrestigeRankUp(WorldPackets::Misc::PvpPrestigeRankUp& /*pvpPrestigeRankUp*/)
|
||||
{
|
||||
if (_player->CanPrestige())
|
||||
_player->Prestige();
|
||||
}
|
||||
|
||||
void WorldSession::HandleCloseInteraction(WorldPackets::Misc::CloseInteraction& closeInteraction)
|
||||
{
|
||||
if (_player->PlayerTalkClass->GetInteractionData().SourceGuid == closeInteraction.SourceGuid)
|
||||
|
||||
@@ -95,10 +95,12 @@ void WorldSession::HandleCreatureQuery(WorldPackets::Query::QueryCreature& packe
|
||||
for (uint32 i = 0; i < MAX_KILL_CREDIT; ++i)
|
||||
stats.ProxyCreatureID[i] = creatureInfo->KillCredit[i];
|
||||
|
||||
stats.CreatureDisplayID[0] = creatureInfo->Modelid1;
|
||||
stats.CreatureDisplayID[1] = creatureInfo->Modelid2;
|
||||
stats.CreatureDisplayID[2] = creatureInfo->Modelid3;
|
||||
stats.CreatureDisplayID[3] = creatureInfo->Modelid4;
|
||||
std::transform(creatureInfo->Models.begin(), creatureInfo->Models.end(), std::back_inserter(stats.Display.CreatureDisplay),
|
||||
[&stats](CreatureModel const& model) -> WorldPackets::Query::CreatureXDisplay
|
||||
{
|
||||
stats.Display.TotalProbability += model.Probability;
|
||||
return { model.CreatureDisplayID, model.DisplayScale, model.Probability };
|
||||
});
|
||||
|
||||
stats.HpMulti = creatureInfo->ModHealth;
|
||||
stats.EnergyMulti = creatureInfo->ModMana;
|
||||
@@ -107,14 +109,14 @@ void WorldSession::HandleCreatureQuery(WorldPackets::Query::QueryCreature& packe
|
||||
stats.RequiredExpansion = creatureInfo->RequiredExpansion;
|
||||
stats.HealthScalingExpansion = creatureInfo->HealthScalingExpansion;
|
||||
stats.VignetteID = creatureInfo->VignetteID;
|
||||
stats.Class = creatureInfo->unit_class;
|
||||
|
||||
stats.Title = creatureInfo->SubName;
|
||||
stats.TitleAlt = creatureInfo->TitleAlt;
|
||||
stats.CursorName = creatureInfo->IconName;
|
||||
|
||||
if (std::vector<uint32> const* items = sObjectMgr->GetCreatureQuestItemList(packet.CreatureID))
|
||||
for (uint32 item : *items)
|
||||
stats.QuestItems.push_back(item);
|
||||
stats.QuestItems.insert(stats.QuestItems.begin(), items->begin(), items->end());
|
||||
|
||||
LocaleConstant localeConstant = GetSessionDbLocaleIndex();
|
||||
if (localeConstant != LOCALE_enUS)
|
||||
@@ -368,13 +370,12 @@ void WorldSession::HandleQuestPOIQuery(WorldPackets::Query::QuestPOIQuery& quest
|
||||
questPOIBlobData.QuestObjectiveID = data->QuestObjectiveID;
|
||||
questPOIBlobData.QuestObjectID = data->QuestObjectID;
|
||||
questPOIBlobData.MapID = data->MapID;
|
||||
questPOIBlobData.WorldMapAreaID = data->WorldMapAreaID;
|
||||
questPOIBlobData.Floor = data->Floor;
|
||||
questPOIBlobData.UiMapID = data->UiMapID;
|
||||
questPOIBlobData.Priority = data->Priority;
|
||||
questPOIBlobData.Flags = data->Flags;
|
||||
questPOIBlobData.WorldEffectID = data->WorldEffectID;
|
||||
questPOIBlobData.PlayerConditionID = data->PlayerConditionID;
|
||||
questPOIBlobData.UnkWoD1 = data->UnkWoD1;
|
||||
questPOIBlobData.SpawnTrackingID = data->SpawnTrackingID;
|
||||
questPOIBlobData.AlwaysAllowMergingBlobs = data->AlwaysAllowMergingBlobs;
|
||||
|
||||
for (QuestPOIPoint const& point : data->points)
|
||||
|
||||
@@ -55,14 +55,14 @@ void WorldSession::HandleLearnPvpTalentsOpcode(WorldPackets::Talent::LearnPvpTal
|
||||
{
|
||||
WorldPackets::Talent::LearnPvpTalentsFailed learnPvpTalentsFailed;
|
||||
bool anythingLearned = false;
|
||||
for (uint32 talentId : packet.Talents)
|
||||
for (WorldPackets::Talent::PvPTalent pvpTalent : packet.Talents)
|
||||
{
|
||||
if (TalentLearnResult result = _player->LearnPvpTalent(talentId, &learnPvpTalentsFailed.SpellID))
|
||||
if (TalentLearnResult result = _player->LearnPvpTalent(pvpTalent.PvPTalentID, pvpTalent.Slot, &learnPvpTalentsFailed.SpellID))
|
||||
{
|
||||
if (!learnPvpTalentsFailed.Reason)
|
||||
learnPvpTalentsFailed.Reason = result;
|
||||
|
||||
learnPvpTalentsFailed.Talents.push_back(talentId);
|
||||
learnPvpTalentsFailed.Talents.push_back(pvpTalent);
|
||||
}
|
||||
else
|
||||
anythingLearned = true;
|
||||
|
||||
@@ -466,7 +466,7 @@ void WorldSession::HandleSelfResOpcode(WorldPackets::Spells::SelfRes& selfRes)
|
||||
if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
return; // silent return, client should display error by itself and not send this opcode
|
||||
|
||||
std::vector<uint32> const& selfResSpells = _player->GetDynamicValues(PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS);
|
||||
std::vector<uint32> const& selfResSpells = _player->GetDynamicValues(ACTIVE_PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS);
|
||||
if (std::find(selfResSpells.begin(), selfResSpells.end(), selfRes.SpellID) == selfResSpells.end())
|
||||
return;
|
||||
|
||||
@@ -474,7 +474,7 @@ void WorldSession::HandleSelfResOpcode(WorldPackets::Spells::SelfRes& selfRes)
|
||||
if (spellInfo)
|
||||
_player->CastSpell(_player, spellInfo, false, nullptr);
|
||||
|
||||
_player->RemoveDynamicValue(PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS, selfRes.SpellID);
|
||||
_player->RemoveDynamicValue(ACTIVE_PLAYER_DYNAMIC_FIELD_SELF_RES_SPELLS, selfRes.SpellID);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSpellClick(WorldPackets::Spells::SpellClick& spellClick)
|
||||
|
||||
@@ -107,6 +107,16 @@ void WorldSession::SendTaxiMenu(Creature* unit)
|
||||
|
||||
GetPlayer()->m_taxi.AppendTaximaskTo(data, lastTaxiCheaterState);
|
||||
|
||||
TaxiMask reachableNodes;
|
||||
std::fill(reachableNodes.begin(), reachableNodes.end(), 0);
|
||||
sTaxiPathGraph.GetReachableNodesMask(sTaxiNodesStore.LookupEntry(curloc), &reachableNodes);
|
||||
|
||||
for (std::size_t i = 0; i < TaxiMaskSize; ++i)
|
||||
{
|
||||
data.CanLandNodes[i] &= reachableNodes[i];
|
||||
data.CanUseNodes[i] &= reachableNodes[i];
|
||||
}
|
||||
|
||||
SendPacket(data.Write());
|
||||
|
||||
GetPlayer()->SetTaxiCheater(lastTaxiCheaterState);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,23 +60,23 @@ PhaseShift::EraseResult<PhaseShift::VisibleMapIdContainer> PhaseShift::RemoveVis
|
||||
return { VisibleMapIds.end(), false };
|
||||
}
|
||||
|
||||
bool PhaseShift::AddUiWorldMapAreaIdSwap(uint32 uiWorldMapAreaId, int32 references /*= 1*/)
|
||||
bool PhaseShift::AddUiMapPhaseId(uint32 uiMapPhaseId, int32 references /*= 1*/)
|
||||
{
|
||||
auto insertResult = UiWorldMapAreaIdSwaps.emplace(uiWorldMapAreaId, UiWorldMapAreaIdSwapRef{ 0 });
|
||||
auto insertResult = UiMapPhaseIds.emplace(uiMapPhaseId, UiMapPhaseIdRef{ 0 });
|
||||
insertResult.first->second.References += references;
|
||||
return insertResult.second;
|
||||
}
|
||||
|
||||
PhaseShift::EraseResult<PhaseShift::UiWorldMapAreaIdSwapContainer> PhaseShift::RemoveUiWorldMapAreaIdSwap(uint32 uiWorldMapAreaId)
|
||||
PhaseShift::EraseResult<PhaseShift::UiMapPhaseIdContainer> PhaseShift::RemoveUiMapPhaseId(uint32 uiMapPhaseId)
|
||||
{
|
||||
auto itr = UiWorldMapAreaIdSwaps.find(uiWorldMapAreaId);
|
||||
if (itr != UiWorldMapAreaIdSwaps.end())
|
||||
auto itr = UiMapPhaseIds.find(uiMapPhaseId);
|
||||
if (itr != UiMapPhaseIds.end())
|
||||
{
|
||||
if (!--itr->second.References)
|
||||
return { UiWorldMapAreaIdSwaps.erase(itr), true };
|
||||
return { UiMapPhaseIds.erase(itr), true };
|
||||
return { itr, false };
|
||||
}
|
||||
return { UiWorldMapAreaIdSwaps.end(), false };
|
||||
return { UiMapPhaseIds.end(), false };
|
||||
}
|
||||
|
||||
void PhaseShift::Clear()
|
||||
@@ -84,7 +84,7 @@ void PhaseShift::Clear()
|
||||
ClearPhases();
|
||||
PersonalGuid.Clear();
|
||||
VisibleMapIds.clear();
|
||||
UiWorldMapAreaIdSwaps.clear();
|
||||
UiMapPhaseIds.clear();
|
||||
}
|
||||
|
||||
void PhaseShift::ClearPhases()
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
int32 References = 0;
|
||||
TerrainSwapInfo const* VisibleMapInfo = nullptr;
|
||||
};
|
||||
struct UiWorldMapAreaIdSwapRef
|
||||
struct UiMapPhaseIdRef
|
||||
{
|
||||
int32 References = 0;
|
||||
};
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
};
|
||||
typedef boost::container::flat_set<PhaseRef> PhaseContainer;
|
||||
typedef std::map<uint32, VisibleMapIdRef> VisibleMapIdContainer;
|
||||
typedef std::map<uint32, UiWorldMapAreaIdSwapRef> UiWorldMapAreaIdSwapContainer;
|
||||
typedef std::map<uint32, UiMapPhaseIdRef> UiMapPhaseIdContainer;
|
||||
|
||||
PhaseShift() : Flags(PhaseShiftFlags::Unphased), NonCosmeticReferences(0), CosmeticReferences(0), DefaultReferences(0), IsDbPhaseShift(false) { }
|
||||
|
||||
@@ -94,10 +94,10 @@ public:
|
||||
bool HasVisibleMapId(uint32 visibleMapId) const { return VisibleMapIds.find(visibleMapId) != VisibleMapIds.end(); }
|
||||
VisibleMapIdContainer const& GetVisibleMapIds() const { return VisibleMapIds; }
|
||||
|
||||
bool AddUiWorldMapAreaIdSwap(uint32 uiWorldMapAreaId, int32 references = 1);
|
||||
EraseResult<UiWorldMapAreaIdSwapContainer> RemoveUiWorldMapAreaIdSwap(uint32 uiWorldMapAreaId);
|
||||
bool HasUiWorldMapAreaIdSwap(uint32 uiWorldMapAreaId) const { return UiWorldMapAreaIdSwaps.find(uiWorldMapAreaId) != UiWorldMapAreaIdSwaps.end(); }
|
||||
UiWorldMapAreaIdSwapContainer const& GetUiWorldMapAreaIdSwaps() const { return UiWorldMapAreaIdSwaps; }
|
||||
bool AddUiMapPhaseId(uint32 uiMapPhaseId, int32 references = 1);
|
||||
EraseResult<UiMapPhaseIdContainer> RemoveUiMapPhaseId(uint32 uiMapPhaseId);
|
||||
bool HasUiMapPhaseId(uint32 uiMapPhaseId) const { return UiMapPhaseIds.find(uiMapPhaseId) != UiMapPhaseIds.end(); }
|
||||
UiMapPhaseIdContainer const& GetUiWorldMapAreaIdSwaps() const { return UiMapPhaseIds; }
|
||||
|
||||
void Clear();
|
||||
void ClearPhases();
|
||||
@@ -111,7 +111,7 @@ protected:
|
||||
ObjectGuid PersonalGuid;
|
||||
PhaseContainer Phases;
|
||||
VisibleMapIdContainer VisibleMapIds;
|
||||
UiWorldMapAreaIdSwapContainer UiWorldMapAreaIdSwaps;
|
||||
UiMapPhaseIdContainer UiMapPhaseIds;
|
||||
|
||||
void ModifyPhasesReferences(PhaseContainer::iterator itr, int32 references);
|
||||
void UpdateUnphasedFlag();
|
||||
|
||||
@@ -146,8 +146,8 @@ void PhasingHandler::AddVisibleMapId(WorldObject* object, uint32 visibleMapId)
|
||||
TerrainSwapInfo const* terrainSwapInfo = sObjectMgr->GetTerrainSwapInfo(visibleMapId);
|
||||
bool changed = object->GetPhaseShift().AddVisibleMapId(visibleMapId, terrainSwapInfo);
|
||||
|
||||
for (uint32 uiWorldMapAreaIDSwap : terrainSwapInfo->UiWorldMapAreaIDSwaps)
|
||||
changed = object->GetPhaseShift().AddUiWorldMapAreaIdSwap(uiWorldMapAreaIDSwap) || changed;
|
||||
for (uint32 uiMapPhaseId : terrainSwapInfo->UiMapPhaseIDs)
|
||||
changed = object->GetPhaseShift().AddUiMapPhaseId(uiMapPhaseId) || changed;
|
||||
|
||||
if (Unit* unit = object->ToUnit())
|
||||
{
|
||||
@@ -165,8 +165,8 @@ void PhasingHandler::RemoveVisibleMapId(WorldObject* object, uint32 visibleMapId
|
||||
TerrainSwapInfo const* terrainSwapInfo = sObjectMgr->GetTerrainSwapInfo(visibleMapId);
|
||||
bool changed = object->GetPhaseShift().RemoveVisibleMapId(visibleMapId).Erased;
|
||||
|
||||
for (uint32 uiWorldMapAreaIDSwap : terrainSwapInfo->UiWorldMapAreaIDSwaps)
|
||||
changed = object->GetPhaseShift().RemoveUiWorldMapAreaIdSwap(uiWorldMapAreaIDSwap).Erased || changed;
|
||||
for (uint32 uiWorldMapAreaIDSwap : terrainSwapInfo->UiMapPhaseIDs)
|
||||
changed = object->GetPhaseShift().RemoveUiMapPhaseId(uiWorldMapAreaIDSwap).Erased || changed;
|
||||
|
||||
if (Unit* unit = object->ToUnit())
|
||||
{
|
||||
@@ -198,18 +198,21 @@ void PhasingHandler::OnMapChange(WorldObject* object)
|
||||
ConditionSourceInfo srcInfo = ConditionSourceInfo(object);
|
||||
|
||||
object->GetPhaseShift().VisibleMapIds.clear();
|
||||
object->GetPhaseShift().UiWorldMapAreaIdSwaps.clear();
|
||||
object->GetPhaseShift().UiMapPhaseIds.clear();
|
||||
object->GetSuppressedPhaseShift().VisibleMapIds.clear();
|
||||
|
||||
if (std::vector<TerrainSwapInfo*> const* visibleMapIds = sObjectMgr->GetTerrainSwapsForMap(object->GetMapId()))
|
||||
for (auto visibleMapPair : sObjectMgr->GetTerrainSwaps())
|
||||
{
|
||||
for (TerrainSwapInfo const* visibleMapInfo : *visibleMapIds)
|
||||
for (TerrainSwapInfo const* visibleMapInfo : visibleMapPair.second)
|
||||
{
|
||||
if (sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_TERRAIN_SWAP, visibleMapInfo->Id, srcInfo))
|
||||
{
|
||||
phaseShift.AddVisibleMapId(visibleMapInfo->Id, visibleMapInfo);
|
||||
for (uint32 uiWorldMapAreaIdSwap : visibleMapInfo->UiWorldMapAreaIDSwaps)
|
||||
phaseShift.AddUiWorldMapAreaIdSwap(uiWorldMapAreaIdSwap);
|
||||
if (visibleMapPair.first == object->GetMapId())
|
||||
phaseShift.AddVisibleMapId(visibleMapInfo->Id, visibleMapInfo);
|
||||
|
||||
// ui map is visible on all maps
|
||||
for (uint32 uiMapPhaseId : visibleMapInfo->UiMapPhaseIDs)
|
||||
phaseShift.AddUiMapPhaseId(uiMapPhaseId);
|
||||
}
|
||||
else
|
||||
suppressedPhaseShift.AddVisibleMapId(visibleMapInfo->Id, visibleMapInfo);
|
||||
@@ -317,8 +320,8 @@ void PhasingHandler::OnConditionChange(WorldObject* object)
|
||||
if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_TERRAIN_SWAP, itr->first, srcInfo))
|
||||
{
|
||||
newSuppressions.AddVisibleMapId(itr->first, itr->second.VisibleMapInfo, itr->second.References);
|
||||
for (uint32 uiWorldMapAreaIdSwap : itr->second.VisibleMapInfo->UiWorldMapAreaIDSwaps)
|
||||
changed = phaseShift.RemoveUiWorldMapAreaIdSwap(uiWorldMapAreaIdSwap).Erased || changed;
|
||||
for (uint32 uiMapPhaseId : itr->second.VisibleMapInfo->UiMapPhaseIDs)
|
||||
changed = phaseShift.RemoveUiMapPhaseId(uiMapPhaseId).Erased || changed;
|
||||
|
||||
itr = phaseShift.VisibleMapIds.erase(itr);
|
||||
}
|
||||
@@ -331,8 +334,8 @@ void PhasingHandler::OnConditionChange(WorldObject* object)
|
||||
if (sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_TERRAIN_SWAP, itr->first, srcInfo))
|
||||
{
|
||||
changed = phaseShift.AddVisibleMapId(itr->first, itr->second.VisibleMapInfo, itr->second.References) || changed;
|
||||
for (uint32 uiWorldMapAreaIdSwap : itr->second.VisibleMapInfo->UiWorldMapAreaIDSwaps)
|
||||
changed = phaseShift.AddUiWorldMapAreaIdSwap(uiWorldMapAreaIdSwap) || changed;
|
||||
for (uint32 uiMapPhaseId : itr->second.VisibleMapInfo->UiMapPhaseIDs)
|
||||
changed = phaseShift.AddUiMapPhaseId(uiMapPhaseId) || changed;
|
||||
|
||||
itr = suppressedPhaseShift.VisibleMapIds.erase(itr);
|
||||
}
|
||||
@@ -403,9 +406,9 @@ void PhasingHandler::SendToPlayer(Player const* player, PhaseShift const& phaseS
|
||||
phaseShiftChange.VisibleMapIDs.reserve(phaseShift.VisibleMapIds.size());
|
||||
std::transform(phaseShift.VisibleMapIds.begin(), phaseShift.VisibleMapIds.end(), std::back_inserter(phaseShiftChange.VisibleMapIDs),
|
||||
[](PhaseShift::VisibleMapIdContainer::value_type const& visibleMapId) { return visibleMapId.first; });
|
||||
phaseShiftChange.UiWorldMapAreaIDSwaps.reserve(phaseShift.UiWorldMapAreaIdSwaps.size());
|
||||
std::transform(phaseShift.UiWorldMapAreaIdSwaps.begin(), phaseShift.UiWorldMapAreaIdSwaps.end(), std::back_inserter(phaseShiftChange.UiWorldMapAreaIDSwaps),
|
||||
[](PhaseShift::UiWorldMapAreaIdSwapContainer::value_type const& uiWorldMapAreaIdSwap) { return uiWorldMapAreaIdSwap.first; });
|
||||
phaseShiftChange.UiMapPhaseIDs.reserve(phaseShift.UiMapPhaseIds.size());
|
||||
std::transform(phaseShift.UiMapPhaseIds.begin(), phaseShift.UiMapPhaseIds.end(), std::back_inserter(phaseShiftChange.UiMapPhaseIDs),
|
||||
[](PhaseShift::UiMapPhaseIdContainer::value_type const& uiWorldMapAreaIdSwap) { return uiWorldMapAreaIdSwap.first; });
|
||||
|
||||
player->SendDirectMessage(phaseShiftChange.Write());
|
||||
}
|
||||
@@ -545,10 +548,10 @@ void PhasingHandler::PrintToChat(ChatHandler* chat, PhaseShift const& phaseShift
|
||||
chat->PSendSysMessage(LANG_PHASESHIFT_VISIBLE_MAP_IDS, visibleMapIds.str().c_str());
|
||||
}
|
||||
|
||||
if (!phaseShift.UiWorldMapAreaIdSwaps.empty())
|
||||
if (!phaseShift.UiMapPhaseIds.empty())
|
||||
{
|
||||
std::ostringstream uiWorldMapAreaIdSwaps;
|
||||
for (PhaseShift::UiWorldMapAreaIdSwapContainer::value_type const& uiWorldMapAreaIdSwap : phaseShift.UiWorldMapAreaIdSwaps)
|
||||
for (PhaseShift::UiMapPhaseIdContainer::value_type const& uiWorldMapAreaIdSwap : phaseShift.UiMapPhaseIds)
|
||||
uiWorldMapAreaIdSwaps << uiWorldMapAreaIdSwap.first << ',' << ' ';
|
||||
|
||||
chat->PSendSysMessage(LANG_PHASESHIFT_UI_WORLD_MAP_AREA_SWAPS, uiWorldMapAreaIdSwaps.str().c_str());
|
||||
|
||||
@@ -37,38 +37,40 @@ Quest::Quest(Field* questRecord)
|
||||
ID = questRecord[0].GetUInt32();
|
||||
Type = questRecord[1].GetUInt8();
|
||||
Level = questRecord[2].GetInt32();
|
||||
MaxScalingLevel = questRecord[3].GetInt32();
|
||||
PackageID = questRecord[4].GetUInt32();
|
||||
MinLevel = questRecord[5].GetInt32();
|
||||
QuestSortID = questRecord[6].GetInt16();
|
||||
QuestInfoID = questRecord[7].GetUInt16();
|
||||
SuggestedPlayers = questRecord[8].GetUInt8();
|
||||
NextQuestInChain = questRecord[9].GetUInt32();
|
||||
RewardXPDifficulty = questRecord[10].GetUInt32();
|
||||
RewardXPMultiplier = questRecord[11].GetFloat();
|
||||
RewardMoney = questRecord[12].GetUInt32();
|
||||
RewardMoneyDifficulty = questRecord[13].GetUInt32();
|
||||
RewardMoneyMultiplier = questRecord[14].GetFloat();
|
||||
RewardBonusMoney = questRecord[15].GetUInt32();
|
||||
ScalingFactionGroup = questRecord[3].GetInt32();
|
||||
MaxScalingLevel = questRecord[4].GetInt32();
|
||||
PackageID = questRecord[5].GetUInt32();
|
||||
MinLevel = questRecord[6].GetInt32();
|
||||
QuestSortID = questRecord[7].GetInt16();
|
||||
QuestInfoID = questRecord[8].GetUInt16();
|
||||
SuggestedPlayers = questRecord[9].GetUInt8();
|
||||
NextQuestInChain = questRecord[10].GetUInt32();
|
||||
RewardXPDifficulty = questRecord[11].GetUInt32();
|
||||
RewardXPMultiplier = questRecord[12].GetFloat();
|
||||
RewardMoney = questRecord[13].GetUInt32();
|
||||
RewardMoneyDifficulty = questRecord[14].GetUInt32();
|
||||
RewardMoneyMultiplier = questRecord[15].GetFloat();
|
||||
RewardBonusMoney = questRecord[16].GetUInt32();
|
||||
for (uint32 i = 0; i < QUEST_REWARD_DISPLAY_SPELL_COUNT; ++i)
|
||||
RewardDisplaySpell[i] = questRecord[16 + i].GetUInt32();
|
||||
RewardDisplaySpell[i] = questRecord[17 + i].GetUInt32();
|
||||
|
||||
RewardSpell = questRecord[19].GetUInt32();
|
||||
RewardHonor = questRecord[20].GetUInt32();
|
||||
RewardKillHonor = questRecord[21].GetUInt32();
|
||||
SourceItemId = questRecord[22].GetUInt32();
|
||||
RewardArtifactXPDifficulty = questRecord[23].GetUInt32();
|
||||
RewardArtifactXPMultiplier = questRecord[24].GetFloat();
|
||||
RewardArtifactCategoryID = questRecord[25].GetUInt32();
|
||||
Flags = questRecord[26].GetUInt32();
|
||||
FlagsEx = questRecord[27].GetUInt32();
|
||||
RewardSpell = questRecord[20].GetUInt32();
|
||||
RewardHonor = questRecord[21].GetUInt32();
|
||||
RewardKillHonor = questRecord[22].GetUInt32();
|
||||
SourceItemId = questRecord[23].GetUInt32();
|
||||
RewardArtifactXPDifficulty = questRecord[24].GetUInt32();
|
||||
RewardArtifactXPMultiplier = questRecord[25].GetFloat();
|
||||
RewardArtifactCategoryID = questRecord[26].GetUInt32();
|
||||
Flags = questRecord[27].GetUInt32();
|
||||
FlagsEx = questRecord[28].GetUInt32();
|
||||
FlagsEx2 = questRecord[29].GetUInt32();
|
||||
|
||||
for (uint32 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i)
|
||||
{
|
||||
RewardItemId[i] = questRecord[28 + i * 4].GetUInt32();
|
||||
RewardItemCount[i] = questRecord[29 + i * 4].GetUInt32();
|
||||
ItemDrop[i] = questRecord[30 + i * 4].GetUInt32();
|
||||
ItemDropQuantity[i] = questRecord[31 + i * 4].GetUInt32();
|
||||
RewardItemId[i] = questRecord[30 + i * 4].GetUInt32();
|
||||
RewardItemCount[i] = questRecord[31 + i * 4].GetUInt32();
|
||||
ItemDrop[i] = questRecord[32 + i * 4].GetUInt32();
|
||||
ItemDropQuantity[i] = questRecord[33 + i * 4].GetUInt32();
|
||||
|
||||
if (RewardItemId[i])
|
||||
++_rewItemsCount;
|
||||
@@ -76,63 +78,64 @@ Quest::Quest(Field* questRecord)
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
{
|
||||
RewardChoiceItemId[i] = questRecord[44 + i * 3].GetUInt32();
|
||||
RewardChoiceItemCount[i] = questRecord[45 + i * 3].GetUInt32();
|
||||
RewardChoiceItemDisplayId[i] = questRecord[46 + i * 3].GetUInt32();
|
||||
RewardChoiceItemId[i] = questRecord[46 + i * 3].GetUInt32();
|
||||
RewardChoiceItemCount[i] = questRecord[47 + i * 3].GetUInt32();
|
||||
RewardChoiceItemDisplayId[i] = questRecord[48 + i * 3].GetUInt32();
|
||||
|
||||
if (RewardChoiceItemId[i])
|
||||
++_rewChoiceItemsCount;
|
||||
}
|
||||
|
||||
POIContinent = questRecord[62].GetUInt32();
|
||||
POIx = questRecord[63].GetFloat();
|
||||
POIy = questRecord[64].GetFloat();
|
||||
POIPriority = questRecord[65].GetUInt32();
|
||||
POIContinent = questRecord[64].GetUInt32();
|
||||
POIx = questRecord[65].GetFloat();
|
||||
POIy = questRecord[66].GetFloat();
|
||||
POIPriority = questRecord[67].GetUInt32();
|
||||
|
||||
RewardTitleId = questRecord[66].GetUInt32();
|
||||
RewardArenaPoints = questRecord[67].GetUInt32();
|
||||
RewardSkillId = questRecord[68].GetUInt32();
|
||||
RewardSkillPoints = questRecord[69].GetUInt32();
|
||||
RewardTitleId = questRecord[68].GetUInt32();
|
||||
RewardArenaPoints = questRecord[69].GetUInt32();
|
||||
RewardSkillId = questRecord[70].GetUInt32();
|
||||
RewardSkillPoints = questRecord[71].GetUInt32();
|
||||
|
||||
QuestGiverPortrait = questRecord[70].GetUInt32();
|
||||
QuestTurnInPortrait = questRecord[71].GetUInt32();
|
||||
QuestGiverPortrait = questRecord[72].GetUInt32();
|
||||
QuestGiverPortraitMount = questRecord[73].GetUInt32();
|
||||
QuestTurnInPortrait = questRecord[74].GetUInt32();
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REWARD_REPUTATIONS_COUNT; ++i)
|
||||
{
|
||||
RewardFactionId[i] = questRecord[72 + i * 4].GetUInt32();
|
||||
RewardFactionValue[i] = questRecord[73 + i * 4].GetInt32();
|
||||
RewardFactionOverride[i] = questRecord[74 + i * 4].GetInt32();
|
||||
RewardFactionCapIn[i] = questRecord[75 + i * 4].GetUInt32();
|
||||
RewardFactionId[i] = questRecord[75 + i * 4].GetUInt32();
|
||||
RewardFactionValue[i] = questRecord[76 + i * 4].GetInt32();
|
||||
RewardFactionOverride[i] = questRecord[77 + i * 4].GetInt32();
|
||||
RewardFactionCapIn[i] = questRecord[78 + i * 4].GetUInt32();
|
||||
}
|
||||
|
||||
RewardReputationMask = questRecord[92].GetUInt32();
|
||||
RewardReputationMask = questRecord[95].GetUInt32();
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
|
||||
{
|
||||
RewardCurrencyId[i] = questRecord[93 + i * 2].GetUInt32();
|
||||
RewardCurrencyCount[i] = questRecord[94 + i * 2].GetUInt32();
|
||||
RewardCurrencyId[i] = questRecord[96 + i * 2].GetUInt32();
|
||||
RewardCurrencyCount[i] = questRecord[97 + i * 2].GetUInt32();
|
||||
|
||||
if (RewardCurrencyId[i])
|
||||
++_rewCurrencyCount;
|
||||
}
|
||||
|
||||
SoundAccept = questRecord[101].GetUInt32();
|
||||
SoundTurnIn = questRecord[102].GetUInt32();
|
||||
AreaGroupID = questRecord[103].GetUInt32();
|
||||
LimitTime = questRecord[104].GetUInt32();
|
||||
AllowableRaces = questRecord[105].GetUInt64();
|
||||
QuestRewardID = questRecord[106].GetUInt32();
|
||||
Expansion = questRecord[107].GetInt32();
|
||||
SoundAccept = questRecord[104].GetUInt32();
|
||||
SoundTurnIn = questRecord[105].GetUInt32();
|
||||
AreaGroupID = questRecord[106].GetUInt32();
|
||||
LimitTime = questRecord[107].GetUInt32();
|
||||
AllowableRaces = questRecord[108].GetUInt64();
|
||||
TreasurePickerID = questRecord[109].GetInt32();
|
||||
Expansion = questRecord[110].GetInt32();
|
||||
|
||||
LogTitle = questRecord[108].GetString();
|
||||
LogDescription = questRecord[109].GetString();
|
||||
QuestDescription = questRecord[110].GetString();
|
||||
AreaDescription = questRecord[111].GetString();
|
||||
PortraitGiverText = questRecord[112].GetString();
|
||||
PortraitGiverName = questRecord[113].GetString();
|
||||
PortraitTurnInText = questRecord[114].GetString();
|
||||
PortraitTurnInName = questRecord[115].GetString();
|
||||
QuestCompletionLog = questRecord[116].GetString();
|
||||
LogTitle = questRecord[111].GetString();
|
||||
LogDescription = questRecord[112].GetString();
|
||||
QuestDescription = questRecord[113].GetString();
|
||||
AreaDescription = questRecord[114].GetString();
|
||||
PortraitGiverText = questRecord[115].GetString();
|
||||
PortraitGiverName = questRecord[116].GetString();
|
||||
PortraitTurnInText = questRecord[117].GetString();
|
||||
PortraitTurnInName = questRecord[118].GetString();
|
||||
QuestCompletionLog = questRecord[119].GetString();
|
||||
|
||||
for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i)
|
||||
{
|
||||
@@ -255,20 +258,20 @@ void Quest::LoadQuestObjectiveVisualEffect(Field* fields)
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Quest::XPValue(uint32 playerLevel) const
|
||||
uint32 Quest::XPValue(Player const* player) const
|
||||
{
|
||||
if (playerLevel)
|
||||
if (player)
|
||||
{
|
||||
uint32 questLevel = uint32(Level == -1 ? playerLevel : Level);
|
||||
uint32 questLevel = player->GetQuestLevel(this);
|
||||
QuestXPEntry const* questXp = sQuestXPStore.LookupEntry(questLevel);
|
||||
if (!questXp || RewardXPDifficulty >= 10)
|
||||
return 0;
|
||||
|
||||
float multiplier = 1.0f;
|
||||
if (questLevel != playerLevel)
|
||||
multiplier = sXpGameTable.GetRow(std::min(playerLevel, questLevel))->Divisor / sXpGameTable.GetRow(playerLevel)->Divisor;
|
||||
if (questLevel != player->getLevel())
|
||||
multiplier = sXpGameTable.GetRow(std::min<int32>(player->getLevel(), questLevel))->Divisor / sXpGameTable.GetRow(player->getLevel())->Divisor;
|
||||
|
||||
int32 diffFactor = 2 * (questLevel - playerLevel) + 20;
|
||||
int32 diffFactor = 2 * (questLevel + (Level == -1 ? 0 : 5) - player->getLevel()) + 10;
|
||||
if (diffFactor < 1)
|
||||
diffFactor = 1;
|
||||
else if (diffFactor > 10)
|
||||
@@ -290,11 +293,9 @@ uint32 Quest::XPValue(uint32 playerLevel) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 Quest::MoneyValue(uint8 playerLevel) const
|
||||
uint32 Quest::MoneyValue(Player const* player) const
|
||||
{
|
||||
uint8 level = Level == -1 ? playerLevel : Level;
|
||||
|
||||
if (QuestMoneyRewardEntry const* money = sQuestMoneyRewardStore.LookupEntry(level))
|
||||
if (QuestMoneyRewardEntry const* money = sQuestMoneyRewardStore.LookupEntry(player->GetQuestLevel(this)))
|
||||
return money->Difficulty[GetRewMoneyDifficulty()] * GetMoneyMultiplier();
|
||||
else
|
||||
return 0;
|
||||
@@ -315,11 +316,11 @@ void Quest::BuildQuestRewards(WorldPackets::Quest::QuestRewards& rewards, Player
|
||||
rewards.SpellCompletionID = GetRewSpell();
|
||||
rewards.SkillLineID = GetRewardSkillId();
|
||||
rewards.NumSkillUps = GetRewardSkillPoints();
|
||||
rewards.RewardID = GetRewardId();
|
||||
rewards.TreasurePickerID = GetTreasurePickerId();
|
||||
|
||||
for (uint32 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i)
|
||||
{
|
||||
rewards.ChoiceItems[i].ItemID = RewardChoiceItemId[i];
|
||||
rewards.ChoiceItems[i].Item.ItemID = RewardChoiceItemId[i];
|
||||
rewards.ChoiceItems[i].Quantity = RewardChoiceItemCount[i];
|
||||
}
|
||||
|
||||
|
||||
@@ -200,6 +200,11 @@ enum QuestFlagsEx : uint32
|
||||
QUEST_FLAGS_EX_CLEAR_PROGRESS_OF_CRITERIA_TREE_OBJECTIVES_ON_ACCEPT = 0x1000000
|
||||
};
|
||||
|
||||
enum QuestFlagsEx2 : uint32
|
||||
{
|
||||
QUEST_FLAGS_EX2_NO_WAR_MODE_BONUS = 0x2
|
||||
};
|
||||
|
||||
enum QuestSpecialFlags
|
||||
{
|
||||
QUEST_SPECIAL_FLAGS_NONE = 0x000,
|
||||
@@ -348,17 +353,16 @@ class TC_GAME_API Quest
|
||||
void LoadQuestObjective(Field* fields);
|
||||
void LoadQuestObjectiveVisualEffect(Field* fields);
|
||||
|
||||
uint32 XPValue(uint32 playerLevel) const;
|
||||
uint32 MoneyValue(uint8 playerLevel) const;
|
||||
uint32 XPValue(Player const* player) const;
|
||||
uint32 MoneyValue(Player const* player) const;
|
||||
|
||||
bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; }
|
||||
void SetFlag(uint32 flag) { Flags |= flag; }
|
||||
bool HasFlag(QuestFlags flag) const { return (Flags & uint32(flag)) != 0; }
|
||||
bool HasFlagEx(QuestFlagsEx flag) const { return (FlagsEx & uint32(flag)) != 0; }
|
||||
bool HasFlagEx2(QuestFlagsEx2 flag) const { return (FlagsEx2 & uint32(flag)) != 0; }
|
||||
|
||||
bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; }
|
||||
void SetSpecialFlag(uint32 flag) { SpecialFlags |= flag; }
|
||||
|
||||
bool HasFlagEx(QuestFlagsEx flag) const { return (FlagsEx & uint32(flag)) != 0; }
|
||||
|
||||
// table data accessors:
|
||||
uint32 GetQuestId() const { return ID; }
|
||||
uint32 GetQuestType() const { return Type; }
|
||||
@@ -367,6 +371,7 @@ class TC_GAME_API Quest
|
||||
int32 GetMinLevel() const { return MinLevel; }
|
||||
uint32 GetMaxLevel() const { return MaxLevel; }
|
||||
int32 GetQuestLevel() const { return Level; }
|
||||
int32 GetQuestScalingFactionGroup() const { return ScalingFactionGroup; }
|
||||
int32 GetQuestMaxScalingLevel() const { return MaxScalingLevel; }
|
||||
uint32 GetQuestInfoID() const { return QuestInfoID; }
|
||||
uint32 GetAllowableClasses() const { return AllowableClasses; }
|
||||
@@ -427,15 +432,17 @@ class TC_GAME_API Quest
|
||||
bool IsAutoComplete() const;
|
||||
uint32 GetFlags() const { return Flags; }
|
||||
uint32 GetFlagsEx() const { return FlagsEx; }
|
||||
uint32 GetFlagsEx2() const { return FlagsEx2; }
|
||||
uint32 GetSpecialFlags() const { return SpecialFlags; }
|
||||
uint32 GetScriptId() const { return ScriptId; }
|
||||
uint32 GetAreaGroupID() const { return AreaGroupID; }
|
||||
uint32 GetRewardSkillId() const { return RewardSkillId; }
|
||||
uint32 GetRewardSkillPoints() const { return RewardSkillPoints; }
|
||||
uint32 GetRewardReputationMask() const { return RewardReputationMask; }
|
||||
uint32 GetRewardId() const { return QuestRewardID; }
|
||||
int32 GetTreasurePickerId() const { return TreasurePickerID; }
|
||||
int32 GetExpansion() const { return Expansion; }
|
||||
uint32 GetQuestGiverPortrait() const { return QuestGiverPortrait; }
|
||||
int32 GetQuestGiverPortraitMount() const { return QuestGiverPortraitMount; }
|
||||
uint32 GetQuestTurnInPortrait() const { return QuestTurnInPortrait; }
|
||||
bool IsDaily() const { return (Flags & QUEST_FLAGS_DAILY) != 0; }
|
||||
bool IsWeekly() const { return (Flags & QUEST_FLAGS_WEEKLY) != 0; }
|
||||
@@ -469,6 +476,7 @@ class TC_GAME_API Quest
|
||||
uint32 ID;
|
||||
uint32 Type;
|
||||
int32 Level;
|
||||
int32 ScalingFactionGroup;
|
||||
int32 MaxScalingLevel;
|
||||
uint32 PackageID;
|
||||
int32 MinLevel;
|
||||
@@ -492,6 +500,7 @@ class TC_GAME_API Quest
|
||||
uint32 SourceItemId;
|
||||
uint32 Flags;
|
||||
uint32 FlagsEx;
|
||||
uint32 FlagsEx2;
|
||||
uint32 RewardItemId[QUEST_REWARD_ITEM_COUNT];
|
||||
uint32 RewardItemCount[QUEST_REWARD_ITEM_COUNT];
|
||||
uint32 ItemDrop[QUEST_ITEM_DROP_COUNT];
|
||||
@@ -508,6 +517,7 @@ class TC_GAME_API Quest
|
||||
uint32 RewardSkillId;
|
||||
uint32 RewardSkillPoints;
|
||||
uint32 QuestGiverPortrait;
|
||||
int32 QuestGiverPortraitMount;
|
||||
uint32 QuestTurnInPortrait;
|
||||
uint32 RewardFactionId[QUEST_REWARD_REPUTATIONS_COUNT];
|
||||
int32 RewardFactionValue[QUEST_REWARD_REPUTATIONS_COUNT];
|
||||
@@ -521,7 +531,7 @@ class TC_GAME_API Quest
|
||||
uint32 AreaGroupID;
|
||||
uint32 LimitTime;
|
||||
uint64 AllowableRaces;
|
||||
uint32 QuestRewardID;
|
||||
int32 TreasurePickerID;
|
||||
int32 Expansion;
|
||||
QuestObjectives Objectives;
|
||||
std::string LogTitle;
|
||||
|
||||
@@ -147,8 +147,8 @@ void ScenarioMgr::LoadScenarioPOI()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 6 7 8 9 10 11 12
|
||||
QueryResult result = WorldDatabase.Query("SELECT CriteriaTreeID, BlobIndex, Idx1, MapID, WorldMapAreaId, Floor, Priority, Flags, WorldEffectID, PlayerConditionID FROM scenario_poi ORDER BY CriteriaTreeID, Idx1");
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
QueryResult result = WorldDatabase.Query("SELECT CriteriaTreeID, BlobIndex, Idx1, MapID, UiMapID, Priority, Flags, WorldEffectID, PlayerConditionID FROM scenario_poi ORDER BY CriteriaTreeID, Idx1");
|
||||
if (!result)
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", ">> Loaded 0 scenario POI definitions. DB table `scenario_poi` is empty.");
|
||||
@@ -188,24 +188,23 @@ void ScenarioMgr::LoadScenarioPOI()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
int32 CriteriaTreeID = fields[0].GetInt32();
|
||||
int32 BlobIndex = fields[1].GetInt32();
|
||||
int32 Idx1 = fields[2].GetInt32();
|
||||
int32 MapID = fields[3].GetInt32();
|
||||
int32 WorldMapAreaId = fields[4].GetInt32();
|
||||
int32 Floor = fields[5].GetInt32();
|
||||
int32 Priority = fields[6].GetInt32();
|
||||
int32 Flags = fields[7].GetInt32();
|
||||
int32 WorldEffectID = fields[8].GetInt32();
|
||||
int32 PlayerConditionID = fields[9].GetInt32();
|
||||
int32 criteriaTreeID = fields[0].GetInt32();
|
||||
int32 blobIndex = fields[1].GetInt32();
|
||||
int32 idx1 = fields[2].GetInt32();
|
||||
int32 mapID = fields[3].GetInt32();
|
||||
int32 uiMapID = fields[4].GetInt32();
|
||||
int32 priority = fields[5].GetInt32();
|
||||
int32 flags = fields[6].GetInt32();
|
||||
int32 worldEffectID = fields[7].GetInt32();
|
||||
int32 playerConditionID = fields[8].GetInt32();
|
||||
|
||||
if (!sCriteriaMgr->GetCriteriaTree(CriteriaTreeID))
|
||||
TC_LOG_ERROR("sql.sql", "`scenario_poi` CriteriaTreeID (%u) Idx1 (%u) does not correspond to a valid criteria tree", CriteriaTreeID, Idx1);
|
||||
if (!sCriteriaMgr->GetCriteriaTree(criteriaTreeID))
|
||||
TC_LOG_ERROR("sql.sql", "`scenario_poi` CriteriaTreeID (%u) Idx1 (%u) does not correspond to a valid criteria tree", criteriaTreeID, idx1);
|
||||
|
||||
if (CriteriaTreeID < int32(POIs.size()) && Idx1 < int32(POIs[CriteriaTreeID].size()))
|
||||
_scenarioPOIStore[CriteriaTreeID].emplace_back(BlobIndex, MapID, WorldMapAreaId, Floor, Priority, Flags, WorldEffectID, PlayerConditionID, POIs[CriteriaTreeID][Idx1]);
|
||||
if (criteriaTreeID < int32(POIs.size()) && idx1 < int32(POIs[criteriaTreeID].size()))
|
||||
_scenarioPOIStore[criteriaTreeID].emplace_back(blobIndex, mapID, uiMapID, priority, flags, worldEffectID, playerConditionID, POIs[criteriaTreeID][idx1]);
|
||||
else
|
||||
TC_LOG_ERROR("server.loading", "Table scenario_poi references unknown scenario poi points for criteria tree id %i POI id %i", CriteriaTreeID, BlobIndex);
|
||||
TC_LOG_ERROR("server.loading", "Table scenario_poi references unknown scenario poi points for criteria tree id %i POI id %i", criteriaTreeID, blobIndex);
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
@@ -74,23 +74,22 @@ struct ScenarioPOI
|
||||
{
|
||||
int32 BlobIndex;
|
||||
int32 MapID;
|
||||
int32 WorldMapAreaID;
|
||||
int32 Floor;
|
||||
int32 UiMapID;
|
||||
int32 Priority;
|
||||
int32 Flags;
|
||||
int32 WorldEffectID;
|
||||
int32 PlayerConditionID;
|
||||
std::vector<ScenarioPOIPoint> Points;
|
||||
|
||||
ScenarioPOI() : BlobIndex(0), MapID(0), WorldMapAreaID(0), Floor(0), Priority(0), Flags(0), WorldEffectID(0), PlayerConditionID(0) { }
|
||||
ScenarioPOI() : BlobIndex(0), MapID(0), UiMapID(0), Priority(0), Flags(0), WorldEffectID(0), PlayerConditionID(0) { }
|
||||
|
||||
ScenarioPOI(int32 _BlobIndex, int32 _MapID, int32 _WorldMapAreaID, int32 _Floor, int32 _Priority, int32 _Flags, int32 _WorldEffectID,
|
||||
int32 _PlayerConditionID, std::vector<ScenarioPOIPoint> points) :
|
||||
BlobIndex(_BlobIndex), MapID(_MapID), WorldMapAreaID(_WorldMapAreaID), Floor(_Floor), Priority(_Priority), Flags(_Flags), WorldEffectID(_WorldEffectID),
|
||||
PlayerConditionID(_PlayerConditionID), Points(std::move(points)) { }
|
||||
ScenarioPOI(int32 blobIndex, int32 mapID, int32 uiMapID, int32 priority, int32 flags, int32 worldEffectID,
|
||||
int32 playerConditionID, std::vector<ScenarioPOIPoint> points) :
|
||||
BlobIndex(blobIndex), MapID(mapID), UiMapID(uiMapID), Priority(priority), Flags(flags), WorldEffectID(worldEffectID),
|
||||
PlayerConditionID(playerConditionID), Points(std::move(points)) { }
|
||||
|
||||
ScenarioPOI(ScenarioPOI&& scenarioPOI) :
|
||||
BlobIndex(scenarioPOI.BlobIndex), MapID(scenarioPOI.MapID), WorldMapAreaID(scenarioPOI.WorldMapAreaID), Floor(scenarioPOI.Floor), Priority(scenarioPOI.Priority),
|
||||
BlobIndex(scenarioPOI.BlobIndex), MapID(scenarioPOI.MapID), UiMapID(scenarioPOI.UiMapID), Priority(scenarioPOI.Priority),
|
||||
Flags(scenarioPOI.Flags), WorldEffectID(scenarioPOI.WorldEffectID), PlayerConditionID(scenarioPOI.PlayerConditionID), Points(std::move(scenarioPOI.Points)) { }
|
||||
};
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ WorldPacket const* WorldPackets::Achievement::AchievementEarned::Write()
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Achievement::ServerFirstAchievement::Write()
|
||||
WorldPacket const* WorldPackets::Achievement::BroadcastAchievement::Write()
|
||||
{
|
||||
_worldPacket.WriteBits(Name.length(), 7);
|
||||
_worldPacket.WriteBit(GuildAchievement);
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace WorldPackets
|
||||
class AchievementDeleted final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
AchievementDeleted() : ServerPacket(SMSG_ACHIEVEMENT_DELETED, 4) { }
|
||||
AchievementDeleted() : ServerPacket(SMSG_ACHIEVEMENT_DELETED, 8) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
@@ -125,10 +125,10 @@ namespace WorldPackets
|
||||
ObjectGuid Sender;
|
||||
};
|
||||
|
||||
class ServerFirstAchievement final : public ServerPacket
|
||||
class BroadcastAchievement final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
ServerFirstAchievement() : ServerPacket(SMSG_SERVER_FIRST_ACHIEVEMENT) { }
|
||||
BroadcastAchievement() : ServerPacket(SMSG_BROADCAST_ACHIEVEMENT) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::AreaTrigger::AreaTriggerS
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, AreaTriggerCircularMovementInfo const& areaTriggerCircularMovement)
|
||||
{
|
||||
data.WriteBit(areaTriggerCircularMovement.TargetGUID.is_initialized());
|
||||
data.WriteBit(areaTriggerCircularMovement.PathTarget.is_initialized());
|
||||
data.WriteBit(areaTriggerCircularMovement.Center.is_initialized());
|
||||
data.WriteBit(areaTriggerCircularMovement.CounterClockwise);
|
||||
data.WriteBit(areaTriggerCircularMovement.CanLoop);
|
||||
@@ -46,8 +46,8 @@ ByteBuffer& operator<<(ByteBuffer& data, AreaTriggerCircularMovementInfo const&
|
||||
data << float(areaTriggerCircularMovement.InitialAngle);
|
||||
data << float(areaTriggerCircularMovement.ZOffset);
|
||||
|
||||
if (areaTriggerCircularMovement.TargetGUID)
|
||||
data << *areaTriggerCircularMovement.TargetGUID;
|
||||
if (areaTriggerCircularMovement.PathTarget)
|
||||
data << *areaTriggerCircularMovement.PathTarget;
|
||||
|
||||
if (areaTriggerCircularMovement.Center)
|
||||
data << *areaTriggerCircularMovement.Center;
|
||||
@@ -72,14 +72,6 @@ WorldPacket const* WorldPackets::AreaTrigger::AreaTriggerDenied::Write()
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::AreaTrigger::AreaTriggerRePath::Write()
|
||||
{
|
||||
_worldPacket << TriggerGUID;
|
||||
_worldPacket << AreaTriggerSpline;
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::AreaTrigger::AreaTriggerReShape::Write()
|
||||
{
|
||||
_worldPacket << TriggerGUID;
|
||||
|
||||
|
||||
@@ -68,18 +68,7 @@ namespace WorldPackets
|
||||
class AreaTriggerRePath final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
AreaTriggerRePath() : ServerPacket(SMSG_AREA_TRIGGER_RE_PATH, 50) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
AreaTriggerSplineInfo AreaTriggerSpline;
|
||||
ObjectGuid TriggerGUID;
|
||||
};
|
||||
|
||||
class AreaTriggerReShape final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
AreaTriggerReShape() : ServerPacket(SMSG_AREA_TRIGGER_RE_SHAPE, 17) { }
|
||||
AreaTriggerRePath() : ServerPacket(SMSG_AREA_TRIGGER_RE_PATH, 17) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user