Core/Datastores: updated DBC structure names to generated member format

This commit is contained in:
Ovahlord committed 2020-01-25 12:36:32 +01:00
1 parent 06ffa70afc
commit fcb79fee07
105 files changed
+2301 -2328

No files matched your search

+4 -4
View File
@@ -304,7 +304,7 @@ bool SpellTargetSelector::operator()(Unit const* target) const
float rangeMod = 0.0f;
if (_spellInfo->RangeEntry)
{
if (_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE)
if (_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE)
{
rangeMod = _caster->GetCombatReach() + 4.0f / 3.0f;
rangeMod += target->GetCombatReach();
@@ -314,7 +314,7 @@ bool SpellTargetSelector::operator()(Unit const* target) const
else
{
float meleeRange = 0.0f;
if (_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED)
if (_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED)
{
meleeRange = _caster->GetCombatReach() + 4.0f / 3.0f;
meleeRange += target->GetCombatReach();
@@ -328,12 +328,12 @@ bool SpellTargetSelector::operator()(Unit const* target) const
rangeMod = _caster->GetCombatReach();
rangeMod += target->GetCombatReach();
if (minRange > 0.0f && !(_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED))
if (minRange > 0.0f && !(_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED))
minRange += rangeMod;
}
if (_caster->isMoving() && target->isMoving() && !_caster->IsWalking() && !target->IsWalking() &&
(_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER))
(_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER))
rangeMod += 8.0f / 3.0f;
}
+1 -1
View File
@@ -459,7 +459,7 @@ uint8 PlayerAI::GetPlayerSpec(Player const* who)
if (!tabEntry)
return 0;
return tabEntry->tabpage;
return tabEntry->OrderIndex;
}
bool PlayerAI::IsPlayerHealer(Player const* who)
+2 -2
View File
@@ -1085,10 +1085,10 @@ class SmartTrigger : public AreaTriggerScript
if (!player->IsAlive())
return false;
TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->id);
TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->ID);
SmartScript script;
script.OnInitialize(nullptr, trigger);
script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id);
script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->ID);
return true;
}
};
@@ -3705,7 +3705,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
if (obj)
TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry());
if (at)
TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id);
TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->ID);
return;
}
for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i)
@@ -3749,7 +3749,7 @@ void SmartScript::GetScript()
}
else if (trigger)
{
e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType);
e = sSmartScriptMgr->GetScript((int32)trigger->ID, mScriptType);
FillScript(e, nullptr, trigger);
}
}
@@ -3778,7 +3778,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at)
{
mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER;
trigger = at;
TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id);
TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->ID);
}
else
{
+100 -100
View File
@@ -52,7 +52,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
return false;
}
switch (criteria->type)
switch (criteria->Type)
{
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE:
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE:
@@ -83,7 +83,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
default:
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` contains data for a non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->type);
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` contains data for a non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->Type);
return false;
}
break;
@@ -98,7 +98,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!creature.id || !sObjectMgr->GetCreatureTemplate(creature.id))
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) contains a non-existing creature id in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, creature.id);
criteria->ID, criteria->Type, dataType, creature.id);
return false;
}
return true;
@@ -106,19 +106,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!classRace.class_id && !classRace.race_id)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
criteria->ID, criteria->type, dataType);
criteria->ID, criteria->Type, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) contains a non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, classRace.class_id);
criteria->ID, criteria->Type, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) contains a non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->type, dataType, classRace.race_id);
criteria->ID, criteria->Type, dataType, classRace.race_id);
return false;
}
return true;
@@ -126,7 +126,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (health.percent < 1 || health.percent > 100)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) contains a wrong percent value in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, health.percent);
criteria->ID, criteria->Type, dataType, health.percent);
return false;
}
return true;
@@ -137,19 +137,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!spellEntry)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) contains a wrong spell id in value1 (%u), ignored.",
criteria->ID, criteria->type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id);
criteria->ID, criteria->Type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id);
return false;
}
if (aura.effect_idx >= 3)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) contains a wrong spell effect index in value2 (%u), ignored.",
criteria->ID, criteria->type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx);
criteria->ID, criteria->Type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx);
return false;
}
if (!spellEntry->Effects[aura.effect_idx].ApplyAuraName)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) contains a non-aura spell effect (ID: %u Effect: %u), ignored.",
criteria->ID, criteria->type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx);
criteria->ID, criteria->Type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx);
return false;
}
return true;
@@ -158,7 +158,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (value.compType >= COMP_TYPE_MAX)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE (%u) contains a wrong ComparisionType in value2 (%u), ignored.",
criteria->ID, criteria->type, dataType, value.compType);
criteria->ID, criteria->Type, dataType, value.compType);
return false;
}
return true;
@@ -166,7 +166,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (level.minlevel > STRONG_MAX_LEVEL)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) contains a wrong minlevel in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, level.minlevel);
criteria->ID, criteria->Type, dataType, level.minlevel);
return false;
}
return true;
@@ -174,7 +174,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (gender.gender > GENDER_NONE)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) contains a wrong gender value in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, gender.gender);
criteria->ID, criteria->Type, dataType, gender.gender);
return false;
}
return true;
@@ -182,7 +182,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!ScriptId)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have a ScriptName set, ignored.",
criteria->ID, criteria->type, dataType);
criteria->ID, criteria->Type, dataType);
return false;
}
return true;
@@ -190,7 +190,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (map_players.maxcount <= 0)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) contains a wrong max players count in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, map_players.maxcount);
criteria->ID, criteria->Type, dataType, map_players.maxcount);
return false;
}
return true;
@@ -198,7 +198,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (team.team != ALLIANCE && team.team != HORDE)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) contains an unknown team value in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, team.team);
criteria->ID, criteria->Type, dataType, team.team);
return false;
}
return true;
@@ -206,7 +206,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (drunk.state >= MAX_DRUNKEN)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) contains an unknown drunken state value in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, drunk.state);
criteria->ID, criteria->Type, dataType, drunk.state);
return false;
}
return true;
@@ -214,7 +214,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!sHolidaysStore.LookupEntry(holiday.id))
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) contains an unknown holiday entry in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, holiday.id);
criteria->ID, criteria->Type, dataType, holiday.id);
return false;
}
return true;
@@ -224,7 +224,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (game_event.id < 1 || game_event.id >= events.size())
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_GAME_EVENT (%u) has unknown game_event in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, game_event.id);
criteria->ID, criteria->Type, dataType, game_event.id);
return false;
}
return true;
@@ -236,7 +236,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (equipped_item.item_quality >= MAX_ITEM_QUALITY)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) contains an unknown quality state value in value1 (%u), ignored.",
criteria->ID, criteria->type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPPED_ITEM ? "ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPPED_ITEM" : "ACHIEVEMENT_CRITERIA_DATA_TYPE_S_ITEM_QUALITY"), dataType, equipped_item.item_quality);
criteria->ID, criteria->Type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPPED_ITEM ? "ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPPED_ITEM" : "ACHIEVEMENT_CRITERIA_DATA_TYPE_S_ITEM_QUALITY"), dataType, equipped_item.item_quality);
return false;
}
return true;
@@ -244,19 +244,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!classRace.class_id && !classRace.race_id)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) should not have 0 in either value field. Ignored.",
criteria->ID, criteria->type, dataType);
criteria->ID, criteria->Type, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) contains a non-existing class entry in value1 (%u), ignored.",
criteria->ID, criteria->type, dataType, classRace.class_id);
criteria->ID, criteria->Type, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) contains a non-existing race entry in value2 (%u), ignored.",
criteria->ID, criteria->type, dataType, classRace.race_id);
criteria->ID, criteria->Type, dataType, classRace.race_id);
return false;
}
return true;
@@ -264,12 +264,12 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
if (!sCharTitlesStore.LookupEntry(known_title.title_id))
{
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE (%u) contains an unknown title_id in value1 (%u), ignore.",
criteria->ID, criteria->type, dataType, known_title.title_id);
criteria->ID, criteria->Type, dataType, known_title.title_id);
return false;
}
return true;
default:
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) contains data of a non-supported data type (%u), ignored.", criteria->ID, criteria->type, dataType);
TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` (Entry: %u Type: %u) contains data of a non-supported data type (%u), ignored.", criteria->ID, criteria->Type, dataType);
return false;
}
}
@@ -373,7 +373,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE:
{
if (CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(known_title.title_id))
return source && source->HasTitle(titleInfo->bit_index);
return source && source->HasTitle(titleInfo->Mask_ID);
return false;
}
@@ -488,7 +488,7 @@ void AchievementMgr<T>::ResetAchievementCriteria(AchievementCriteriaTypes type,
{
AchievementCriteriaEntry const* achievementCriteria = (*i);
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->achievement);
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->Achievement_ID);
if (!achievement)
continue;
@@ -679,7 +679,7 @@ void AchievementMgr<Player>::LoadFromDB(PreparedQueryResult achievementResult, P
ca.date = time_t(fields[1].GetUInt32());
ca.changed = false;
_achievementPoints += achievement->points;
_achievementPoints += achievement->Points;
// title achievement rewards are retroactive
if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement))
@@ -713,7 +713,7 @@ void AchievementMgr<Player>::LoadFromDB(PreparedQueryResult achievementResult, P
continue;
}
if (criteria->timeLimit && time_t(date + criteria->timeLimit) < GameTime::GetGameTime())
if (criteria->Timer_time && time_t(date + criteria->Timer_time) < GameTime::GetGameTime())
continue;
CriteriaProgress& progress = m_criteriaProgress[id];
@@ -748,7 +748,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
ca.changed = false;
_achievementPoints += achievement->points;
_achievementPoints += achievement->Points;
}
while (achievementResult->NextRow());
}
@@ -775,7 +775,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
continue;
}
if (criteria->timeLimit && time_t(date + criteria->timeLimit) < GameTime::GetGameTime())
if (criteria->Timer_time && time_t(date + criteria->Timer_time) < GameTime::GetGameTime())
continue;
CriteriaProgress& progress = m_criteriaProgress[id];
@@ -859,7 +859,7 @@ template<class T>
void AchievementMgr<T>::SendAchievementEarned(AchievementEntry const* achievement) const
{
// Don't send for achievements with ACHIEVEMENT_FLAG_HIDDEN
if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN)
if (achievement->Flags & ACHIEVEMENT_FLAG_HIDDEN)
return;
TC_LOG_DEBUG("achievement", "AchievementMgr::SendAchievementEarned(%u)", achievement->ID);
@@ -871,7 +871,7 @@ void AchievementMgr<T>::SendAchievementEarned(AchievementEntry const* achievemen
guild->BroadcastWorker(_localizer, GetOwner());
}
if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_GUILD))
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_GUILD))
{
// broadcast realm first reached
WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, GetOwner()->GetName().size() + 1 + 8 + 4 + 4);
@@ -942,7 +942,7 @@ void AchievementMgr<Player>::SendCriteriaUpdate(AchievementCriteriaEntry const*
data.appendPackGUID(progress->counter);
data << GetOwner()->GetPackGUID();
if (!entry->timeLimit)
if (!entry->Timer_time)
data << uint32(0);
else
data << uint32(timedCompleted ? 1 : 0); // this are some flags, 1 is for keeping the counter at 0 in client
@@ -1160,10 +1160,10 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type,
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
{
AchievementCriteriaEntry const* achievementCriteria = (*i);
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->achievement);
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->Achievement_ID);
if (!achievement)
{
TC_LOG_ERROR("achievement", "UpdateAchievementCriteria: Achievement %u not found!", achievementCriteria->achievement);
TC_LOG_ERROR("achievement", "UpdateAchievementCriteria: Achievement %u not found!", achievementCriteria->Achievement_ID);
continue;
}
@@ -1373,7 +1373,7 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type,
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first);
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
{
if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine)
if (skillIter->second->SkillLine == achievementCriteria->learn_skillline_spell.skillLine)
spellCount++;
}
}
@@ -1398,7 +1398,7 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type,
{
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first);
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine)
if (skillIter->second->SkillLine == achievementCriteria->learn_skill_line.skillLine)
spellCount++;
}
SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer);
@@ -1504,7 +1504,7 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type,
// check again the completeness for SUMM and REQ COUNT achievements,
// as they don't depend on the completed criteria but on the sum of the progress of each individual criteria
if (achievement->flags & ACHIEVEMENT_FLAG_SUMM)
if (achievement->Flags & ACHIEVEMENT_FLAG_SUMM)
if (IsCompletedAchievement(achievement))
CompletedAchievement(achievement, referencePlayer);
@@ -1530,10 +1530,10 @@ bool AchievementMgr<T>::IsCompletedCriteria(AchievementCriteriaEntry const* achi
return false;
// counter can never complete
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER)
if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER)
return false;
if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_GUILD))
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_GUILD))
{
// someone on this realm has already completed that achievement
if (sAchievementMgr->IsRealmCompleted(achievement, GetInstanceId(GetOwner())))
@@ -1544,7 +1544,7 @@ bool AchievementMgr<T>::IsCompletedCriteria(AchievementCriteriaEntry const* achi
if (!progress)
return false;
switch (AchievementCriteriaTypes(achievementCriteria->type))
switch (AchievementCriteriaTypes(achievementCriteria->Type))
{
case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG:
return progress->counter >= achievementCriteria->win_bg.winCount;
@@ -1720,7 +1720,7 @@ template<class T>
void AchievementMgr<T>::CompletedCriteriaFor(AchievementEntry const* achievement, Player* referencePlayer)
{
// counter can never complete
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER)
if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER)
return;
// already completed and stored
@@ -1735,12 +1735,12 @@ template<class T>
bool AchievementMgr<T>::IsCompletedAchievement(AchievementEntry const* entry)
{
// counter can never complete
if (entry->flags & ACHIEVEMENT_FLAG_COUNTER)
if (entry->Flags & ACHIEVEMENT_FLAG_COUNTER)
return false;
// for achievement with referenced achievement criterias get from referenced and counter from self
uint32 achievementForTestId = entry->refAchievement ? entry->refAchievement : entry->ID;
uint32 achievementForTestCount = entry->count;
uint32 achievementForTestId = entry->Shares_criteria ? entry->Shares_criteria : entry->ID;
uint32 achievementForTestCount = entry->Minimum_criteria;
AchievementCriteriaEntryList const* cList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievementForTestId);
if (!cList)
@@ -1749,7 +1749,7 @@ bool AchievementMgr<T>::IsCompletedAchievement(AchievementEntry const* entry)
// For SUMM achievements, we have to count the progress of each criteria of the achievement.
// Oddly, the target count is NOT contained in the achievement, but in each individual criteria
if (entry->flags & ACHIEVEMENT_FLAG_SUMM)
if (entry->Flags & ACHIEVEMENT_FLAG_SUMM)
{
for (AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr)
{
@@ -1810,7 +1810,7 @@ void AchievementMgr<T>::SetCriteriaProgress(AchievementCriteriaEntry const* entr
{
// Don't allow to cheat - doing timed achievements without timer active
TimedAchievementMap::iterator timedIter = m_timedAchievements.find(entry->ID);
if (entry->timeLimit && timedIter == m_timedAchievements.end())
if (entry->Timer_time && timedIter == m_timedAchievements.end())
return;
TC_LOG_DEBUG("achievement", "SetCriteriaProgress(%u, " UI64FMTD ") for (%s)",
@@ -1821,7 +1821,7 @@ void AchievementMgr<T>::SetCriteriaProgress(AchievementCriteriaEntry const* entr
{
// not create record for 0 counter but allow it for timed achievements
// we will need to send 0 progress to client to start the timer
if (changeValue == 0 && !entry->timeLimit)
if (changeValue == 0 && !entry->Timer_time)
return;
progress = &m_criteriaProgress[entry->ID];
@@ -1848,7 +1848,7 @@ void AchievementMgr<T>::SetCriteriaProgress(AchievementCriteriaEntry const* entr
}
// not update (not mark as changed) if counter will have same value
if (progress->counter == newValue && !entry->timeLimit)
if (progress->counter == newValue && !entry->Timer_time)
return;
progress->counter = newValue;
@@ -1857,21 +1857,21 @@ void AchievementMgr<T>::SetCriteriaProgress(AchievementCriteriaEntry const* entr
progress->changed = true;
progress->date = GameTime::GetGameTime(); // set the date to the latest update.
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(entry->achievement);
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(entry->Achievement_ID);
uint32 timeElapsed = 0;
bool criteriaComplete = IsCompletedCriteria(entry, achievement);
if (entry->timeLimit)
if (entry->Timer_time)
{
// Client expects this in packet
timeElapsed = entry->timeLimit - (timedIter->second/IN_MILLISECONDS);
timeElapsed = entry->Timer_time - (timedIter->second/IN_MILLISECONDS);
// Remove the timer, we wont need it anymore
if (criteriaComplete)
m_timedAchievements.erase(timedIter);
}
if (criteriaComplete && achievement->flags & ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS && !progress->CompletedGUID)
if (criteriaComplete && achievement->Flags & ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS && !progress->CompletedGUID)
progress->CompletedGUID = referencePlayer->GetGUID();
SendCriteriaUpdate(entry, progress, timeElapsed, criteriaComplete);
@@ -1911,16 +1911,16 @@ void AchievementMgr<Player>::StartTimedAchievement(AchievementCriteriaTimedTypes
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type);
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
{
if ((*i)->timedCriteriaMiscId != entry)
if ((*i)->Timer_asset_ID != entry)
continue;
AchievementEntry const* achievement = sAchievementMgr->GetAchievement((*i)->achievement);
AchievementEntry const* achievement = sAchievementMgr->GetAchievement((*i)->Achievement_ID);
if (m_timedAchievements.find((*i)->ID) == m_timedAchievements.end() && !IsCompletedCriteria(*i, achievement))
{
// Start the timer
if ((*i)->timeLimit * IN_MILLISECONDS > timeLost)
if ((*i)->Timer_time * IN_MILLISECONDS > timeLost)
{
m_timedAchievements[(*i)->ID] = (*i)->timeLimit * IN_MILLISECONDS - timeLost;
m_timedAchievements[(*i)->ID] = (*i)->Timer_time * IN_MILLISECONDS - timeLost;
// and at client too
SetCriteriaProgress(*i, 0, GetOwner(), PROGRESS_SET);
@@ -1935,7 +1935,7 @@ void AchievementMgr<T>::RemoveTimedAchievement(AchievementCriteriaTimedTypes typ
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type);
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i)
{
if ((*i)->timedCriteriaMiscId != entry)
if ((*i)->Timer_asset_ID != entry)
continue;
TimedAchievementMap::iterator timedIter = m_timedAchievements.find((*i)->ID);
@@ -1958,12 +1958,12 @@ void AchievementMgr<Player>::CompletedAchievement(AchievementEntry const* achiev
if (GetOwner()->IsGameMaster())
return;
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID))
if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID))
return;
if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS)
if (achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS)
if (Guild* guild = referencePlayer->GetGuild())
guild->AddGuildNews(GUILD_NEWS_PLAYER_ACHIEVEMENT, referencePlayer->GetGUID(), achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID);
guild->AddGuildNews(GUILD_NEWS_PLAYER_ACHIEVEMENT, referencePlayer->GetGUID(), achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID);
if (!GetOwner()->GetSession()->PlayerLoading())
SendAchievementEarned(achievement);
@@ -1977,10 +1977,10 @@ void AchievementMgr<Player>::CompletedAchievement(AchievementEntry const* achiev
sAchievementMgr->SetRealmCompleted(achievement, GetOwner()->GetInstanceId());
_achievementPoints += achievement->points;
_achievementPoints += achievement->Points;
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, 0, nullptr, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, 0, nullptr, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->Points, 0, 0, nullptr, referencePlayer);
// reward items and titles if any
AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement);
@@ -2044,19 +2044,19 @@ void AchievementMgr<Guild>::CompletedAchievement(AchievementEntry const* achieve
{
TC_LOG_DEBUG("achievement", "AchievementMgr<Guild>::CompletedAchievement(%u)", achievement->ID);
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID))
if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID))
return;
if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS)
if (achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS)
if (Guild* guild = referencePlayer->GetGuild())
guild->AddGuildNews(GUILD_NEWS_GUILD_ACHIEVEMENT, ObjectGuid::Empty, achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID);
guild->AddGuildNews(GUILD_NEWS_GUILD_ACHIEVEMENT, ObjectGuid::Empty, achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID);
SendAchievementEarned(achievement);
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
ca.date = GameTime::GetGameTime();
ca.changed = true;
if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS)
if (achievement->Flags & ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS)
{
if (referencePlayer->GetGuildId() == GetOwner()->GetId())
ca.guids.insert(referencePlayer->GetGUID());
@@ -2070,10 +2070,10 @@ void AchievementMgr<Guild>::CompletedAchievement(AchievementEntry const* achieve
sAchievementMgr->SetRealmCompleted(achievement, referencePlayer->GetInstanceId());
_achievementPoints += achievement->points;
_achievementPoints += achievement->Points;
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, 0, nullptr, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_GUILD_ACHIEVEMENT_POINTS, achievement->points, 0, 0, nullptr, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_GUILD_ACHIEVEMENT_POINTS, achievement->Points, 0, 0, nullptr, referencePlayer);
}
struct VisibleAchievementPred
@@ -2081,7 +2081,7 @@ struct VisibleAchievementPred
bool operator()(CompletedAchievementMap::value_type const& val)
{
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(val.first);
return achievement && !(achievement->flags & ACHIEVEMENT_FLAG_HIDDEN);
return achievement && !(achievement->Flags & ACHIEVEMENT_FLAG_HIDDEN);
}
};
@@ -2401,50 +2401,50 @@ bool AchievementMgr<T>::CanUpdateCriteria(AchievementCriteriaEntry const* criter
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, nullptr))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s) Disabled",
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type));
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type));
return false;
}
if (achievement->mapID != -1 && referencePlayer->GetMapId() != uint32(achievement->mapID))
if (achievement->Instance_ID != -1 && referencePlayer->GetMapId() != uint32(achievement->Instance_ID))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s Achievement %u) Wrong map",
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type), achievement->ID);
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type), achievement->ID);
return false;
}
if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && referencePlayer->GetTeam() != HORDE) ||
(achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && referencePlayer->GetTeam() != ALLIANCE))
if ((achievement->Faction == ACHIEVEMENT_FACTION_HORDE && referencePlayer->GetTeam() != HORDE) ||
(achievement->Faction == ACHIEVEMENT_FACTION_ALLIANCE && referencePlayer->GetTeam() != ALLIANCE))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s Achievement %u) Wrong faction",
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type), achievement->ID);
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type), achievement->ID);
return false;
}
if (IsCompletedCriteria(criteria, achievement))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: %s (Id: %u Type %s) Is Completed",
criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type));
criteria->Description, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type));
return false;
}
if (!RequirementsSatisfied(criteria, miscValue1, miscValue2, miscValue3, unit, referencePlayer, go))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: %s (Id: %u Type %s) Requirements not satisfied",
criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type));
criteria->Description, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type));
return false;
}
if (!AdditionalRequirementsSatisfied(criteria, miscValue1, miscValue2, unit, referencePlayer))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: %s (Id: %u Type %s) Additional requirements not satisfied",
criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type));
criteria->Description, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type));
return false;
}
if (!ConditionsSatisfied(criteria, referencePlayer))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s) Conditions not satisfied",
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type));
criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type));
return false;
}
@@ -2480,7 +2480,7 @@ bool AchievementMgr<T>::ConditionsSatisfied(AchievementCriteriaEntry const* crit
template<class T>
bool AchievementMgr<T>::RequirementsSatisfied(AchievementCriteriaEntry const* achievementCriteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer, GameObject* go) const
{
switch (AchievementCriteriaTypes(achievementCriteria->type))
switch (AchievementCriteriaTypes(achievementCriteria->Type))
{
case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS:
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST:
@@ -2588,7 +2588,7 @@ bool AchievementMgr<T>::RequirementsSatisfied(AchievementCriteriaEntry const* ac
bool notfit = false;
for (int j = 0; j < MAX_ARENA_SLOT; ++j)
{
if (achievIdByArenaSlot[j] == achievementCriteria->achievement)
if (achievIdByArenaSlot[j] == achievementCriteria->Achievement_ID)
{
Battleground* bg = referencePlayer->GetBattleground();
if (!bg || !bg->isArena() || ArenaTeam::GetSlotByType(bg->GetArenaType()) != j)
@@ -2613,7 +2613,7 @@ bool AchievementMgr<T>::RequirementsSatisfied(AchievementCriteriaEntry const* ac
bool found = false;
for (int j = 0; achievIdForDungeon[j][0]; ++j)
{
if (achievIdForDungeon[j][0] == achievementCriteria->achievement)
if (achievIdForDungeon[j][0] == achievementCriteria->Achievement_ID)
{
if (map->IsRaid())
{
@@ -2722,7 +2722,7 @@ bool AchievementMgr<T>::RequirementsSatisfied(AchievementCriteriaEntry const* ac
bool matchFound = false;
for (int j = 0; j < MAX_WORLD_MAP_OVERLAY_AREA_IDX; ++j)
{
AreaTableEntry const* area = sAreaTableStore.LookupEntry(worldOverlayEntry->areatableID[j]);
AreaTableEntry const* area = sAreaTableStore.LookupEntry(worldOverlayEntry->AreaID[j]);
if (!area)
break;
@@ -2859,8 +2859,8 @@ bool AchievementMgr<T>::AdditionalRequirementsSatisfied(AchievementCriteriaEntry
{
for (uint8 i = 0; i < MAX_ADDITIONAL_CRITERIA_CONDITIONS; ++i)
{
uint32 reqType = criteria->additionalConditionType[i];
uint32 reqValue = criteria->additionalConditionValue[i];
uint32 reqType = criteria->AdditionalConditionType[i];
uint32 reqValue = criteria->AdditionalConditionValue[i];
switch (AchievementCriteriaAdditionalCondition(reqType))
{
@@ -3024,7 +3024,7 @@ bool AchievementMgr<T>::AdditionalRequirementsSatisfied(AchievementCriteriaEntry
ResearchProjectEntry const* rp = sResearchProjectStore.LookupEntry(miscValue1);
if (!rp) return false;
if (rp->hasReward != reqValue)
if (rp->Rarity != reqValue)
return false;
break;
@@ -3312,17 +3312,17 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
if (!criteria)
continue;
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->achievement);
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->Achievement_ID);
m_AchievementCriteriaListByAchievement[criteria->achievement].push_back(criteria);
m_AchievementCriteriaListByAchievement[criteria->Achievement_ID].push_back(criteria);
if (achievement && achievement->flags & ACHIEVEMENT_FLAG_GUILD)
++guildCriterias, m_GuildAchievementCriteriasByType[criteria->type].push_back(criteria);
if (achievement && achievement->Flags & ACHIEVEMENT_FLAG_GUILD)
++guildCriterias, m_GuildAchievementCriteriasByType[criteria->Type].push_back(criteria);
else
++criterias, m_AchievementCriteriasByType[criteria->type].push_back(criteria);
++criterias, m_AchievementCriteriasByType[criteria->Type].push_back(criteria);
if (criteria->timeLimit)
m_AchievementCriteriasByTimedType[criteria->timedCriteriaStartType].push_back(criteria);
if (criteria->Timer_time)
m_AchievementCriteriasByTimedType[criteria->Timer_start_event].push_back(criteria);
}
TC_LOG_INFO("server.loading", ">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms.", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime));
@@ -3343,16 +3343,16 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId)
{
AchievementEntry const* achievement = sAchievementMgr->GetAchievement(entryId);
if (!achievement || !achievement->refAchievement)
if (!achievement || !achievement->Shares_criteria)
continue;
m_AchievementListByReferencedId[achievement->refAchievement].push_back(achievement);
m_AchievementListByReferencedId[achievement->Shares_criteria].push_back(achievement);
++count;
}
// Once Bitten, Twice Shy (10 player) - Icecrown Citadel
if (AchievementEntry const* achievement = sAchievementMgr->GetAchievement(4539))
const_cast<AchievementEntry*>(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar)
const_cast<AchievementEntry*>(achievement)->Instance_ID = 631; // Correct map requirement (currently has Ulduar)
TC_LOG_INFO("server.loading", ">> Loaded %u achievement references in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
@@ -3447,7 +3447,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
continue;
}
else if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_GUILD))
else if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_GUILD))
m_allCompletedAchievements[achievementId] = uint32(0xFFFFFFFF);
}
while (result->NextRow());
@@ -3498,7 +3498,7 @@ void AchievementGlobalMgr::LoadRewards()
continue;
}
if (achievement->requiredFaction == ACHIEVEMENT_FACTION_ANY && (!reward.TitleID[0] ^ !reward.TitleID[1]))
if (achievement->Faction == ACHIEVEMENT_FACTION_ANY && (!reward.TitleID[0] ^ !reward.TitleID[1]))
TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (ID: %u) contains the title (A: %u H: %u) for only one team.", id, reward.TitleID[0], reward.TitleID[1]);
if (reward.TitleID[0])
@@ -360,7 +360,7 @@ class TC_GAME_API AchievementGlobalMgr
if (itr == m_allCompletedAchievements.end())
return false;
if (achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)
if (achievement->Flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)
return itr->second != instanceId;
return true;
@@ -65,9 +65,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId)
FactionTemplateEntry const* uEntry = sFactionTemplateStore.LookupEntry(factionTemplateId);
if (!uEntry)
return &mNeutralAuctions;
else if (uEntry->ourMask & FACTION_MASK_ALLIANCE)
else if (uEntry->FactionGroup & FACTION_MASK_ALLIANCE)
return &mAllianceAuctions;
else if (uEntry->ourMask & FACTION_MASK_HORDE)
else if (uEntry->FactionGroup & FACTION_MASK_HORDE)
return &mHordeAuctions;
else
return &mNeutralAuctions;
@@ -93,7 +93,7 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32
if (MSV <= 0)
return AH_MINIMUM_DEPOSIT * sWorld->getRate(RATE_AUCTION_DEPOSIT);
float multiplier = CalculatePct(float(entry->depositPercent), 3);
float multiplier = CalculatePct(float(entry->DepositRate), 3);
uint32 timeHr = (((time / 60) / 60) / 12);
uint32 deposit = uint32(MSV * multiplier * sWorld->getRate(RATE_AUCTION_DEPOSIT));
float remainderbase = float(MSV * multiplier * sWorld->getRate(RATE_AUCTION_DEPOSIT)) - deposit;
@@ -578,9 +578,9 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(factionTemplateId);
if (!u_entry)
houseid = AUCTIONHOUSE_NEUTRAL; // goblin auction house
else if (u_entry->ourMask & FACTION_MASK_ALLIANCE)
else if (u_entry->FactionGroup & FACTION_MASK_ALLIANCE)
houseid = AUCTIONHOUSE_ALLIANCE; // human auction house
else if (u_entry->ourMask & FACTION_MASK_HORDE)
else if (u_entry->FactionGroup & FACTION_MASK_HORDE)
houseid = AUCTIONHOUSE_HORDE; // orc auction house
else
houseid = AUCTIONHOUSE_NEUTRAL; // goblin auction house
@@ -800,13 +800,13 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
{
ItemRandomSuffixEntry const* itemRandSuffix = sItemRandomSuffixStore.LookupEntry(-propRefID);
if (itemRandSuffix)
suffix = itemRandSuffix->nameSuffix;
suffix = itemRandSuffix->Name;
}
else
{
ItemRandomPropertiesEntry const* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID);
if (itemRandProp)
suffix = itemRandProp->nameSuffix;
suffix = itemRandProp->Name;
}
// dbc local name
@@ -871,7 +871,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data, Item* sourceItem) const
uint32 AuctionEntry::GetAuctionCut() const
{
int32 cut = int32(CalculatePct(bid, auctionHouseEntry->cutPercent) * sWorld->getRate(RATE_AUCTION_CUT));
int32 cut = int32(CalculatePct(bid, auctionHouseEntry->ConsignmentRate) * sWorld->getRate(RATE_AUCTION_CUT));
return std::max(cut, 0);
}
+3 -3
View File
@@ -664,7 +664,7 @@ void BfGraveyard::SetSpirit(Creature* spirit, TeamId team)
float BfGraveyard::GetDistance(Player* player)
{
WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(m_GraveyardId);
return player->GetDistance2d(safeLoc->x, safeLoc->y);
return player->GetDistance2d(safeLoc->Loc.X, safeLoc->Loc.Y);
}
void BfGraveyard::AddPlayer(ObjectGuid playerGuid)
@@ -740,12 +740,12 @@ void BfGraveyard::RelocateDeadPlayers()
continue;
if (closestGrave)
player->TeleportTo(player->GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation());
player->TeleportTo(player->GetMapId(), closestGrave->Loc.X, closestGrave->Loc.Y, closestGrave->Loc.Z, player->GetOrientation());
else
{
closestGrave = m_Bf->GetClosestGraveyard(player);
if (closestGrave)
player->TeleportTo(player->GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation());
player->TeleportTo(player->GetMapId(), closestGrave->Loc.X, closestGrave->Loc.Y, closestGrave->Loc.Z, player->GetOrientation());
}
}
}
@@ -1441,7 +1441,7 @@ void Battleground::RelocateDeadPlayers(ObjectGuid guideGuid)
closestGrave = GetClosestGraveyard(player);
if (closestGrave)
player->TeleportTo(GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation());
player->TeleportTo(GetMapId(), closestGrave->Loc.X, closestGrave->Loc.Y, closestGrave->Loc.Z, player->GetOrientation());
}
ghostList.clear();
}
@@ -1932,7 +1932,7 @@ void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uin
void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry)
{
m_BracketId = bracketEntry->GetBracketId();
SetLevelRange(bracketEntry->minLevel, bracketEntry->maxLevel);
SetLevelRange(bracketEntry->MinLevel, bracketEntry->MaxLevel);
}
void Battleground::RewardXPAtKill(Player* killer, Player* victim)
@@ -49,7 +49,7 @@
bool BattlegroundTemplate::IsArena() const
{
return BattlemasterEntry->type == MAP_ARENA;
return BattlemasterEntry->InstanceType == MAP_ARENA;
}
/*********************************************************/
@@ -752,8 +752,8 @@ bool BattlegroundMgr::CreateBattleground(BattlegroundTemplate const* bgTemplate)
AddBattleground(bg);
}
bg->SetMapId(bgTemplate->BattlemasterEntry->mapid[0]);
bg->SetName(bgTemplate->BattlemasterEntry->name);
bg->SetMapId(bgTemplate->BattlemasterEntry->MapID[0]);
bg->SetName(bgTemplate->BattlemasterEntry->Name);
bg->SetInstanceID(0);
bg->SetArenaorBGType(bgTemplate->IsArena());
bg->SetMinPlayersPerTeam(bgTemplate->MinPlayersPerTeam);
@@ -837,7 +837,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
uint32 startId = fields[5].GetUInt32();
if (WorldSafeLocsEntry const* start = sWorldSafeLocsStore.LookupEntry(startId))
{
bgTemplate.StartLocation[TEAM_ALLIANCE].Relocate(start->x, start->y, start->z, fields[6].GetFloat());
bgTemplate.StartLocation[TEAM_ALLIANCE].Relocate(start->Loc.X, start->Loc.Y, start->Loc.Z, fields[6].GetFloat());
}
else
{
@@ -848,7 +848,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
startId = fields[7].GetUInt32();
if (WorldSafeLocsEntry const* start = sWorldSafeLocsStore.LookupEntry(startId))
{
bgTemplate.StartLocation[TEAM_HORDE].Relocate(start->x, start->y, start->z, fields[8].GetFloat());
bgTemplate.StartLocation[TEAM_HORDE].Relocate(start->Loc.X, start->Loc.Y, start->Loc.Z, fields[8].GetFloat());
}
else
{
@@ -862,8 +862,8 @@ void BattlegroundMgr::LoadBattlegroundTemplates()
_battlegroundTemplates[bgTypeId] = bgTemplate;
if (bgTemplate.BattlemasterEntry->mapid[1] == -1) // in this case we have only one mapId
_battlegroundMapTemplates[bgTemplate.BattlemasterEntry->mapid[0]] = &_battlegroundTemplates[bgTypeId];
if (bgTemplate.BattlemasterEntry->MapID[1] == -1) // in this case we have only one mapId
_battlegroundMapTemplates[bgTemplate.BattlemasterEntry->MapID[0]] = &_battlegroundTemplates[bgTypeId];
++count;
}
@@ -1229,7 +1229,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId)
ids.reserve(16);
std::vector<double> weights;
weights.reserve(16);
for (int32 mapId : bgTemplate->BattlemasterEntry->mapid)
for (int32 mapId : bgTemplate->BattlemasterEntry->MapID)
{
if (mapId == -1)
break;
@@ -204,8 +204,8 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr
uint32 MinPlayers = bg->GetMinPlayersPerTeam();
uint32 qHorde = 0;
uint32 qAlliance = 0;
uint32 q_min_level = bracketEntry->minLevel;
uint32 q_max_level = bracketEntry->maxLevel;
uint32 q_min_level = bracketEntry->MinLevel;
uint32 q_max_level = bracketEntry->MaxLevel;
GroupsQueueType::const_iterator itr;
for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr)
if (!(*itr)->IsInvitedToBGInstanceGUID)
@@ -657,7 +657,7 @@ WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveyard(Player* player)
WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[nodes[i]]);
if (!entry)
continue;
float dist = (entry->x - plr_x)*(entry->x - plr_x)+(entry->y - plr_y)*(entry->y - plr_y);
float dist = (entry->Loc.X - plr_x)*(entry->Loc.X - plr_x)+(entry->Loc.Y - plr_y)*(entry->Loc.Y - plr_y);
if (mindist > dist)
{
mindist = dist;
@@ -1116,7 +1116,7 @@ WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveyard(Player* player)
player->GetPosition(x, y);
pGraveyard = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[GetTeamIndexByTeamId(player->GetTeam())+7]);
minDist = (pGraveyard->x - x)*(pGraveyard->x - x)+(pGraveyard->y - y)*(pGraveyard->y - y);
minDist = (pGraveyard->Loc.X - x) * (pGraveyard->Loc.X - x) + (pGraveyard->Loc.Y - y) * (pGraveyard->Loc.Y - y);
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
@@ -1124,7 +1124,7 @@ WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveyard(Player* player)
entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]);
if (entry)
{
dist = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y);
dist = (entry->Loc.X - x) * (entry->Loc.X - x) +(entry->Loc.Y - y) * (entry->Loc.Y - y);
if (dist < minDist)
{
minDist = dist;
@@ -637,7 +637,7 @@ WorldSafeLocsEntry const* BattlegroundBFG::GetClosestGraveyard(Player* player)
WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_BFG_GraveyardIds[nodes[i]]);
if (!entry)
continue;
float dist = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y);
float dist = (entry->Loc.X - plr_x)*(entry->Loc.X - plr_x) + (entry->Loc.Y - plr_y)*(entry->Loc.Y - plr_y);
if (mindist > dist)
{
mindist = dist;
@@ -505,22 +505,22 @@ bool BattlegroundEY::SetupBattleground()
TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
continue;
}
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
)
TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Could not spawn Speedbuff Fel Reaver.");
}
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE))
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.124139f, TEAM_ALLIANCE))
{
TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created.");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE))
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.193953f, TEAM_HORDE))
{
TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created.");
return false;
@@ -756,7 +756,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point)
DelCreature(Point);
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveyardId);
if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, GetTeamIndexByTeamId(Team)))
if (!sg || !AddSpiritGuide(Point, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.124139f, GetTeamIndexByTeamId(Team)))
TC_LOG_ERROR("bg.battleground", "BatteGroundEY: Failed to spawn spirit guide. point: %u, team: %u, graveyard_id: %u",
Point, Team, m_CapturingPointTypes[Point].GraveyardId);
@@ -907,7 +907,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveyard(Player* player)
float plr_y = player->GetPositionY();
float plr_z = player->GetPositionZ();
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
distance = (entry->Loc.X - plr_x)*(entry->Loc.X - plr_x) + (entry->Loc.Y - plr_y)*(entry->Loc.Y - plr_y) + (entry->Loc.Z - plr_z)*(entry->Loc.Z - plr_z);
nearestDistance = distance;
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
@@ -919,7 +919,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveyard(Player* player)
TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Graveyard %u could not be found.", m_CapturingPointTypes[i].GraveyardId);
else
{
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
distance = (entry->Loc.X - plr_x)*(entry->Loc.X - plr_x) + (entry->Loc.Y - plr_y)*(entry->Loc.Y - plr_y) + (entry->Loc.Z - plr_z)*(entry->Loc.Z - plr_z);
if (distance < nearestDistance)
{
nearestDistance = distance;
@@ -884,7 +884,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[nodes[i]]);
if (!entry)
continue;
float dist = (entry->x - player_x)*(entry->x - player_x)+(entry->y - player_y)*(entry->y - player_y);
float dist = (entry->Loc.X - player_x)*(entry->Loc.X - player_x)+(entry->Loc.Y - player_y)*(entry->Loc.Y - player_y);
if (mindist > dist)
{
mindist = dist;
@@ -205,12 +205,12 @@ bool BattlegroundSA::ResetObjs()
if (i == BG_SA_BEACH_GY)
{
GraveyardStatus[i] = Attackers;
AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], Attackers);
AddSpiritGuide(i + BG_SA_MAXNPC, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, BG_SA_GYOrientation[i], Attackers);
}
else
{
GraveyardStatus[i] = ((Attackers == TEAM_HORDE)? TEAM_ALLIANCE : TEAM_HORDE);
if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], Attackers == TEAM_HORDE ? TEAM_ALLIANCE : TEAM_HORDE))
if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, BG_SA_GYOrientation[i], Attackers == TEAM_HORDE ? TEAM_ALLIANCE : TEAM_HORDE))
TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn GY: %u", i);
}
}
@@ -712,7 +712,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player)
safeloc = BG_SA_GYEntries[BG_SA_DEFENDER_LAST_GY];
closest = sWorldSafeLocsStore.LookupEntry(safeloc);
nearest = player->GetExactDistSq(closest->x, closest->y, closest->z);
nearest = player->GetExactDistSq(closest->Loc.X, closest->Loc.Y, closest->Loc.Z);
for (uint8 i = BG_SA_RIGHT_CAPTURABLE_GY; i < BG_SA_MAX_GY; i++)
{
@@ -720,7 +720,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player)
continue;
ret = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
dist = player->GetExactDistSq(ret->x, ret->y, ret->z);
dist = player->GetExactDistSq(ret->Loc.X, ret->Loc.Y, ret->Loc.Z);
if (dist < nearest)
{
closest = ret;
@@ -820,7 +820,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
return;
}
AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], GraveyardStatus[i]);
AddSpiritGuide(i + BG_SA_MAXNPC, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, BG_SA_GYOrientation[i], GraveyardStatus[i]);
uint32 npc = 0;
uint32 flag = 0;
@@ -290,7 +290,7 @@ bool BattlegroundTP::SetupBattleground()
uint32 creatureType = team == TEAM_ALLIANCE ? TP_SPIRIT_ALLIANCE : TP_SPIRIT_HORDE;
float orientation = float(team == TEAM_ALLIANCE ? M_PI : 0);
if (!AddSpiritGuide(creatureType, grave->x, grave->y, grave->z, orientation, TeamId(team)))
if (!AddSpiritGuide(creatureType, grave->Loc.X, grave->Loc.Y, grave->Loc.Z, orientation, TeamId(team)))
{
TC_LOG_ERROR("misc", "BatteGroundTP: Failed to spawn spirit guide id: %u. Battleground not created!", grave->ID);
return false;
@@ -503,7 +503,7 @@ WorldSafeLocsEntry const* BattlegroundTP::GetClosestGraveyard(Player* player)
WorldSafeLocsEntry const* grave_enemy_base = sWorldSafeLocsStore.LookupEntry(BG_TP_GraveyardIds[TP_GRAVEYARD_FLAGROOM_ALLIANCE + (team ^ 1)]);
WorldSafeLocsEntry const* grave_enemy_middle = sWorldSafeLocsStore.LookupEntry(BG_TP_GraveyardIds[TP_GRAVEYARD_MIDDLE_ALLIANCE + (team ^ 1)]);
if (player->GetDistance2d(grave_enemy_base->x, grave_enemy_base->y) < player->GetDistance2d(grave_enemy_middle->x, grave_enemy_middle->y))
if (player->GetDistance2d(grave_enemy_base->Loc.X, grave_enemy_base->Loc.Y) < player->GetDistance2d(grave_enemy_middle->Loc.X, grave_enemy_middle->Loc.Y))
return sWorldSafeLocsStore.LookupEntry(BG_TP_GraveyardIds[TP_GRAVEYARD_START_ALLIANCE + team]);
else
return sWorldSafeLocsStore.LookupEntry(BG_TP_GraveyardIds[TP_GRAVEYARD_MIDDLE_ALLIANCE + team]);
@@ -696,14 +696,14 @@ bool BattlegroundWS::SetupBattleground()
}
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE))
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.124139f, TEAM_ALLIANCE))
{
TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE))
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.193953f, TEAM_HORDE))
{
TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
return false;
+8 -8
View File
@@ -44,13 +44,13 @@ Channel::Channel(uint32 channelId, uint32 team /*= 0*/, AreaTableEntry const* zo
_zoneEntry(zoneEntry)
{
ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId);
if (channelEntry->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
if (channelEntry->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
_channelFlags |= CHANNEL_FLAG_TRADE;
if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
_channelFlags |= CHANNEL_FLAG_CITY;
if (channelEntry->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
if (channelEntry->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
_channelFlags |= CHANNEL_FLAG_LFG;
else // for all other channels
_channelFlags |= CHANNEL_FLAG_NOT_LFG;
@@ -116,15 +116,15 @@ void Channel::GetChannelName(std::string& channelName, uint32 channelId, LocaleC
if (channelId)
{
ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId);
if (!(channelEntry->flags & CHANNEL_DBC_FLAG_GLOBAL))
if (!(channelEntry->Flags & CHANNEL_DBC_FLAG_GLOBAL))
{
if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
channelName = Trinity::StringFormat(channelEntry->pattern, sObjectMgr->GetTrinityString(LANG_CHANNEL_CITY, locale));
if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY)
channelName = Trinity::StringFormat(channelEntry->Name, sObjectMgr->GetTrinityString(LANG_CHANNEL_CITY, locale));
else
channelName = Trinity::StringFormat(channelEntry->pattern, ASSERT_NOTNULL(zoneEntry)->AreaName);
channelName = Trinity::StringFormat(channelEntry->Name, ASSERT_NOTNULL(zoneEntry)->AreaName);
}
else
channelName = channelEntry->pattern;
channelName = channelEntry->Name;
}
}
+3 -3
View File
@@ -77,7 +77,7 @@ Channel* ChannelMgr::GetJoinChannel(uint32 channelId, std::string const& name, A
{
ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId);
uint32 zoneId = zoneEntry ? zoneEntry->ID : 0;
if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY))
if (channelEntry->Flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY))
zoneId = 0;
std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId);
@@ -116,7 +116,7 @@ Channel* ChannelMgr::GetChannel(uint32 channelId, std::string const& name, Playe
{
ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId);
uint32 zoneId = zoneEntry ? zoneEntry->ID : 0;
if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY))
if (channelEntry->Flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY))
zoneId = 0;
std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId);
@@ -177,7 +177,7 @@ void ChannelMgr::LeftChannel(uint32 channelId, AreaTableEntry const* zoneEntry)
{
ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId);
uint32 zoneId = zoneEntry ? zoneEntry->ID : 0;
if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY))
if (channelEntry->Flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY))
zoneId = 0;
std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId);
+2 -2
View File
@@ -985,7 +985,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
if (rank >= MAX_TALENT_RANK)
return 0;
return talentEntry->RankID[rank];
return talentEntry->SpellRank[rank];
}
case SPELL_LINK_ENCHANT:
case SPELL_LINK_TRADE:
@@ -998,7 +998,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
if (!glyphPropEntry)
return 0;
return glyphPropEntry->SpellId;
return glyphPropEntry->SpellID;
}
}
+10 -10
View File
@@ -184,7 +184,7 @@ bool ItemChatLink::ValidateName(char* buffer, char const* context)
{
ChatLink::ValidateName(buffer, context);
char* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : nullptr);
char* suffixStrings = _suffix ? _suffix->Name : (_property ? _property->Name : nullptr);
bool res = (FormatName(LOCALE_enUS, nullptr, suffixStrings) == buffer);
if (!res)
@@ -300,15 +300,15 @@ bool SpellChatLink::ValidateName(char* buffer, char const* context)
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id);
return false;
}
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId);
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->SkillLine);
if (!skillLine)
{
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId);
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->SkillLine);
return false;
}
uint32 skillLineNameLength = strlen(skillLine->name);
if (skillLineNameLength > 0 && strncmp(skillLine->name, buffer, skillLineNameLength) == 0)
uint32 skillLineNameLength = strlen(skillLine->DisplayName);
if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName, buffer, skillLineNameLength) == 0)
{
// found the prefix, remove it to perform spellname validation below
// -2 = strlen(": ")
@@ -373,7 +373,7 @@ bool AchievementChatLink::ValidateName(char* buffer, char const* context)
{
ChatLink::ValidateName(buffer, context);
if (*_achievement->name && strcmp(_achievement->name, buffer) == 0)
if (*_achievement->Title && strcmp(_achievement->Title, buffer) == 0)
return true;
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID);
@@ -452,10 +452,10 @@ bool TalentChatLink::Initialize(std::istringstream& iss)
return false;
}
// Validate talent's spell
_spell = sSpellMgr->GetSpellInfo(talentInfo->RankID[0]);
_spell = sSpellMgr->GetSpellInfo(talentInfo->SpellRank[0]);
if (!_spell)
{
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), talentInfo->RankID[0]);
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), talentInfo->SpellRank[0]);
return false;
}
// Delimiter
@@ -523,10 +523,10 @@ bool GlyphChatLink::Initialize(std::istringstream& iss)
return false;
}
// Validate glyph's spell
_spell = sSpellMgr->GetSpellInfo(_glyph->SpellId);
_spell = sSpellMgr->GetSpellInfo(_glyph->SpellID);
if (!_spell)
{
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellId);
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellID);
return false;
}
return true;
+1 -1
View File
@@ -131,7 +131,7 @@ void HostileRefManager::deleteReferencesForFaction(uint32 faction)
while (ref)
{
HostileReference* nextRef = ref->next();
if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->faction == faction)
if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->Faction == faction)
{
ref->removeReference();
delete ref;
+71 -73
View File
@@ -225,7 +225,6 @@ DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftEntryfmt);
DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt);
DBCStorage <SpellVisualEntry> sSpellVisualStore(SpellVisualfmt);
DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt);
DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt);
DBCStorage <TalentEntry> sTalentStore(TalentEntryfmt);
TalentSpellPosMap sTalentSpellPosMap;
@@ -486,7 +485,6 @@ void LoadDBCStores(const std::string& dataPath)
LOAD_DBC(sSpellShapeshiftStore, "SpellShapeshift.dbc");//15595
LOAD_DBC(sSpellShapeshiftFormStore, "SpellShapeshiftForm.dbc");//15595
LOAD_DBC(sSpellVisualStore, "SpellVisual.dbc");//15595
//LOAD_DBC(sStableSlotPricesStore, "StableSlotPrices.dbc");
LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");//15595
LOAD_DBC(sTalentStore, "Talent.dbc");//15595
LOAD_DBC(sTalentTabStore, "TalentTab.dbc");//15595
@@ -518,11 +516,11 @@ void LoadDBCStores(const std::string& dataPath)
#undef LOAD_DBC_EXT
for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit;
sCharStartOutfitMap[outfit->RaceID | (outfit->ClassID << 8) | (outfit->SexID << 16)] = outfit;
for (CharSectionsEntry const* entry : sCharSectionsStore)
if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry });
if (entry->RaceID && ((1 << (entry->RaceID - 1)) & RACEMASK_ALL_PLAYABLE) != 0) //ignore Nonplayable races
sCharSectionMap.insert({ entry->BaseSection | (entry->SexID << 8) | (entry->RaceID << 16), entry });
for (uint32 i = 0; i < MAX_CLASSES; ++i)
for (uint32 j = 0; j < MAX_POWERS; ++j)
@@ -534,44 +532,44 @@ void LoadDBCStores(const std::string& dataPath)
{
uint32 index = 0;
for (uint32 j = 0; j < MAX_POWERS; ++j)
if (PowersByClass[power->classId][j] != MAX_POWERS)
if (PowersByClass[power->ClassID][j] != MAX_POWERS)
++index;
PowersByClass[power->classId][power->power] = index;
PowersByClass[power->ClassID][power->PowerType] = index;
}
}
for (EmotesTextSoundEntry const* entry : sEmotesTextSoundStore)
sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextId, entry->RaceId, entry->SexId)] = entry;
sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextID, entry->RaceID, entry->SexID)] = entry;
for (FactionEntry const* faction : sFactionStore)
{
if (faction->team)
if (faction->ParentFactionID)
{
SimpleFactionsList& flist = sFactionTeamMap[faction->team];
SimpleFactionsList& flist = sFactionTeamMap[faction->ParentFactionID];
flist.push_back(faction->ID);
}
}
for (GameObjectDisplayInfoEntry const* info : sGameObjectDisplayInfoStore)
{
if (info->maxX < info->minX)
std::swap(*(float*)(&info->maxX), *(float*)(&info->minX));
if (info->maxY < info->minY)
std::swap(*(float*)(&info->maxY), *(float*)(&info->minY));
if (info->maxZ < info->minZ)
std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ));
if (info->GeoBoxMax.X < info->GeoBoxMin.X)
std::swap(*(float*)(&info->GeoBoxMax.X), *(float*)(&info->GeoBoxMin.X));
if (info->GeoBoxMax.Y < info->GeoBoxMin.Y)
std::swap(*(float*)(&info->GeoBoxMax.Y), *(float*)(&info->GeoBoxMin.Y));
if (info->GeoBoxMax.Z < info->GeoBoxMin.Z)
std::swap(*(float*)(&info->GeoBoxMax.Z), *(float*)(&info->GeoBoxMin.Z));
}
// fill data
sMapDifficultyMap[MAKE_PAIR32(0, 0)] = MapDifficulty(0, 0, false); // map 0 is missing from MapDifficulty.dbc use this till its ported to sql
for (MapDifficultyEntry const* entry : sMapDifficultyStore)
sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0);
sMapDifficultyMap[MAKE_PAIR32(entry->MapID, entry->Difficulty)] = MapDifficulty(entry->RaidDuration, entry->MaxPlayers, !std::string(entry->Message).empty());
sMapDifficultyMap.erase(MAKE_PAIR32(189, 1)); // Scarlet Monastry has a incorrect heroic entry so we drop it
for (NameGenEntry const* entry : sNameGenStore)
sGenNameVectoArraysMap[entry->race].stringVectorArray[entry->gender].push_back(std::string(entry->name));
sGenNameVectoArraysMap[entry->RaceID].stringVectorArray[entry->Sex].push_back(std::string(entry->Name));
for (NamesProfanityEntry const* namesProfanity : sNamesProfanityStore)
{
@@ -602,39 +600,39 @@ void LoadDBCStores(const std::string& dataPath)
}
for (PhaseGroupEntry const* group : sPhaseGroupStore)
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseId))
sPhasesByGroup[group->GroupId].push_back(phase->ID);
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID))
sPhasesByGroup[group->PhaseGroupID].push_back(phase->ID);
for (PvPDifficultyEntry const* entry : sPvPDifficultyStore)
if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
if (entry->RangeIndex > MAX_BATTLEGROUND_BRACKETS)
ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
for (SkillRaceClassInfoEntry const* entry : sSkillRaceClassInfoStore)
if (sSkillLineStore.LookupEntry(entry->SkillId))
SkillRaceClassInfoBySkill.emplace(entry->SkillId, entry);
if (sSkillLineStore.LookupEntry(entry->SkillID))
SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry);
// Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded
for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore)
{
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->Spell);
if (!spellInfo)
continue;
SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsId);
if (spellInfo->SpellLevelsId && (!levels || levels->spellLevel))
SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->LevelsID);
if (spellInfo->LevelsID && (!levels || levels->SpellLevel))
continue;
if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
{
for (CreatureFamilyEntry const* cFamily : sCreatureFamilyStore)
{
if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1])
if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1])
continue;
if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->Id);
sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->ID);
}
}
}
@@ -643,33 +641,33 @@ void LoadDBCStores(const std::string& dataPath)
for (SpellDifficultyEntry const* spellDiff : sSpellDifficultyStore)
{
SpellDifficultyEntry newEntry;
memset(newEntry.SpellID, 0, 4 * sizeof(uint32));
memset(newEntry.DifficultySpellID, 0, 4 * sizeof(uint32));
for (uint32 x = 0; x < MAX_DIFFICULTY; ++x)
{
if (spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x]))
if (spellDiff->DifficultySpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->DifficultySpellID[x]))
{
if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
TC_LOG_ERROR("sql.sql", "spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0
if (spellDiff->DifficultySpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
TC_LOG_ERROR("sql.sql", "spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->DifficultySpellID[x], spellDiff->ID, x);
newEntry.DifficultySpellID[x] = 0;//spell was <= 0 or invalid, set to 0
}
else
newEntry.SpellID[x] = spellDiff->SpellID[x];
newEntry.DifficultySpellID[x] = spellDiff->DifficultySpellID[x];
}
if (newEntry.SpellID[0] <= 0 || newEntry.SpellID[1] <= 0)//id0-1 must be always set!
if (newEntry.DifficultySpellID[0] <= 0 || newEntry.DifficultySpellID[1] <= 0)//id0-1 must be always set!
continue;
for (uint32 x = 0; x < MAX_DIFFICULTY; ++x)
if (newEntry.SpellID[x])
sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
if (newEntry.DifficultySpellID[x])
sSpellMgr->SetSpellDifficultyId(uint32(newEntry.DifficultySpellID[x]), spellDiff->ID);
}
// create talent spells set
for (TalentEntry const* talentInfo : sTalentStore)
{
for (uint8 j = 0; j < MAX_TALENT_RANK; ++j)
if (talentInfo->RankID[j])
sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(talentInfo->TalentID, j);
if (talentInfo->SpellRank[j])
sTalentSpellPosMap[talentInfo->SpellRank[j]] = TalentSpellPos(talentInfo->ID, j);
}
// prepare fast data access to bit pos of talent ranks for use at inspecting
@@ -684,15 +682,15 @@ void LoadDBCStores(const std::string& dataPath)
// store class talent tab pages
for (uint32 cls = 1; cls < MAX_CLASSES; ++cls)
if (talentTabInfo->ClassMask & (1 << (cls - 1)))
sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabInfo->TalentTabID;
sTalentTabPages[cls][talentTabInfo->OrderIndex] = talentTabInfo->ID;
}
}
for (TalentTreePrimarySpellsEntry const* talentSpell : sTalentTreePrimarySpellsStore)
sTalentTreePrimarySpellsMap[talentSpell->TalentTree].push_back(talentSpell->SpellId);
sTalentTreePrimarySpellsMap[talentSpell->TalentTabID].push_back(talentSpell->SpellID);
for (TaxiPathEntry const* entry : sTaxiPathStore)
sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price);
sTaxiPathSetBySource[entry->FromTaxiNode][entry->ToTaxiNode] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost);
uint32 pathCount = sTaxiPathStore.GetNumRows();
// Calculate path nodes count
@@ -759,7 +757,7 @@ void LoadDBCStores(const std::string& dataPath)
sDeathKnightTaxiNodesMask[field] |= submask;
// old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info)
if (node->map_id < 2 || node->ID == 82 || node->ID == 83 || node->ID == 93 || node->ID == 94)
if (node->ContinentID < 2 || node->ID == 82 || node->ID == 83 || node->ID == 93 || node->ID == 94)
sOldContinentsNodesMask[field] |= submask;
// fix DK node at Ebon Hold and Shadow Vault flight master
@@ -769,7 +767,7 @@ void LoadDBCStores(const std::string& dataPath)
}
for (WMOAreaTableEntry const* entry : sWMOAreaTableStore)
sWMOAreaInfoByTripple[WMOAreaTableKey(entry->rootId, entry->adtId, entry->groupId)] = entry;
sWMOAreaInfoByTripple[WMOAreaTableKey(entry->WMOID, entry->NameSetID, entry->WMOGroupID)] = entry;
// error checks
if (bad_dbc_files.size() >= DBCFileCount)
@@ -854,13 +852,13 @@ WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid
char const* GetRaceName(uint8 race, uint8 /*locale*/)
{
ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race);
return raceEntry ? raceEntry->name : nullptr;
return raceEntry ? raceEntry->Name : nullptr;
}
char const* GetClassName(uint8 class_, uint8 /*locale*/)
{
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
return classEntry ? classEntry->name : nullptr;
return classEntry ? classEntry->Name : nullptr;
}
uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
@@ -869,7 +867,7 @@ uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
return mapid;
if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
return wma->virtual_map_id >= 0 ? wma->virtual_map_id : wma->map_id;
return wma->DisplayMapID >= 0 ? wma->DisplayMapID : wma->MapID;
return mapid;
}
@@ -934,10 +932,10 @@ bool IsTotemCategoryCompatibleWith(uint32 itemTotemCategoryId, uint32 requiredTo
if (!reqEntry)
return false;
if (itemEntry->categoryType != reqEntry->categoryType)
if (itemEntry->TotemCategoryType != reqEntry->TotemCategoryType)
return false;
return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask;
return (itemEntry->TotemCategoryMask & reqEntry->TotemCategoryMask) == reqEntry->TotemCategoryMask;
}
void Zone2MapCoordinates(float& x, float& y, uint32 zone)
@@ -949,8 +947,8 @@ void Zone2MapCoordinates(float& x, float& y, uint32 zone)
return;
std::swap(x, y); // at client map coords swapped
x = x*((maEntry->x2-maEntry->x1)/100)+maEntry->x1;
y = y*((maEntry->y2-maEntry->y1)/100)+maEntry->y1; // client y coord from top to down
x = x * ((maEntry->LocBottom - maEntry->LocTop) / 100) + maEntry->LocTop;
y = y * ((maEntry->LocRight - maEntry->LocLeft) / 100) + maEntry->LocLeft; // client y coord from top to down
}
void Map2ZoneCoordinates(float& x, float& y, uint32 zone)
@@ -961,8 +959,8 @@ void Map2ZoneCoordinates(float& x, float& y, uint32 zone)
if (!maEntry)
return;
x = (x-maEntry->x1)/((maEntry->x2-maEntry->x1)/100);
y = (y-maEntry->y1)/((maEntry->y2-maEntry->y1)/100); // client y coord from top to down
x = (x - maEntry->LocTop) / ((maEntry->LocBottom - maEntry->LocTop) / 100);
y = (y - maEntry->LocLeft) / ((maEntry->LocRight - maEntry->LocLeft) / 100); // client y coord from top to down
std::swap(x, y); // client have map coords swapped
}
@@ -1004,15 +1002,15 @@ PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 lev
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
{
// skip unrelated and too-high brackets
if (entry->mapId != mapid || entry->minLevel > level)
if (entry->MapID != mapid || entry->MinLevel > level)
continue;
// exactly fit
if (entry->maxLevel >= level)
if (entry->MaxLevel >= level)
return entry;
// remember for possible out-of-range case (search higher from existed)
if (!maxEntry || maxEntry->maxLevel < entry->maxLevel)
if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel)
maxEntry = entry;
}
}
@@ -1024,7 +1022,7 @@ PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundB
{
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
if (entry->mapId == mapid && entry->GetBracketId() == id)
if (entry->MapID == mapid && entry->GetBracketId() == id)
return entry;
return nullptr;
@@ -1047,7 +1045,7 @@ std::vector<uint32> const* GetTalentTreePrimarySpells(uint32 talentTree)
uint32 GetLiquidFlags(uint32 liquidType)
{
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
return 1 << liq->Type;
return 1 << liq->SoundBank;
return 0;
}
@@ -1066,7 +1064,7 @@ CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType
std::pair<CharSectionsMap::const_iterator, CharSectionsMap::const_iterator> eqr = sCharSectionMap.equal_range(uint32(genType) | uint32(gender << 8) | uint32(race << 16));
for (CharSectionsMap::const_iterator itr = eqr.first; itr != eqr.second; ++itr)
{
if (itr->second->Type == type && itr->second->Color == color)
if (itr->second->VariationIndex == type && itr->second->ColorIndex == color)
return itr->second;
}
@@ -1239,7 +1237,7 @@ LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty)
if (!dungeon)
continue;
if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty)
if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->DifficultyID) == difficulty)
return dungeon;
}
@@ -1254,8 +1252,8 @@ uint32 GetDefaultMapLight(uint32 mapId)
if (!light)
continue;
if (light->MapId == mapId && light->X == 0.0f && light->Y == 0.0f && light->Z == 0.0f)
return light->Id;
if (light->ContinentID == mapId && light->X == 0.0f && light->Y == 0.0f && light->Z == 0.0f)
return light->ID;
}
return 0;
@@ -1373,14 +1371,14 @@ uint32 ItemTemplate::GetEffectiveArmor(Player const* owner) const
if (SubClass < ITEM_SUBCLASS_ARMOR_CLOTH || SubClass > ITEM_SUBCLASS_ARMOR_PLATE)
return 0;
return uint32(armorQuality->Value[Quality] * armorTotal->Value[SubClass - ITEM_SUBCLASS_ARMOR_CLOTH] * location->Value[SubClass - ITEM_SUBCLASS_ARMOR_CLOTH] + 0.5f);
return uint32(armorQuality->Qualitymod[Quality] * armorTotal->Value[SubClass - ITEM_SUBCLASS_ARMOR_CLOTH] * location->Value[SubClass - ITEM_SUBCLASS_ARMOR_CLOTH] + 0.5f);
}
ItemArmorShieldEntry const* shield = sItemArmorShieldStore.LookupEntry(level);
if (!shield)
return 0;
return uint32(shield->Value[Quality] + 0.5f);
return uint32(shield->Quality[Quality] + 0.5f);
}
bool ItemTemplate::GetWeaponDamage(Player const* owner, float& minValue, float& maxValue, float& dps) const
@@ -1449,9 +1447,9 @@ bool ItemTemplate::GetWeaponDamage(Player const* owner, float& minValue, float&
if (!damageInfo)
return false;
dps = damageInfo->DPS[Quality];
dps = damageInfo->Quality[Quality];
float avgDamage = Delay * damageInfo->DPS[Quality] * 0.001f;
float avgDamage = Delay * damageInfo->Quality[Quality] * 0.001f;
float scaled_stat = std::floor((StatScalingFactor * 0.5f + 1.f) * avgDamage + 0.5f);
if (Delay && ArmorDamageModifier != 0.f)
{
@@ -1556,10 +1554,10 @@ uint32 ItemTemplate::GetStatValue(uint32 index, Player const* owner /*= nullptr*
// req. check at equip, but allow use for extended range if range limit max level, set proper level
uint32 ssdLevel = owner->getLevel();
if (ssd && ssdLevel > ssd->MaxLevel)
ssdLevel = ssd->MaxLevel;
if (ssd && ssdLevel < ssd->MinLevel)
ssdLevel = ssd->MinLevel;
if (ssd && ssdLevel > ssd->Maxlevel)
ssdLevel = ssd->Maxlevel;
if (ssd && ssdLevel < ssd->Minlevel)
ssdLevel = ssd->Minlevel;
if (ssdLevel < 1)
ssdLevel = 1;
@@ -1568,10 +1566,10 @@ uint32 ItemTemplate::GetStatValue(uint32 index, Player const* owner /*= nullptr*
uint32 statBaseValue = 0;
if (ssd && ssv)
{
if (ssd->StatMod[index] < 0)
if (ssd->StatID[index] < 0)
return 0; // What do we do ?
statBaseValue = ssv->GetStatMultiplier(InventoryType) * ssd->Modifier[index] / 10000;
statBaseValue = ssv->GetStatMultiplier(InventoryType) * ssd->Bonus[index] / 10000;
}
else
{
-1
View File
@@ -238,7 +238,6 @@ TC_GAME_API extern DBCStorage <SpellReagentsEntry> sSpellReagentsStore
TC_GAME_API extern DBCStorage <SpellScalingEntry> sSpellScalingStore;
TC_GAME_API extern DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore;
TC_GAME_API extern DBCStorage <SpellTotemsEntry> sSpellTotemsStore;
//TC_GAME_API extern DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore;
TC_GAME_API extern DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore;
TC_GAME_API extern DBCStorage <TalentEntry> sTalentStore;
TC_GAME_API extern DBCStorage <TalentTabEntry> sTalentTabStore;
File diff suppressed because it is too large. Load diff
+11 -11
View File
@@ -28,7 +28,7 @@ char const AnimKitfmt[] = "nxx";
char const AchievementCriteriafmt[] = "niiiliiiisiiiiixxiiiiii";
char const AreaTableEntryfmt[] = "niiiiiiiiiisiiiiiffiiiiiii";
char const AreaGroupEntryfmt[] = "niiiiiii";
char const AreaPOIEntryfmt[] = "niiiiiiiiiiiffixixxixx";
char const AreaPOIEntryfmt[] = "nxiiiiiiiiixffixixxixx";
char const AreaTriggerEntryfmt[] = "nifffiiifffff";
char const ArmorLocationfmt[] = "nfffff";
char const AuctionHouseEntryfmt[] = "niiix";
@@ -44,14 +44,14 @@ char const ChrClassesEntryfmt[] = "nixsxxxixiiiii";
char const ChrRacesEntryfmt[] = "niixiixixxxxixsxxxxxixxx";
char const ChrClassesXPowerTypesfmt[] = "nii";
char const CinematicCameraEntryfmt[] = "nsiffff";
char const CinematicSequencesEntryfmt[] = "nxixxxxxxx";
char const CinematicSequencesEntryfmt[] = "nxiiiiiiii";
char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxx";
char const CreatureDisplayInfoExtrafmt[] = "diixxxxxxxxxxxxxxxxxx";
char const CreatureModelDatafmt[] = "nisxfxxxxxxxxxxffxxxxxxxxxxxxxx";
char const CreatureFamilyfmt[] = "nfifiiiiixsx";
char const CreatureSpellDatafmt[] = "niiiixxxx";
char const CreatureTypefmt[] = "nxx";
char const CurrencyTypesfmt[] = "nixxxiiiiix";
char const CurrencyTypesfmt[] = "nixxxxiiiix";
char const DestructibleModelDatafmt[] = "ixxixxxixxxixxxixxxxxxxx";
char const DungeonEncounterfmt[] = "niixisxx";
char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
@@ -59,7 +59,7 @@ char const DurabilityQualityfmt[] = "nf";
char const EmotesEntryfmt[] = "nxxiiixx";
char const EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx";
char const EmotesTextSoundEntryfmt[] = "niiii";
char const FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixsxi";
char const FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffiisxi";
char const FactionTemplateEntryfmt[] = "niiiiiiiiiiiii";
char const GameObjectArtKitfmt[] = "nxxxxxxx";
char const GameObjectDisplayInfofmt[] = "nsxxxxxxxxxxffffffxxx";
@@ -100,7 +100,7 @@ char const ItemDisenchantLootfmt[] = "niiiiii";
char const ItemLimitCategoryEntryfmt[] = "nxii";
char const ItemRandomPropertiesfmt[] = "nxiiixxs";
char const ItemRandomSuffixfmt[] = "nsxiiiiiiiiii";
char const ItemSetEntryfmt[] = "dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii";
char const ItemSetEntryfmt[] = "dsiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
char const LFGDungeonEntryfmt[] = "nsiiiiiiiiixxixixiiii";
char const LFGDungeonsGroupingMapfmt[] = "niii";
char const LightEntryfmt[] = "nifffxxxxxxxxxx";
@@ -163,7 +163,7 @@ char const SpellScalingEntryfmt[] = "diiiiffffffffffi";
char const SpellTotemsEntryfmt[] = "niiii";
char const SpellTargetRestrictionsEntryfmt[] = "nfiiii";
char const SpellPowerEntryfmt[] = "diiiixxx";
char const SpellInterruptsEntryfmt[] = "dixixi";
char const SpellInterruptsEntryfmt[] = "diiiii";
char const SpellEquippedItemsEntryfmt[] = "diii";
char const SpellAuraOptionsEntryfmt[] = "niiii";
char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii";
@@ -173,22 +173,22 @@ char const SpellCooldownsEntryfmt[] = "diii";
char const SpellLevelsEntryfmt[] = "diii";
char const SpellRuneCostfmt[] = "niiii";
char const SpellShapeshiftEntryfmt[] = "niiiix";
char const SpellShapeshiftFormfmt[] = "nxxiixiiixxiiiiiiiiix";
char const SpellShapeshiftFormfmt[] = "nxxiixiiiiiiiiiiiiiix";
char const SpellVisualfmt[] = "dxxxxxxiixxxxxxxxxxxxxxxxxxxxxxxi";
char const StableSlotPricesfmt[] = "ni";
char const SummonPropertiesfmt[] = "niiiii";
char const TalentEntryfmt[] = "niiiiiiiiixxixxxxxx";
char const TalentEntryfmt[] = "niiiiiiiiiiiiiixxxx";
char const TalentTabEntryfmt[] = "nxxiiixxxii";
char const TalentTreePrimarySpellsfmt[] = "diix";
char const TaxiNodesEntryfmt[] = "nifffsiiixx";
char const TaxiNodesEntryfmt[] = "nifffsiiiff";
char const TaxiPathEntryfmt[] = "niii";
char const TaxiPathNodeEntryfmt[] = "diiifffiiii";
char const TotemCategoryEntryfmt[] = "nxii";
char const UnitPowerBarfmt[] = "niiixxxxxxxxxxxxxxxxxxxxxxx";
char const TransportAnimationfmt[] = "diifffx";
char const TransportRotationfmt[] = "diiffff";
char const VehicleEntryfmt[] = "niffffiiiiiiiifffffffffffffffssssfifiixx";
char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx";
char const VehicleEntryfmt[] = "niffffiiiiiiiifffffffffffffffssssfifiiii";
char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiiffffffffffffiiiiiiii";
char const WMOAreaTableEntryfmt[] = "niiixxxxxiixxxx";
char const WorldMapAreaEntryfmt[] = "xinxffffixxxxi";
char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxx";
+12 -12
View File
@@ -44,12 +44,12 @@
namespace lfg
{
LFGDungeonData::LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->ID), name(dbc->name), map(dbc->map),
type(dbc->type), expansion(dbc->expansion), group(dbc->grouptype),
minlevel(dbc->minlevel), maxlevel(dbc->maxlevel), difficulty(Difficulty(dbc->difficulty)),
seasonal((dbc->flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
requiredItemLevel(0), requiredTanks(dbc->requiredTanks), requiredHealers(dbc->requiredHealers),
requiredDamageDealers(dbc->requiredDamageDealers)
LFGDungeonData::LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->ID), name(dbc->Name), map(dbc->MapID),
type(dbc->TypeID), expansion(dbc->ExpansionLevel), group(dbc->Group_ID),
minlevel(dbc->MinLevel), maxlevel(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),
requiredItemLevel(0), requiredTanks(dbc->Count_tank), requiredHealers(dbc->Count_healer),
requiredDamageDealers(dbc->Count_damage)
{
}
@@ -205,7 +205,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
if (!dungeon)
continue;
switch (dungeon->type)
switch (dungeon->TypeID)
{
case LFG_TYPE_DUNGEON:
case LFG_TYPE_HEROIC:
@@ -397,7 +397,7 @@ void LFGMgr::Update(uint32 diff)
// Update shortages
for (LFGDungeonEntry const* dungeon : sLFGDungeonStore)
{
if (dungeon->type != LFG_TYPE_RANDOM)
if (dungeon->TypeID != LFG_TYPE_RANDOM)
continue;
uint32 dpsCount = 0;
@@ -1053,7 +1053,7 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
{
uint32 rDungeonId = (*dungeons.begin());
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(rDungeonId);
if (dungeon && dungeon->type == LFG_TYPE_RANDOM)
if (dungeon && dungeon->TypeID == LFG_TYPE_RANDOM)
player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false);
}
}
@@ -2260,10 +2260,10 @@ void LFGMgr::AddDungeonsFromGroupingMap(LfgCachedDungeonContainer& container, ui
// Check for grouped dungeons from grouping map
for (auto itr : sLFGDungeonsGroupingMapStore)
{
if (itr->randomLfgDungeonId == dungeonId)
if (itr->Random_lfgDungeonsID == dungeonId)
{
if (container[groupId].find(itr->dungeonId) == container[groupId].end())
container[groupId].insert(itr->dungeonId);
if (container[groupId].find(itr->LfgDungeonsID) == container[groupId].end())
container[groupId].insert(itr->LfgDungeonsID);
}
}
}
@@ -548,7 +548,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
// checked and error show at loading templates
if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction))
SetPvP((factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP) != 0);
SetPvP((factionTemplate->Flags & FACTION_TEMPLATE_FLAG_PVP) != 0);
// updates spell bars for vehicles and set player's faction - should be called here, to overwrite faction that is set from the new template
if (IsVehicle())
@@ -307,7 +307,7 @@ void Minion::RemoveFromWorld()
bool Minion::IsGuardianPet() const
{
return IsPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
return IsPet() || (m_Properties && m_Properties->Control == SUMMON_CATEGORY_PET);
}
bool Minion::IsWarlockMinion() const
@@ -330,7 +330,7 @@ Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool is
{
memset(m_statFromOwner, 0, sizeof(float)*MAX_STATS);
m_unitTypeMask |= UNIT_MASK_GUARDIAN;
if (properties && properties->Type == SUMMON_TYPE_PET)
if (properties && properties->Title == SUMMON_TYPE_PET)
{
m_unitTypeMask |= UNIT_MASK_CONTROLABLE_GUARDIAN;
InitCharmInfo();
@@ -2053,9 +2053,9 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
float cosB = dy / dist;
dx = dist * (cosA * cosB + sinA * sinB);
dy = dist * (cosA * sinB - sinA * cosB);
return dx < info->maxX + radius && dx > info->minX - radius
&& dy < info->maxY + radius && dy > info->minY - radius
&& dz < info->maxZ + radius && dz > info->minZ - radius;
return dx < info->GeoBoxMax.X + radius && dx > info->GeoBoxMin.X - radius
&& dy < info->GeoBoxMax.Y + radius && dy > info->GeoBoxMin.Y - radius
&& dz < info->GeoBoxMax.Z + radius && dz > info->GeoBoxMin.Z - radius;
}
void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= nullptr*/)
@@ -2231,8 +2231,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
if (modelData->DamagedDisplayId)
modelId = modelData->DamagedDisplayId;
if (modelData->State0WMO)
modelId = modelData->State0WMO;
SetDisplayId(modelId);
if (setHealth)
@@ -2260,8 +2260,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
if (modelData->DestroyedDisplayId)
modelId = modelData->DestroyedDisplayId;
if (modelData->State1WMO)
modelId = modelData->State1WMO;
SetDisplayId(modelId);
if (setHealth)
@@ -2279,8 +2279,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
if (modelData->RebuildingDisplayId)
modelId = modelData->RebuildingDisplayId;
if (modelData->State2WMO)
modelId = modelData->State2WMO;
SetDisplayId(modelId);
// restores to full health
@@ -2706,12 +2706,12 @@ bool GameObject::IsAtInteractDistance(Position const& pos, float radius) const
{
float scale = GetObjectScale();
float minX = displayInfo->minX * scale - radius;
float minY = displayInfo->minY * scale - radius;
float minZ = displayInfo->minZ * scale - radius;
float maxX = displayInfo->maxX * scale + radius;
float maxY = displayInfo->maxY * scale + radius;
float maxZ = displayInfo->maxZ * scale + radius;
float minX = displayInfo->GeoBoxMin.X * scale - radius;
float minY = displayInfo->GeoBoxMin.Y * scale - radius;
float minZ = displayInfo->GeoBoxMin.Z * scale - radius;
float maxX = displayInfo->GeoBoxMax.X * scale + radius;
float maxY = displayInfo->GeoBoxMax.Y * scale + radius;
float maxZ = displayInfo->GeoBoxMax.Z * scale + radius;
QuaternionData worldRotation = GetWorldRotation();
G3D::Quat worldRotationQuat(worldRotation.x, worldRotation.y, worldRotation.z, worldRotation.w);
+35 -34
View File
@@ -50,7 +50,7 @@ void AddItemsSetItem(Player* player, Item* item)
return;
}
if (set->required_skill_id && player->GetSkillValue(set->required_skill_id) < set->required_skill_value)
if (set->RequiredSkill && player->GetSkillValue(set->RequiredSkill) < set->RequiredSkillRank)
return;
ItemSetEffect* eff = nullptr;
@@ -84,15 +84,16 @@ void AddItemsSetItem(Player* player, Item* item)
for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; ++x)
{
if (!set->spells [x])
if (!set->SetSpellID[x])
continue;
//not enough for spell
if (set->items_to_triggerspell[x] > eff->item_count)
if (set->SetThreshold[x] > eff->item_count)
continue;
uint32 z = 0;
for (; z < MAX_ITEM_SET_SPELLS; ++z)
if (eff->spells[z] && eff->spells[z]->Id == set->spells[x])
if (eff->spells[z] && eff->spells[z]->Id == set->SetSpellID[x])
break;
if (z < MAX_ITEM_SET_SPELLS)
@@ -103,10 +104,10 @@ void AddItemsSetItem(Player* player, Item* item)
{
if (!eff->spells[y]) // free slot
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->SetSpellID[x]);
if (!spellInfo)
{
TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", set->SetSpellID[x], setid);
break;
}
@@ -150,16 +151,16 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; x++)
{
if (!set->spells[x])
if (!set->SetSpellID[x])
continue;
// enough for spell
if (set->items_to_triggerspell[x] <= eff->item_count)
if (set->SetThreshold[x] <= eff->item_count)
continue;
for (uint32 z = 0; z < MAX_ITEM_SET_SPELLS; z++)
{
if (eff->spells[z] && eff->spells[z]->Id == set->spells[x])
if (eff->spells[z] && eff->spells[z]->Id == set->SetSpellID[x])
{
// spell can be not active if not fit form requirement
player->ApplyEquipSpell(eff->spells[z], nullptr, false);
@@ -554,7 +555,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
SetState(ITEM_CHANGED, GetOwner());
}
for (uint32 i = PROP_ENCHANTMENT_SLOT_1; i < PROP_ENCHANTMENT_SLOT_1 + 3; ++i)
SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_1], 0, 0);
SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_1], 0, 0);
}
}
else
@@ -571,7 +572,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
}
for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i <= PROP_ENCHANTMENT_SLOT_4; ++i)
SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0);
SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_0], 0, 0);
}
}
}
@@ -702,7 +703,7 @@ bool Item::HasEnchantRequiredSkill(Player const* player) const
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
if (enchantEntry->RequiredSkillID && player->GetSkillValue(enchantEntry->RequiredSkillID) < enchantEntry->RequiredSkillRank)
return false;
}
@@ -721,8 +722,8 @@ uint32 Item::GetEnchantRequiredLevel() const
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->requiredLevel > level)
level = enchantEntry->requiredLevel;
if (enchantEntry->MinLevel > level)
level = enchantEntry->MinLevel;
}
return level;
@@ -738,7 +739,7 @@ bool Item::IsBoundByEnchant() const
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND)
return true;
}
@@ -868,7 +869,7 @@ bool Item::GemsFitSockets() const
uint8 GemColor = 0;
uint32 gemid = enchantEntry->GemID;
uint32 gemid = enchantEntry->Src_itemID;
if (gemid)
{
ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(gemid);
@@ -876,7 +877,7 @@ bool Item::GemsFitSockets() const
{
GemPropertiesEntry const* gemProperty = sGemPropertiesStore.LookupEntry(gemProto->GemProperties);
if (gemProperty)
GemColor = gemProperty->color;
GemColor = gemProperty->Type;
}
}
@@ -899,7 +900,7 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const
if (!enchantEntry)
continue;
if (GemID == enchantEntry->GemID)
if (GemID == enchantEntry->Src_itemID)
++count;
}
return count;
@@ -918,7 +919,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
if (!enchantEntry)
continue;
ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID);
ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->Src_itemID);
if (!gemProto)
continue;
@@ -1272,9 +1273,9 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
inventoryType == INVTYPE_RANGED ||
inventoryType == INVTYPE_THROWN ||
inventoryType == INVTYPE_RANGEDRIGHT)
baseFactor = basePrice->WeaponFactor;
baseFactor = basePrice->Weapon;
else
baseFactor = basePrice->ArmorFactor;
baseFactor = basePrice->Armor;
if (inventoryType == INVTYPE_ROBE)
inventoryType = INVTYPE_CHEST;
@@ -1302,16 +1303,16 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
{
case ITEM_SUBCLASS_ARMOR_MISCELLANEOUS:
case ITEM_SUBCLASS_ARMOR_CLOTH:
typeFactor = armorPrice->ClothFactor;
typeFactor = armorPrice->ClothModifier;
break;
case ITEM_SUBCLASS_ARMOR_LEATHER:
typeFactor = armorPrice->LeatherFactor;
typeFactor = armorPrice->LeatherModifier;
break;
case ITEM_SUBCLASS_ARMOR_MAIL:
typeFactor = armorPrice->MailFactor;
typeFactor = armorPrice->ChainModifier;
break;
case ITEM_SUBCLASS_ARMOR_PLATE:
typeFactor = armorPrice->PlateFactor;
typeFactor = armorPrice->PlateModifier;
break;
default:
return 0;
@@ -1325,7 +1326,7 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
if (!shieldPrice)
return 0;
typeFactor = shieldPrice->Factor;
typeFactor = shieldPrice->Data;
break;
}
case INVTYPE_WEAPONMAINHAND:
@@ -1355,7 +1356,7 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice)
if (!weaponPrice)
return 0;
typeFactor = weaponPrice->Factor;
typeFactor = weaponPrice->Data;
}
normalSellPrice = false;
@@ -1380,7 +1381,7 @@ uint32 Item::GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice /*=
{
ItemClassEntry const* classEntry = sItemClassStore.LookupEntry(proto->Class);
if (classEntry)
cost *= classEntry->PriceFactor;
cost *= classEntry->PriceModifier;
else
cost = 0;
}
@@ -1417,10 +1418,10 @@ int32 Item::GetReforgableStat(ItemModType statType) const
for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e)
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e))))
for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f)
if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType)
if (enchant->Effect[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->EffectArg[f]) == statType)
for (int k = 0; k < 5; ++k)
if (randomSuffix->enchant_id[k] == enchant->ID)
return int32((randomSuffix->prefix[k] * GetItemSuffixFactor()) / 10000);
if (randomSuffix->Enchantment[k] == enchant->ID)
return int32((randomSuffix->AllocationPct[k] * GetItemSuffixFactor()) / 10000);
}
else
{
@@ -1431,10 +1432,10 @@ int32 Item::GetReforgableStat(ItemModType statType) const
for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e)
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e))))
for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f)
if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType)
if (enchant->Effect[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->EffectArg[f]) == statType)
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
if (randomProp->enchant_id[k] == enchant->ID)
return int32(enchant->amount[k]);
if (randomProp->Enchantment[k] == enchant->ID)
return int32(enchant->EffectPointsMin[k]);
}
return 0;
+3 -3
View File
@@ -554,7 +554,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const
if (flags & UPDATEFLAG_VEHICLE)
{
*data << float(self->GetTransport() ? self->GetTransOffsetO() : self->GetOrientation());
*data << uint32(self->GetVehicleKit()->GetVehicleInfo()->m_ID);
*data << uint32(self->GetVehicleKit()->GetVehicleInfo()->ID);
}
if (flags & UPDATEFLAG_GO_TRANSPORT_POSITION)
@@ -2041,7 +2041,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
uint32 mask = UNIT_MASK_SUMMON;
if (properties)
{
switch (properties->Category)
switch (properties->Control)
{
case SUMMON_CATEGORY_PET:
mask = UNIT_MASK_GUARDIAN;
@@ -2056,7 +2056,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
case SUMMON_CATEGORY_ALLY:
case SUMMON_CATEGORY_UNK:
{
switch (properties->Type)
switch (properties->Title)
{
case SUMMON_TYPE_MINION:
case SUMMON_TYPE_GUARDIAN:
+12 -12
View File
@@ -842,15 +842,15 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
//scale
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family);
if (cFamily && cFamily->minScale > 0.0f && petType == HUNTER_PET)
if (cFamily && cFamily->MinScale > 0.0f && petType == HUNTER_PET)
{
float scale;
if (getLevel() >= cFamily->maxScaleLevel)
scale = cFamily->maxScale;
else if (getLevel() <= cFamily->minScaleLevel)
scale = cFamily->minScale;
if (getLevel() >= cFamily->MaxScaleLevel)
scale = cFamily->MaxScale;
else if (getLevel() <= cFamily->MinScaleLevel)
scale = cFamily->MinScale;
else
scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale);
scale = cFamily->MinScale + float(getLevel() - cFamily->MinScaleLevel) / cFamily->MaxScaleLevel * (cFamily->MaxScale - cFamily->MinScale);
SetObjectScale(scale);
}
@@ -1080,7 +1080,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const
if (!cFamily)
return false;
uint32 diet = cFamily->petFoodMask;
uint32 diet = cFamily->PetFoodMask;
uint32 FoodMask = 1 << (item->FoodType-1);
return (diet & FoodMask) != 0;
}
@@ -1378,7 +1378,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
for (uint8 i = 0; i < MAX_TALENT_RANK; ++i)
{
// skip learning spell and no rank spell case
uint32 rankSpellId = talentInfo->RankID[i];
uint32 rankSpellId = talentInfo->SpellRank[i];
if (!rankSpellId || rankSpellId == spellId)
continue;
@@ -1611,7 +1611,7 @@ bool Pet::resetTalents()
return false;
// Check pet talent type
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
if (!pet_family || pet_family->petTalentType < 0)
if (!pet_family || pet_family->PetTalentType < 0)
return false;
uint8 level = getLevel();
@@ -1630,13 +1630,13 @@ bool Pet::resetTalents()
if (!talentInfo)
continue;
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
continue;
// unlearn only talents for pets family talent type
if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
if (!((1 << pet_family->PetTalentType) & talentTabInfo->CategoryEnumID))
continue;
for (uint8 j = 0; j < MAX_TALENT_RANK; ++j)
@@ -1652,7 +1652,7 @@ bool Pet::resetTalents()
uint32 itrFirstId = sSpellMgr->GetFirstSpellInChain(itr->first);
// unlearn if first rank is talent or learned by talent
if (itrFirstId == talentInfo->RankID[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->RankID[j], itrFirstId))
if (itrFirstId == talentInfo->SpellRank[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->SpellRank[j], itrFirstId))
{
unlearnSpell(itr->first, false);
itr = m_spells.begin();
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -65,7 +65,7 @@ void Totem::InitStats(uint32 duration)
GetOwner()->ToPlayer()->SendDirectMessage(&data);
// set display id depending on caster's race
SetDisplayId(GetOwner()->GetModelForTotem(PlayerTotemType(m_Properties->Id)));
SetDisplayId(GetOwner()->GetModelForTotem(PlayerTotemType(m_Properties->ID)));
}
Minion::InitStats(duration);
@@ -89,7 +89,7 @@ void Totem::InitSummon()
if (GetSpell(1))
CastSpell(this, GetSpell(1), true);
if (m_Properties->Id == SUMMON_TYPE_TOTEM_FIRE && GetOwner()->HasAura(SPELL_TOTEMIC_WRATH_TALENT))
if (m_Properties->ID == SUMMON_TYPE_TOTEM_FIRE && GetOwner()->HasAura(SPELL_TOTEMIC_WRATH_TALENT))
CastSpell(this, SPELL_TOTEMIC_WRATH, true);
}
@@ -213,11 +213,11 @@ bool Transport::Create(ObjectGuid::LowType guidlow, uint32 entry, Map* map, uint
uint32 finalStopFrameTime = 0;
for (TransportAnimationEntry const* animation : sTransportAnimationStore)
{
if (animation->TransportEntry != entry)
if (animation->TransportID != entry)
continue;
if (animation->TimeSeg > finalStopFrameTime)
finalStopFrameTime = animation->TimeSeg;
if (animation->TimeIndex > finalStopFrameTime)
finalStopFrameTime = animation->TimeIndex;
}
_finalStopFrameTime = finalStopFrameTime;
@@ -378,10 +378,10 @@ void Transport::RelocateToProgress(uint32 progress)
if (m_goValue.Transport.AnimationInfo->GetAnimNode(progress, curr, next, percPos))
{
// curr node offset
G3D::Vector3 pos = G3D::Vector3(curr->X, curr->Y, curr->Z);
G3D::Vector3 pos = G3D::Vector3(curr->Pos.X, curr->Pos.Y, curr->Pos.Z);
// move by percentage of segment already passed
pos += G3D::Vector3(percPos * (next->X - curr->X), percPos * (next->Y - curr->Y), percPos * (next->Z - curr->Z));
pos += G3D::Vector3(percPos * (next->Pos.X - curr->Pos.X), percPos * (next->Pos.Y - curr->Pos.Y), percPos * (next->Pos.Z - curr->Pos.Z));
// rotate path by PathRotation
// PathRotation in db is only simple orientation rotation, so don't use sophisticated and not working code
@@ -641,13 +641,13 @@ void MapTransport::Update(uint32 diff)
MoveToNextWaypoint();
sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ);
sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->ContinentID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z);
TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ);
TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->NodeIndex, _currentFrame->Node->ContinentID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z);
// Departure event
if (_currentFrame->IsTeleportFrame())
if (TeleportTransport(_nextFrame->Node->MapID, _nextFrame->Node->LocX, _nextFrame->Node->LocY, _nextFrame->Node->LocZ, _nextFrame->InitialOrientation))
if (TeleportTransport(_nextFrame->Node->ContinentID, _nextFrame->Node->Loc.X, _nextFrame->Node->Loc.Y, _nextFrame->Node->Loc.Z, _nextFrame->InitialOrientation))
return; // Update more in new map thread
}
@@ -673,7 +673,7 @@ void MapTransport::Update(uint32 diff)
UpdatePosition(pos.x, pos.y, pos.z, std::atan2(dir.y, dir.x) + float(M_PI));
}
else if (justStopped)
UpdatePosition(_currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ, _currentFrame->InitialOrientation);
UpdatePosition(_currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z, _currentFrame->InitialOrientation);
else
{
/* There are four possible scenarios that trigger loading/unloading passengers:
@@ -855,7 +855,7 @@ TempSummon* MapTransport::SummonPassenger(uint32 entry, Position const& pos, Tem
uint32 mask = UNIT_MASK_SUMMON;
if (properties)
{
switch (properties->Category)
switch (properties->Control)
{
case SUMMON_CATEGORY_PET:
mask = UNIT_MASK_GUARDIAN;
@@ -870,7 +870,7 @@ TempSummon* MapTransport::SummonPassenger(uint32 entry, Position const& pos, Tem
case SUMMON_CATEGORY_ALLY:
case SUMMON_CATEGORY_UNK:
{
switch (properties->Type)
switch (properties->Title)
{
case SUMMON_TYPE_MINION:
case SUMMON_TYPE_GUARDIAN:
@@ -1090,13 +1090,13 @@ void MapTransport::DelayedTeleportTransport()
return;
_delayedTeleport = false;
Map* newMap = sMapMgr->CreateBaseMap(_nextFrame->Node->MapID);
Map* newMap = sMapMgr->CreateBaseMap(_nextFrame->Node->ContinentID);
GetMap()->RemoveFromMap<MapTransport>(this, false);
SetMap(newMap);
float x = _nextFrame->Node->LocX,
y = _nextFrame->Node->LocY,
z = _nextFrame->Node->LocZ,
float x = _nextFrame->Node->Loc.X,
y = _nextFrame->Node->Loc.Y,
z = _nextFrame->Node->Loc.Z,
o =_nextFrame->InitialOrientation;
for (_passengerTeleportItr = _passengers.begin(); _passengerTeleportItr != _passengers.end();)
@@ -1110,7 +1110,7 @@ void MapTransport::DelayedTeleportTransport()
switch (obj->GetTypeId())
{
case TYPEID_PLAYER:
if (!obj->ToPlayer()->TeleportTo(_nextFrame->Node->MapID, destX, destY, destZ, destO, TELE_TO_NOT_LEAVE_TRANSPORT))
if (!obj->ToPlayer()->TeleportTo(_nextFrame->Node->ContinentID, destX, destY, destZ, destO, TELE_TO_NOT_LEAVE_TRANSPORT))
RemovePassenger(obj);
break;
case TYPEID_DYNAMICOBJECT:
+5 -5
View File
@@ -334,11 +334,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
uint16 index_mult = ranged ? UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER : UNIT_FIELD_ATTACK_POWER_MULTIPLIER;
if (ranged)
val2 = (level + std::max(GetStat(STAT_AGILITY) - 10.0f, 0.0f)) * entry->RAPPerAgility;
val2 = (level + std::max(GetStat(STAT_AGILITY) - 10.0f, 0.0f)) * entry->RangedAttackPowerPerAgility;
else
{
float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->APPerStrength, 0.0f);
float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerAgility, 0.0f);
float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->AttackPowerPerStrength, 0.0f);
float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerAgility, 0.0f);
// Druids in Bear and Cat form get two points attack power per agility point
if (GetShapeshiftForm() == FORM_BEAR || GetShapeshiftForm() == FORM_CAT)
@@ -539,10 +539,10 @@ void Player::UpdateMastery()
for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
{
if (!talentTab->MasterySpellId[i])
if (!talentTab->MasterySpellID[i])
continue;
if (Aura* aura = GetAura(talentTab->MasterySpellId[i]))
if (Aura* aura = GetAura(talentTab->MasterySpellID[i]))
{
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
+47 -47
View File
@@ -3303,15 +3303,15 @@ void Unit::ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData>
curLiquid = sLiquidTypeStore.LookupEntry(liquidData->entry);
if (curLiquid != _lastLiquid)
{
if (_lastLiquid && _lastLiquid->SpellId)
RemoveAurasDueToSpell(_lastLiquid->SpellId);
if (_lastLiquid && _lastLiquid->SpellID)
RemoveAurasDueToSpell(_lastLiquid->SpellID);
Player* player = GetCharmerOrOwnerPlayerOrPlayerItself();
// Set _lastLiquid before casting liquid spell to avoid infinite loops
_lastLiquid = curLiquid;
if (curLiquid && curLiquid->SpellId && (!player || !player->IsGameMaster()))
CastSpell(this, curLiquid->SpellId, true);
if (curLiquid && curLiquid->SpellID && (!player || !player->IsGameMaster()))
CastSpell(this, curLiquid->SpellID, true);
// Update mount capabilities when changing liquidstatus (enabling / disabling flight auras for example)
if (player)
@@ -5515,12 +5515,12 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
return *repRank;
if (!selfPlayerOwner->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION))
{
if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->faction))
if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->Faction))
{
if (targetFactionEntry->CanHaveReputation())
{
// check contested flags
if (targetFactionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
if (targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
&& selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
return REP_HOSTILE;
@@ -5550,14 +5550,14 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
if (Player const* targetPlayerOwner = target->GetAffectingPlayer())
{
// check contested flags
if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
&& targetPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
return REP_HOSTILE;
if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
return *repRank;
if (!target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION))
{
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction))
{
if (factionEntry->CanHaveReputation())
{
@@ -5578,7 +5578,7 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
return REP_FRIENDLY;
if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry))
return REP_FRIENDLY;
if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
return REP_HOSTILE;
// neutral by default
return REP_NEUTRAL;
@@ -5597,11 +5597,11 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
bool Unit::IsHostileToPlayers() const
{
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
if (!my_faction->faction)
if (!my_faction->Faction)
return false;
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
if (raw_faction && raw_faction->reputationListID >= 0)
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction);
if (raw_faction && raw_faction->ReputationIndex >= 0)
return false;
return my_faction->IsHostileToPlayers();
@@ -5610,11 +5610,11 @@ bool Unit::IsHostileToPlayers() const
bool Unit::IsNeutralToAll() const
{
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
if (!my_faction->faction)
if (!my_faction->Faction)
return true;
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
if (raw_faction && raw_faction->reputationListID >= 0)
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction);
if (raw_faction && raw_faction->ReputationIndex >= 0)
return false;
return my_faction->IsNeutralToAll();
@@ -6116,7 +6116,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
}
}
if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET)
if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET)
SetCritterGUID(minion->GetGUID());
// PvP, FFAPvP
@@ -6147,7 +6147,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
m_Controlled.erase(minion);
if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET)
if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET)
if (GetCritterGUID() == minion->GetGUID())
SetCritterGUID(ObjectGuid::Empty);
@@ -8306,11 +8306,11 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
for (uint32 i = MAX_MOUNT_CAPABILITIES; i > 0; --i)
{
MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(mountTypeEntry->MountCapability[i - 1]);
MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(mountTypeEntry->Capability[i - 1]);
if (!mountCapability)
continue;
if (ridingSkill < mountCapability->RequiredRidingSkill)
if (ridingSkill < mountCapability->ReqRidingSkill)
continue;
if (!(mountCapability->Flags & MOUNT_CAPABIILTY_FLAG_IGNORE_RESTRICTIONS))
@@ -8344,18 +8344,18 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
else if (!(mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLOAT))
continue;
if (mountCapability->RequiredMap != -1 &&
int32(GetMapId()) != mountCapability->RequiredMap &&
GetMap()->GetEntry()->ParentMapID != mountCapability->RequiredMap)
if (mountCapability->ReqMapID != -1 &&
int32(GetMapId()) != mountCapability->ReqMapID &&
GetMap()->GetEntry()->ParentMapID != mountCapability->ReqMapID)
continue;
if (mountCapability->RequiredArea && !IsInArea(areaId, mountCapability->RequiredArea))
if (mountCapability->ReqAreaID && !IsInArea(areaId, mountCapability->ReqAreaID))
continue;
if (mountCapability->RequiredAura && !HasAura(mountCapability->RequiredAura))
if (mountCapability->ReqSpellAuraID && !HasAura(mountCapability->ReqSpellAuraID))
continue;
if (mountCapability->RequiredSpell && !HasSpell(mountCapability->RequiredSpell))
if (mountCapability->ReqSpellKnownID && !HasSpell(mountCapability->ReqSpellKnownID))
continue;
return mountCapability;
@@ -8628,7 +8628,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
{
if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->Faction))
if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
if (!(repState->Flags & FACTION_FLAG_AT_WAR))
return false;
@@ -9713,7 +9713,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
return 0;
if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile)
if (spellInfo->RangeEntry->RangeMax[1] == spellInfo->RangeEntry->RangeMax[0])
return spellInfo->GetMaxRange();
if (!target)
return spellInfo->GetMaxRange(true);
@@ -9724,7 +9724,7 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
return 0;
if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile)
if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
return spellInfo->GetMinRange();
if (!target)
return spellInfo->GetMinRange(true);
@@ -9737,8 +9737,8 @@ uint32 Unit::GetCreatureType() const
{
ShapeshiftForm form = GetShapeshiftForm();
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
if (ssEntry && ssEntry->creatureType > 0)
return ssEntry->creatureType;
if (ssEntry && ssEntry->CreatureType > 0)
return ssEntry->CreatureType;
else
return CREATURE_TYPE_HUMANOID;
}
@@ -9771,7 +9771,7 @@ bool Unit::IsInDisallowedMountForm() const
if (!shapeshift)
return true;
if (!(shapeshift->flags1 & 0x1))
if (!(shapeshift->Flags & 0x1))
return true;
}
@@ -9782,12 +9782,12 @@ bool Unit::IsInDisallowedMountForm() const
if (!display)
return true;
CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtraId);
CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtendedDisplayInfoID);
if (!displayExtra)
return true;
CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId);
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->Race);
CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelID);
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->DisplayRaceID);
if (model && !(model->Flags & 0x80))
if (race && !(race->Flags & 0x4))
@@ -13137,21 +13137,21 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const
uint32 modelid = 0;
SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(form);
if (formEntry && formEntry->modelID_A)
if (formEntry && formEntry->CreatureDisplayID[0])
{
// Take the alliance modelid as default
if (GetTypeId() != TYPEID_PLAYER)
return formEntry->modelID_A;
return formEntry->CreatureDisplayID[0];
else
{
if (Player::TeamForRace(getRace()) == ALLIANCE)
modelid = formEntry->modelID_A;
modelid = formEntry->CreatureDisplayID[0];
else
modelid = formEntry->modelID_H;
modelid = formEntry->CreatureDisplayID[1];
// If the player is horde but there are no values for the horde modelid - take the alliance modelid
if (!modelid && Player::TeamForRace(getRace()) == HORDE)
modelid = formEntry->modelID_A;
modelid = formEntry->CreatureDisplayID[0];
}
}
@@ -13402,7 +13402,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
// If vehicle flag for fixed position set (cannons), or if the following hardcoded units, then set state rooted
// 30236 | Argent Cannon
// 39759 | Tankbuster Cannon
if ((vehicle->GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759)
if ((vehicle->GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759)
SetControlled(true, UNIT_STATE_ROOT);
ASSERT(!m_vehicle);
@@ -14008,7 +14008,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
{
if (Unit* victim = GetVictim())
{
if (victim->GetFactionTemplateEntry()->faction == faction_id)
if (victim->GetFactionTemplateEntry()->Faction == faction_id)
{
AttackStop();
if (IsNonMeleeSpellCast(false))
@@ -14023,7 +14023,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
AttackerSet const& attackers = getAttackers();
for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
{
if ((*itr)->GetFactionTemplateEntry()->faction == faction_id)
if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
{
(*itr)->AttackStop();
itr = attackers.begin();
@@ -14812,11 +14812,11 @@ float Unit::GetCollisionHeight() const
{
if (CreatureDisplayInfoEntry const* mountDisplayInfo = sCreatureDisplayInfoStore.LookupEntry(GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID)))
{
if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId))
if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelID))
{
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId());
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId);
float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->Scale * displayInfo->scale * 0.5f);
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID);
float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale * 0.5f);
return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight;
}
}
@@ -14824,9 +14824,9 @@ float Unit::GetCollisionHeight() const
//! Dismounting case - use basic default model data
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId());
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId);
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID);
float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->Scale * displayInfo->scale;
float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale;
return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight;
}
+15 -15
View File
@@ -38,7 +38,7 @@ UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry
{
for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
{
if (uint32 seatId = _vehicleInfo->m_seatID[i])
if (uint32 seatId = _vehicleInfo->SeatID[i])
if (VehicleSeatEntry const* veSeat = sVehicleSeatStore.LookupEntry(seatId))
{
Seats.insert(std::make_pair(i, VehicleSeat(veSeat)));
@@ -77,15 +77,15 @@ void Vehicle::Install()
{
if (_me->GetTypeId() == TYPEID_UNIT)
{
if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->m_powerDisplayId))
_me->setPowerType(Powers(powerDisplay->PowerType));
if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->PowerDisplayID[0]))
_me->setPowerType(Powers(powerDisplay->ActualType));
else if (_me->getClass() == CLASS_ROGUE)
_me->setPowerType(POWER_ENERGY);
}
if (Creature* creature = _me->ToCreature())
{
switch (_vehicleInfo->m_powerDisplayId)
switch (_vehicleInfo->PowerDisplayID[0])
{
case POWER_STEAM:
case POWER_HEAT:
@@ -244,11 +244,11 @@ void Vehicle::ApplyAllImmunities()
// If vehicle flag for fixed position set (cannons), or if the following hardcoded units, then set state rooted
// 30236 | Argent Cannon
// 39759 | Tankbuster Cannon
if ((GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION) || GetBase()->GetEntry() == 30236 || GetBase()->GetEntry() == 39759)
if ((GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION) || GetBase()->GetEntry() == 30236 || GetBase()->GetEntry() == 39759)
_me->SetControlled(true, UNIT_STATE_ROOT);
// Different immunities for vehicles goes below
switch (GetVehicleInfo()->m_ID)
switch (GetVehicleInfo()->ID)
{
// code below prevents a bug with movable cannons
case 160: // Strand of the Ancients
@@ -464,7 +464,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
}
TC_LOG_DEBUG("entities.vehicle", "Unit %s scheduling enter vehicle (entry: %u, vehicleId: %u, guid: %u (dbguid: %u) on seat %d",
unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().GetCounter(),
unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->ID, _me->GetGUID().GetCounter(),
(_me->GetTypeId() == TYPEID_UNIT ? _me->ToCreature()->GetSpawnId() : 0), (int32)seatId);
// The seat selection code may kick other passengers off the vehicle.
@@ -534,7 +534,7 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit)
ASSERT(seat != Seats.end());
TC_LOG_DEBUG("entities.vehicle", "Unit %s exit vehicle entry %u id %u dbguid %u seat %d",
unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().GetCounter(), (int32)seat->first);
unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->ID, _me->GetGUID().GetCounter(), (int32)seat->first);
if (seat->second.SeatInfo->CanEnterOrExit() && ++UsableSeatNum)
_me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
@@ -549,7 +549,7 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit)
seat->second.Passenger.Reset();
if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
_me->RemoveCharmedBy(unit);
if (_me->IsInWorld())
@@ -635,7 +635,7 @@ bool Vehicle::IsVehicleInUse() const
void Vehicle::InitMovementInfoForBase()
{
uint32 vehicleFlags = GetVehicleInfo()->m_flags;
uint32 vehicleFlags = GetVehicleInfo()->Flags;
if (vehicleFlags & VEHICLE_FLAG_NO_STRAFE)
_me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_NO_STRAFE);
@@ -882,17 +882,17 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
if (veSeat->HasFlag(VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE))
Passenger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
float o = sObjectMgr->GetVehicleSeatOrientationOffset(veSeat->m_ID);
float o = sObjectMgr->GetVehicleSeatOrientationOffset(veSeat->ID);
float x = veSeat->m_attachmentOffsetX;
float y = veSeat->m_attachmentOffsetY;
float z = veSeat->m_attachmentOffsetZ;
float x = veSeat->AttachmentOffset.X;
float y = veSeat->AttachmentOffset.Y;
float z = veSeat->AttachmentOffset.Z;
Passenger->m_movementInfo.transport.pos.Relocate(x, y, z, o);
Passenger->m_movementInfo.transport.time = 0;
Passenger->m_movementInfo.transport.seat = Seat->first;
Passenger->m_movementInfo.transport.guid = Target->GetBase()->GetGUID();
Passenger->m_movementInfo.transport.vehicleId = Target->GetVehicleInfo()->m_ID;
Passenger->m_movementInfo.transport.vehicleId = Target->GetVehicleInfo()->ID;
if (Target->GetBase()->GetTypeId() == TYPEID_UNIT && Passenger->GetTypeId() == TYPEID_PLAYER &&
veSeat->HasFlag(VEHICLE_SEAT_FLAG_CAN_CONTROL))
+5 -5
View File
@@ -975,9 +975,9 @@ void GameEventMgr::LoadHolidayDates()
if (uint32 duration = fields[3].GetUInt32())
entry->Duration[0] = duration;
auto itr = std::lower_bound(modifiedHolidays.begin(), modifiedHolidays.end(), entry->Id);
if (itr == modifiedHolidays.end() || *itr != entry->Id)
modifiedHolidays.insert(itr, entry->Id);
auto itr = std::lower_bound(modifiedHolidays.begin(), modifiedHolidays.end(), entry->ID);
if (itr == modifiedHolidays.end() || *itr != entry->ID)
modifiedHolidays.insert(itr, entry->ID);
++count;
} while (result->NextRow());
@@ -1581,10 +1581,10 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate)
if (bgTypeId != BATTLEGROUND_TYPE_NONE)
{
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
if (bl && bl->HolidayWorldStateId)
if (bl && bl->HolidayWorldState)
{
WorldPacket data;
sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0);
sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldState, Activate ? 1 : 0);
sWorld->SendGlobalMessage(&data);
}
}
+47 -47
View File
@@ -1093,7 +1093,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (cInfo->scale <= 0.0f)
{
if (displayScaleEntry)
const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->scale;
const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->CreatureModelScale;
else
const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f;
}
@@ -1593,8 +1593,8 @@ void ObjectMgr::LoadCreatureModelInfo()
modelInfo.modelid_other_gender = 0;
}
if (CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(creatureDisplay->ModelId))
modelInfo.is_trigger = strstr(modelData->ModelPath, "INVISIBLESTALKER");
if (CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(creatureDisplay->ModelID))
modelInfo.is_trigger = strstr(modelData->ModelName, "INVISIBLESTALKER");
++count;
}
@@ -2862,24 +2862,24 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill,
if (!disenchant)
continue;
if (disenchant->ItemClass == itemTemplate.Class &&
disenchant->ItemQuality == itemTemplate.Quality &&
disenchant->MinItemLevel <= itemTemplate.ItemLevel &&
disenchant->MaxItemLevel >= itemTemplate.ItemLevel)
if (disenchant->Class == itemTemplate.Class &&
disenchant->Quality == itemTemplate.Quality &&
disenchant->MinLevel <= itemTemplate.ItemLevel &&
disenchant->MaxLevel >= itemTemplate.ItemLevel)
{
if (disenchant->Id == 60 || disenchant->Id == 61) // epic item disenchant ilvl range 66-99 (classic)
if (disenchant->ID == 60 || disenchant->ID == 61) // epic item disenchant ilvl range 66-99 (classic)
{
if (itemTemplate.RequiredLevel > 60 || itemTemplate.RequiredSkillRank > 300)
continue; // skip to epic item disenchant ilvl range 90-199 (TBC)
}
else if (disenchant->Id == 66 || disenchant->Id == 67) // epic item disenchant ilvl range 90-199 (TBC)
else if (disenchant->ID == 66 || disenchant->ID == 67) // epic item disenchant ilvl range 90-199 (TBC)
{
if (itemTemplate.RequiredLevel <= 60 || (itemTemplate.RequiredSkill && itemTemplate.RequiredSkillRank <= 300))
continue;
}
*disenchantID = disenchant->Id;
*requiredDisenchantSkill = disenchant->RequiredDisenchantSkill;
*disenchantID = disenchant->ID;
*requiredDisenchantSkill = disenchant->SkillRequired;
return;
}
}
@@ -3155,10 +3155,10 @@ void ObjectMgr::LoadItemTemplates()
for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j)
{
if (entry->ItemId[j] <= 0)
if (entry->ItemID[j] <= 0)
continue;
uint32 item_id = entry->ItemId[j];
uint32 item_id = entry->ItemID[j];
if (!GetItemTemplate(item_id))
notFoundOutfit.insert(item_id);
@@ -3507,10 +3507,10 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
bool found = false;
for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x)
{
if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId)
if (entry->ItemID[x] > 0 && uint32(entry->ItemID[x]) == itemId)
{
found = true;
const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0;
const_cast<CharStartOutfitEntry*>(entry)->ItemID[x] = 0;
break;
}
}
@@ -3597,8 +3597,8 @@ void ObjectMgr::LoadPlayerInfo()
info->positionY = positionY;
info->positionZ = positionZ;
info->orientation = orientation;
info->displayId_m = rEntry->model_m;
info->displayId_f = rEntry->model_f;
info->displayId_m = rEntry->MaleDisplayID;
info->displayId_f = rEntry->FemaleDisplayID;
_playerInfo[current_race][current_class] = info;
++count;
@@ -5835,7 +5835,7 @@ void ObjectMgr::LoadInstanceEncounters()
if (lastEncounterDungeon && !sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon))
{
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName, lastEncounterDungeon);
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->Name, lastEncounterDungeon);
continue;
}
@@ -5844,7 +5844,7 @@ void ObjectMgr::LoadInstanceEncounters()
{
if (itr != dungeonLastBosses.end())
{
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName, itr->second->id, itr->second->encounterName);
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->Name, itr->second->ID, itr->second->Name);
continue;
}
@@ -5858,12 +5858,12 @@ void ObjectMgr::LoadInstanceEncounters()
CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry);
if (!creatureInfo)
{
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name);
continue;
}
const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
if (dungeonEncounter->difficulty == -1)
if (dungeonEncounter->DifficultyID == -1)
{
for (uint8 i = 0; i < 3; i++)
{
@@ -5877,29 +5877,29 @@ void ObjectMgr::LoadInstanceEncounters()
case ENCOUNTER_CREDIT_CAST_SPELL:
if (!sSpellMgr->GetSpellInfo(creditEntry))
{
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name);
continue;
}
break;
default:
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName);
TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->Name);
continue;
}
if (dungeonEncounter->difficulty == -1)
if (dungeonEncounter->DifficultyID == -1)
{
for (uint32 i = 0; i < MAX_DIFFICULTY; ++i)
{
if (GetMapDifficultyData(dungeonEncounter->mapId, Difficulty(i)))
if (GetMapDifficultyData(dungeonEncounter->MapID, Difficulty(i)))
{
DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, i)];
DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, i)];
encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
}
}
}
else
{
DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, dungeonEncounter->difficulty)];
DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, dungeonEncounter->DifficultyID)];
encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
}
@@ -6436,7 +6436,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
{
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
if (!node || node->map_id != mapid || (!node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981)) // dk flight
if (!node || node->ContinentID != mapid || (!node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981)) // dk flight
continue;
uint8 field = (uint8)((i - 1) / 8);
@@ -6446,7 +6446,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui
if ((sTaxiNodesMask[field] & submask) == 0)
continue;
float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z);
float dist2 = (node->Pos.X - x)*(node->Pos.X - x)+(node->Pos.Y - y)*(node->Pos.Y - y)+(node->Pos.Z - z)*(node->Pos.Z - z);
if (found)
{
if (dist2 < dist)
@@ -6674,17 +6674,17 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveyard(WorldLocation const& lo
if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_GRAVEYARD, data.safeLocId, conditionSource))
continue;
if (int16(entry->map_id) == mapEntry->ParentMapID && !conditionObject->GetPhaseShift().HasVisibleMapId(entry->map_id))
if (int16(entry->Continent) == mapEntry->ParentMapID && !conditionObject->GetPhaseShift().HasVisibleMapId(entry->Continent))
continue;
}
// find now nearest graveyard at other map
if (MapId != entry->map_id && int16(entry->map_id) != mapEntry->ParentMapID)
if (MapId != entry->Continent && int16(entry->Continent) != mapEntry->ParentMapID)
{
// if find graveyard at different map from where entrance placed (or no entrance data), use any first
if (!mapEntry
|| mapEntry->CorpseMapID < 0
|| uint32(mapEntry->CorpseMapID) != entry->map_id
|| uint32(mapEntry->CorpseMapID) != entry->Continent
|| (mapEntry->Corpse.X == 0 && mapEntry->Corpse.Y == 0))
{
// not have any corrdinates for check distance anyway
@@ -6693,8 +6693,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveyard(WorldLocation const& lo
}
// at entrance map calculate distance (2D);
float dist2 = (entry->x - mapEntry->Corpse.X)*(entry->x - mapEntry->Corpse.X)
+(entry->y - mapEntry->Corpse.Y)*(entry->y - mapEntry->Corpse.Y);
float dist2 = (entry->Loc.X - mapEntry->Corpse.X)*(entry->Loc.X - mapEntry->Corpse.X)
+(entry->Loc.Y - mapEntry->Corpse.Y)*(entry->Loc.Y - mapEntry->Corpse.Y);
if (foundEntr)
{
if (dist2 < distEntr)
@@ -6713,7 +6713,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveyard(WorldLocation const& lo
// find now nearest graveyard at same map
else
{
float dist2 = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y)+(entry->z - z)*(entry->z - z);
float dist2 = (entry->Loc.X - x)*(entry->Loc.X - x)+(entry->Loc.Y - y)*(entry->Loc.Y - y)+(entry->Loc.Z - z)*(entry->Loc.Z - z);
if (foundNear)
{
if (dist2 < distNear)
@@ -7020,7 +7020,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId))
{
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
if (atEntry && atEntry->mapid == Map)
if (atEntry && atEntry->ContinentID == Map)
return &itr->second;
}
return nullptr;
@@ -7885,7 +7885,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
continue;
}
if (factionEntry->team == 0)
if (factionEntry->ParentFactionID == 0)
{
TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId);
continue;
@@ -7905,7 +7905,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
break;
}
if (factionSpillover->reputationListID < 0)
if (factionSpillover->ReputationIndex < 0)
{
TC_LOG_ERROR("sql.sql", "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId);
invalidSpilloverFaction = true;
@@ -8644,11 +8644,11 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac
for (int i = 0; i < 4; i++)
{
if ((!factionEntry->BaseRepClassMask[i] ||
factionEntry->BaseRepClassMask[i] & classMask) &&
(!factionEntry->BaseRepRaceMask[i] ||
factionEntry->BaseRepRaceMask[i] & raceMask))
return factionEntry->BaseRepValue[i];
if ((!factionEntry->ReputationClassMask[i] ||
factionEntry->ReputationClassMask[i] & classMask) &&
(!factionEntry->ReputationRaceMask[i] ||
factionEntry->ReputationRaceMask[i] & raceMask))
return factionEntry->ReputationBase[i];
}
return 0;
@@ -8656,17 +8656,17 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac
SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry)
{
SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillId);
SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID);
if (!skill)
return SKILL_RANGE_NONE;
if (sSkillTiersStore.LookupEntry(rcEntry->SkillTier))
if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID))
return SKILL_RANGE_RANK;
if (rcEntry->SkillId == SKILL_RUNEFORGING)
if (rcEntry->SkillID == SKILL_RUNEFORGING)
return SKILL_RANGE_MONO;
switch (skill->categoryId)
switch (skill->CategoryID)
{
case SKILL_CATEGORY_ARMOR:
return SKILL_RANGE_MONO;
+7 -7
View File
@@ -2153,7 +2153,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
// check for min / max count
uint32 memberscount = GetMembersCount();
if (memberscount > bgEntry->maxGroupSize) // no MinPlayerCount for battlegrounds
if (memberscount > bgEntry->MaxGroupSize) // no MinPlayerCount for battlegrounds
return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side
// get a player as reference, to compare other players' stats to (arena team id, queue id based on level, etc.)
@@ -2183,7 +2183,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
if (member->GetTeam() != team)
return ERR_BATTLEGROUND_JOIN_TIMED_OUT;
// not in the same battleground level braket, don't let join
PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId, member->getLevel());
PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel());
if (memberBracketEntry != bracketEntry)
return ERR_BATTLEGROUND_JOIN_RANGE_INDEX;
// don't let join rated matches if the arena team id doesn't match
@@ -2366,7 +2366,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
{
WorldLocation graveyard = WorldLocation(instanceEntrance->target_mapId, instanceEntrance->target_X, instanceEntrance->target_Y, instanceEntrance->target_Z);
WorldSafeLocsEntry const* graveyardLocation = sObjectMgr->GetClosestGraveyard(graveyard, SendMsgTo->GetTeam(), nullptr);
uint32 const zoneId = sMapMgr->GetZoneId(PhasingHandler::GetEmptyPhaseShift(), graveyardLocation->map_id, graveyardLocation->x, graveyardLocation->y, graveyardLocation->z);
uint32 const zoneId = sMapMgr->GetZoneId(PhasingHandler::GetEmptyPhaseShift(), graveyardLocation->Continent, graveyardLocation->Loc.X, graveyardLocation->Loc.Y, graveyardLocation->Loc.Z);
for (const MemberSlot &member : this->GetMemberSlots())
{
@@ -2374,11 +2374,11 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
{
PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_POSITION_BY_MAPID);
stmt->setFloat(0, graveyardLocation->x);
stmt->setFloat(1, graveyardLocation->y);
stmt->setFloat(2, graveyardLocation->z);
stmt->setFloat(0, graveyardLocation->Loc.X);
stmt->setFloat(1, graveyardLocation->Loc.Y);
stmt->setFloat(2, graveyardLocation->Loc.Z);
stmt->setFloat(3, instanceEntrance->target_Orientation);
stmt->setUInt32(4, graveyardLocation->map_id);
stmt->setUInt32(4, graveyardLocation->Continent);
stmt->setUInt32(5, zoneId);
stmt->setUInt32(6, member.guid);
stmt->setUInt32(7, map->GetId());
+7 -7
View File
@@ -829,7 +829,7 @@ void Guild::Member::LoadProfessionDataFromDB(ObjectGuid guid)
uint16 max = fields[2].GetUInt16();
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skill);
if (!skillLine || skillLine->categoryId != SKILL_CATEGORY_PROFESSION)
if (!skillLine || skillLine->CategoryID != SKILL_CATEGORY_PROFESSION)
continue;
GuildMemberProfessionData profession;
@@ -2604,8 +2604,8 @@ void Guild::SendLoginInfo(WorldSession* session)
for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i)
if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i))
if (entry->Level <= GetLevel())
player->LearnSpell(entry->SpellId, true);
if (entry->GuildLevel <= GetLevel())
player->LearnSpell(entry->SpellID, true);
SendGuildReputationWeeklyCap(session, member->GetWeekReputation());
@@ -3165,8 +3165,8 @@ void Guild::DeleteMember(SQLTransaction& trans, ObjectGuid guid, bool isDisbandi
for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i)
if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i))
if (entry->Level <= GetLevel())
player->RemoveSpell(entry->SpellId, false, false);
if (entry->GuildLevel <= GetLevel())
player->RemoveSpell(entry->SpellID, false, false);
// Update GuildId in group
if (Group* group = player->GetGroup())
@@ -3990,8 +3990,8 @@ void Guild::GiveXP(uint32 xp, Player* source, bool rewardedByChallenge)
std::vector<uint32> perksToLearn;
for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i)
if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i))
if (entry->Level > oldLevel && entry->Level <= GetLevel())
perksToLearn.push_back(entry->SpellId);
if (entry->GuildLevel > oldLevel && entry->GuildLevel <= GetLevel())
perksToLearn.push_back(entry->SpellID);
// Notify all online players that guild level changed and learn perks
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+1 -1
View File
@@ -95,7 +95,7 @@ void GuildFinderMgr::LoadGuildSettings()
TeamId guildTeam = TEAM_ALLIANCE;
if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(fields[7].GetUInt8()))
if (raceEntry->TeamID == 1)
if (raceEntry->BaseLanguage == 1)
guildTeam = TEAM_HORDE;
LFGuildSettings settings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment);
+6 -6
View File
@@ -585,15 +585,15 @@ void GuildMgr::LoadGuildProfessionData()
{
for (SkillLineAbilityEntry const* entry : sSkillLineAbilityStore)
{
SkillLineEntry const* skill = sSkillLineStore.LookupEntry(entry->skillId);
if (!skill || skill->categoryId != SKILL_CATEGORY_PROFESSION)
SkillLineEntry const* skill = sSkillLineStore.LookupEntry(entry->SkillLine);
if (!skill || skill->CategoryID != SKILL_CATEGORY_PROFESSION)
continue;
GuildProfession prof;
prof.SpellId = entry->spellId;
prof.UniqueBits = entry->UniqueBits;
prof.AutoLearn = entry->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE;
GuildProfessionStore[skill->id].push_back(prof);
prof.SpellId = entry->Spell;
prof.UniqueBits = entry->UniqueBit;
prof.AutoLearn = entry->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE;
GuildProfessionStore[skill->ID].push_back(prof);
}
}
@@ -70,7 +70,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
WorldPacket data(MSG_AUCTION_HELLO, 12);
data << uint64(guid);
data << uint32(ahEntry->houseId);
data << uint32(ahEntry->ID);
data << uint8(1); // 3.3.3: 1 - AH enabled, 0 - AH disabled
SendPacket(&data);
}
@@ -311,7 +311,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
}
AuctionHouseEntry const* AHEntry = sAuctionMgr->GetAuctionHouseEntry(auctioneerInfo->faction);
AH->houseId = AHEntry->houseId;
AH->houseId = AHEntry->ID;
}
// Required stack size of auction matches to current item stack size, just move item to auctionhouse
+1 -1
View File
@@ -160,7 +160,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
{
HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(entry);
data << uint32(holiday->Id); // m_ID
data << uint32(holiday->ID); // m_ID
data << uint32(holiday->Region); // m_region, might be looping
data << uint32(holiday->Looping); // m_looping, might be region
data << uint32(holiday->Priority); // m_priority
+27 -27
View File
@@ -367,17 +367,17 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
}
// prevent character creating Expansion race without Expansion account
if (raceEntry->expansion > Expansion())
if (raceEntry->Race_related > Expansion())
{
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, createInfo->Race);
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->Race_related, createInfo->Race);
SendCharCreate(CHAR_CREATE_EXPANSION);
return;
}
// prevent character creating Expansion class without Expansion account
if (classEntry->expansion > Expansion())
if (classEntry->Required_expansion > Expansion())
{
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, createInfo->Class);
TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->Required_expansion, createInfo->Class);
SendCharCreate(CHAR_CREATE_EXPANSION_CLASS);
return;
}
@@ -942,10 +942,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
if (ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->getClass()))
{
if (cEntry->CinematicSequence)
pCurrChar->SendCinematicStart(cEntry->CinematicSequence);
if (cEntry->CinematicSequenceID)
pCurrChar->SendCinematicStart(cEntry->CinematicSequenceID);
else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace()))
pCurrChar->SendCinematicStart(rEntry->CinematicSequence);
pCurrChar->SendCinematicStart(rEntry->CinematicSequenceID);
// send new char string if not empty
if (!sWorld->GetNewCharString().empty())
@@ -1441,25 +1441,25 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair);
if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->getRace() || bs_hair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
return;
BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair);
if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->getRace() || bs_facialHair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
return;
BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor);
if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)))
if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->getRace() || bs_skinColor->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)))
return;
if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER),
bs_hair->hair_id,
bs_hair->Data,
Color,
_player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID),
bs_facialHair->hair_id,
bs_skinColor ? bs_skinColor->hair_id : _player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID)))
bs_facialHair->Data,
bs_skinColor ? bs_skinColor->Data : _player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID)))
return;
@@ -1476,7 +1476,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
return;
}
uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor);
uint32 cost = _player->GetBarberShopCost(bs_hair->Data, Color, bs_facialHair->Data, bs_skinColor);
// 0 - ok
// 1, 3 - not enough money
@@ -1492,11 +1492,11 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
_player->ModifyMoney(-int64(cost)); // it isn't free
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost);
_player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, uint8(bs_hair->hair_id));
_player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, uint8(bs_hair->Data));
_player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, uint8(Color));
_player->SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, uint8(bs_facialHair->hair_id));
_player->SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, uint8(bs_facialHair->Data));
if (bs_skinColor)
_player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, uint8(bs_skinColor->hair_id));
_player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, uint8(bs_skinColor->Data));
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
@@ -1518,7 +1518,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData)
{
if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph))
{
_player->RemoveAurasDueToSpell(gp->SpellId);
_player->RemoveAurasDueToSpell(gp->SpellID);
_player->SetGlyph(slot, 0);
_player->SendTalentsInfoData(false);
}
@@ -2259,28 +2259,28 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
// new team
if (newTeam == ALLIANCE)
{
uint32 bitIndex = htitleInfo->bit_index;
uint32 bitIndex = htitleInfo->Mask_ID;
uint32 index = bitIndex / 32;
uint32 old_flag = 1 << (bitIndex % 32);
uint32 new_flag = 1 << (atitleInfo->bit_index % 32);
uint32 new_flag = 1 << (atitleInfo->Mask_ID % 32);
if (knownTitles[index] & old_flag)
{
knownTitles[index] &= ~old_flag;
// use index of the new title
knownTitles[atitleInfo->bit_index / 32] |= new_flag;
knownTitles[atitleInfo->Mask_ID / 32] |= new_flag;
}
}
else
{
uint32 bitIndex = atitleInfo->bit_index;
uint32 bitIndex = atitleInfo->Mask_ID;
uint32 index = bitIndex / 32;
uint32 old_flag = 1 << (bitIndex % 32);
uint32 new_flag = 1 << (htitleInfo->bit_index % 32);
uint32 new_flag = 1 << (htitleInfo->Mask_ID % 32);
if (knownTitles[index] & old_flag)
{
knownTitles[index] &= ~old_flag;
// use index of the new title
knownTitles[htitleInfo->bit_index / 32] |= new_flag;
knownTitles[htitleInfo->Mask_ID / 32] |= new_flag;
}
}
@@ -2465,9 +2465,9 @@ void WorldSession::HandleOpeningCinematic(WorldPacket& /*recvData*/)
if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass()))
{
if (classEntry->CinematicSequence)
_player->SendCinematicStart(classEntry->CinematicSequence);
if (classEntry->CinematicSequenceID)
_player->SendCinematicStart(classEntry->CinematicSequenceID);
else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace()))
_player->SendCinematicStart(raceEntry->CinematicSequence);
_player->SendCinematicStart(raceEntry->CinematicSequenceID);
}
}
+1 -1
View File
@@ -778,7 +778,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
if (!em)
return;
uint32 emote_anim = em->textid;
uint32 emote_anim = em->EmoteID;
switch (emote_anim)
{
+1 -1
View File
@@ -55,7 +55,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData)
{
VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(_player);
ASSERT(seat);
if (!(seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK))
if (!(seat->Flags & VEHICLE_SEAT_FLAG_CAN_ATTACK))
{
SendAttackStop(pEnemy);
return;
+2 -2
View File
@@ -1203,7 +1203,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
if (mask & GROUP_UPDATE_FLAG_VEHICLE_SEAT)
{
if (Vehicle* veh = player->GetVehicle())
*data << int32(veh->GetVehicleInfo()->m_seatID[player->m_movementInfo.transport.seat]);
*data << int32(veh->GetVehicleInfo()->SeatID[player->m_movementInfo.transport.seat]);
else
*data << int32(0);
}
@@ -1378,7 +1378,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData)
data.put<uint64>(maskPos, petAuraMask); // GROUP_UPDATE_FLAG_PET_AURAS
if (updateFlags & GROUP_UPDATE_FLAG_VEHICLE_SEAT)
data << uint32(player->GetVehicle()->GetVehicleInfo()->m_seatID[player->m_movementInfo.transport.seat]);
data << uint32(player->GetVehicle()->GetVehicleInfo()->SeatID[player->m_movementInfo.transport.seat]);
if (updateFlags & GROUP_UPDATE_FLAG_PHASE)
PhasingHandler::FillPartyMemberPhase(&data, player->GetPhaseShift());
+10 -10
View File
@@ -848,7 +848,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
return;
}
uint32 price = slotEntry->price;
uint32 price = slotEntry->Cost;
if (!_player->HasEnoughMoney(uint64(price)))
{
@@ -1142,19 +1142,19 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
}
// tried to put normal gem in meta socket
if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META)
if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->Type != SOCKET_COLOR_META)
return;
// tried to put meta gem in normal socket
if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META)
if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->Type == SOCKET_COLOR_META)
return;
// tried to put normal gem in cogwheel socket
if (itemProto->Socket[i].Color == SOCKET_COLOR_COGWHEEL && GemProps[i]->color != SOCKET_COLOR_COGWHEEL)
if (itemProto->Socket[i].Color == SOCKET_COLOR_COGWHEEL && GemProps[i]->Type != SOCKET_COLOR_COGWHEEL)
return;
// tried to put cogwheel gem in normal socket
if (itemProto->Socket[i].Color != SOCKET_COLOR_COGWHEEL && GemProps[i]->color == SOCKET_COLOR_COGWHEEL)
if (itemProto->Socket[i].Color != SOCKET_COLOR_COGWHEEL && GemProps[i]->Type == SOCKET_COLOR_COGWHEEL)
return;
}
@@ -1162,7 +1162,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
uint32 OldEnchants[MAX_GEM_SOCKETS];
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments
{
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->Enchant_ID : 0;
OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i));
}
@@ -1195,7 +1195,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
{
if (iGemProto->ItemId == enchantEntry->GemID)
if (iGemProto->ItemId == enchantEntry->Src_itemID)
{
_player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, nullptr);
return;
@@ -1224,13 +1224,13 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{
// existing gem
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID))
if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->Src_itemID))
if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
++limit_newcount;
}
}
if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->maxCount)
if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->Quantity)
{
_player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, nullptr);
return;
@@ -1641,7 +1641,7 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData)
return;
}
if (!item->GetReforgableStat(ItemModType(stats->SourceStat)) || item->GetReforgableStat(ItemModType(stats->FinalStat))) // Cheating, you cant reforge to a stat that the item already has, nor reforge from a stat that the item does not have
if (!item->GetReforgableStat(ItemModType(stats->Source_stat)) || item->GetReforgableStat(ItemModType(stats->Target_stat))) // Cheating, you cant reforge to a stat that the item already has, nor reforge from a stat that the item does not have
{
SendReforgeResult(false);
return;
+1 -1
View File
@@ -809,7 +809,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
{
MailTemplateEntry const* mailTemplateEntry = sMailTemplateStore.LookupEntry(m->mailTemplateId);
ASSERT(mailTemplateEntry);
bodyItem->SetText(mailTemplateEntry->content);
bodyItem->SetText(mailTemplateEntry->Body);
}
else
bodyItem->SetText(m->body);
+2 -2
View File
@@ -712,7 +712,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
if (sObjectMgr->IsTavernAreaTrigger(triggerId))
{
// set resting flag we are in the inn
player->SetRestFlag(REST_FLAG_IN_TAVERN, atEntry->id);
player->SetRestFlag(REST_FLAG_IN_TAVERN, atEntry->ID);
if (sWorld->IsFFAPvPRealm())
player->RemoveByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, UNIT_BYTE2_FLAG_FFA_PVP);
@@ -771,7 +771,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
case Map::CANNOT_ENTER_INSTANCE_BIND_MISMATCH:
if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId))
{
char const* mapName = entry->Name;
char const* mapName = entry->MapName;
TC_LOG_DEBUG("maps", "MAP: Player '%s' cannot enter instance map '%s' because their permanent bind is incompatible with their group's", player->GetName().c_str(), mapName);
player->SendTransferAborted(entry->ID, TRANSFER_ABORT_LOCKED_TO_DIFFERENT_INSTANCE, player->GetDifficulty(entry->IsRaid()));
}
+1 -1
View File
@@ -411,7 +411,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
{
if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(mover))
{
if (seat->m_flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING)
if (seat->Flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING)
{
if (movementInfo.pos.GetOrientation() != mover->GetOrientation())
{
+1 -1
View File
@@ -279,7 +279,7 @@ void WorldSession::SendSpiritResurrect()
WorldSafeLocsEntry const* ghostGrave = sObjectMgr->GetClosestGraveyard(*_player, _player->GetTeam(), _player);
if (corpseGrave != ghostGrave)
_player->TeleportTo(corpseGrave->map_id, corpseGrave->x, corpseGrave->y, corpseGrave->z, _player->GetOrientation());
_player->TeleportTo(corpseGrave->Continent, corpseGrave->Loc.X, corpseGrave->Loc.Y, corpseGrave->Loc.Z, _player->GetOrientation());
}
}
+1 -1
View File
@@ -46,7 +46,7 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
{
if (TalentTabEntry const* talentTabEntry = sTalentTabStore.LookupEntry(_player->GetPrimaryTalentTree(_player->GetActiveSpec())))
{
if (talentTabEntry->tabpage != uint32(tabPage))
if (talentTabEntry->OrderIndex != uint32(tabPage))
{
recvPacket.rfinish();
return;
+2 -2
View File
@@ -221,7 +221,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData)
TaxiNodesEntry const* curDestNode = sTaxiNodesStore.LookupEntry(curDest);
// far teleport case
if (curDestNode && curDestNode->map_id != GetPlayer()->GetMapId())
if (curDestNode && curDestNode->ContinentID != GetPlayer()->GetMapId())
{
if (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
{
@@ -232,7 +232,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData)
TaxiPathNodeEntry const* node = flight->GetPath()[flight->GetCurrentNode()];
flight->SkipCurrentNode();
GetPlayer()->TeleportTo(curDestNode->map_id, node->LocX, node->LocY, node->LocZ, GetPlayer()->GetOrientation());
GetPlayer()->TeleportTo(curDestNode->ContinentID, node->Loc.X, node->Loc.Y, node->Loc.Z, GetPlayer()->GetOrientation());
}
}
+2 -2
View File
@@ -61,7 +61,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData)
{
recvData.rfinish(); // prevent warnings spam
TC_LOG_ERROR("network", "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.",
recvData.GetOpcode(), GetPlayer()->GetGUID().GetCounter(), seat->m_flags);
recvData.GetOpcode(), GetPlayer()->GetGUID().GetCounter(), seat->Flags);
return;
}
@@ -211,7 +211,7 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
GetPlayer()->ExitVehicle();
else
TC_LOG_ERROR("network", "Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
GetPlayer()->GetGUID().GetCounter(), seat->m_ID, seat->m_flags);
GetPlayer()->GetGUID().GetCounter(), seat->ID, seat->Flags);
}
}
}
@@ -630,7 +630,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
if (!mapEntry->Instanceable())
return;
TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->Name, mapid, uint8(difficulty), warn);
TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->MapName, mapid, uint8(difficulty), warn);
time_t now = GameTime::GetGameTime();
+5 -5
View File
@@ -743,16 +743,16 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
DungeonEncounter const* encounter = *itr;
if (encounter->creditType == type && encounter->creditEntry == creditEntry)
{
completedEncounters |= 1 << encounter->dbcEntry->encounterIndex;
encounterId = encounter->dbcEntry->id;
completedEncounters |= 1 << encounter->dbcEntry->Bit;
encounterId = encounter->dbcEntry->ID;
if (encounter->lastEncounterDungeon)
{
if (instance->GetDifficulty() != sLFGDungeonStore.LookupEntry(encounter->lastEncounterDungeon)->difficulty)
if (instance->GetDifficulty() != sLFGDungeonStore.LookupEntry(encounter->lastEncounterDungeon)->DifficultyID)
dungeonId = sLFGMgr->GetDungeonIdForDifficulty(encounter->lastEncounterDungeon, instance->GetDifficulty());
else
dungeonId = encounter->lastEncounterDungeon;
TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName, dungeonId);
TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->Name, dungeonId);
break;
}
}
@@ -779,7 +779,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
{
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
{
if (grp->MemberLevelIsInRange(dungeon->minlevel, dungeon->maxlevel))
if (grp->MemberLevelIsInRange(dungeon->MinLevel, dungeon->Maxlevel))
{
if (dungeonId)
guild->CompleteChallenge(instance->IsNonRaidDungeon() ? GUILD_CHALLENGE_TYPE_DUNGEON : GUILD_CHALLENGE_TYPE_RAID, player);
+3 -3
View File
@@ -121,16 +121,16 @@ void Loot::AddItem(LootStoreItem const& item)
if (!currency)
return;
uint32 totalCap = currency->TotalCap > 0 ? currency->TotalCap : 1;
uint32 totalCap = currency->MaxQty > 0 ? currency->MaxQty : 1;
uint32 count = urand(item.mincount, item.maxcount);
uint32 stacks = count / totalCap + ((count % totalCap) ? 1 : 0);
for (uint32 i = 0; i < stacks && lootItems.size() < limit; ++i)
{
LootItem generatedLoot(item);
generatedLoot.count = std::min(count, currency->TotalCap);
generatedLoot.count = std::min(count, currency->MaxQty);
lootItems.push_back(generatedLoot);
count -= currency->TotalCap;
count -= currency->MaxQty;
// Never seen a currency that needs a quest but just in case
if (!item.needs_quest)
+1 -1
View File
@@ -846,7 +846,7 @@ void LoadLootTemplates_Disenchant()
if (!disenchant)
continue;
uint32 lootid = disenchant->Id;
uint32 lootid = disenchant->ID;
if (lootIdSet.find(lootid) == lootIdSet.end())
LootTemplates_Disenchant.ReportNonExistingId(lootid);
else
+11 -11
View File
@@ -2388,23 +2388,23 @@ inline ZLiquidStatus GridMap::GetLiquidStatus(float x, float y, float z, uint8 R
if (LiquidTypeEntry const* liquidEntry = sLiquidTypeStore.LookupEntry(entry))
{
type &= MAP_LIQUID_TYPE_DARK_WATER;
uint32 liqTypeIdx = liquidEntry->Type;
uint32 liqTypeIdx = liquidEntry->SoundBank;
if (entry < 21)
{
if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(getArea(x, y)))
{
uint32 overrideLiquid = area->LiquidTypeID[liquidEntry->Type];
uint32 overrideLiquid = area->LiquidTypeID[liquidEntry->SoundBank];
if (!overrideLiquid && area->ParentAreaID)
{
area = sAreaTableStore.LookupEntry(area->ParentAreaID);
if (area)
overrideLiquid = area->LiquidTypeID[liquidEntry->Type];
overrideLiquid = area->LiquidTypeID[liquidEntry->SoundBank];
}
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid))
{
entry = overrideLiquid;
liqTypeIdx = liq->Type;
liqTypeIdx = liq->SoundBank;
}
}
}
@@ -2607,7 +2607,7 @@ uint32 Map::GetAreaId(PhaseShift const& phaseShift, float x, float y, float z) c
{
// wmo found
if (WMOAreaTableEntry const* wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId))
areaId = wmoEntry->areaId;
areaId = wmoEntry->AreaTableID;
if (!areaId)
areaId = gridAreaId;
@@ -2665,7 +2665,7 @@ ZLiquidStatus Map::GetLiquidStatus(PhaseShift const& phaseShift, float x, float
uint32 liquidFlagType = 0;
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquid_type))
liquidFlagType = liq->Type;
liquidFlagType = liq->SoundBank;
if (liquid_type && liquid_type < 21)
{
@@ -2682,7 +2682,7 @@ ZLiquidStatus Map::GetLiquidStatus(PhaseShift const& phaseShift, float x, float
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid))
{
liquid_type = overrideLiquid;
liquidFlagType = liq->Type;
liquidFlagType = liq->SoundBank;
}
}
}
@@ -2772,7 +2772,7 @@ void Map::GetFullTerrainStatusForPosition(PhaseShift const& phaseShift, float x,
data.outdoors = (vmapData.areaInfo->mogpFlags & 0x8) != 0;
if (wmoEntry)
{
data.areaId = wmoEntry->areaId;
data.areaId = wmoEntry->AreaTableID;
if (wmoEntry->Flags & 4)
data.outdoors = true;
else if (wmoEntry->Flags & 2)
@@ -2808,7 +2808,7 @@ void Map::GetFullTerrainStatusForPosition(PhaseShift const& phaseShift, float x,
uint32 liquidFlagType = 0;
if (LiquidTypeEntry const* liquidData = sLiquidTypeStore.LookupEntry(liquidType))
liquidFlagType = liquidData->Type;
liquidFlagType = liquidData->SoundBank;
if (liquidType && liquidType < 21 && areaEntry)
{
@@ -2823,7 +2823,7 @@ void Map::GetFullTerrainStatusForPosition(PhaseShift const& phaseShift, float x,
if (LiquidTypeEntry const* overrideData = sLiquidTypeStore.LookupEntry(overrideLiquid))
{
liquidType = overrideLiquid;
liquidFlagType = overrideData->Type;
liquidFlagType = overrideData->SoundBank;
}
}
@@ -2922,7 +2922,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const
char const* Map::GetMapName() const
{
return i_mapEntry ? i_mapEntry->Name : "UNNAMEDMAP\x0";
return i_mapEntry ? i_mapEntry->MapName : "UNNAMEDMAP\x0";
}
void Map::SendInitSelf(Player* player)
+1 -1
View File
@@ -250,7 +250,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun
uint8 spawnMode;
if (bracketEntry)
spawnMode = bracketEntry->difficulty;
spawnMode = bracketEntry->Difficulty;
else
spawnMode = REGULAR_DIFFICULTY;
+1 -1
View File
@@ -176,7 +176,7 @@ Map::EnterState MapManager::PlayerCannotEnter(uint32 mapid, Player* player, bool
if (player->IsGameMaster())
return Map::CAN_ENTER;
char const* mapName = entry->Name;
char const* mapName = entry->MapName;
Group* group = player->GetGroup();
// Cannot enter raid maps when not in a raid-group. Ignore rule when CONFIG_INSTANCE_IGNORE_RAID = true
+13 -13
View File
@@ -95,10 +95,10 @@ void TransportMgr::LoadTransportTemplates()
void TransportMgr::LoadTransportAnimationAndRotation()
{
for (TransportAnimationEntry const* anim : sTransportAnimationStore)
AddPathNodeToTransport(anim->TransportEntry, anim->TimeSeg, anim);
AddPathNodeToTransport(anim->TransportID, anim->TimeIndex, anim);
for (TransportRotationEntry const* rot : sTransportRotationStore)
AddPathRotationToTransport(rot->TransportEntry, rot->TimeSeg, rot);
AddPathRotationToTransport(rot->GameObjectsID, rot->TimeIndex, rot);
}
class SplineRawInitializer
@@ -126,7 +126,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
Movement::PointsArray splinePath, allPoints;
bool mapChange = false;
for (size_t i = 0; i < path.size(); ++i)
allPoints.push_back(G3D::Vector3(path[i]->LocX, path[i]->LocY, path[i]->LocZ));
allPoints.push_back(G3D::Vector3(path[i]->Loc.X, path[i]->Loc.Y, path[i]->Loc.Z));
// Add extra points to allow derivative calculations for all path nodes
allPoints.insert(allPoints.begin(), allPoints.front().lerp(allPoints[1], -0.2f));
@@ -143,7 +143,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
if (!mapChange)
{
TaxiPathNodeEntry const* node_i = path[i];
if (i != path.size() - 1 && (node_i->Flags & 1 || node_i->MapID != path[i + 1]->MapID))
if (i != path.size() - 1 && (node_i->Flags & 1 || node_i->ContinentID != path[i + 1]->ContinentID))
{
keyFrames.back().Teleport = true;
mapChange = true;
@@ -156,8 +156,8 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl
k.InitialOrientation = Position::NormalizeOrientation(std::atan2(h.y, h.x) + float(M_PI));
keyFrames.push_back(k);
splinePath.push_back(G3D::Vector3(node_i->LocX, node_i->LocY, node_i->LocZ));
transport->mapsUsed.insert(k.Node->MapID);
splinePath.push_back(G3D::Vector3(node_i->Loc.X, node_i->Loc.Y, node_i->Loc.Z));
transport->mapsUsed.insert(k.Node->ContinentID);
}
}
else
@@ -388,10 +388,10 @@ MapTransport* TransportMgr::CreateTransport(uint32 entry, ObjectGuid::LowType gu
// ...at first waypoint
TaxiPathNodeEntry const* startNode = tInfo->keyFrames.begin()->Node;
uint32 mapId = startNode->MapID;
float x = startNode->LocX;
float y = startNode->LocY;
float z = startNode->LocZ;
uint32 mapId = startNode->ContinentID;
float x = startNode->Loc.X;
float y = startNode->Loc.Y;
float z = startNode->Loc.Z;
float o = tInfo->keyFrames.begin()->InitialOrientation;
// initialize the gameobject base
@@ -522,7 +522,7 @@ bool TransportAnimation::GetAnimNode(uint32 time, TransportAnimationEntry const*
--itr;
next = itr->second;
percPos = float(time - curr->TimeSeg) / float(next->TimeSeg - curr->TimeSeg);
percPos = float(time - curr->TimeIndex) / float(next->TimeIndex - curr->TimeIndex);
return true;
}
@@ -543,7 +543,7 @@ void TransportAnimation::GetAnimRotation(uint32 time, QuaternionData& curr, Quat
for (TransportPathRotationContainer::const_reverse_iterator itr = Rotations.rbegin(); itr != Rotations.rend(); ++itr)
if (time >= itr->first)
{
uint32 currSeg = itr->second->TimeSeg;
uint32 currSeg = itr->second->TimeIndex;
uint32 nextSeg = 0;
curr = QuaternionData(itr->second->X, itr->second->Y, itr->second->Z, itr->second->W);
@@ -551,7 +551,7 @@ void TransportAnimation::GetAnimRotation(uint32 time, QuaternionData& curr, Quat
{
--itr;
next = QuaternionData(itr->second->X, itr->second->Y, itr->second->Z, itr->second->W);
nextSeg = itr->second->TimeSeg;
nextSeg = itr->second->TimeIndex;
}
else
{
@@ -45,9 +45,9 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
if (_currentNode >= _path.size())
return _path.size();
uint32 curMapId = _path[_currentNode]->MapID;
uint32 curMapId = _path[_currentNode]->ContinentID;
for (uint32 itr = _currentNode; itr < _path.size(); ++itr)
if (_path[itr]->MapID != curMapId)
if (_path[itr]->ContinentID != curMapId)
return itr;
return _path.size();
@@ -55,7 +55,7 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const
bool IsNodeIncludedInShortenedPath(TaxiPathNodeEntry const* p1, TaxiPathNodeEntry const* p2)
{
return p1->MapID != p2->MapID || std::pow(p1->LocX - p2->LocX, 2) + std::pow(p1->LocY - p2->LocY, 2) > SKIP_SPLINE_POINT_DISTANCE_SQ;
return p1->ContinentID != p2->ContinentID || std::pow(p1->Loc.X - p2->Loc.X, 2) + std::pow(p1->Loc.Y - p2->Loc.Y, 2) > SKIP_SPLINE_POINT_DISTANCE_SQ;
}
void FlightPathMovementGenerator::LoadPath(Player* player)
@@ -125,8 +125,8 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
// When the player reaches the last flight point, teleport to taxi node location
if (TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(taxiNodeId))
{
player->SetFallInformation(0, node->z);
player->TeleportTo(node->map_id, node->x, node->y, node->z, player->GetOrientation());
player->SetFallInformation(0, node->Pos.Z);
player->TeleportTo(node->ContinentID, node->Pos.X, node->Pos.Y, node->Pos.Z, player->GetOrientation());
}
}
@@ -145,7 +145,7 @@ void FlightPathMovementGenerator::DoReset(Player* player)
uint32 end = GetPathAtMapEnd();
for (uint32 i = GetCurrentNode(); i != end; ++i)
{
G3D::Vector3 vertice(_path[i]->LocX, _path[i]->LocY, _path[i]->LocZ);
G3D::Vector3 vertice(_path[i]->Loc.X, _path[i]->Loc.Y, _path[i]->Loc.Z);
init.Path().push_back(vertice);
}
init.SetFirstPointId(GetCurrentNode());
@@ -196,10 +196,10 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport()
if (_path.empty() || _currentNode >= _path.size())
return;
uint32 map0 = _path[_currentNode]->MapID;
uint32 map0 = _path[_currentNode]->ContinentID;
for (size_t i = _currentNode + 1; i < _path.size(); ++i)
{
if (_path[i]->MapID != map0)
if (_path[i]->ContinentID != map0)
{
_currentNode = i;
return;
@@ -219,9 +219,9 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry
bool FlightPathMovementGenerator::GetResetPos(Player*, float& x, float& y, float& z)
{
TaxiPathNodeEntry const* node = _path[_currentNode];
x = node->LocX;
y = node->LocY;
z = node->LocZ;
x = node->Loc.X;
y = node->Loc.Y;
z = node->Loc.Z;
return true;
}
@@ -230,10 +230,10 @@ void FlightPathMovementGenerator::InitEndGridInfo()
/*! Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will
be reinitialized for each flightmaster at the end of each spline (or stop) in the flight. */
uint32 nodeCount = _path.size(); //! Number of nodes in path.
_endMapId = _path[nodeCount - 1]->MapID; //! MapId of last node
_endMapId = _path[nodeCount - 1]->ContinentID; //! MapId of last node
_preloadTargetNode = nodeCount - 3;
_endGridX = _path[nodeCount - 1]->LocX;
_endGridY = _path[nodeCount - 1]->LocY;
_endGridX = _path[nodeCount - 1]->Loc.X;
_endGridY = _path[nodeCount - 1]->Loc.Y;
}
void FlightPathMovementGenerator::PreloadEndGrid()
+2 -2
View File
@@ -259,10 +259,10 @@ uint32 Quest::GetXPReward(Player const* player) const
else if (diffFactor > 10)
diffFactor = 10;
uint32 xp = RoundXPValue(diffFactor * xpentry->Exp[RewardXPDifficulty] / 10);
uint32 xp = RoundXPValue(diffFactor * xpentry->Difficulty[RewardXPDifficulty] / 10);
if (sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO))
{
uint32 minScaledXP = RoundXPValue(xpentry->Exp[RewardXPDifficulty]) * sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO) / 100;
uint32 minScaledXP = RoundXPValue(xpentry->Difficulty[RewardXPDifficulty]) * sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO) / 100;
xp = std::max(minScaledXP, xp);
}
+30 -30
View File
@@ -89,14 +89,14 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const
uint32 classMask = _player->getClassMask();
for (int i=0; i < 4; i++)
{
if ((factionEntry->BaseRepRaceMask[i] & raceMask ||
(factionEntry->BaseRepRaceMask[i] == 0 &&
factionEntry->BaseRepClassMask[i] != 0)) &&
(factionEntry->BaseRepClassMask[i] & classMask ||
(factionEntry->BaseRepClassMask[i] == 0 &&
factionEntry->BaseRepValue[i] != 0)))
if ((factionEntry->ReputationRaceMask[i] & raceMask ||
(factionEntry->ReputationRaceMask[i] == 0 &&
factionEntry->ReputationClassMask[i] != 0)) &&
(factionEntry->ReputationClassMask[i] & classMask ||
(factionEntry->ReputationClassMask[i] == 0 &&
factionEntry->ReputationBase[i] != 0)))
return factionEntry->BaseRepValue[i];
return factionEntry->ReputationBase[i];
}
// in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i] == 0
@@ -144,11 +144,11 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con
uint32 classMask = _player->getClassMask();
for (int i=0; i < 4; i++)
{
if ((factionEntry->BaseRepRaceMask[i] & raceMask ||
(factionEntry->BaseRepRaceMask[i] == 0 &&
factionEntry->BaseRepClassMask[i] != 0)) &&
(factionEntry->BaseRepClassMask[i] & classMask ||
factionEntry->BaseRepClassMask[i] == 0))
if ((factionEntry->ReputationRaceMask[i] & raceMask ||
(factionEntry->ReputationRaceMask[i] == 0 &&
factionEntry->ReputationClassMask[i] != 0)) &&
(factionEntry->ReputationClassMask[i] & classMask ||
factionEntry->ReputationClassMask[i] == 0))
return factionEntry->ReputationFlags[i];
}
@@ -264,11 +264,11 @@ void ReputationMgr::Initialize()
{
FactionEntry const* factionEntry = sFactionStore.LookupEntry(i);
if (factionEntry && (factionEntry->reputationListID >= 0))
if (factionEntry && (factionEntry->ReputationIndex >= 0))
{
FactionState newFaction;
newFaction.ID = factionEntry->ID;
newFaction.ReputationListID = factionEntry->reputationListID;
newFaction.ReputationListID = factionEntry->ReputationIndex;
newFaction.Standing = 0;
newFaction.Flags = GetDefaultStateFlags(factionEntry);
newFaction.needSend = true;
@@ -310,12 +310,12 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
// check for sub-factions that receive spillover
SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID);
// if has no sub-factions, check for factions with same parent
if (!flist && factionEntry->team && factionEntry->spilloverRateOut != 0.0f)
if (!flist && factionEntry->ParentFactionID && factionEntry->ParentFactionMod[1] != 0.0f)
{
spillOverRepOut *= factionEntry->spilloverRateOut;
if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->team))
spillOverRepOut *= factionEntry->ParentFactionMod[1];
if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->ParentFactionID))
{
FactionStateList::iterator parentState = _factions.find(parent->reputationListID);
FactionStateList::iterator parentState = _factions.find(parent->ReputationIndex);
// some team factions have own reputation standing, in this case do not spill to other sub-factions
if (parentState != _factions.end() && (parentState->second.Flags & FACTION_FLAG_SPECIAL))
{
@@ -323,7 +323,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
}
else // spill to "sister" factions
{
flist = GetFactionTeamList(factionEntry->team);
flist = GetFactionTeamList(factionEntry->ParentFactionID);
}
}
}
@@ -334,9 +334,9 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
{
if (FactionEntry const* factionEntryCalc = sFactionStore.LookupEntry(*itr))
{
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->spilloverMaxRankIn))
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->ParentFactionCap[0]))
continue;
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn);
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->ParentFactionCap[0]);
if (spilloverRep != 0 || !incremental)
res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental);
}
@@ -345,7 +345,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
}
// spillover done, update faction itself
FactionStateList::iterator faction = _factions.find(factionEntry->reputationListID);
FactionStateList::iterator faction = _factions.find(factionEntry->ReputationIndex);
if (faction != _factions.end())
{
// if we update spillover only, do not update main reputation (rank exceeds creature reward rate)
@@ -360,7 +360,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental)
{
FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID);
FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex);
if (itr != _factions.end())
{
int32 BaseRep = GetBaseReputation(factionEntry);
@@ -408,21 +408,21 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry)
{
if (!factionTemplateEntry->faction)
if (!factionTemplateEntry->Faction)
return;
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction))
// Never show factions of the opposing team
if (!(factionEntry->BaseRepRaceMask[1] & _player->getRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom))
if (!(factionEntry->ReputationRaceMask[1] & _player->getRaceMask() && factionEntry->ReputationBase[1] == Reputation_Bottom))
SetVisible(factionEntry);
}
void ReputationMgr::SetVisible(FactionEntry const* factionEntry)
{
if (factionEntry->reputationListID < 0)
if (factionEntry->ReputationIndex < 0)
return;
FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID);
FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex);
if (itr == _factions.end())
return;
@@ -523,9 +523,9 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result)
Field* fields = result->Fetch();
FactionEntry const* factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt16());
if (factionEntry && (factionEntry->reputationListID >= 0))
if (factionEntry && (factionEntry->ReputationIndex >= 0))
{
FactionState* faction = &_factions[factionEntry->reputationListID];
FactionState* faction = &_factions[factionEntry->ReputationIndex];
// update standing to current
faction->Standing = fields[1].GetInt32();
+2 -2
View File
@@ -85,7 +85,7 @@ class TC_GAME_API ReputationMgr
FactionState const* GetState(FactionEntry const* factionEntry) const
{
return factionEntry->CanHaveReputation() ? GetState(factionEntry->reputationListID) : nullptr;
return factionEntry->CanHaveReputation() ? GetState(factionEntry->ReputationIndex) : nullptr;
}
FactionState const* GetState(RepListID id) const
@@ -110,7 +110,7 @@ class TC_GAME_API ReputationMgr
ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const
{
ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->faction);
ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->Faction);
return forceItr != _forcedReactions.end() ? &forceItr->second : nullptr;
}
+3 -3
View File
@@ -1590,7 +1590,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
ASSERT(player);
ASSERT(trigger);
GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->id), tmpscript, false);
GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->ID), tmpscript, false);
return tmpscript->OnTrigger(player, trigger);
}
@@ -2211,7 +2211,7 @@ AreaTriggerScript::AreaTriggerScript(char const* name)
bool OnlyOnceAreaTriggerScript::OnTrigger(Player* player, AreaTriggerEntry const* trigger)
{
uint32 const triggerId = trigger->id;
uint32 const triggerId = trigger->ID;
if (InstanceScript* instance = player->GetInstanceScript())
{
if (instance->IsAreaTriggerDone(triggerId))
@@ -2222,7 +2222,7 @@ bool OnlyOnceAreaTriggerScript::OnTrigger(Player* player, AreaTriggerEntry const
return _OnTrigger(player, trigger);
}
void OnlyOnceAreaTriggerScript::ResetAreaTriggerDone(InstanceScript* script, uint32 triggerId) { script->ResetAreaTriggerDone(triggerId); }
void OnlyOnceAreaTriggerScript::ResetAreaTriggerDone(Player const* player, AreaTriggerEntry const* trigger) { if (InstanceScript* instance = player->GetInstanceScript()) ResetAreaTriggerDone(instance, trigger->id); }
void OnlyOnceAreaTriggerScript::ResetAreaTriggerDone(Player const* player, AreaTriggerEntry const* trigger) { if (InstanceScript* instance = player->GetInstanceScript()) ResetAreaTriggerDone(instance, trigger->ID); }
BattlegroundScript::BattlegroundScript(char const* name)
@@ -116,7 +116,7 @@ WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Fiel
VisualItems[slot].InvType = proto->InventoryType;
VisualItems[slot].DisplayID = proto->DisplayInfoID;
VisualItems[slot].DisplayEnchantID = enchant ? enchant->aura_id : 0;
VisualItems[slot].DisplayEnchantID = enchant ? enchant->ItemVisual : 0;
}
}
@@ -103,7 +103,7 @@ void ArchaeologyMgr::LoadData()
for (std::list<std::pair<uint16, uint32> >::iterator itr = sites.begin(); itr != sites.end();)
{
if (itr->second == entry->blobId)
if (itr->second == entry->QuestPOIBlobID)
{
uint16 site = itr->first;
uint16 poiRel = itr->second;
@@ -116,19 +116,19 @@ void ArchaeologyMgr::LoadData()
// Create Site Polygon
_polygonMap[site] = new SitePolygonGraph();
_polygonMap[site]->add_node(entry->x, entry->y);
_polygonMap[site]->add_node(entry->X, entry->Y);
for (uint32 j = 1; j < 12; j++)
{
entry = sQuestPOIPointStore.LookupEntry(++i);
if (poiRel != entry->blobId)
if (poiRel != entry->QuestPOIBlobID)
{
TC_LOG_ERROR("server.loading", "Archaeology: Tried to use POI %u not related to site %u", entry->id, poiRel);
TC_LOG_ERROR("server.loading", "Archaeology: Tried to use POI %u not related to site %u", entry->ID, poiRel);
break;
}
// Add new perimeter point
_polygonMap[site]->add_node(entry->x, entry->y);
_polygonMap[site]->add_node(entry->X, entry->Y);
}
// Generate ALL inscribed and boundary geometries for the polygon!
+2 -2
View File
@@ -122,7 +122,7 @@ void LoadSkillDiscoveryTable()
}
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance));
SkillDiscoveryStore[-int32(_spell_idx->second->SkillLine)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance));
}
else
{
@@ -164,7 +164,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
return 0;
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : uint32(0);
uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->SkillLine) : uint32(0);
float full_chance = 0;
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
@@ -499,13 +499,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
{
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; k++)
{
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]);
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]);
if (pEnchant)
{
for (int t = 0; t < MAX_ITEM_ENCHANTMENT_EFFECTS; t++)
if (pEnchant->spellid[t] == m_spellInfo->Id)
if (pEnchant->EffectArg[t] == m_spellInfo->Id)
{
amount = uint32((item_rand_suffix->prefix[k]*castItem->GetItemSuffixFactor()) / 10000);
amount = uint32((item_rand_suffix->AllocationPct[k]*castItem->GetItemSuffixFactor()) / 10000);
break;
}
}
@@ -554,7 +554,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
case SPELL_AURA_MOUNTED:
if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(uint32(GetMiscValueB())))
{
amount = mountCapability->Id;
amount = mountCapability->ID;
m_canBeRecalculated = true;
}
break;
@@ -1319,12 +1319,12 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
{
if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId))
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellID);
if (!spellInfo || !(spellInfo->HasAttribute(SPELL_ATTR0_PASSIVE) || spellInfo->HasAttribute(SPELL_ATTR0_HIDDEN_CLIENTSIDE)))
continue;
if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
target->CastSpell(target, glyph->SpellId, true, nullptr, this);
target->CastSpell(target, glyph->SpellID, true, nullptr, this);
}
}
}
@@ -1962,12 +1962,12 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
// Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
{
if (!shapeInfo->stanceSpell[i])
if (!shapeInfo->PresetSpellID[i])
continue;
if (apply)
target->ToPlayer()->AddTemporarySpell(shapeInfo->stanceSpell[i]);
target->ToPlayer()->AddTemporarySpell(shapeInfo->PresetSpellID[i]);
else
target->ToPlayer()->RemoveTemporarySpell(shapeInfo->stanceSpell[i]);
target->ToPlayer()->RemoveTemporarySpell(shapeInfo->PresetSpellID[i]);
}
}
}
@@ -2697,7 +2697,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
// cast speed aura
if (mode & AURA_EFFECT_HANDLE_REAL)
if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount()))
target->CastSpell(target, mountCapability->SpeedModSpell, true);
target->CastSpell(target, mountCapability->ModSpellAuraID, true);
}
else
{
@@ -2711,7 +2711,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
// remove speed aura
if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount()))
target->RemoveAurasDueToSpell(mountCapability->SpeedModSpell, target->GetGUID());
target->RemoveAurasDueToSpell(mountCapability->ModSpellAuraID, target->GetGUID());
}
}
}
@@ -5059,7 +5059,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
target->SetUInt16Value(PLAYER_FIELD_BYTES2, PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET, overrideId);
if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
if (uint32 spellId = overrideSpells->spellId[i])
if (uint32 spellId = overrideSpells->Spells[i])
target->AddTemporarySpell(spellId);
}
else
@@ -5067,7 +5067,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
target->SetUInt16Value(PLAYER_FIELD_BYTES2, PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET, 0);
if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
if (uint32 spellId = overrideSpells->spellId[i])
if (uint32 spellId = overrideSpells->Spells[i])
target->RemoveTemporarySpell(spellId);
}
}
+11 -11
View File
@@ -4986,7 +4986,7 @@ void Spell::TakeRunePower(SpellMissInfo hitInfo)
player->ClearLastUsedRuneMask();
int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death
int32 runicPowerGain = runeCostData->runePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME);
int32 runicPowerGain = runeCostData->RunicPower * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME);
// Apply rune cost modifiers
for (uint32 i = 0; i < RUNE_DEATH; ++i)
@@ -5634,7 +5634,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
{
uint32 glyphId = m_spellInfo->Effects[i].MiscValue;
if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyphId))
if (m_caster->HasAura(gp->SpellId))
if (m_caster->HasAura(gp->SpellID))
return SPELL_FAILED_UNIQUE_GLYPH;
break;
}
@@ -5823,7 +5823,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
SummonPropertiesEntry const* SummonProperties = sSummonPropertiesStore.LookupEntry(m_spellInfo->Effects[i].MiscValueB);
if (!SummonProperties)
break;
switch (SummonProperties->Category)
switch (SummonProperties->Control)
{
case SUMMON_CATEGORY_PET:
if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && m_caster->GetPetGUID())
@@ -6442,7 +6442,7 @@ SpellCastResult Spell::CheckRange(bool strict) const
std::tie(minRange, maxRange) = GetMinMaxRange(strict);
// dont check max_range to strictly after cast
if (m_spellInfo->RangeEntry && m_spellInfo->RangeEntry->type != SPELL_RANGE_MELEE && !strict)
if (m_spellInfo->RangeEntry && m_spellInfo->RangeEntry->Flags != SPELL_RANGE_MELEE && !strict)
maxRange += std::min(MAX_SPELL_RANGE_TOLERANCE, maxRange*0.1f); // 10% but no more than MAX_SPELL_RANGE_TOLERANCE
// get square values for sqr distance checks
@@ -6495,14 +6495,14 @@ std::pair<float, float> Spell::GetMinMaxRange(bool strict) const
if (m_spellInfo->RangeEntry)
{
Unit* target = m_targets.GetUnitTarget();
if (m_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE)
if (m_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE)
{
rangeMod = m_caster->GetMeleeRange(target ? target : m_caster); // when the target is not a unit, take the caster's combat reach as the target's combat reach.
}
else
{
float meleeRange = 0.0f;
if (m_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED)
if (m_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED)
meleeRange = m_caster->GetMeleeRange(target ? target : m_caster); // when the target is not a unit, take the caster's combat reach as the target's combat reach.
minRange = m_caster->GetSpellMinRangeForTarget(target, m_spellInfo) + meleeRange;
@@ -6512,13 +6512,13 @@ std::pair<float, float> Spell::GetMinMaxRange(bool strict) const
{
rangeMod = m_caster->GetCombatReach() + (target ? target->GetCombatReach() : m_caster->GetCombatReach());
if (minRange > 0.0f && !(m_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED))
if (minRange > 0.0f && !(m_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED))
minRange += rangeMod;
}
}
if (target && m_caster->isMoving() && target->isMoving() && !m_caster->IsWalking() && !target->IsWalking() &&
(m_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER))
(m_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER))
rangeMod += 8.0f / 3.0f;
}
@@ -6803,7 +6803,7 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 /
{
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
switch (enchantEntry->type[s])
switch (enchantEntry->Effect[s])
{
case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
if (isItemUsable)
@@ -6829,7 +6829,7 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 /
{
if (!enchantEntry)
return SPELL_FAILED_ERROR;
if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
break;
@@ -6846,7 +6846,7 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 /
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if (!pEnchant)
return SPELL_FAILED_ERROR;
if (pEnchant->slot & ENCHANTMENT_CAN_SOULBOUND)
if (pEnchant->Flags & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
+12 -12
View File
@@ -1852,7 +1852,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
// however so far noone found a generic check to find all of those (there's no related data in summonproperties.dbc
// and in spell attributes, possibly we need to add a table for those)
// so here's a list of MiscValueB values, which is currently most generic check
switch (properties->Id)
switch (properties->ID)
{
case 64:
case 61:
@@ -1878,7 +1878,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
break;
}
switch (properties->Category)
switch (properties->Control)
{
case SUMMON_CATEGORY_WILD:
case SUMMON_CATEGORY_ALLY:
@@ -1888,7 +1888,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
SummonGuardian(effIndex, entry, properties, numSummons);
break;
}
switch (properties->Type)
switch (properties->Title)
{
case SUMMON_TYPE_PET:
case SUMMON_TYPE_GUARDIAN:
@@ -1952,7 +1952,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (!summon)
continue;
if (properties->Category == SUMMON_CATEGORY_ALLY)
if (properties->Control == SUMMON_CATEGORY_ALLY)
{
summon->SetOwnerGUID(m_originalCaster->GetGUID());
summon->SetFaction(m_originalCaster->GetFaction());
@@ -2266,12 +2266,12 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex)
if (!rcEntry)
return;
SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTier);
SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID);
if (!tier)
return;
uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid);
unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max<uint16>(skillval, 1), tier->MaxSkill[damage - 1]);
unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max<uint16>(skillval, 1), tier->Value[damage - 1]);
}
void Spell::EffectPlayMovie(SpellEffIndex effIndex)
@@ -2390,7 +2390,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
bool add_socket = false;
for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i)
{
if (enchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
if (enchant->Effect[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
{
add_socket = true;
break;
@@ -3877,7 +3877,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
{
if (GlyphSlotEntry const* newGlyphSlot = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex)))
{
if (newGlyphProperties->TypeFlags != newGlyphSlot->TypeFlags)
if (newGlyphProperties->GlyphSlotFlags != newGlyphSlot->Type)
{
SendCastResult(SPELL_FAILED_INVALID_GLYPH);
return; // glyph slot mismatch
@@ -3889,12 +3889,12 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
{
if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph))
{
player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId);
player->RemoveAurasDueToSpell(oldGlyphProperties->SpellID);
player->SetGlyph(m_glyphIndex, 0);
}
}
player->CastSpell(m_caster, newGlyphProperties->SpellId, true);
player->CastSpell(m_caster, newGlyphProperties->SpellID, true);
player->SetGlyph(m_glyphIndex, newGlyph);
player->SendTalentsInfoData(false);
}
@@ -3903,7 +3903,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
{
if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph))
{
player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId);
player->RemoveAurasDueToSpell(oldGlyphProperties->SpellID);
player->SetGlyph(m_glyphIndex, 0);
player->SendTalentsInfoData(false);
}
@@ -5366,7 +5366,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
summon->SetFullHealth();
}
if (properties && properties->Category == SUMMON_CATEGORY_ALLY)
if (properties && properties->Control == SUMMON_CATEGORY_ALLY)
summon->SetFaction(caster->GetFaction());
if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && m_targets.HasDst())
+1 -1
View File
@@ -351,7 +351,7 @@ void SpellHistory::StartCooldown(SpellInfo const* spellInfo, uint32 itemId, Spel
SpellCategoryEntry const* categoryEntry = sSpellCategoryStore.AssertEntry(categoryId);
if (categoryEntry->Flags & SPELL_CATEGORY_FLAG_COOLDOWN_EXPIRES_AT_DAILY_RESET)
{
uint32 parentCategoryId = GetParentSpellCategoryId(categoryEntry->Id);
uint32 parentCategoryId = GetParentSpellCategoryId(categoryEntry->ID);
SpellCategoryEntry const* parentCategory = sSpellCategoryStore.LookupEntry(parentCategoryId);
if (parentCategory && parentCategory->UsesPerWeek)
+90 -90
View File
@@ -353,15 +353,15 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con
_spellInfo = spellInfo;
_effIndex = _effect ? _effect->EffectIndex : effIndex;
Effect = _effect ? _effect->Effect : 0;
ApplyAuraName = _effect ? _effect->EffectApplyAuraName : 0;
Amplitude = _effect ? _effect->EffectAmplitude : 0;
ApplyAuraName = _effect ? _effect->EffectAura : 0;
Amplitude = _effect ? _effect->EffectAuraPeriod : 0;
DieSides = _effect ? _effect->EffectDieSides : 0;
RealPointsPerLevel = _effect ? _effect->EffectRealPointsPerLevel : 0.0f;
BasePoints = _effect ? _effect->EffectBasePoints : 0;
PointsPerComboPoint = _effect ? _effect->EffectPointsPerComboPoint : 0.0f;
ValueMultiplier = _effect ? _effect->EffectValueMultiplier : 0.0f;
DamageMultiplier = _effect ? _effect->EffectDamageMultiplier : 0.0f;
BonusMultiplier = _effect ? _effect->EffectBonusMultiplier : 0.0f;
PointsPerComboPoint = _effect ? _effect->EffectPointsPerResource : 0.0f;
ValueMultiplier = _effect ? _effect->EffectAmplitude : 0.0f;
DamageMultiplier = _effect ? _effect->EffectChainAmplitude : 0.0f;
BonusMultiplier = _effect ? _effect->EffectBonusCoefficient : 0.0f;
MiscValue = _effect ? _effect->EffectMiscValue : 0;
MiscValueB = _effect ? _effect->EffectMiscValueB : 0;
Mechanic = Mechanics(_effect ? _effect->EffectMechanic : 0);
@@ -369,14 +369,14 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con
TargetB = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetB : 0);
RadiusEntry = _effect && _effect->EffectRadiusIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusIndex) : nullptr;
MaxRadiusEntry = _effect && _effect->EffectRadiusMaxIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusMaxIndex) : nullptr;
ChainTarget = _effect ? _effect->EffectChainTarget : 0;
ChainTarget = _effect ? _effect->EffectChainTargets : 0;
ItemType = _effect ? _effect->EffectItemType : 0;
TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0;
SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag96(0);
ImplicitTargetConditions = nullptr;
ScalingMultiplier = scaling ? scaling->Multiplier[_effIndex] : 0.0f;
DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[_effIndex] : 0.0f;
ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[_effIndex] : 0.0f;
ScalingMultiplier = scaling ? scaling->Coefficient[_effIndex] : 0.0f;
DeltaScalingMultiplier = scaling ? scaling->Variance[_effIndex] : 0.0f;
ComboScalingMultiplier = scaling ? scaling->ComboPointsCoefficient[_effIndex] : 0.0f;
}
bool SpellEffectInfo::IsEffect() const
@@ -854,7 +854,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] =
SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects)
{
Id = spellEntry->Id;
Id = spellEntry->ID;
Attributes = spellEntry->Attributes;
AttributesEx = spellEntry->AttributesEx;
AttributesEx2 = spellEntry->AttributesEx2;
@@ -869,36 +869,36 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
AttributesCu = 0;
CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : nullptr;
DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : nullptr;
PowerType = spellEntry->powerType;
RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : nullptr;
Speed = spellEntry->speed;
PowerType = spellEntry->PowerType;
RangeEntry = spellEntry->RangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->RangeIndex) : nullptr;
Speed = spellEntry->Speed;
for (uint8 i = 0; i < 2; ++i)
SpellVisual[i] = spellEntry->SpellVisual[i];
SpellVisual[i] = spellEntry->SpellVisualID[i];
SpellIconID = spellEntry->SpellIconID;
ActiveIconID = spellEntry->activeIconID;
SpellName = spellEntry->SpellName;
Rank = spellEntry->Rank;
ActiveIconID = spellEntry->ActiveIconID;
SpellName = spellEntry->Name;
Rank = spellEntry->NameSubtext;
SchoolMask = spellEntry->SchoolMask;
RuneCostID = spellEntry->runeCostID;
SpellDifficultyId = spellEntry->SpellDifficultyId;
SpellScalingId = spellEntry->SpellScalingId;
SpellAuraOptionsId = spellEntry->SpellAuraOptionsId;
SpellAuraRestrictionsId = spellEntry->SpellAuraRestrictionsId;
SpellCastingRequirementsId = spellEntry->SpellCastingRequirementsId;
SpellCategoriesId = spellEntry->SpellCategoriesId;
SpellClassOptionsId = spellEntry->SpellClassOptionsId;
SpellCooldownsId = spellEntry->SpellCooldownsId;
SpellEquippedItemsId = spellEntry->SpellEquippedItemsId;
SpellInterruptsId = spellEntry->SpellInterruptsId;
SpellLevelsId = spellEntry->SpellLevelsId;
SpellPowerId = spellEntry->SpellPowerId;
SpellReagentsId = spellEntry->SpellReagentsId;
SpellShapeshiftId = spellEntry->SpellShapeshiftId;
SpellTargetRestrictionsId = spellEntry->SpellTargetRestrictionsId;
SpellTotemsId = spellEntry->SpellTotemsId;
ResearchProjectId = spellEntry->ResearchProjectId;
RuneCostID = spellEntry->RuneCostID;
SpellDifficultyId = spellEntry->Difficulty;
SpellScalingId = spellEntry->ScalingID;
SpellAuraOptionsId = spellEntry->AuraOptionsID;
SpellAuraRestrictionsId = spellEntry->AuraRestrictionsID;
SpellCastingRequirementsId = spellEntry->CastingRequirementsID;
SpellCategoriesId = spellEntry->CategoriesID;
SpellClassOptionsId = spellEntry->ClassOptionsID;
SpellCooldownsId = spellEntry->CooldownsID;
SpellEquippedItemsId = spellEntry->EquippedItemsID;
SpellInterruptsId = spellEntry->InterruptsID;
SpellLevelsId = spellEntry->LevelsID;
SpellPowerId = spellEntry->PowerDisplayID;
SpellReagentsId = spellEntry->ReagentsID;
SpellShapeshiftId = spellEntry->ShapeshiftID;
SpellTargetRestrictionsId = spellEntry->TargetRestrictionsID;
SpellTotemsId = spellEntry->TotemsID;
ResearchProjectId = spellEntry->RequiredProjectID;
// SpellDifficultyEntry
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -909,47 +909,47 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
CastTimeMin = _scaling ? _scaling->CastTimeMin : 0;
CastTimeMax = _scaling ?_scaling->CastTimeMax : 0;
CastTimeMaxLevel = _scaling ? _scaling->CastTimeMaxLevel : 0;
ScalingClass = _scaling ? _scaling->ScalingClass : 0;
CoefBase = _scaling ? _scaling->CoefBase : 0;
CoefLevelBase = _scaling ? _scaling->CoefLevelBase : 0;
ScalingClass = _scaling ? _scaling->Class : 0;
CoefBase = _scaling ? _scaling->NerfFactor : 0;
CoefLevelBase = _scaling ? _scaling->NerfMaxLevel : 0;
// SpellAuraOptionsEntry
SpellAuraOptionsEntry const* _options = GetSpellAuraOptions();
ProcFlags = _options ? _options->procFlags : 0;
ProcChance = _options ? _options->procChance : 0;
ProcCharges = _options ? _options->procCharges : 0;
StackAmount = _options ? _options->StackAmount : 0;
ProcFlags = _options ? _options->ProcTypeMask : 0;
ProcChance = _options ? _options->ProcChance : 0;
ProcCharges = _options ? _options->ProcCharges : 0;
StackAmount = _options ? _options->CumulativeAura : 0;
// SpellAuraRestrictionsEntry
SpellAuraRestrictionsEntry const* _aura = GetSpellAuraRestrictions();
CasterAuraState = _aura ? _aura->CasterAuraState : 0;
TargetAuraState = _aura ? _aura->TargetAuraState : 0;
CasterAuraStateNot = _aura ? _aura->CasterAuraStateNot : 0;
TargetAuraStateNot = _aura ? _aura->TargetAuraStateNot : 0;
CasterAuraSpell = _aura ? _aura->casterAuraSpell : 0;
TargetAuraSpell = _aura ? _aura->targetAuraSpell : 0;
ExcludeCasterAuraSpell = _aura ? _aura->excludeCasterAuraSpell : 0;
ExcludeTargetAuraSpell = _aura ? _aura->excludeTargetAuraSpell : 0;
CasterAuraStateNot = _aura ? _aura->ExcludeCasterAuraState : 0;
TargetAuraStateNot = _aura ? _aura->ExcludeTargetAuraState : 0;
CasterAuraSpell = _aura ? _aura->CasterAuraSpell : 0;
TargetAuraSpell = _aura ? _aura->TargetAuraSpell : 0;
ExcludeCasterAuraSpell = _aura ? _aura->ExcludeCasterAuraSpell : 0;
ExcludeTargetAuraSpell = _aura ? _aura->ExcludeTargetAuraSpell : 0;
// SpellCastingRequirementsEntry
SpellCastingRequirementsEntry const* _castreq = GetSpellCastingRequirements();
RequiresSpellFocus = _castreq ? _castreq->RequiresSpellFocus : 0;
FacingCasterFlags = _castreq ? _castreq->FacingCasterFlags : 0;
AreaGroupId = _castreq ? _castreq->AreaGroupId : -1;
AreaGroupId = _castreq ? _castreq->RequiredAreasID : -1;
// SpellCategoriesEntry
SpellCategoriesEntry const* _categorie = GetSpellCategories();
CategoryEntry = _categorie ? sSpellCategoryStore.LookupEntry(_categorie->Category) : nullptr;
Dispel = _categorie ? _categorie->Dispel : 0;
Dispel = _categorie ? _categorie->DispelType : 0;
Mechanic = _categorie ? _categorie->Mechanic : 0;
StartRecoveryCategory = _categorie ? _categorie->StartRecoveryCategory : 0;
DmgClass = _categorie ? _categorie->DmgClass : 0;
DmgClass = _categorie ? _categorie->DefenseType : 0;
PreventionType = _categorie ? _categorie->PreventionType : 0;
// SpellClassOptionsEntry
SpellClassOptionsEntry const* _class = GetSpellClassOptions();
SpellFamilyName = _class ? _class->SpellFamilyName : 0;
SpellFamilyFlags = _class ? _class->SpellFamilyFlags : flag96(0);
SpellFamilyName = _class ? _class->SpellClassSet : 0;
SpellFamilyFlags = _class ? _class->SpellFamilyMask : flag96(0);
// SpellCooldownsEntry
SpellCooldownsEntry const* _cooldowns = GetSpellCooldowns();
@@ -960,40 +960,40 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellEquippedItemsEntry
SpellEquippedItemsEntry const* _equipped = GetSpellEquippedItems();
EquippedItemClass = _equipped ? _equipped->EquippedItemClass : -1;
EquippedItemSubClassMask = _equipped ?_equipped->EquippedItemSubClassMask : -1;
EquippedItemInventoryTypeMask = _equipped ? _equipped->EquippedItemInventoryTypeMask : -1;
EquippedItemSubClassMask = _equipped ?_equipped->EquippedItemSubclass : -1;
EquippedItemInventoryTypeMask = _equipped ? _equipped->EquippedItemInvTypes : -1;
// SpellInterruptsEntry
SpellInterruptsEntry const* _interrupt = GetSpellInterrupts();
InterruptFlags = _interrupt ? _interrupt->InterruptFlags : 0;
AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags : 0;
ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags : 0;
AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags[0] : 0;
ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags[0] : 0;
// SpellLevelsEntry
SpellLevelsEntry const* _levels = GetSpellLevels();
MaxLevel = _levels ? _levels->maxLevel : 0;
BaseLevel = _levels ? _levels->baseLevel : 0;
SpellLevel = _levels ? _levels->spellLevel : 0;
MaxLevel = _levels ? _levels->MaxLevel : 0;
BaseLevel = _levels ? _levels->BaseLevel : 0;
SpellLevel = _levels ? _levels->SpellLevel : 0;
// SpellPowerEntry
SpellPowerEntry const* _power = GetSpellPower();
ManaCost = _power ? _power->manaCost : 0;
ManaCostPerlevel = _power ? _power->manaCostPerlevel : 0;
ManaCostPercentage = _power ? _power->ManaCostPercentage : 0;
ManaPerSecond = _power ? _power->manaPerSecond : 0;
ManaCost = _power ? _power->ManaCost : 0;
ManaCostPerlevel = _power ? _power->ManaCostPerLevel : 0;
ManaCostPercentage = _power ? _power->PowerCostPct : 0;
ManaPerSecond = _power ? _power->ManaPerSecond : 0;
// SpellReagentsEntry
SpellReagentsEntry const* _reagents = GetSpellReagents();
for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i)
Reagent[i] = _reagents ? _reagents->Reagent[i] : 0;
Reagent[i] = _reagents ? _reagents->Reagents[i] : 0;
for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i)
ReagentCount[i] = _reagents ? _reagents->ReagentCount[i] : 0;
// SpellShapeshiftEntry
if (SpellShapeshiftEntry const* _shapeshift = GetSpellShapeshift())
{
Stances = MAKE_PAIR64(_shapeshift->Stances[0], _shapeshift->Stances[1]);
StancesNot = MAKE_PAIR64(_shapeshift->StancesNot[0], _shapeshift->StancesNot[1]);
Stances = MAKE_PAIR64(_shapeshift->ShapeshiftMask[0], _shapeshift->ShapeshiftMask[1]);
StancesNot = MAKE_PAIR64(_shapeshift->ShapeshiftExclude[0], _shapeshift->ShapeshiftExclude[1]);
}
else
{
@@ -1006,13 +1006,13 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
ConeAngle = _target ? _target->ConeAngle : 0.f;
Targets = _target ? _target->Targets : 0;
TargetCreatureType = _target ? _target->TargetCreatureType : 0;
MaxAffectedTargets = _target ? _target->MaxAffectedTargets : 0;
MaxAffectedTargets = _target ? _target->MaxTargets : 0;
MaxTargetLevel = _target ? _target->MaxTargetLevel : 0;
// SpellTotemsEntry
SpellTotemsEntry const* _totem = GetSpellTotems();
for (uint8 i = 0; i < 2; ++i)
TotemCategory[i] = _totem ? _totem->TotemCategory[i] : 0;
TotemCategory[i] = _totem ? _totem->RequiredTotemCategoryID[i] : 0;
for (uint8 i = 0; i < 2; ++i)
Totem[i] = _totem ? _totem->Totem[i] : 0;
@@ -1033,7 +1033,7 @@ SpellInfo::~SpellInfo()
uint32 SpellInfo::GetCategory() const
{
return CategoryEntry ? CategoryEntry->Id : 0;
return CategoryEntry ? CategoryEntry->ID : 0;
}
bool SpellInfo::HasEffect(SpellEffects effect) const
@@ -1163,10 +1163,10 @@ bool SpellInfo::IsAbilityLearnedWithProfession() const
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
{
SkillLineAbilityEntry const* pAbility = _spell_idx->second;
if (!pAbility || pAbility->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
if (!pAbility || pAbility->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
continue;
if (pAbility->req_skill_value > 0)
if (pAbility->MinSkillLineRank > 0)
return true;
}
@@ -1178,7 +1178,7 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id);
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
if (_spell_idx->second->skillId == uint32(skillType))
if (_spell_idx->second->SkillLine == uint32(skillType))
return true;
return false;
@@ -1599,7 +1599,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
TC_LOG_ERROR("spells", "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
return SPELL_CAST_OK;
}
actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells
actAsShifted = !(shapeInfo->Flags & 1); // shapeshift acts as normal form for spells
}
if (actAsShifted)
@@ -1619,7 +1619,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
// Check if stance disables cast of not-stance spells
// Example: cannot cast any other spells in zombie or ghoul form
/// @todo Find a way to disable use of these spells clientside
if (shapeInfo && shapeInfo->flags1 & 0x400)
if (shapeInfo && shapeInfo->Flags & 0x400)
{
if (!(stanceMask & Stances))
return SPELL_FAILED_ONLY_SHAPESHIFT;
@@ -1638,12 +1638,12 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
while (groupEntry)
{
for (uint8 i = 0; i < MAX_GROUP_AREA_IDS; ++i)
if (groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id)
if (groupEntry->AreaID[i] == zone_id || groupEntry->AreaID[i] == area_id)
found = true;
if (found || !groupEntry->nextGroup)
if (found || !groupEntry->NextAreaID)
break;
// Try search in next group
groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup);
groupEntry = sAreaGroupStore.LookupEntry(groupEntry->NextAreaID);
}
if (!found)
@@ -1980,7 +1980,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const
if (Effects[effIndex].ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT)
{
SpellShapeshiftFormEntry const* shapeShiftFromEntry = sSpellShapeshiftFormStore.LookupEntry(Effects[effIndex].MiscValue);
if (shapeShiftFromEntry && (shapeShiftFromEntry->flags1 & 1) == 0) // unk flag
if (shapeShiftFromEntry && (shapeShiftFromEntry->Flags & 1) == 0) // unk flag
checkMask |= VEHICLE_SEAT_FLAG_UNCONTROLLED;
break;
}
@@ -1997,11 +1997,11 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
if (!HasAttribute(SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_MOUNTED)
&& (vehicleSeat->m_flags & checkMask) != checkMask)
&& (vehicleSeat->Flags & checkMask) != checkMask)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
// Can only summon uncontrolled minions/guardians when on controlled vehicle
if (vehicleSeat->m_flags & (VEHICLE_SEAT_FLAG_CAN_CONTROL | VEHICLE_SEAT_FLAG_UNK2))
if (vehicleSeat->Flags & (VEHICLE_SEAT_FLAG_CAN_CONTROL | VEHICLE_SEAT_FLAG_UNK2))
{
for (uint32 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
{
@@ -2009,7 +2009,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const
continue;
SummonPropertiesEntry const* props = sSummonPropertiesStore.LookupEntry(Effects[i].MiscValueB);
if (props && props->Category != SUMMON_CATEGORY_WILD)
if (props && props->Control != SUMMON_CATEGORY_WILD)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
}
}
@@ -3192,8 +3192,8 @@ float SpellInfo::GetMinRange(bool positive) const
if (!RangeEntry)
return 0.0f;
if (positive)
return RangeEntry->minRangeFriend;
return RangeEntry->minRangeHostile;
return RangeEntry->RangeMin[1];
return RangeEntry->RangeMin[0];
}
float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
@@ -3202,9 +3202,9 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
return 0.0f;
float range;
if (positive)
range = RangeEntry->maxRangeFriend;
range = RangeEntry->RangeMax[1];
else
range = RangeEntry->maxRangeHostile;
range = RangeEntry->RangeMax[0];
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
@@ -3215,14 +3215,14 @@ int32 SpellInfo::GetDuration() const
{
if (!DurationEntry)
return 0;
return (DurationEntry->Duration[0] == -1) ? -1 : abs(DurationEntry->Duration[0]);
return (DurationEntry->Duration == -1) ? -1 : abs(DurationEntry->Duration);
}
int32 SpellInfo::GetMaxDuration() const
{
if (!DurationEntry)
return 0;
return (DurationEntry->Duration[2] == -1) ? -1 : abs(DurationEntry->Duration[2]);
return (DurationEntry->MaxDuration == -1) ? -1 : abs(DurationEntry->MaxDuration);
}
uint32 SpellInfo::CalcCastTime(uint8 level, Spell* spell /*= nullptr*/) const
@@ -3239,7 +3239,7 @@ uint32 SpellInfo::CalcCastTime(uint8 level, Spell* spell /*= nullptr*/) const
castTime = CastTimeMin + int32(level - 1) * (CastTimeMax - CastTimeMin) / (CastTimeMaxLevel - 1);
}
else if (CastTimeEntry)
castTime = CastTimeEntry->CastTime;
castTime = CastTimeEntry->Base;
if (!castTime)
return 0;
+32 -32
View File
@@ -36,20 +36,20 @@
bool IsPrimaryProfessionSkill(uint32 skill)
{
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill);
return pSkill && pSkill->categoryId == SKILL_CATEGORY_PROFESSION;
return pSkill && pSkill->CategoryID == SKILL_CATEGORY_PROFESSION;
}
bool IsWeaponSkill(uint32 skill)
{
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill);
return pSkill && pSkill->categoryId == SKILL_CATEGORY_WEAPON;
return pSkill && pSkill->CategoryID == SKILL_CATEGORY_WEAPON;
}
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
{
SkillLineAbilityMapBounds skillBounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
for (SkillLineAbilityMap::const_iterator itr = skillBounds.first; itr != skillBounds.second; ++itr)
if (itr->second->skillId == skillId)
if (itr->second->SkillLine == skillId)
return true;
return false;
@@ -200,20 +200,20 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
return spellId; //return source spell
}
if (difficultyEntry->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC)
if (difficultyEntry->DifficultySpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC)
{
TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is nullptr, using mode %u", spellId, mode, mode - 2);
mode -= 2;
}
if (difficultyEntry->SpellID[mode] <= 0)
if (difficultyEntry->DifficultySpellID[mode] <= 0)
{
TC_LOG_ERROR("sql.sql", "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spellId, mode);
return spellId;
}
TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]);
return uint32(difficultyEntry->SpellID[mode]);
TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->DifficultySpellID[mode]);
return uint32(difficultyEntry->DifficultySpellID[mode]);
}
SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const
@@ -805,9 +805,9 @@ void SpellMgr::LoadSpellTalentRanks()
SpellInfo const* lastSpell = nullptr;
for (uint8 rank = MAX_TALENT_RANK - 1; rank > 0; --rank)
{
if (talentInfo->RankID[rank])
if (talentInfo->SpellRank[rank])
{
lastSpell = GetSpellInfo(talentInfo->RankID[rank]);
lastSpell = GetSpellInfo(talentInfo->SpellRank[rank]);
break;
}
}
@@ -815,17 +815,17 @@ void SpellMgr::LoadSpellTalentRanks()
if (!lastSpell)
continue;
SpellInfo const* firstSpell = GetSpellInfo(talentInfo->RankID[0]);
SpellInfo const* firstSpell = GetSpellInfo(talentInfo->SpellRank[0]);
if (!firstSpell)
{
TC_LOG_ERROR("spells", "SpellMgr::LoadSpellTalentRanks: First Rank Spell %u for TalentEntry %u does not exist.", talentInfo->RankID[0], i);
TC_LOG_ERROR("spells", "SpellMgr::LoadSpellTalentRanks: First Rank Spell %u for TalentEntry %u does not exist.", talentInfo->SpellRank[0], i);
continue;
}
SpellInfo const* prevSpell = nullptr;
for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank)
{
uint32 spellId = talentInfo->RankID[rank];
uint32 spellId = talentInfo->SpellRank[rank];
if (!spellId)
break;
@@ -842,7 +842,7 @@ void SpellMgr::LoadSpellTalentRanks()
node.rank = rank + 1;
node.prev = prevSpell;
node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[node.rank]) : nullptr;
node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->SpellRank[node.rank]) : nullptr;
mSpellChains[spellId] = node;
mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId];
@@ -1192,7 +1192,7 @@ void SpellMgr::LoadSpellLearnSpells()
for (uint32 m = 0; m < MAX_MASTERY_SPELLS; ++m)
{
uint32 mastery = talentTab->MasterySpellId[m];
uint32 mastery = talentTab->MasterySpellID[m];
if (!mastery)
continue;
@@ -2028,11 +2028,11 @@ void SpellMgr::LoadSkillLineAbilityMap()
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
{
SkillLineAbilityEntry const* SkillInfo = sSkillLineAbilityStore.LookupEntry(i);
if (!SkillInfo)
SkillLineAbilityEntry const* skillInfo = sSkillLineAbilityStore.LookupEntry(i);
if (!skillInfo)
continue;
mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo));
mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(skillInfo->Spell, skillInfo));
++count;
}
@@ -2257,7 +2257,7 @@ void SpellMgr::LoadPetLevelupSpellMap()
for (uint8 j = 0; j < 2; ++j)
{
if (!creatureFamily->skillLine[j])
if (!creatureFamily->SkillLine[j])
continue;
for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k)
@@ -2270,13 +2270,13 @@ void SpellMgr::LoadPetLevelupSpellMap()
// (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1]))
// continue;
if (skillLine->skillId != creatureFamily->skillLine[j])
if (skillLine->SkillLine != creatureFamily->SkillLine[j])
continue;
if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
SpellInfo const* spell = GetSpellInfo(skillLine->spellId);
SpellInfo const* spell = GetSpellInfo(skillLine->Spell);
if (!spell) // not exist or triggered or talent
continue;
@@ -2368,7 +2368,7 @@ void SpellMgr::LoadPetDefaultSpells()
int32 petSpellsId = -int32(itr->second.PetSpellDataId);
PetDefaultSpellsEntry petDefSpells;
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
petDefSpells.spellid[j] = spellDataEntry->spellId[j];
petDefSpells.spellid[j] = spellDataEntry->Spells[j];
if (LoadPetDefaultSpells_helper(&itr->second, petDefSpells))
{
@@ -2633,10 +2633,10 @@ void SpellMgr::LoadSpellInfoStore()
std::unordered_map<uint32, SpellEffectArray> effectsBySpell;
for (SpellEffectEntry const* effect : sSpellEffectStore)
effectsBySpell[effect->EffectSpellId].effects[effect->EffectIndex] = effect;
effectsBySpell[effect->SpellID].effects[effect->EffectIndex] = effect;
for (SpellEntry const* spellEntry : sSpellStore)
mSpellInfoMap[spellEntry->Id] = new SpellInfo(spellEntry, effectsBySpell[spellEntry->Id].effects);
mSpellInfoMap[spellEntry->ID] = new SpellInfo(spellEntry, effectsBySpell[spellEntry->ID].effects);
for (uint32 spellIndex = 0; spellIndex < GetSpellInfoStoreSize(); ++spellIndex)
{
@@ -2777,10 +2777,10 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]);
SpellInfo* procInfo = _GetSpellInfo(enchant->EffectArg[s]);
if (!procInfo)
continue;
@@ -2813,9 +2813,9 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
// add custom attribute to liquid auras
for (LiquidTypeEntry const* liquid : sLiquidTypeStore)
{
if (liquid->SpellId)
if (liquid->SpellID)
{
spellInfo = _GetSpellInfo(liquid->SpellId);
spellInfo = _GetSpellInfo(liquid->SpellID);
if (spellInfo)
spellInfo->AttributesCu |= SPELL_ATTR0_CU_LIQUID_AURA;
}
@@ -5692,13 +5692,13 @@ void SpellMgr::LoadSpellInfoCorrections()
}
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121)))
properties->Type = SUMMON_TYPE_TOTEM;
properties->Title = SUMMON_TYPE_TOTEM;
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647))) // 52893
properties->Type = SUMMON_TYPE_TOTEM;
properties->Title = SUMMON_TYPE_TOTEM;
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(3069))) // Wild Mushroom
properties->Type = SUMMON_TYPE_MINION;
properties->Title = SUMMON_TYPE_MINION;
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(628))) // Hungry Plaguehound
properties->Category = SUMMON_CATEGORY_PET;
properties->Control = SUMMON_CATEGORY_PET;
if (LockEntry* entry = const_cast<LockEntry*>(sLockStore.LookupEntry(36))) // 3366 Opening, allows to open without proper key
entry->Type[2] = LOCK_KEY_NONE;
@@ -142,7 +142,7 @@ bool CharacterDatabaseCleaner::TalentCheck(uint32 talent_id)
if (!talentInfo)
return false;
return sTalentTabStore.LookupEntry(talentInfo->TalentTab) != nullptr;
return sTalentTabStore.LookupEntry(talentInfo->TabID) != nullptr;
}
void CharacterDatabaseCleaner::CleanCharacterTalent()
+5 -5
View File
@@ -280,11 +280,11 @@ public:
{
if (target->HasTitle(titleInfo))
{
std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale;
std::string name = target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1;
if (name.empty())
continue;
char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->Mask_ID
? handler->GetTrinityString(LANG_ACTIVE)
: "";
@@ -293,9 +293,9 @@ public:
// send title in "id (idx:idx) - [namedlink locale]" format
if (handler->GetSession())
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, titleInfo->ID, titleInfo->bit_index, titleInfo->ID, titleNameStr, localeNames[loc], knownStr, activeStr);
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, titleInfo->ID, titleInfo->Mask_ID, titleInfo->ID, titleNameStr, localeNames[loc], knownStr, activeStr);
else
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, titleInfo->ID, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, titleInfo->ID, titleInfo->Mask_ID, name.c_str(), localeNames[loc], knownStr, activeStr);
}
}
@@ -649,7 +649,7 @@ public:
{
FactionState const& faction = itr->second;
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
char const* factionName = factionEntry ? factionEntry->name : "#Not found#";
char const* factionName = factionEntry ? factionEntry->Name : "#Not found#";
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
+11 -11
View File
@@ -136,9 +136,9 @@ public:
}
// Dump camera locations
if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera))
if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->Camera[0]))
{
handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera);
handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->Camera[0]);
uint32 count = 1;
for (FlyByCamera const& cam : *flyByCameras)
{
@@ -1530,7 +1530,7 @@ public:
}
if (!mEntry->IsDungeon())
{
handler->PSendSysMessage("'%s' is not a dungeon map.", mEntry->Name[LOCALE_enUS]);
handler->PSendSysMessage("'%s' is not a dungeon map.", mEntry->MapName[LOCALE_enUS]);
return true;
}
int32 difficulty = difficulty_str ? atoi(difficulty_str) : -1;
@@ -1541,29 +1541,29 @@ public:
}
if (difficulty >= 0 && !GetMapDifficultyData(mEntry->ID, Difficulty(difficulty)))
{
handler->PSendSysMessage("Difficulty %d is not valid for '%s'.", difficulty, mEntry->Name[LOCALE_enUS]);
handler->PSendSysMessage("Difficulty %d is not valid for '%s'.", difficulty, mEntry->MapName[LOCALE_enUS]);
return true;
}
if (difficulty == -1)
{
handler->PSendSysMessage("Resetting all difficulties for '%s'.", mEntry->Name[LOCALE_enUS]);
handler->PSendSysMessage("Resetting all difficulties for '%s'.", mEntry->MapName[LOCALE_enUS]);
for (uint8 diff = (mEntry->IsRaid() ? 0 : 1); diff < (mEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY); ++diff)
{
if (GetMapDifficultyData(mEntry->ID, Difficulty(diff)))
{
handler->PSendSysMessage("Resetting difficulty %d for '%s'.", diff, mEntry->Name[LOCALE_enUS]);
handler->PSendSysMessage("Resetting difficulty %d for '%s'.", diff, mEntry->MapName[LOCALE_enUS]);
sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(diff));
}
}
}
else if (mEntry->IsNonRaidDungeon() && difficulty == DUNGEON_DIFFICULTY_NORMAL)
{
handler->PSendSysMessage("'%s' does not have any permanent saves for difficulty %d.", mEntry->Name[LOCALE_enUS], difficulty);
handler->PSendSysMessage("'%s' does not have any permanent saves for difficulty %d.", mEntry->MapName[LOCALE_enUS], difficulty);
}
else
{
handler->PSendSysMessage("Resetting difficulty %d for '%s'.", difficulty, mEntry->Name[LOCALE_enUS]);
handler->PSendSysMessage("Resetting difficulty %d for '%s'.", difficulty, mEntry->MapName[LOCALE_enUS]);
sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(difficulty));
}
return true;
@@ -1596,9 +1596,9 @@ public:
for (uint32 i = 0; i < sWorldSafeLocsStore.GetNumRows(); ++i)
{
WorldSafeLocsEntry const* loc = sWorldSafeLocsStore.LookupEntry(i);
if (loc && loc->map_id == player->GetMapId())
if (loc && loc->Continent == player->GetMapId())
{
float dist = (loc->x - x) * (loc->x - x) + (loc->y - y) * (loc->y - y) + (loc->z - z) * (loc->z - z);
float dist = (loc->Loc.X - x) * (loc->Loc.X - x) + (loc->Loc.Y - y) * (loc->Loc.Y - y) + (loc->Loc.Z - z) * (loc->Loc.Z - z);
if (dist < distNearest)
{
distNearest = dist;
@@ -1609,7 +1609,7 @@ public:
}
if (nearestLoc)
handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD, nearestLoc->ID, nearestLoc->x, nearestLoc->y, nearestLoc->z);
handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD, nearestLoc->ID, nearestLoc->Loc.X, nearestLoc->Loc.Y, nearestLoc->Loc.Z);
else
handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD_NOTFOUND);
+5 -5
View File
@@ -192,9 +192,9 @@ public:
return false;
}
if (!MapManager::IsValidMapCoord(gy->map_id, gy->x, gy->y, gy->z))
if (!MapManager::IsValidMapCoord(gy->Continent, gy->Loc.X, gy->Loc.Y, gy->Loc.Z))
{
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->x, gy->y, gy->map_id);
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->Loc.X, gy->Loc.Y, gy->Continent);
handler->SetSentErrorMessage(true);
return false;
}
@@ -210,7 +210,7 @@ public:
else
player->SaveRecallPosition();
player->TeleportTo(gy->map_id, gy->x, gy->y, gy->z, player->GetOrientation());
player->TeleportTo(gy->Continent, gy->Loc.X, gy->Loc.Y, gy->Loc.Z, player->GetOrientation());
return true;
}
@@ -259,7 +259,7 @@ public:
return false;
}
return DoTeleport(handler, { node->map_id, { node->x, node->y, node->z } });
return DoTeleport(handler, { node->ContinentID, { node->Pos.X, node->Pos.Y, node->Pos.Z } });
}
static bool HandleGoAreaTriggerCommand(ChatHandler* handler, Variant<Hyperlink<areatrigger>, uint32> areaTriggerId)
@@ -272,7 +272,7 @@ public:
return false;
}
return DoTeleport(handler, { at->mapid, { at->x, at->y, at->z } });
return DoTeleport(handler, { at->ContinentID, { at->Pos.X, at->Pos.Y, at->Pos.Z } });
}
//teleport at coordinates
+1 -1
View File
@@ -672,7 +672,7 @@ public:
handler->PSendSysMessage(LANG_OBJECTINFO_AIINFO, gameObjectInfo->AIName.c_str(), sObjectMgr->GetScriptName(gameObjectInfo->ScriptId).c_str());
if (GameObjectDisplayInfoEntry const* modelInfo = sGameObjectDisplayInfoStore.LookupEntry(displayId))
handler->PSendSysMessage(LANG_GOINFO_MODEL, modelInfo->maxX, modelInfo->maxY, modelInfo->maxZ, modelInfo->minX, modelInfo->minY, modelInfo->minZ);
handler->PSendSysMessage(LANG_GOINFO_MODEL, modelInfo->GeoBoxMax.X, modelInfo->GeoBoxMax.X, modelInfo->GeoBoxMax.Z, modelInfo->GeoBoxMin.X, modelInfo->GeoBoxMin.Y, modelInfo->GeoBoxMin.Z);
return true;
}
+26 -26
View File
@@ -151,11 +151,11 @@ public:
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->getClass());
if (!classEntry)
return true;
uint32 family = classEntry->spellfamily;
uint32 family = classEntry->SpellClassSet;
for (SkillLineAbilityEntry const* entry : sSkillLineAbilityStore)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->Spell);
if (!spellInfo)
continue;
@@ -193,7 +193,7 @@ public:
for (TalentEntry const* talentInfo : sTalentStore)
{
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
continue;
@@ -204,9 +204,9 @@ public:
uint32 spellId = 0;
for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank)
{
if (talentInfo->RankID[rank] != 0)
if (talentInfo->SpellRank[rank] != 0)
{
spellId = talentInfo->RankID[rank];
spellId = talentInfo->SpellRank[rank];
break;
}
}
@@ -257,7 +257,7 @@ public:
return false;
}
if (petFamily->petTalentType < 0) // not hunter pet
if (petFamily->PetTalentType < 0) // not hunter pet
{
handler->SendSysMessage(LANG_WRONG_PET_TYPE);
handler->SetSentErrorMessage(true);
@@ -266,12 +266,12 @@ public:
for (TalentEntry const* talentInfo : sTalentStore)
{
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
continue;
// prevent learn talent for different family (cheating)
if (((1 << petFamily->petTalentType) & talentTabInfo->petTalentMask) == 0)
if (((1 << petFamily->PetTalentType) & talentTabInfo->CategoryEnumID) == 0)
continue;
// search highest talent rank
@@ -279,9 +279,9 @@ public:
for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank)
{
if (talentInfo->RankID[rank] != 0)
if (talentInfo->SpellRank[rank] != 0)
{
spellId = talentInfo->RankID[rank];
spellId = talentInfo->SpellRank[rank];
break;
}
}
@@ -339,10 +339,10 @@ public:
if (!skillInfo)
continue;
if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) &&
skillInfo->canLink) // only prof. with recipes have
if ((skillInfo->CategoryID == SKILL_CATEGORY_PROFESSION || skillInfo->CategoryID == SKILL_CATEGORY_SECONDARY) &&
skillInfo->CanLink) // only prof. with recipes have
{
HandleLearnSkillRecipesHelper(target, skillInfo->id);
HandleLearnSkillRecipesHelper(target, skillInfo->ID);
}
}
@@ -382,12 +382,12 @@ public:
if (!skillInfo)
continue;
if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION &&
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) ||
!skillInfo->canLink) // only prof with recipes have set
if ((skillInfo->CategoryID != SKILL_CATEGORY_PROFESSION &&
skillInfo->CategoryID != SKILL_CATEGORY_SECONDARY) ||
!skillInfo->CanLink) // only prof with recipes have set
continue;
name = skillInfo->name;
name = skillInfo->DisplayName;
if (name.empty())
continue;
@@ -400,10 +400,10 @@ public:
if (!targetSkillInfo)
return false;
HandleLearnSkillRecipesHelper(target, targetSkillInfo->id);
HandleLearnSkillRecipesHelper(target, targetSkillInfo->ID);
uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id);
target->SetSkill(targetSkillInfo->id, target->GetSkillStep(targetSkillInfo->id), maxLevel, maxLevel);
uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->ID);
target->SetSkill(targetSkillInfo->ID, target->GetSkillStep(targetSkillInfo->ID), maxLevel, maxLevel);
handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str());
return true;
}
@@ -415,26 +415,26 @@ public:
for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore)
{
// wrong skill
if (skillLine->skillId != skillId)
if (skillLine->SkillLine != skillId)
continue;
// not high rank
if (skillLine->forward_spellid)
if (skillLine->SupercededBySpell)
continue;
// skip racial skills
if (skillLine->racemask != 0)
if (skillLine->RaceMask != 0)
continue;
// skip wrong class skills
if (skillLine->classmask && (skillLine->classmask & classmask) == 0)
if (skillLine->ClassMask && (skillLine->ClassMask & classmask) == 0)
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->spellId);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->Spell);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false))
continue;
player->LearnSpell(skillLine->spellId, false);
player->LearnSpell(skillLine->Spell, false);
}
}
+11 -11
View File
@@ -296,7 +296,7 @@ public:
{
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : nullptr;
std::string name = factionEntry->name;
std::string name = factionEntry->Name;
if (name.empty())
continue;
@@ -458,7 +458,7 @@ public:
ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
if (set)
{
std::string name = set->name;
std::string name = set->Name;
if (name.empty())
continue;
@@ -721,7 +721,7 @@ public:
SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id);
if (skillInfo)
{
std::string name = skillInfo->name;
std::string name = skillInfo->DisplayName;
if (name.empty())
continue;
@@ -950,7 +950,7 @@ public:
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id);
if (nodeEntry)
{
std::string name = nodeEntry->name;
std::string name = nodeEntry->Name;
if (name.empty())
continue;
@@ -966,10 +966,10 @@ public:
// send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
if (handler->GetSession())
handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), "",
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
nodeEntry->ContinentID, nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z);
else
handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), "",
nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
nodeEntry->ContinentID, nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z);
if (!found)
found = true;
@@ -1069,7 +1069,7 @@ public:
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
if (titleInfo)
{
std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale;
std::string name = target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1;
if (name.empty())
continue;
@@ -1085,7 +1085,7 @@ public:
char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : "";
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->Mask_ID
? handler->GetTrinityString(LANG_ACTIVE)
: "";
@@ -1094,9 +1094,9 @@ public:
// send title in "id (idx:idx) - [namedlink locale]" format
if (handler->GetSession())
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, "", knownStr, activeStr);
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->Mask_ID, id, titleNameStr, "", knownStr, activeStr);
else
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, "", knownStr, activeStr);
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->Mask_ID, titleNameStr, "", knownStr, activeStr);
++counter;
}
@@ -1129,7 +1129,7 @@ public:
{
if (MapEntry const* mapInfo = sMapStore.LookupEntry(id))
{
std::string name = mapInfo->Name;
std::string name = mapInfo->MapName;
if (name.empty())
continue;
+2 -2
View File
@@ -78,9 +78,9 @@ public:
uint32 channelId = 0;
for (ChatChannelsEntry const* entry : sChatChannelsStore)
{
if (strstr(entry->pattern, channelStr))
if (strstr(entry->Name, channelStr))
{
channelId = entry->ChannelID;
channelId = entry->ID;
break;
}
}
+3 -3
View File
@@ -277,7 +277,7 @@ public:
char const* unknown = handler->GetTrinityString(LANG_UNKNOWN);
handler->PSendSysMessage(LANG_MAP_POSITION,
mapId, (mapEntry ? mapEntry->Name : unknown),
mapId, (mapEntry ? mapEntry->MapName : unknown),
zoneId, (zoneEntry ? zoneEntry->AreaName : unknown),
areaId, (areaEntry ? areaEntry->AreaName : unknown),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation());
@@ -1500,7 +1500,7 @@ public:
// add the skill to the player's book with step 1 (which is the first rank, in most cases something
// like 'Apprentice <skill>'.
target->SetSkill(skill, targetHasSkill ? target->GetSkillStep(skill) : 1, level, max);
handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, handler->GetNameLink(target).c_str(), level, max);
handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->DisplayName, handler->GetNameLink(target).c_str(), level, max);
return true;
}
@@ -1848,7 +1848,7 @@ public:
}
if (target)
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->Name,
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->MapName,
(!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)),
(!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)));
+3 -3
View File
@@ -789,16 +789,16 @@ public:
return false;
}
if (factionEntry->reputationListID < 0)
if (factionEntry->ReputationIndex < 0)
{
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId);
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name, factionId);
handler->SetSentErrorMessage(true);
return false;
}
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId,
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name, factionId,
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
return true;
}
+1 -1
View File
@@ -98,7 +98,7 @@ public:
return false;
}
uint8 powerType = classEntry->powerType;
uint8 powerType = classEntry->DisplayPower;
// reset m_form if no aura
if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
+5 -5
View File
@@ -93,9 +93,9 @@ public:
std::string tNameLink = handler->GetNameLink(target);
target->SetTitle(titleInfo); // to be sure that title now known
target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index);
target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->Mask_ID);
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, tNameLink.c_str());
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, tNameLink.c_str());
return true;
}
@@ -135,7 +135,7 @@ public:
}
std::string tNameLink = handler->GetNameLink(target);
std::string titleNameStr = Trinity::StringFormat(target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str());
std::string titleNameStr = Trinity::StringFormat(target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, target->GetName().c_str());
target->SetTitle(titleInfo);
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr.c_str(), tNameLink.c_str());
@@ -183,7 +183,7 @@ public:
std::string tNameLink = handler->GetNameLink(target);
char titleNameStr[80];
snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str());
snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1, target->GetName().c_str());
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str());
@@ -218,7 +218,7 @@ public:
uint64 allValidTitleMask = 0;
for (CharTitlesEntry const* tEntry : sCharTitlesStore)
allValidTitleMask |= (uint64(1) << tEntry->bit_index);
allValidTitleMask |= (uint64(1) << tEntry->Mask_ID);
titles &= allValidTitleMask; // remove non-existing titles
@@ -1213,7 +1213,7 @@ class spell_maloriak_master_adventurer_award : public AuraScript
return;
player->SetTitle(titleInfo);
player->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index);
player->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->Mask_ID);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -80,7 +80,7 @@ class npc_tb_spirit_guide : public CreatureScript
}
if (WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(areaId))
player->TeleportTo(safeLoc->map_id, safeLoc->x, safeLoc->y, safeLoc->z, 0);
player->TeleportTo(safeLoc->Continent, safeLoc->Loc.X, safeLoc->Loc.Y, safeLoc->Loc.Z, 0);
return true;
}
};
+1 -1
View File
@@ -947,7 +947,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript
uint32 questId = 0;
uint32 orphanId = 0;
switch (trigger->id)
switch (trigger->ID)
{
case AT_DOWN_AT_THE_DOCKS:
questId = QUEST_DOWN_AT_THE_DOCKS;
@@ -240,7 +240,7 @@ class npc_wg_spirit_guide : public CreatureScript
for (uint8 i = 0; i < gy.size(); i++)
if (action - GOSSIP_ACTION_INFO_DEF == i && gy[i]->GetControlTeamId() == player->GetTeamId())
if (WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(gy[i]->GetGraveyardId()))
player->TeleportTo(safeLoc->map_id, safeLoc->x, safeLoc->y, safeLoc->z, 0);
player->TeleportTo(safeLoc->Continent, safeLoc->Loc.X, safeLoc->Loc.Y, safeLoc->Loc.Z, 0);
}
return true;
}
@@ -506,7 +506,7 @@ class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript
return false;
if (Vehicle* vehicle = source->GetVehicle())
if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon
if (vehicle->GetVehicleInfo()->ID == 244) // Wintergrasp Tower Cannon
return true;
}
@@ -172,7 +172,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
if (atEntry)
{
// 5.0f is safe-distance
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius)
{
// he dropped it further, summon mound
GameObject* go = new GameObject;
@@ -202,7 +202,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
if (atEntry)
{
// 5.0f is safe-distance
if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius)
if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius)
{
// he dropped it further, summon mound
GameObject* go = new GameObject;
Loaded 100 of 105 files, more files were not shown because too many files have changed in this diff. Show more