Merge branch 'dbc' of https://github.com/Intel/TrinityCore into Intel-dbc

Conflicts:
	src/server/game/DataStores/DBCStores.cpp
	src/server/game/DataStores/DBCStructure.h
	src/server/game/Events/GameEventMgr.cpp
This commit is contained in:
Rat
2014-11-10 15:18:01 +01:00
91 changed files with 2083 additions and 1848 deletions
@@ -96,7 +96,7 @@ GameObjectModel::~GameObjectModel()
bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info)
{
ModelList::const_iterator it = model_list.find(info.Displayid);
ModelList::const_iterator it = model_list.find(info.ID);
if (it == model_list.end())
return false;
+1 -1
View File
@@ -296,7 +296,7 @@ bool SpellTargetSelector::operator()(Unit const* target) const
return false;
// copypasta from Spell::CheckRange
uint32 range_type = _spellInfo->RangeEntry ? _spellInfo->RangeEntry->type : 0;
uint32 range_type = _spellInfo->RangeEntry ? _spellInfo->RangeEntry->Flags : 0;
float max_range = _caster->GetSpellMaxRangeForTarget(target, _spellInfo);
float min_range = _caster->GetSpellMinRangeForTarget(target, _spellInfo);
+2 -2
View File
@@ -936,10 +936,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(NULL, trigger);
script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id);
script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->ID);
return true;
}
};
@@ -3405,7 +3405,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)
@@ -3431,7 +3431,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
if (mEvents.empty() && obj)
TC_LOG_ERROR("sql.sql", "SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry());
if (mEvents.empty() && at)
TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id);
TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->ID);
}
void SmartScript::GetScript()
@@ -3453,7 +3453,7 @@ void SmartScript::GetScript()
}
else if (trigger)
{
e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType);
e = sSmartScriptMgr->GetScript((int32)trigger->ID, mScriptType);
FillScript(e, NULL, trigger);
}
}
@@ -3482,7 +3482,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
{
+37 -37
View File
@@ -370,7 +370,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->MaskID);
return false;
}
@@ -669,7 +669,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))
@@ -739,7 +739,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
ca.changed = false;
_achievementPoints += achievement->points;
_achievementPoints += achievement->Points;
}
while (achievementResult->NextRow());
}
@@ -851,7 +851,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);
@@ -863,7 +863,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))
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH))
{
// broadcast realm first reached
WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, GetOwner()->GetName().size() + 1 + 8 + 4 + 4);
@@ -1342,7 +1342,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++;
}
}
@@ -1367,7 +1367,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);
@@ -1476,7 +1476,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);
@@ -1502,10 +1502,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))
if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
{
// someone on this realm has already completed that achievement
if (sAchievementMgr->IsRealmCompleted(achievement, GetInstanceId(GetOwner())))
@@ -1667,7 +1667,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
@@ -1682,12 +1682,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->SharesCriteria ? entry->SharesCriteria : entry->ID;
uint32 achievementForTestCount = entry->MinimumCriteria;
AchievementCriteriaEntryList const* cList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievementForTestId);
if (!cList)
@@ -1696,7 +1696,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)
{
@@ -1818,7 +1818,7 @@ void AchievementMgr<T>::SetCriteriaProgress(AchievementCriteriaEntry const* entr
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);
@@ -1905,12 +1905,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);
@@ -1924,10 +1924,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, NULL, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, 0, NULL, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->Points, 0, 0, NULL, referencePlayer);
// reward items and titles if any
AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement);
@@ -1991,19 +1991,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 = time(NULL);
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());
@@ -2017,10 +2017,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, NULL, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, 0, NULL, referencePlayer);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->Points, 0, 0, NULL, referencePlayer);
}
struct VisibleAchievementPred
@@ -2028,7 +2028,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);
}
};
@@ -2329,15 +2329,15 @@ bool AchievementMgr<T>::CanUpdateCriteria(AchievementCriteriaEntry const* criter
return false;
}
if (achievement->mapID != -1 && referencePlayer->GetMapId() != uint32(achievement->mapID))
if (achievement->MapID != -1 && referencePlayer->GetMapId() != uint32(achievement->MapID))
{
TC_LOG_TRACE("achievement", "CanUpdateCriteria: %s (Id: %u Type %s) Wrong map",
criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type));
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: %s (Id: %u Type %s) Wrong faction",
criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type));
@@ -3154,7 +3154,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
m_AchievementCriteriaListByAchievement[criteria->achievement].push_back(criteria);
if (achievement && achievement->flags & ACHIEVEMENT_FLAG_GUILD)
if (achievement && achievement->Flags & ACHIEVEMENT_FLAG_GUILD)
++guildCriterias, m_GuildAchievementCriteriasByType[criteria->type].push_back(criteria);
else
++criterias, m_AchievementCriteriasByType[criteria->type].push_back(criteria);
@@ -3181,16 +3181,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->SharesCriteria)
continue;
m_AchievementListByReferencedId[achievement->refAchievement].push_back(achievement);
m_AchievementListByReferencedId[achievement->SharesCriteria].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)->MapID = 631; // Correct map requirement (currently has Ulduar)
TC_LOG_INFO("server.loading", ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
@@ -3285,7 +3285,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
continue;
}
else if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
else if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL))
m_allCompletedAchievements[achievementId] = uint32(0xFFFFFFFF);
}
while (result->NextRow());
@@ -3337,7 +3337,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` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]);
if (reward.titleId[0])
@@ -359,7 +359,7 @@ class 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;
@@ -54,9 +54,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->Mask & FACTION_MASK_ALLIANCE)
return &mAllianceAuctions;
else if (uEntry->ourMask & FACTION_MASK_HORDE)
else if (uEntry->Mask & FACTION_MASK_HORDE)
return &mHordeAuctions;
else
return &mNeutralAuctions;
@@ -69,7 +69,7 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32
if (MSV <= 0)
return AH_MINIMUM_DEPOSIT;
float multiplier = CalculatePct(float(entry->depositPercent), 3);
float multiplier = CalculatePct(float(entry->DepositRate), 3);
uint32 timeHr = (((time / 60) / 60) / 12);
uint32 deposit = uint32(((multiplier * MSV * count / 3) * timeHr * 3) * sWorld->getRate(RATE_AUCTION_DEPOSIT));
@@ -413,9 +413,9 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(factionTemplateId);
if (!u_entry)
houseid = 7; // goblin auction house
else if (u_entry->ourMask & FACTION_MASK_ALLIANCE)
else if (u_entry->Mask & FACTION_MASK_ALLIANCE)
houseid = 1; // human auction house
else if (u_entry->ourMask & FACTION_MASK_HORDE)
else if (u_entry->Mask & FACTION_MASK_HORDE)
houseid = 6; // orc auction house
else
houseid = 7; // goblin auction house
@@ -599,13 +599,13 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
{
const ItemRandomSuffixEntry* itemRandSuffix = sItemRandomSuffixStore.LookupEntry(-propRefID);
if (itemRandSuffix)
suffix = itemRandSuffix->nameSuffix;
suffix = itemRandSuffix->Name_lang;
}
else
{
const ItemRandomPropertiesEntry* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID);
if (itemRandProp)
suffix = itemRandProp->nameSuffix;
suffix = itemRandProp->Name_lang;
}
// dbc local name
@@ -670,7 +670,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) 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);
}
@@ -80,8 +80,8 @@ struct AuctionEntry
uint32 factionTemplateId;
// helpers
uint32 GetHouseId() const { return auctionHouseEntry->houseId; }
uint32 GetHouseFaction() const { return auctionHouseEntry->faction; }
uint32 GetHouseId() const { return auctionHouseEntry->ID; }
uint32 GetHouseFaction() const { return auctionHouseEntry->FactionID; }
uint32 GetAuctionCut() const;
uint32 GetAuctionOutBid() const;
bool BuildAuctionInfo(WorldPacket & data) const;
@@ -1898,7 +1898,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)
@@ -735,8 +735,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_lang);
bg->SetInstanceID(0);
bg->SetArenaorBGType(bgTemplate->IsArena());
bg->SetMinPlayersPerTeam(bgTemplate->MinPlayersPerTeam);
@@ -845,8 +845,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;
}
@@ -1204,7 +1204,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId)
uint32 weight = 0;
BattlegroundSelectionWeightMap selectionWeights;
for (int32 mapId : bgTemplate->BattlemasterEntry->mapid)
for (int32 mapId : bgTemplate->BattlemasterEntry->MapID)
{
if (mapId == -1)
break;
@@ -51,7 +51,7 @@ struct BattlegroundTemplate
uint32 ScriptId;
BattlemasterListEntry const* BattlemasterEntry;
bool IsArena() const { return BattlemasterEntry->type == MAP_ARENA; }
bool IsArena() const { return BattlemasterEntry->InstanceType == MAP_ARENA; }
};
class BattlegroundMgr
@@ -201,8 +201,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)
@@ -510,9 +510,9 @@ 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: Cannot spawn buff");
}
+3 -3
View File
@@ -44,13 +44,13 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team):
_flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
if (ch->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
_flags |= CHANNEL_FLAG_TRADE;
if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
if (ch->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
_flags |= CHANNEL_FLAG_CITY;
if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
if (ch->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
_flags |= CHANNEL_FLAG_LFG;
else // for all other channels
_flags |= CHANNEL_FLAG_NOT_LFG;
+1 -1
View File
@@ -1033,7 +1033,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
if (!glyphPropEntry)
return 0;
return glyphPropEntry->SpellId;
return glyphPropEntry->SpellID;
}
}
+8 -8
View File
@@ -183,7 +183,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context)
{
ChatLink::ValidateName(buffer, context);
char* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL);
char* suffixStrings = _suffix ? _suffix->Name_lang : (_property ? _property->Name_lang : NULL);
bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer);
if (!res)
@@ -299,15 +299,15 @@ bool SpellChatLink::ValidateName(char* buffer, const char* 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_lang);
if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName_lang, buffer, skillLineNameLength) == 0)
{
// found the prefix, remove it to perform spellname validation below
// -2 = strlen(": ")
@@ -372,7 +372,7 @@ bool AchievementChatLink::ValidateName(char* buffer, const char* context)
{
ChatLink::ValidateName(buffer, context);
if (*_achievement->name && strcmp(_achievement->name, buffer) == 0)
if (*_achievement->Title_lang && strcmp(_achievement->Title_lang, 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);
@@ -522,10 +522,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
@@ -133,7 +133,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;
+4 -4
View File
@@ -126,7 +126,7 @@ void LoadDisables()
continue;
}
bool isFlagInvalid = false;
switch (mapEntry->map_type)
switch (mapEntry->InstanceType)
{
case MAP_COMMON:
if (flags)
@@ -190,7 +190,7 @@ void LoadDisables()
TC_LOG_ERROR("sql.sql", "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
switch (mapEntry->map_type)
switch (mapEntry->InstanceType)
{
case MAP_COMMON:
if (flags & VMAP::VMAP_DISABLE_AREAFLAG)
@@ -230,7 +230,7 @@ void LoadDisables()
TC_LOG_ERROR("sql.sql", "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
switch (mapEntry->map_type)
switch (mapEntry->InstanceType)
{
case MAP_COMMON:
TC_LOG_INFO("misc", "Pathfinding disabled for world map %u.", entry);
@@ -364,7 +364,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
return (disabledModes & RAID_STATUSFLAG_25MAN_HEROIC) != 0;
}
}
else if (mapEntry->map_type == MAP_COMMON)
else if (mapEntry->InstanceType == MAP_COMMON)
return true;
}
return false;
+17 -5
View File
@@ -27,6 +27,12 @@ DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore(ItemCurrencyCostfmt);
DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt);
DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply);
DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt);
DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt);
DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscEntryfmt);
DB2Storage<SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt);
DB2Storage<SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt);
DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostEntryfmt);
typedef std::list<std::string> DB2StoreProblemList;
@@ -96,11 +102,17 @@ void LoadDB2Stores(std::string const& dataPath)
DB2StoreProblemList bad_db2_files;
uint32 availableDb2Locales = 0xFF;
LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sSpellClassOptionsStore, db2Path, "SpellClassOptions.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sSpellMiscStore, db2Path, "SpellMisc.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sSpellPowerStore, db2Path, "SpellPower.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2");
LoadDB2(availableDb2Locales, bad_db2_files, sSpellRuneCostStore, db2Path, "SpellRuneCost.db2");
// error checks
if (bad_db2_files.size() >= DB2FilesCount)
+6
View File
@@ -27,6 +27,12 @@ extern DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore;
extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore;
extern DB2Storage<ItemSparseEntry> sItemSparseStore;
extern DB2Storage<KeyChainEntry> sKeyChainStore;
extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
extern DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore;
extern DB2Storage<SpellMiscEntry> sSpellMiscStore;
extern DB2Storage<SpellPowerEntry> sSpellPowerStore;
extern DB2Storage<SpellReagentsEntry> sSpellReagentsStore;
extern DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore;
void LoadDB2Stores(std::string const& dataPath);
+88
View File
@@ -150,6 +150,94 @@ struct KeyChainEntry
uint8 Key[KEYCHAIN_SIZE];
};
struct SpellAuraRestrictionsEntry
{
//uint32 ID; // 0
uint32 CasterAuraState; // 1
uint32 TargetAuraState; // 2
uint32 ExcludeCasterAuraState; // 3
uint32 ExcludeTargetAuraState; // 4
uint32 CasterAuraSpell; // 5
uint32 TargetAuraSpell; // 6
uint32 ExcludeCasterAuraSpell; // 7
uint32 ExcludeTargetAuraSpell; // 8
};
struct SpellClassOptionsEntry
{
uint32 ID; // 0
uint32 ModalNextSpell; // 1
flag128 SpellClassMask; // 2
uint32 SpellClassSet; // 3
};
struct SpellMiscEntry
{
uint32 ID; // 0
uint32 Attributes; // 1
uint32 AttributesEx; // 2
uint32 AttributesExB; // 3
uint32 AttributesExC; // 4
uint32 AttributesExD; // 5
uint32 AttributesExE; // 6
uint32 AttributesExF; // 7
uint32 AttributesExG; // 8
uint32 AttributesExH; // 9
uint32 AttributesExI; // 10
uint32 AttributesExJ; // 11
uint32 AttributesExK; // 12
uint32 AttributesExL; // 13
uint32 AttributesExM; // 14
uint32 CastingTimeIndex; // 15
uint32 DurationIndex; // 16
uint32 RangeIndex; // 17
uint32 Speed; // 18
uint32 SpellVisualID[2]; // 19-20
uint32 SpellIconID; // 21
uint32 ActiveIconID; // 22
uint32 SchoolMask; // 23
//float Unk; // 24
};
struct SpellPowerEntry
{
uint32 ID; // 0
uint32 SpellID; // 1
//uint32 Unk2; // 2
//uint32 Unk3; // 3
uint32 ManaCost; // 4
uint32 ManaCostPerLevel; // 5
uint32 ManaCostPerSecond; // 6
//uint32 Unk4; // 7 (All 0 except one spell: 22570)
//uint32 Unk5; // 8
//uint32 Unk6; // 9
float ManaCostPercentage; // 10
//float Unk7; // 11
//uint32 Unk8; // 12
};
#define MAX_SPELL_REAGENTS 8
struct SpellReagentsEntry
{
uint32 ID; // 0
int32 Reagent[MAX_SPELL_REAGENTS]; // 1-8
uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 9-16
//uint32 Unk1; // 17
//uint32 Unk2; // 18
};
struct SpellRuneCostEntry
{
uint32 ID; // 0
uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy)
//uint32 Unk; // 4 (All 0 except for 2 ids: 2510, 2748)
uint32 RunePowerGain; // 5
bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; }
bool NoRunicPowerGain() const { return RunePowerGain == 0; }
};
// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform
#if defined(__GNUC__)
#pragma pack()
+6
View File
@@ -23,5 +23,11 @@ char const ItemCurrencyCostfmt[]="xn";
char const ItemSparsefmt[]="niiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiifiiifii";
char const ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiiiiiii";
char const KeyChainfmt[]="nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii";
char const SpellClassOptionsEntryfmt[] = "niiiiii";
char const SpellMiscEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiix";
char const SpellPowerEntryfmt[] = "nixxiiixxxfxx";
char const SpellReagentsEntryfmt[] = "niiiiiiiiiiiiiiiixx";
char const SpellRuneCostEntryfmt[] = "niiixi";
#endif
+62 -69
View File
@@ -53,7 +53,6 @@ typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTri
DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
DBCStorage <AreaPOIEntry> sAreaPOIStore(AreaPOIEntryfmt);
static AreaFlagByAreaID sAreaFlagByAreaID;
static AreaFlagByMapID sAreaFlagByMapID; // for instances without generated *.map files
@@ -142,11 +141,13 @@ DBCStorage <ItemDamageEntry> sItemDamageTwoHandStore(ItemDamagefmt)
DBCStorage <ItemDamageEntry> sItemDamageTwoHandCasterStore(ItemDamagefmt);
DBCStorage <ItemDamageEntry> sItemDamageWandStore(ItemDamagefmt);
DBCStorage <ItemDisenchantLootEntry> sItemDisenchantLootStore(ItemDisenchantLootfmt);
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
DBCStorage <ItemSetSpellEntry> sItemSetSpellStore(ItemSetSpellEntryfmt);
ItemSetSpellsStore sItemSetSpellsStore;
DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt);
DBCStorage <LightEntry> sLightStore(LightEntryfmt);
@@ -166,7 +167,6 @@ DBCStorage <MountTypeEntry> sMountTypeStore(MountTypefmt);
DBCStorage <NameGenEntry> sNameGenStore(NameGenfmt);
NameGenContainer sGenerateNamesMap;
DBCStorage <NumTalentsAtLevelEntry> sNumTalentsAtLevelStore(NumTalentsAtLevelfmt);
DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt);
@@ -195,29 +195,23 @@ SpellCategoryStore sSpellsByCategoryStore;
PetFamilySpellsStore sPetFamilySpellsStore;
DBCStorage <SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt);
DBCStorage <SpellScalingEntry> sSpellScalingStore(SpellScalingEntryfmt);
DBCStorage <SpellTotemsEntry> sSpellTotemsStore(SpellTotemsEntryfmt);
DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt);
DBCStorage <SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt);
DBCStorage <SpellLevelsEntry> sSpellLevelsStore(SpellLevelsEntryfmt);
DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore(SpellInterruptsEntryfmt);
DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore(SpellEquippedItemsEntryfmt);
DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore(SpellCooldownsEntryfmt);
DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt);
DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt);
DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt);
DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt);
DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore(SpellCategoriesEntryfmt);
DBCStorage <SpellCategoryEntry> sSpellCategoryStore(SpellCategoryfmt);
DBCStorage <SpellEffectEntry> sSpellEffectStore(SpellEffectEntryfmt);
DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore(SpellDifficultyfmt);
DBCStorage <SpellDurationEntry> sSpellDurationStore(SpellDurationfmt);
DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt);
DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt);
DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt);
DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftEntryfmt);
DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt);
DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt);
@@ -349,7 +343,6 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sArmorLocationStore, dbcPath, "ArmorLocation.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc");//15595
@@ -359,7 +352,7 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc");//15595
for (uint32 i = 0; i < sCharStartOutfitStore.GetNumRows(); ++i)
if (CharStartOutfitEntry const* outfit = sCharStartOutfitStore.LookupEntry(i))
sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit;
sCharStartOutfitMap[outfit->RaceID | (outfit->ClassID << 8) | (outfit->GenderID << 16)] = outfit;
LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");//15595
@@ -376,10 +369,10 @@ 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;
}
}
@@ -401,9 +394,9 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 i=0; i<sFactionStore.GetNumRows(); ++i)
{
FactionEntry const* faction = sFactionStore.LookupEntry(i);
if (faction && faction->team)
if (faction && faction->ParentFactionID)
{
SimpleFactionsList &flist = sFactionTeamMap[faction->team];
SimpleFactionsList &flist = sFactionTeamMap[faction->ParentFactionID];
flist.push_back(i);
}
}
@@ -414,12 +407,12 @@ void LoadDBCStores(const std::string& dataPath)
{
if (GameObjectDisplayInfoEntry const* info = sGameObjectDisplayInfoStore.LookupEntry(i))
{
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));
}
}
@@ -457,6 +450,10 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetSpellStore, dbcPath, "ItemSetSpell.dbc");//15595
for (uint32 i = 0; i < sItemSetSpellStore.GetNumRows(); ++i)
if (ItemSetSpellEntry const* entry = sItemSetSpellStore.LookupEntry(i))
sItemSetSpellsStore[entry->ItemSetID].push_back(entry);
LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorQualityStore, dbcPath, "ItemArmorQuality.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorShieldStore, dbcPath, "ItemArmorShield.dbc");//15595
@@ -483,7 +480,7 @@ void LoadDBCStores(const std::string& dataPath)
sMapDifficultyMap[MAKE_PAIR32(0, 0)] = MapDifficulty(0, 0, false);//map 0 is missingg from MapDifficulty.dbc use this till its ported to sql
for (uint32 i = 0; i < sMapDifficultyStore.GetNumRows(); ++i)
if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i))
sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0);
sMapDifficultyMap[MAKE_PAIR32(entry->MapID, entry->DifficultyID)] = MapDifficulty(entry->RaidDuration, entry->MaxPlayers, entry->Message_lang[0] > 0);
sMapDifficultyStore.Clear();
LoadDBC(availableDbcLocales, bad_dbc_files, sMountCapabilityStore, dbcPath, "MountCapability.dbc");//15595
@@ -492,11 +489,9 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sNameGenStore, dbcPath, "NameGen.dbc"); // 19116
for (uint32 i = 0; i < sNameGenStore.GetNumRows(); ++i)
if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i))
sGenerateNamesMap[entry->Race].Contents[entry->Sex].emplace_back(entry->Name);
sGenNameVectoArraysMap[entry->Race].stringVectorArray[entry->Sex].push_back(std::string(entry->Name));
sNameGenStore.Clear();
LoadDBC(availableDbcLocales, bad_dbc_files, sNumTalentsAtLevelStore, dbcPath, "NumTalentsAtLevel.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");//15595
@@ -506,8 +501,8 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 i = 0; i < sPhaseGroupStore.GetNumRows(); ++i)
if (PhaseGroupEntry const* group = sPhaseGroupStore.LookupEntry(i))
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseId))
sPhasesByGroup[group->GroupId].insert(phase->ID);
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID))
sPhasesByGroup[group->PhaseGroupID].insert(phase->ID);
LoadDBC(availableDbcLocales, bad_dbc_files, sPowerDisplayStore, dbcPath, "PowerDisplay.dbc");
@@ -515,7 +510,7 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
if (entry->BracketID > MAX_BATTLEGROUND_BRACKETS)
ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
LoadDBC(availableDbcLocales, bad_dbc_files, sQuestXPStore, dbcPath, "QuestXP.dbc");//15595
@@ -531,8 +526,8 @@ void LoadDBCStores(const std::string& dataPath)
LoadDBC(availableDbcLocales, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc");
for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i)
if (SkillRaceClassInfoEntry const* entry = sSkillRaceClassInfoStore.LookupEntry(i))
if (sSkillLineStore.LookupEntry(entry->SkillId))
SkillRaceClassInfoBySkill.emplace(entry->SkillId, entry);
if (sSkillLineStore.LookupEntry(entry->SkillID))
SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry);
LoadDBC(availableDbcLocales, bad_dbc_files, sSkillTiersStore, dbcPath, "SkillTiers.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");//15595
@@ -545,51 +540,46 @@ void LoadDBCStores(const std::string& dataPath)
if (!spell)
continue;
if (SpellCategoriesEntry const* category = sSpellCategoriesStore.LookupEntry(spell->SpellCategoriesId))
if (SpellCategoriesEntry const* category = sSpellCategoriesStore.LookupEntry(spell->CategoriesID))
sSpellsByCategoryStore[category->Category].insert(i);
}
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore, dbcPath,"SpellTargetRestrictions.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellPowerStore, dbcPath,"SpellPower.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellLevelsStore, dbcPath,"SpellLevels.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellInterruptsStore, dbcPath,"SpellInterrupts.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEquippedItemsStore, dbcPath,"SpellEquippedItems.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellClassOptionsStore, dbcPath,"SpellClassOptions.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCooldownsStore, dbcPath,"SpellCooldowns.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc", &CustomSpellEffectEntryfmt, &CustomSpellEffectEntryIndex);//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc", &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex);//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshift.dbc");//15595
LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc");//15595
//LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc");
LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//15595
// Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded
/* TODO: Requires spells attributes from SpellMisc.db2 is loaded after dbc
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
{
SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j);
if (!skillLine)
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->SpellID);
if (!spellInfo)
continue;
SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsId);
if (spellInfo->SpellLevelsId && (!levels || levels->spellLevel))
SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsID);
if (spellInfo->SpellLevelsID && (!levels || levels->spellLevel))
continue;
if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
@@ -600,20 +590,22 @@ void LoadDBCStores(const std::string& dataPath)
if (!cFamily)
continue;
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->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
sPetFamilySpellsStore[i].insert(spellInfo->Id);
sPetFamilySpellsStore[i].insert(spellInfo->ID);
}
}
}
*/
LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//15595
// Create Spelldifficulty searcher
/* TODO: 6.x update to new spell diffs
for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i)
{
SpellDifficultyEntry const* spellDiff = sSpellDifficultyStore.LookupEntry(i);
@@ -640,7 +632,7 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 x = 0; x < MAX_DIFFICULTY; ++x)
if (newEntry.SpellID[x])
sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
}
}*/
// create talent spells set
for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i)
@@ -856,7 +848,7 @@ char const* GetPetName(uint32 petfamily, uint32 /*dbclang*/)
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
if (!pet_family)
return NULL;
return pet_family->Name ? pet_family->Name : NULL;
return pet_family->Name_lang ? pet_family->Name_lang : NULL;
}
TalentSpellPos const* GetTalentSpellPos(uint32 spellId)
@@ -908,7 +900,7 @@ AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_
return sAreaStore.LookupEntry(area_flag);
if (MapEntry const* mapEntry = sMapStore.LookupEntry(map_id))
return GetAreaEntryByAreaID(mapEntry->linked_zone);
return GetAreaEntryByAreaID(mapEntry->AreaTableID);
return NULL;
}
@@ -916,13 +908,13 @@ AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_
char const* GetRaceName(uint8 race, uint8 /*locale*/)
{
ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race);
return raceEntry ? raceEntry->name : NULL;
return raceEntry ? raceEntry->Name_lang : NULL;
}
char const* GetClassName(uint8 class_, uint8 /*locale*/)
{
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_);
return classEntry ? classEntry->name : NULL;
return classEntry ? classEntry->Name_lang : NULL;
}
uint32 GetAreaFlagByMapId(uint32 mapid)
@@ -982,8 +974,8 @@ ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId)
return CONTENT_1_60;
// no need enum all maps from phasing
if (mapEntry->rootPhaseMap >= 0)
mapid = mapEntry->rootPhaseMap;
if (mapEntry->ParentMapID >= 0)
mapid = mapEntry->ParentMapID;
switch (mapid)
{
@@ -1079,15 +1071,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;
}
}
@@ -1099,7 +1091,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 NULL;
@@ -1201,7 +1193,6 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType)
case INVTYPE_FINGER:
case INVTYPE_TRINKET:
case INVTYPE_WEAPON:
case INVTYPE_SHIELD:
case INVTYPE_RANGED:
case INVTYPE_2HWEAPON:
case INVTYPE_BAG:
@@ -1225,7 +1216,9 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType)
case INVTYPE_WRISTS:
return Armor[7][armorType];
case INVTYPE_CLOAK:
return CloakArmor;
return ArmorBack;
case INVTYPE_SHIELD:
return ArmorShield;
default:
break;
}
@@ -1245,7 +1238,7 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i
case ITEM_SUBCLASS_WEAPON_DAGGER:
case ITEM_SUBCLASS_WEAPON_THROWN:
*damageMultiplier = 0.3f;
return dpsMod[0];
return DPSMod[0];
case ITEM_SUBCLASS_WEAPON_AXE2:
case ITEM_SUBCLASS_WEAPON_MACE2:
case ITEM_SUBCLASS_WEAPON_POLEARM:
@@ -1253,12 +1246,12 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i
case ITEM_SUBCLASS_WEAPON_STAFF:
case ITEM_SUBCLASS_WEAPON_FISHING_POLE:
*damageMultiplier = 0.2f;
return dpsMod[1];
return DPSMod[1];
case ITEM_SUBCLASS_WEAPON_BOW:
case ITEM_SUBCLASS_WEAPON_GUN:
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
*damageMultiplier = 0.3f;
return dpsMod[4];
return DPSMod[4];
case ITEM_SUBCLASS_WEAPON_Obsolete:
case ITEM_SUBCLASS_WEAPON_EXOTIC:
case ITEM_SUBCLASS_WEAPON_EXOTIC2:
@@ -1278,17 +1271,17 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i
if (mask & 0x562)
{
*damageMultiplier = 0.2f;
return dpsMod[3];
return DPSMod[3];
}
if (mask & (1 << ITEM_SUBCLASS_WEAPON_WAND))
{
*damageMultiplier = 0.3f;
return dpsMod[5];
return DPSMod[5];
}
}
*damageMultiplier = 0.3f;
return dpsMod[2];
return DPSMod[2];
}
return 0;
}
@@ -1302,7 +1295,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;
}
@@ -1317,8 +1310,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->MapID == mapId && light->Pos.X == 0.0f && light->Pos.Y == 0.0f && light->Pos.Z == 0.0f)
return light->ID;
}
return 0;
+2 -8
View File
@@ -95,7 +95,6 @@ extern DBCStorage <AchievementEntry> sAchievementStore;
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions
extern DBCStorage <AreaGroupEntry> sAreaGroupStore;
extern DBCStorage <AreaPOIEntry> sAreaPOIStore;
extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore;
extern DBCStorage <ArmorLocationEntry> sArmorLocationStore;
extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore;
@@ -171,6 +170,8 @@ extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore;
extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore;
extern DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore;
extern DBCStorage <ItemSetEntry> sItemSetStore;
extern DBCStorage <ItemSetSpellEntry> sItemSetSpellStore;
extern ItemSetSpellsStore sItemSetSpellsStore;
extern DBCStorage <LFGDungeonEntry> sLFGDungeonStore;
extern DBCStorage <LiquidTypeEntry> sLiquidTypeStore;
extern DBCStorage <LockEntry> sLockStore;
@@ -179,7 +180,6 @@ extern DBCStorage <MapEntry> sMapStore;
extern DBCStorage <MountCapabilityEntry> sMountCapabilityStore;
extern DBCStorage <MountTypeEntry> sMountTypeStore;
extern DBCStorage <NameGenEntry> sNameGenStore;
extern DBCStorage <NumTalentsAtLevelEntry> sNumTalentsAtLevelStore;
extern DBCStorage <PhaseEntry> sPhaseStore;
extern DBCStorage <PhaseGroupEntry> sPhaseGroupStore;
//extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed
@@ -199,7 +199,6 @@ extern DBCStorage <SkillTiersEntry> sSkillTiersStore;
extern DBCStorage <SoundEntriesEntry> sSoundEntriesStore;
extern DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore;
extern DBCStorage <SpellCategoryEntry> sSpellCategoryStore;
extern DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore;
extern DBCStorage <SpellDurationEntry> sSpellDurationStore;
extern DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore;
extern DBCStorage <SpellItemEnchantmentEntry> sSpellItemEnchantmentStore;
@@ -208,22 +207,17 @@ extern SpellCategoryStore sSpellsByCategoryStore;
extern PetFamilySpellsStore sPetFamilySpellsStore;
extern DBCStorage <SpellRadiusEntry> sSpellRadiusStore;
extern DBCStorage <SpellRangeEntry> sSpellRangeStore;
extern DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore;
extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore;
extern DBCStorage <SpellEntry> sSpellStore;
extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore;
extern DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
extern DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore;
extern DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore;
extern DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore;
extern DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore;
extern DBCStorage <SpellEffectEntry> sSpellEffectStore;
extern DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore;
extern DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore;
extern DBCStorage <SpellLevelsEntry> sSpellLevelsStore;
extern DBCStorage <SpellPowerEntry> sSpellPowerStore;
extern DBCStorage <SpellReagentsEntry> sSpellReagentsStore;
extern DBCStorage <SpellScalingEntry> sSpellScalingStore;
extern DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore;
extern DBCStorage <SpellTotemsEntry> sSpellTotemsStore;
File diff suppressed because it is too large Load Diff
+46 -55
View File
@@ -22,46 +22,45 @@
// x - skip<uint32>, X - skip<uint8>, s - char*, f - float, i - uint32, b - uint8, d - index (not included)
// n - index (included), l - bool, p - field present in sql dbc, a - field absent in sql dbc
char const Achievementfmt[] = "niixsxiixixxii";
char const Achievementfmt[] = "niixsxiixixxiix";
const std::string CustomAchievementfmt = "pppaaaapapaapp";
const std::string CustomAchievementIndex = "ID";
char const AchievementCriteriafmt[] = "niiiliiiisiiiiixxiiiiii";
char const AreaTableEntryfmt[] = "iiinixxxxxisiiiiiffixxxxxx";
char const AreaGroupEntryfmt[] = "niiiiiii";
char const AreaPOIEntryfmt[] = "niiiiiiiiiiiffixixxixx";
char const AreaTriggerEntryfmt[] = "nifffxxxfffff";
char const AreaTriggerEntryfmt[] = "nifffxxxfffffxxxx";
char const ArmorLocationfmt[] = "nfffff";
char const AuctionHouseEntryfmt[] = "niiix";
char const BankBagSlotPricesEntryfmt[] = "ni";
char const BannedAddOnsfmt[] = "nxxxxxxxxxx";
char const BarberShopStyleEntryfmt[] = "nixxxiii";
char const BattlemasterListEntryfmt[] = "niiiiiiiiixsiiiixxxx";
char const BattlemasterListEntryfmt[] = "niiiiiiiiiiiiiiiiixsiiiixxxxxxx";
char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii";
char const CharTitlesEntryfmt[] = "nxssix";
char const ChatChannelsEntryfmt[] = "nixsx";
char const ChrClassesEntryfmt[] = "nixsxxxixiiiii";
char const ChrRacesEntryfmt[] = "niixiixixxxxixsxxxxxixxx";
char const ChrClassesEntryfmt[] = "nixsxxxixiiiixxxxx";
char const ChrRacesEntryfmt[] = "niixiixxxxxxiisxxxxxxxxxxxxxxxxxxxxxxxxx";
char const ChrClassesXPowerTypesfmt[] = "nii";
char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx";
char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxx";
char const CreatureDisplayInfoExtrafmt[] = "diixxxxxxxxxxxxxxxxxx";
char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxffxxxxxxxxxxxxxxx";
char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxxx";
char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxx";
char const CreatureFamilyfmt[] = "nfifiiiiixsx";
char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx";
char const CreatureSpellDatafmt[] = "niiiixxxx";
char const CreatureTypefmt[] = "nxx";
char const CurrencyTypesfmt[] = "nixxxiiiiix";
char const DestructibleModelDatafmt[] = "ixxixxxixxxixxxixxxxxxxx";
char const DungeonEncounterfmt[] = "niixisxx";
char const CurrencyTypesfmt[] = "nixxxxxiiixx";
char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxixxxxxxxx";
char const DungeonEncounterfmt[] = "niiixsxx";
char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
char const DurabilityQualityfmt[] = "nf";
char const EmotesEntryfmt[] = "nxxiiixx";
char const EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx";
char const FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixsxi";
char const FactionTemplateEntryfmt[] = "niiiiiiiiiiiii";
char const GameObjectDisplayInfofmt[] = "nsxxxxxxxxxxffffffxxx";
char const GameObjectDisplayInfofmt[] = "nixxxxxxxxxxffffffxxx";
char const GemPropertiesEntryfmt[] = "nixxii";
char const GlyphPropertiesfmt[] = "niii";
char const GlyphSlotfmt[] = "nii";
char const GlyphPropertiesfmt[] = "niiix";
char const GlyphSlotfmt[] = "nix";
char const GtBarberShopCostBasefmt[] = "xf";
char const GtCombatRatingsfmt[] = "xf";
char const GtOCTHpPerStaminafmt[] = "df";
@@ -89,24 +88,25 @@ char const ItemBagFamilyfmt[] = "nx";
char const ItemArmorQualityfmt[] = "nfffffffi";
char const ItemArmorShieldfmt[] = "nifffffff";
char const ItemArmorTotalfmt[] = "niffff";
char const ItemClassfmt[] = "dixxfx";
char const ItemClassfmt[] = "nxfx";
char const ItemDamagefmt[] = "nfffffffi";
char const ItemDisenchantLootfmt[] = "niiiiii";
//char const ItemDisplayTemplateEntryfmt[] = "nxxxxxxxxxxixxxxxxxxxxx";
char const ItemLimitCategoryEntryfmt[] = "nxii";
char const ItemRandomPropertiesfmt[] = "nxiiixxs";
char const ItemRandomPropertiesfmt[] = "nxiiiiis";
char const ItemRandomSuffixfmt[] = "nsxiiiiiiiiii";
char const ItemSetEntryfmt[] = "dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii";
char const LFGDungeonEntryfmt[] = "nsiiiiiiiiixxixixixxx";
char const LightEntryfmt[] = "nifffxxxxxxxxxx";
char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char const ItemSetEntryfmt[] = "nsiiiiiiiiiiiiiiiiiii";
char const ItemSetSpellEntryfmt[] = "niiii";
char const LFGDungeonEntryfmt[] = "nsiiixxiiiixxixixxxxxxxxxx";
char const LightEntryfmt[] = "nifffxxxxxxxxxxxxx";
char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char const LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
char const PhaseEntryfmt[] = "nsi";
char const PhaseGroupfmt[] = "nii";
char const MailTemplateEntryfmt[] = "nxs";
char const MapEntryfmt[] = "nxiixxsixxixiffxiiii";
char const MapEntryfmt[] = "nxiixxsixxixiffxiiiixx";
char const MapDifficultyEntryfmt[] = "diisiix";
char const MovieEntryfmt[] = "nxxx";
char const MovieEntryfmt[] = "nxxxx";
char const MountCapabilityfmt[] = "niiiiiii";
char const MountTypefmt[] = "niiiiiiiiiiiiiiiiiiiiiiii";
char const NameGenfmt[] = "dsii";
@@ -115,50 +115,41 @@ char const OverrideSpellDatafmt[] = "niiiiiiiiiixx";
char const QuestFactionRewardfmt[] = "niiiiiiiiii";
char const QuestSortEntryfmt[] = "nx";
char const QuestXPfmt[] = "niiiiiiiiii";
char const PowerDisplayfmt[] = "nixxxx";
char const PvPDifficultyfmt[] = "diiiii";
char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii";
char const PowerDisplayfmt[] = "nixx";
char const PvPDifficultyfmt[] = "diiii";
char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiii";
char const ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiixi";
char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
char const SkillLinefmt[] = "nisxixi";
char const SkillLineAbilityfmt[] = "niiiixxiiiiiii";
char const SkillRaceClassInfofmt[] = "diiiixxix";
char const SkillTiersfmt[] = "nxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiii";
char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
char const SkillLinefmt[] = "nisxixixx";
char const SkillLineAbilityfmt[] = "niiiiiiiiiiii";
char const SkillRaceClassInfofmt[] = "diiiixxi";
char const SkillTiersfmt[] = "niiiiiiiiiiiiiiii";
char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char const SpellCastTimefmt[] = "nixx";
char const SpellCategoriesEntryfmt[] = "diiiiii";
char const SpellCategoryfmt[] = "nixx";
char const SpellDifficultyfmt[] = "niiii";
const std::string CustomSpellDifficultyfmt = "ppppp";
const std::string CustomSpellDifficultyIndex = "id";
char const SpellCategoriesEntryfmt[] = "diiiiiiiix";
char const SpellCategoryfmt[] = "nixxxx";
char const SpellDurationfmt[] = "niii";
// 0 10 20 26
char const SpellEffectEntryfmt[] = "nifiiiffiiiiiifiifiiiiiiiix";
char const SpellEffectEntryfmt[] = "niifiiiffiiiiiifiifiiiiifiiiiif";
const std::string CustomSpellEffectEntryfmt = "ppppppppppppppappppppppppp";
const std::string CustomSpellEffectEntryIndex = "Id";
// 0 10 20 30 40 47
char const SpellEntryfmt[] = "niiiiiiiiiiiiiiifiiiissxxiixxifiiiiiiixiiiiiiiix";
char const SpellEntryfmt[] = "nixxxiiiiiiiiiiiiiiiiiii";
const std::string CustomSpellEntryfmt = "ppppppppppppppapaaaaaaaaapaaaaaapapppaapppaaapa";
const std::string CustomSpellEntryIndex = "Id";
char const SpellFocusObjectfmt[] = "nx";
char const SpellItemEnchantmentfmt[] = "nxiiiiiixxxiiisiiiiiiix";
char const SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
char const SpellRadiusfmt[] = "nfff";
char const SpellItemEnchantmentfmt[] = "niiiiiiiiiixiiiiiiiiiiiiii";
char const SpellItemEnchantmentConditionfmt[] = "nbbbbbXXXiiiiibbbbbbbbbbXXiiiiibbbbbXXX";
char const SpellRadiusfmt[] = "nxfff";
char const SpellRangefmt[] = "nffffixx";
char const SpellReagentsEntryfmt[] = "diiiiiiiiiiiiiiii";
char const SpellScalingEntryfmt[] = "diiiiffffffffffi";
char const SpellScalingEntryfmt[] = "niiiifiii";
char const SpellTotemsEntryfmt[] = "niiii";
char const SpellTargetRestrictionsEntryfmt[] = "nxiiii";
char const SpellTargetRestrictionsEntryfmt[] = "niiffiiii";
char const SpellPowerEntryfmt[] = "diiiiixf";
char const SpellInterruptsEntryfmt[] = "dixixi";
char const SpellEquippedItemsEntryfmt[] = "diii";
char const SpellAuraOptionsEntryfmt[] = "niiii";
char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii";
char const SpellInterruptsEntryfmt[] = "diiiiiii";
char const SpellEquippedItemsEntryfmt[] = "diiiii";
char const SpellAuraOptionsEntryfmt[] = "niiiiiiii";
char const SpellCastingRequirementsEntryfmt[] = "dixxixi";
char const SpellClassOptionsEntryfmt[] = "dxiiiix";
char const SpellCooldownsEntryfmt[] = "diii";
char const SpellCooldownsEntryfmt[] = "diiiii";
char const SpellLevelsEntryfmt[] = "diii";
char const SpellRuneCostfmt[] = "niiii";
char const SpellShapeshiftEntryfmt[] = "nixixx";
char const SpellShapeshiftFormfmt[] = "nxxiixiiixxiiiiiiiixx";
char const StableSlotPricesfmt[] = "ni";
@@ -178,6 +169,6 @@ char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiii
char const WMOAreaTableEntryfmt[] = "niiixxxxxiixxxx";
char const WorldMapAreaEntryfmt[] = "xinxffffixxxxx";
char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxx";
char const WorldSafeLocsEntryfmt[] = "niffffx";
char const WorldSafeLocsEntryfmt[] = "niffff";
#endif
+1 -1
View File
@@ -183,7 +183,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
if (!dungeon)
continue;
switch (dungeon->type)
switch (dungeon->Type)
{
case LFG_TYPE_DUNGEON:
case LFG_TYPE_HEROIC:
+4 -4
View File
@@ -271,10 +271,10 @@ struct LFGDungeonData
maxlevel(0), difficulty(REGULAR_DIFFICULTY), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f),
requiredItemLevel(0)
{ }
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),
LFGDungeonData(LFGDungeonEntry const* dbc): id(dbc->ID), name(dbc->Name_lang), map(dbc->MapID),
type(dbc->Type), expansion(dbc->Expansion), group(dbc->GroupID),
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)
{ }
@@ -409,7 +409,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))
{
if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP)
if (factionTemplate->Flags & FACTION_TEMPLATE_FLAG_PVP)
SetPvP(true);
else
SetPvP(false);
@@ -1875,9 +1875,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 /*= NULL*/)
@@ -2017,8 +2017,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec))
if (modelData->DamagedDisplayId)
modelId = modelData->DamagedDisplayId;
if (modelData->StateDamaged.DisplayID)
modelId = modelData->StateDamaged.DisplayID;
SetDisplayId(modelId);
if (setHealth)
@@ -2045,8 +2045,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec))
if (modelData->DestroyedDisplayId)
modelId = modelData->DestroyedDisplayId;
if (modelData->StateDestroyed.DisplayID)
modelId = modelData->StateDestroyed.DisplayID;
SetDisplayId(modelId);
if (setHealth)
@@ -2064,8 +2064,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec))
if (modelData->RebuildingDisplayId)
modelId = modelData->RebuildingDisplayId;
if (modelData->StateRebuilding.DisplayID)
modelId = modelData->StateRebuilding.DisplayID;
SetDisplayId(modelId);
// restores to full health
+31 -32
View File
@@ -43,7 +43,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 = NULL;
@@ -74,18 +74,18 @@ void AddItemsSetItem(Player* player, Item* item)
}
++eff->item_count;
ItemSetSpells& spells = sItemSetSpellsStore[setid];
for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; ++x)
for (uint32 x = 0; x < spells.size(); ++x)
{
if (!set->spells [x])
continue;
//not enough for spell
if (set->items_to_triggerspell[x] > eff->item_count)
if (spells[x]->Threshold > 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 == spells[x]->SpellID)
break;
if (z < MAX_ITEM_SET_SPELLS)
@@ -96,10 +96,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(spells[x]->SpellID);
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", spells[x]->SpellID, setid);
break;
}
@@ -140,19 +140,18 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
return;
--eff->item_count;
ItemSetSpells& spells = sItemSetSpellsStore[setid];
for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; x++)
for (uint32 x = 0; x < spells.size(); x++)
{
if (!set->spells[x])
continue;
// enough for spell
if (set->items_to_triggerspell[x] <= eff->item_count)
if (spells[x]->Threshold <= 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 == spells[x]->SpellID)
{
// spell can be not active if not fit form requirement
player->ApplyEquipSpell(eff->spells[z], NULL, false);
@@ -626,7 +625,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
@@ -643,7 +642,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);
}
}
}
@@ -774,7 +773,7 @@ bool Item::HasEnchantRequiredSkill(const Player* 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;
}
@@ -793,8 +792,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;
@@ -810,7 +809,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;
}
@@ -940,7 +939,7 @@ bool Item::GemsFitSockets() const
uint8 GemColor = 0;
uint32 gemid = enchantEntry->GemID;
uint32 gemid = enchantEntry->SRCItemID;
if (gemid)
{
ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(gemid);
@@ -948,7 +947,7 @@ bool Item::GemsFitSockets() const
{
GemPropertiesEntry const* gemProperty = sGemPropertiesStore.LookupEntry(gemProto->GemProperties);
if (gemProperty)
GemColor = gemProperty->color;
GemColor = gemProperty->Type;
}
}
@@ -971,7 +970,7 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const
if (!enchantEntry)
continue;
if (GemID == enchantEntry->GemID)
if (GemID == enchantEntry->SRCItemID)
++count;
}
return count;
@@ -990,7 +989,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
if (!enchantEntry)
continue;
ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID);
ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->SRCItemID);
if (!gemProto)
continue;
@@ -1459,7 +1458,7 @@ uint32 Item::GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice /*=
{
ItemClassEntry const* classEntry = sItemClassStore.LookupEntry(proto->Class);
if (classEntry)
cost *= classEntry->PriceFactor;
cost *= classEntry->PriceMod;
else
cost = 0;
}
@@ -1496,10 +1495,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)
for (int k = 0; k < 5; ++k)
if (randomSuffix->enchant_id[k] == enchant->ID)
return int32((randomSuffix->prefix[k] * GetItemSuffixFactor()) / 10000);
if (enchant->Effect[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->EffectSpellID[f]) == statType)
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
if (randomSuffix->Enchantment[k] == enchant->ID)
return int32((randomSuffix->AllocationPct[k] * GetItemSuffixFactor()) / 10000);
}
else
{
@@ -1510,10 +1509,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->EffectSpellID[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;
@@ -573,16 +573,6 @@ const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS] =
MAX_ITEM_SUBCLASS_GLYPH
};
inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemSubClass)
{
switch (ItemClass)
{
case ITEM_CLASS_WEAPON: return ItemSubClass;
case ITEM_CLASS_ARMOR: return ItemSubClass + 21;
}
return 0;
}
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
#if defined(__GNUC__)
#pragma pack(1)
+11 -11
View File
@@ -747,7 +747,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
SetDisplayId(creature->GetDisplayId());
if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name);
SetName(cFamily->Name_lang);
else
SetName(creature->GetNameForLocaleIdx(sObjectMgr->GetDBCLocaleIndex()));
@@ -760,7 +760,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner)
return false;
if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name);
SetName(cFamily->Name_lang);
Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
@@ -834,15 +834,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);
}
@@ -1045,7 +1045,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;
}
@@ -1633,7 +1633,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();
@@ -1658,7 +1658,7 @@ bool Pet::resetTalents()
continue;
// unlearn only talents for pets family talent type
if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask))
continue;
for (uint8 j = 0; j < MAX_TALENT_RANK; ++j)
+159 -152
View File
@@ -966,7 +966,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac
SetMap(sMapMgr->CreateMap(info->mapId, this));
uint8 powertype = cEntry->powerType;
uint8 powertype = cEntry->PowerType;
SetObjectScale(1.0f);
@@ -1127,10 +1127,10 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac
{
for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j)
{
if (oEntry->ItemId[j] <= 0)
if (oEntry->ItemID[j] <= 0)
continue;
uint32 itemId = oEntry->ItemId[j];
uint32 itemId = oEntry->ItemID[j];
// just skip, reported in ObjectMgr::LoadItemTemplates
ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId);
@@ -1430,7 +1430,7 @@ void Player::HandleDrowning(uint32 time_diff)
SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10);
}
if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellId))
if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellID))
{
// Breath timer not activated - activate it
if (m_MirrorTimer[FIRE_TIMER] == DISABLED_MIRROR_TIMER)
@@ -2639,9 +2639,9 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
// not unfriendly
if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction()))
if (factionTemplate->faction)
if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction))
if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY)
if (factionTemplate->Faction)
if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->Faction))
if (faction->ReputationIndex >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY)
return NULL;
// not too far
@@ -3688,13 +3688,13 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// not ranked skills
for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx)
{
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId);
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->SkillLine);
if (!pSkill)
continue;
///@todo: confirm if rogues start with lockpicking skill at level 1 but only receive the spell to use it at level 16
if ((_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id)) || (pSkill->id == SKILL_LOCKPICKING && _spell_idx->second->max_value == 0))
LearnDefaultSkill(pSkill->id, 0);
if ((_spell_idx->second->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->ID)) || (pSkill->ID == SKILL_LOCKPICKING && _spell_idx->second->TrivialSkillLineRankHigh == 0))
LearnDefaultSkill(pSkill->ID, 0);
}
}
}
@@ -3718,8 +3718,8 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// not ranked skills
for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx)
{
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->SkillLine);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->SkillLine);
}
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId);
@@ -5235,8 +5235,13 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
return TotalCost;
}
uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class, ditemProto->SubClass)];
uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod));
uint32 dmultiplier = 0;
if (ditemProto->Class == ITEM_CLASS_WEAPON)
dmultiplier = dcost->WeaponSubClassCost[ditemProto->SubClass];
else if (ditemProto->Class == ITEM_CLASS_ARMOR)
dmultiplier = dcost->ArmorSubClassCost[ditemProto->SubClass];
uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->QualityMod));
costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST));
@@ -5330,13 +5335,13 @@ void Player::RepopAtGraveyard()
bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone)
{
if (channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE)
if (channel->Flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE)
return false;
if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL)))
if ((channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL)))
return false;
if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId())
if ((channel->Flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId())
return false;
return true;
@@ -5401,22 +5406,22 @@ void Player::UpdateLocalChannels(uint32 newZone)
if (CanJoinConstantChannelInZone(channel, current_zone))
{
if (!(channel->flags & CHANNEL_DBC_FLAG_GLOBAL))
if (!(channel->Flags & CHANNEL_DBC_FLAG_GLOBAL))
{
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel)
if (channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel)
continue; // Already on the channel, as city channel names are not changing
char new_channel_name_buf[100];
char const* currentNameExt;
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
if (channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY)
currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY);
else
currentNameExt = current_zone_name.c_str();
snprintf(new_channel_name_buf, 100, channel->pattern, currentNameExt);
snprintf(new_channel_name_buf, 100, channel->Name_lang, currentNameExt);
joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ChannelID);
joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ID);
if (usedChannel)
{
if (joinChannel != usedChannel)
@@ -5429,7 +5434,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
}
}
else
joinChannel = cMgr->GetJoinChannel(channel->pattern, channel->ChannelID);
joinChannel = cMgr->GetJoinChannel(channel->Name_lang, channel->ID);
}
else
removeChannel = usedChannel;
@@ -5854,24 +5859,24 @@ bool Player::UpdateCraftSkill(uint32 spellid)
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
{
if (_spell_idx->second->skillId)
if (_spell_idx->second->SkillLine)
{
uint32 SkillValue = GetPureSkillValue(_spell_idx->second->skillId);
uint32 SkillValue = GetPureSkillValue(_spell_idx->second->SkillLine);
// Alchemy Discoveries here
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellid);
if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY)
{
if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this))
if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->SkillLine, spellid, this))
LearnSpell(discoveredSpell, false);
}
uint32 craft_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING);
return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue,
_spell_idx->second->max_value,
(_spell_idx->second->max_value + _spell_idx->second->min_value)/2,
_spell_idx->second->min_value),
return UpdateSkillPro(_spell_idx->second->SkillLine, SkillGainChance(SkillValue,
_spell_idx->second->TrivialSkillLineRankHigh,
(_spell_idx->second->TrivialSkillLineRankHigh + _spell_idx->second->TrivialSkillLineRankLow)/2,
_spell_idx->second->TrivialSkillLineRankLow),
craft_skill_gain);
}
}
@@ -6011,7 +6016,7 @@ void Player::UpdateSkillsForLevel()
if (GetSkillRangeType(rcEntry) != SKILL_RANGE_LEVEL)
continue;
if (IsWeaponSkill(rcEntry->SkillId))
if (IsWeaponSkill(rcEntry->SkillID))
continue;
uint16 field = itr->second.pos / 2;
@@ -6043,10 +6048,10 @@ void Player::UpdateSkillsToMaxSkillsForLevel()
if (!rcEntry)
continue;
if (IsProfessionOrRidingSkill(rcEntry->SkillId))
if (IsProfessionOrRidingSkill(rcEntry->SkillID))
continue;
if (IsWeaponSkill(rcEntry->SkillId))
if (IsWeaponSkill(rcEntry->SkillID))
continue;
uint16 field = itr->second.pos / 2;
@@ -6124,8 +6129,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
// remove all spells that related to this skill
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j))
if (pAbility->skillId == id)
RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->spellId));
if (pAbility->SkillLine == id)
RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->SpellID));
// Clear profession lines
if (GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1) == id)
@@ -6152,7 +6157,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
}
SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, id);
if (skillEntry->categoryId == SKILL_CATEGORY_PROFESSION)
if (skillEntry->CategoryID == SKILL_CATEGORY_PROFESSION)
{
if (!GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1))
SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1, id);
@@ -6618,8 +6623,8 @@ uint32 Player::TeamForRace(uint8 race)
{
switch (rEntry->TeamID)
{
case 0: return ALLIANCE;
case 1: return HORDE;
case 7: return ALLIANCE;
}
TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
}
@@ -6744,7 +6749,7 @@ void Player::RewardReputation(Unit* victim, float rate)
Map const* map = GetMap();
if (map && map->IsNonRaidDungeon())
if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty()))
if (dungeon->reclevel == 80)
if (dungeon->TargetLevel == 80)
ChampioningFaction = GetChampioningFaction();
}
@@ -7115,7 +7120,7 @@ void Player::SendCurrencies() const
CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first);
// not send init meta currencies.
if (!entry || entry->Category == CURRENCY_CATEGORY_META_CONQUEST)
if (!entry || entry->CategoryID == CURRENCY_CATEGORY_META_CONQUEST)
continue;
uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1;
@@ -7264,7 +7269,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo
if (count > 0)
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count);
if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST)
if (currency->CategoryID == CURRENCY_CATEGORY_META_CONQUEST)
{
// count was changed to week limit, now we can modify original points.
ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, count, printLog);
@@ -7350,12 +7355,12 @@ uint32 Player::GetCurrencyWeekCap(CurrencyTypesEntry const* currency) const
return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * CURRENCY_PRECISION;
}
return currency->WeekCap;
return currency->MaxEarnablePerWeek;
}
uint32 Player::GetCurrencyTotalCap(CurrencyTypesEntry const* currency) const
{
uint32 cap = currency->TotalCap;
uint32 cap = currency->MaxQty;
switch (currency->ID)
{
@@ -7878,9 +7883,9 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
// If set ScalingStatDistribution need get stats and values from it
if (ssd && ssv)
{
if (ssd->StatMod[i] < 0)
if (ssd->StatID[i] < 0)
continue;
statType = ssd->StatMod[i];
statType = ssd->StatID[i];
val = (ssv->GetStatMultiplier(proto->InventoryType) * ssd->Modifier[i]) / 10000;
}
else
@@ -8056,7 +8061,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
// Apply Spell Power from ScalingStatValue if set
if (ssv && proto->Flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON)
if (int32 spellbonus = int32(ssv->Spellpower))
if (int32 spellbonus = int32(ssv->SpellPower))
ApplySpellPowerBonus(spellbonus, apply);
// If set ScalingStatValue armor get it or use item armor
@@ -8435,7 +8440,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id);
@@ -8454,15 +8459,15 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
continue;
}
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
if (!spellInfo)
{
TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(%s, name: %s, enchant: %i): unknown spell %i is cast, ignoring...",
GetGUID().ToString().c_str(), GetName().c_str(), pEnchant->ID, pEnchant->spellid[s]);
GetGUID().ToString().c_str(), GetName().c_str(), pEnchant->ID, pEnchant->EffectSpellID[s]);
continue;
}
float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
float chance = pEnchant->EffectPointsMin[s] != 0 ? float(pEnchant->EffectPointsMin[s]) : GetWeaponProcChance();
if (entry)
{
@@ -8473,7 +8478,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
}
// Apply spell mods
ApplySpellMod(pEnchant->spellid[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
ApplySpellMod(pEnchant->EffectSpellID[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
// Shiv has 100% chance to apply the poison
if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT)
@@ -8559,13 +8564,13 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
continue;
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
if (!spellInfo)
{
TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->EffectSpellID[s]);
continue;
}
@@ -9706,12 +9711,12 @@ void Player::SendBGWeekendWorldStates()
for (uint32 i = 1; i < sBattlemasterListStore.GetNumRows(); ++i)
{
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(i);
if (bl && bl->HolidayWorldStateId)
if (bl && bl->HolidayWorldState)
{
if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->id))
SendUpdateWorldState(bl->HolidayWorldStateId, 1);
if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->ID))
SendUpdateWorldState(bl->HolidayWorldState, 1);
else
SendUpdateWorldState(bl->HolidayWorldStateId, 0);
SendUpdateWorldState(bl->HolidayWorldState, 0);
}
}
}
@@ -10492,13 +10497,13 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item
return EQUIP_ERR_NOT_EQUIPPABLE;
}
if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE)
if (limitEntry->Flags == ITEM_LIMIT_CATEGORY_MODE_HAVE)
{
uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem);
if (curcount + count > uint32(limitEntry->maxCount))
if (curcount + count > uint32(limitEntry->Quantity))
{
if (no_space_count)
*no_space_count = count + curcount - limitEntry->maxCount;
*no_space_count = count + curcount - limitEntry->Quantity;
if (itemLimitCategory)
*itemLimitCategory = pProto->ItemLimitCategory;
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS;
@@ -13696,17 +13701,17 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
if (!pEnchant)
return;
if (!ignore_condition && pEnchant->EnchantmentCondition && !EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
if (!ignore_condition && pEnchant->ConditionID && !EnchantmentFitsRequirements(pEnchant->ConditionID, -1))
return;
if (pEnchant->requiredLevel > getLevel())
if (pEnchant->MinLevel > getLevel())
return;
if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill))
if (pEnchant->RequiredSkillID > 0 && pEnchant->RequiredSkillRank > GetSkillValue(pEnchant->RequiredSkillID))
return;
// Cogwheel gems dont have requirement data set in SpellItemEnchantment.dbc, but they do have it in Item-sparse.db2
if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->GemID))
if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->SRCItemID))
if (gem->RequiredSkill && GetSkillValue(gem->RequiredSkill) < gem->RequiredSkillRank)
return;
@@ -13716,18 +13721,18 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
&& !item->GetTemplate()->Socket[slot-SOCK_ENCHANTMENT_SLOT].Color)
{
// Check if the requirements for the prismatic socket are met before applying the gem stats
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
if (!pPrismaticEnchant || (pPrismaticEnchant->requiredSkill > 0 && pPrismaticEnchant->requiredSkillValue > GetSkillValue(pPrismaticEnchant->requiredSkill)))
return;
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
if (!pPrismaticEnchant || (pPrismaticEnchant->RequiredSkillID > 0 && pPrismaticEnchant->RequiredSkillRank > GetSkillValue(pPrismaticEnchant->RequiredSkillID)))
return;
}
if (!item->IsBroken())
{
for (int s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
uint32 enchant_display_type = pEnchant->type[s];
uint32 enchant_amount = pEnchant->amount[s];
uint32 enchant_spell_id = pEnchant->spellid[s];
uint32 enchant_display_type = pEnchant->Effect[s];
uint32 enchant_amount = pEnchant->EffectPointsMin[s];
uint32 enchant_spell_id = pEnchant->EffectSpellID[s];
switch (enchant_display_type)
{
@@ -13757,11 +13762,11 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
if (item_rand)
{
// Search enchant_amount
for (int k = 0; k < 5; ++k)
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
{
if (item_rand->enchant_id[k] == enchant_id)
if (item_rand->Enchantment[k] == enchant_id)
{
basepoints = int32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000);
basepoints = int32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000);
break;
}
}
@@ -13785,9 +13790,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
{
if (item_rand->enchant_id[k] == enchant_id)
if (item_rand->Enchantment[k] == enchant_id)
{
enchant_amount = uint32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000);
enchant_amount = uint32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000);
break;
}
}
@@ -13803,11 +13808,11 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
if (item_rand_suffix)
{
for (int k = 0; k < 5; ++k)
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
{
if (item_rand_suffix->enchant_id[k] == enchant_id)
if (item_rand_suffix->Enchantment[k] == enchant_id)
{
enchant_amount = uint32((item_rand_suffix->prefix[k] * item->GetItemSuffixFactor()) / 10000);
enchant_amount = uint32((item_rand_suffix->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000);
break;
}
}
@@ -14071,12 +14076,12 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16
if (!Enchant)
return;
if (Enchant->requiredSkill == skill_id)
if (Enchant->RequiredSkillID == skill_id)
{
// Checks if the enchantment needs to be applied or removed
if (curr_value < Enchant->requiredSkillValue && new_value >= Enchant->requiredSkillValue)
if (curr_value < Enchant->RequiredSkillRank && new_value >= Enchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true);
else if (new_value < Enchant->requiredSkillValue && curr_value >= Enchant->requiredSkillValue)
else if (new_value < Enchant->RequiredSkillRank && curr_value >= Enchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false);
}
@@ -14087,11 +14092,11 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16
{
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(m_items[i]->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
if (pPrismaticEnchant && pPrismaticEnchant->requiredSkill == skill_id)
if (pPrismaticEnchant && pPrismaticEnchant->RequiredSkillID == skill_id)
{
if (curr_value < pPrismaticEnchant->requiredSkillValue && new_value >= pPrismaticEnchant->requiredSkillValue)
if (curr_value < pPrismaticEnchant->RequiredSkillRank && new_value >= pPrismaticEnchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true);
else if (new_value < pPrismaticEnchant->requiredSkillValue && curr_value >= pPrismaticEnchant->requiredSkillValue)
else if (new_value < pPrismaticEnchant->RequiredSkillRank && curr_value >= pPrismaticEnchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false);
}
}
@@ -17906,13 +17911,13 @@ void Player::_LoadGlyphAuras()
{
if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(GetGlyphSlot(i)))
{
if (gp->TypeFlags == gs->TypeFlags)
if (gp->Type == gs->Type)
{
CastSpell(this, gp->SpellId, true);
CastSpell(this, gp->SpellID, true);
continue;
}
else
TC_LOG_ERROR("entities.player", "Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags);
TC_LOG_ERROR("entities.player", "Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->Type, gs->Type);
}
else
TC_LOG_ERROR("entities.player", "Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i);
@@ -18673,7 +18678,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
bool deleteInstance = false;
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
std::string mapname = mapEntry ? mapEntry->name : "Unknown";
std::string mapname = mapEntry ? mapEntry->MapName_lang : "Unknown";
if (!mapEntry || !mapEntry->IsDungeon())
{
@@ -20355,7 +20360,7 @@ void Player::ResetInstances(uint8 method, bool isRaid)
if (method == INSTANCE_RESET_ALL)
{
// the "reset all instances" method can only reset normal maps
if (entry->map_type == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC)
if (entry->IsRaid() || diff == DUNGEON_DIFFICULTY_HEROIC)
{
++itr;
continue;
@@ -20974,7 +20979,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply)
OpcodeServer opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER;
int i = 0;
flag96 _mask = 0;
flag96 _mask;
uint32 modTypeCount = 0; // count of mods per one mod->op
WorldPacket data(opcode);
data << uint32(1); // count of different mod->op's in packet
@@ -21586,10 +21591,10 @@ void Player::InitDataForForm(bool reapplyMods)
ShapeshiftForm form = GetShapeshiftForm();
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
if (ssEntry && ssEntry->attackSpeed)
if (ssEntry && ssEntry->CombatRoundTime)
{
SetAttackTime(BASE_ATTACK, ssEntry->attackSpeed);
SetAttackTime(OFF_ATTACK, ssEntry->attackSpeed);
SetAttackTime(BASE_ATTACK, ssEntry->CombatRoundTime);
SetAttackTime(OFF_ATTACK, ssEntry->CombatRoundTime);
SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
}
else
@@ -21613,8 +21618,8 @@ void Player::InitDataForForm(bool reapplyMods)
default: // 0, for example
{
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass());
if (cEntry && cEntry->powerType < MAX_POWERS && uint32(getPowerType()) != cEntry->powerType)
setPowerType(Powers(cEntry->powerType));
if (cEntry && cEntry->PowerType < MAX_POWERS && uint32(getPowerType()) != cEntry->PowerType)
setPowerType(Powers(cEntry->PowerType));
break;
}
}
@@ -22478,7 +22483,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
if (!enchantEntry)
continue;
uint32 gemid = enchantEntry->GemID;
uint32 gemid = enchantEntry->SRCItemID;
if (!gemid)
continue;
@@ -22490,7 +22495,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
if (!gemProperty)
continue;
uint8 GemColor = gemProperty->color;
uint8 GemColor = gemProperty->Type;
for (uint8 b = 0, tmpcolormask = 1; b < 4; b++, tmpcolormask <<= 1)
{
@@ -22505,15 +22510,15 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
for (uint8 i = 0; i < 5; i++)
{
if (!Condition->Color[i])
if (!Condition->LTOperandType[i])
continue;
uint32 _cur_gem = curcount[Condition->Color[i] - 1];
uint32 _cur_gem = curcount[Condition->LTOperandType[i] - 1];
// if have <CompareColor> use them as count, else use <value> from Condition
uint32 _cmp_gem = Condition->CompareColor[i] ? curcount[Condition->CompareColor[i] - 1]: Condition->Value[i];
uint32 _cmp_gem = Condition->RTOperandType[i] ? curcount[Condition->RTOperandType[i] - 1]: Condition->RTOperand[i];
switch (Condition->Comparator[i])
switch (Condition->Operator[i])
{
case 2: // requires less <color> than (<value> || <comparecolor>) gems
activate &= (_cur_gem < _cmp_gem) ? true : false;
@@ -22556,7 +22561,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply)
if (!enchantEntry)
continue;
uint32 condition = enchantEntry->EnchantmentCondition;
uint32 condition = enchantEntry->ConditionID;
if (condition)
{
//was enchant active with/without item?
@@ -22600,7 +22605,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply)
continue;
//only metagems to be (de)activated, so only enchants with condition
uint32 condition = enchantEntry->EnchantmentCondition;
uint32 condition = enchantEntry->ConditionID;
if (condition)
ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply);
}
@@ -23379,7 +23384,7 @@ void Player::ResetSpells(bool myClassOnly)
ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(getClass());
if (!clsEntry)
return;
family = clsEntry->spellfamily;
family = clsEntry->SpellClassSet;
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
{
@@ -23486,8 +23491,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank)
if (!rank)
break;
SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTier);
uint16 maxValue = tier->MaxSkill[std::max<int32>(rank - 1, 0)];
SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTierID);
uint16 maxValue = tier->Value[std::max<int32>(rank - 1, 0)];
uint16 skillValue = 1;
if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE)
skillValue = maxValue;
@@ -23602,31 +23607,31 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
{
SkillLineAbilityEntry const* ability = sSkillLineAbilityStore.LookupEntry(j);
if (!ability || ability->skillId != skillId)
if (!ability || ability->SkillLine != skillId)
continue;
if (!sSpellMgr->GetSpellInfo(ability->spellId))
if (!sSpellMgr->GetSpellInfo(ability->SpellID))
continue;
if (ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
if (ability->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
// Check race if set
if (ability->racemask && !(ability->racemask & raceMask))
if (ability->RaceMask && !(ability->RaceMask & raceMask))
continue;
// Check class if set
if (ability->classmask && !(ability->classmask & classMask))
if (ability->ClassMask && !(ability->ClassMask & classMask))
continue;
// need unlearn spell
if (skillValue < ability->req_skill_value && ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
RemoveSpell(ability->spellId);
if (skillValue < ability->MinSkillLineRank && ability->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
RemoveSpell(ability->SpellID);
// need learn
else if (!IsInWorld())
AddSpell(ability->spellId, true, true, true, false, false, true);
AddSpell(ability->SpellID, true, true, true, false, false, true);
else
LearnSpell(ability->spellId, true, true);
LearnSpell(ability->SpellID, true, true);
}
}
@@ -23871,10 +23876,10 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
float Player::GetReputationPriceDiscount(Creature const* creature) const
{
FactionTemplateEntry const* vendor_faction = creature->GetFactionTemplateEntry();
if (!vendor_faction || !vendor_faction->faction)
if (!vendor_faction || !vendor_faction->Faction)
return 1.0f;
ReputationRank rank = GetReputationRank(vendor_faction->faction);
ReputationRank rank = GetReputationRank(vendor_faction->Faction);
if (rank <= REP_NEUTRAL)
return 1.0f;
@@ -23893,11 +23898,11 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
{
// skip wrong race skills
if (_spell_idx->second->racemask && (_spell_idx->second->racemask & racemask) == 0)
if (_spell_idx->second->RaceMask && (_spell_idx->second->RaceMask & racemask) == 0)
continue;
// skip wrong class skills
if (_spell_idx->second->classmask && (_spell_idx->second->classmask & classmask) == 0)
if (_spell_idx->second->ClassMask && (_spell_idx->second->ClassMask & classmask) == 0)
continue;
return true;
@@ -24694,8 +24699,8 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
if (!res)
{
m_MirrorTimerFlags &= ~(UNDERWATER_INWATER | UNDERWATER_INLAVA | UNDERWATER_INSLIME | UNDERWARER_INDARKWATER);
if (_lastLiquid && _lastLiquid->SpellId)
RemoveAurasDueToSpell(_lastLiquid->SpellId);
if (_lastLiquid && _lastLiquid->SpellID)
RemoveAurasDueToSpell(_lastLiquid->SpellID);
_lastLiquid = NULL;
return;
@@ -24704,25 +24709,25 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
if (uint32 liqEntry = liquid_status.entry)
{
LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry);
if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry)
RemoveAurasDueToSpell(_lastLiquid->SpellId);
if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid->ID != liqEntry)
RemoveAurasDueToSpell(_lastLiquid->SpellID);
if (liquid && liquid->SpellId)
if (liquid && liquid->SpellID)
{
if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER))
{
if (!HasAura(liquid->SpellId))
CastSpell(this, liquid->SpellId, true);
if (!HasAura(liquid->SpellID))
CastSpell(this, liquid->SpellID, true);
}
else
RemoveAurasDueToSpell(liquid->SpellId);
RemoveAurasDueToSpell(liquid->SpellID);
}
_lastLiquid = liquid;
}
else if (_lastLiquid && _lastLiquid->SpellId)
else if (_lastLiquid && _lastLiquid->SpellID)
{
RemoveAurasDueToSpell(_lastLiquid->SpellId);
RemoveAurasDueToSpell(_lastLiquid->SpellID);
_lastLiquid = NULL;
}
@@ -24884,7 +24889,7 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n
uint8 facialhair = GetByteValue(PLAYER_BYTES_2, 0);
uint8 skincolor = GetByteValue(PLAYER_BYTES, 0);
if ((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair) && (!newSkin || (newSkin->hair_id == skincolor)))
if ((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair) && (!newSkin || (newSkin->Data == skincolor)))
return 0;
GtBarberShopCostBaseEntry const* bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1);
@@ -24903,7 +24908,7 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n
if (facialhair != newfacialhair)
cost += bsc->cost * 0.75f; // +3/4 of price
if (newSkin && skincolor != newSkin->hair_id)
if (newSkin && skincolor != newSkin->Data)
cost += bsc->cost * 0.75f; // +5/6 of price
return uint32(cost);
@@ -24914,7 +24919,7 @@ void Player::InitGlyphsForLevel()
uint32 slot = 0;
for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows() && slot < MAX_GLYPH_SLOT_INDEX; ++i)
if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i))
SetGlyphSlot(slot++, gs->Id);
SetGlyphSlot(slot++, gs->ID);
uint8 level = getLevel();
uint32 slotMask = 0;
@@ -24961,8 +24966,8 @@ bool Player::HasTitle(uint32 bitIndex) const
void Player::SetTitle(CharTitlesEntry const* title, bool lost)
{
uint32 fieldIndexOffset = title->bit_index / 32;
uint32 flag = 1 << (title->bit_index % 32);
uint32 fieldIndexOffset = title->MaskID / 32;
uint32 flag = 1 << (title->MaskID % 32);
if (lost)
{
@@ -24980,7 +24985,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost)
}
WorldPacket data(SMSG_TITLE_EARNED, 4 + 4);
data << uint32(title->bit_index);
data << uint32(title->MaskID);
data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost
GetSession()->SendPacket(&data);
}
@@ -25309,10 +25314,11 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
SendEquipError(msg, NULL, NULL, item->itemid);
}
// 6.x - removeme
uint32 Player::CalculateTalentsPoints() const
{
// this dbc file has entries only up to level 100
NumTalentsAtLevelEntry const* count = sNumTalentsAtLevelStore.LookupEntry(std::min<uint32>(getLevel(), 100));
/*NumTalentsAtLevelEntry const* count = sNumTalentsAtLevelStore.LookupEntry(std::min<uint32>(getLevel(), 100));
if (!count)
return 0;
@@ -25336,7 +25342,8 @@ uint32 Player::CalculateTalentsPoints() const
if (talentPointsForLevel > baseForLevel)
talentPointsForLevel = baseForLevel;
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));*/
return 0;
}
bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const
@@ -25415,13 +25422,13 @@ void Player::_LoadSkills(PreparedQueryResult result)
SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, skill);
uint16 step = 0;
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillId);
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillID);
if (skillLine)
{
if (skillLine->categoryId == SKILL_CATEGORY_SECONDARY)
if (skillLine->CategoryID == SKILL_CATEGORY_SECONDARY)
step = max / 75;
if (skillLine->categoryId == SKILL_CATEGORY_PROFESSION)
if (skillLine->CategoryID == SKILL_CATEGORY_PROFESSION)
{
step = max / 75;
@@ -25486,7 +25493,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi
if (!enchantEntry)
continue;
ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->GemID);
ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->SRCItemID);
if (!pGem)
continue;
@@ -25520,11 +25527,11 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8
// NOTE: limitEntry->mode not checked because if item have have-limit then it applied and to equip case
if (limit_count > limitEntry->maxCount)
if (limit_count > limitEntry->Quantity)
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS;
// there is an equip limit on this item
if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot))
if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->Quantity - limit_count + 1, except_slot))
return EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED;
}
@@ -25818,11 +25825,11 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
if (!pet_family)
return;
if (pet_family->petTalentType < 0) // not hunter pet
if (pet_family->PetTalentType < 0) // not hunter pet
return;
// prevent learn talent for different family (cheating)
if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask))
return;
// find current max talent rank (0~5)
@@ -26080,7 +26087,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data)
return;
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
if (!pet_family || pet_family->petTalentType < 0)
if (!pet_family || pet_family->PetTalentType < 0)
return;
for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
@@ -26089,7 +26096,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data)
if (!talentTabInfo)
continue;
if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask))
continue;
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
@@ -26645,7 +26652,7 @@ void Player::ActivateSpec(uint8 spec)
// remove secondary glyph
if (uint32 oldglyph = GetGlyph(GetActiveSpec(), slot))
if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph))
RemoveAurasDueToSpell(old_gp->SpellId);
RemoveAurasDueToSpell(old_gp->SpellID);
SetActiveSpec(spec);
uint32 spentTalents = 0;
@@ -26700,7 +26707,7 @@ void Player::ActivateSpec(uint8 spec)
// apply primary glyph
if (glyph)
if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph))
CastSpell(this, gp->SpellId, true);
CastSpell(this, gp->SpellID, true);
SetGlyph(slot, glyph);
}
@@ -27257,13 +27264,13 @@ float Player::GetCollisionHeight(bool mounted) const
if (!mountDisplayInfo)
return GetCollisionHeight(false);
CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId);
CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelID);
if (!mountModelData)
return GetCollisionHeight(false);
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId());
ASSERT(displayInfo);
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId);
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelID);
ASSERT(modelData);
float scaleMod = GetObjectScale(); // 99% sure about this
@@ -27275,7 +27282,7 @@ float Player::GetCollisionHeight(bool mounted) const
//! Dismounting case - use basic default model data
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId());
ASSERT(displayInfo);
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId);
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelID);
ASSERT(modelData);
return modelData->CollisionHeight;
+2 -2
View File
@@ -165,7 +165,7 @@ struct SpellModifier
SpellModType type : 8;
int16 charges : 16;
int32 value;
flag96 mask;
flag128 mask;
uint32 spellId;
Aura* const ownerAura;
};
@@ -2539,7 +2539,7 @@ class Player : public Unit, public GridObject<Player>
void CompletedAchievement(AchievementEntry const* entry);
bool HasTitle(uint32 bitIndex) const;
bool HasTitle(CharTitlesEntry const* title) const { return HasTitle(title->bit_index); }
bool HasTitle(CharTitlesEntry const* title) const { return HasTitle(title->MaskID); }
void SetTitle(CharTitlesEntry const* title, bool lost = false);
//bool isActiveObject() const { return true; }
+7 -7
View File
@@ -318,17 +318,17 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
if (ranged)
{
index = UNIT_FIELD_RANGED_ATTACK_POWER;
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->APPerStrenth, 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);
SpellShapeshiftFormEntry const* form = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm());
// Directly taken from client, SHAPESHIFT_FLAG_AP_FROM_STRENGTH ?
if (form && form->flags1 & 0x20)
agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f);
if (form && form->Flags & 0x20)
agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerStrength, 0.0f);
val2 = strengthValue + agilityValue;
}
@@ -542,11 +542,11 @@ void Player::UpdateMastery()
if (!aura->HasEffect(j))
continue;
float mult = aura->GetSpellInfo()->Effects[j].BonusMultiplier;
float mult = aura->GetSpellInfo()->Effects[j].BonusCoefficient;
if (G3D::fuzzyEq(mult, 0.0f))
continue;
aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier));
aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusCoefficient));
}
}
}
+48 -48
View File
@@ -2949,8 +2949,8 @@ void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z)
ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status);
if (!res)
{
if (_lastLiquid && _lastLiquid->SpellId)
RemoveAurasDueToSpell(_lastLiquid->SpellId);
if (_lastLiquid && _lastLiquid->SpellID)
RemoveAurasDueToSpell(_lastLiquid->SpellID);
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER);
_lastLiquid = NULL;
@@ -2960,26 +2960,26 @@ void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z)
if (uint32 liqEntry = liquid_status.entry)
{
LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry);
if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry)
RemoveAurasDueToSpell(_lastLiquid->SpellId);
if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid->ID != liqEntry)
RemoveAurasDueToSpell(_lastLiquid->SpellID);
if (liquid && liquid->SpellId)
if (liquid && liquid->SpellID)
{
if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER))
{
if (!HasAura(liquid->SpellId))
CastSpell(this, liquid->SpellId, true);
if (!HasAura(liquid->SpellID))
CastSpell(this, liquid->SpellID, true);
}
else
RemoveAurasDueToSpell(liquid->SpellId);
RemoveAurasDueToSpell(liquid->SpellID);
}
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_ABOVEWATER);
_lastLiquid = liquid;
}
else if (_lastLiquid && _lastLiquid->SpellId)
else if (_lastLiquid && _lastLiquid->SpellID)
{
RemoveAurasDueToSpell(_lastLiquid->SpellId);
RemoveAurasDueToSpell(_lastLiquid->SpellID);
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER);
_lastLiquid = NULL;
}
@@ -3728,7 +3728,7 @@ void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, ui
if (!casterGUID || aura->GetCasterGUID() == casterGUID)
{
SpellInfo const* spell = aura->GetSpellInfo();
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3))
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3))
{
RemoveAura(iter);
continue;
@@ -3990,7 +3990,7 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f
for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
{
SpellInfo const* spell = (*i)->GetSpellInfo();
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3))
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3))
{
if (!casterGUID.IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
continue;
@@ -5521,7 +5521,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return true;
}
// Seed of Corruption (Mobs cast) - no die req
if (dummySpell->SpellFamilyFlags.IsEqual(0, 0, 0) && dummySpell->SpellIconID == 1932)
if (!dummySpell->SpellFamilyFlags && dummySpell->SpellIconID == 1932)
{
// if damage is more than need deal finish spell
if (triggeredByAura->GetAmount() <= int32(damage))
@@ -5625,7 +5625,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* blessHealing = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!blessHealing)
return false;
basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].Amplitude));
basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].ApplyAuraPeriod));
}
break;
}
@@ -5745,7 +5745,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!triggeredSpell)
return false;
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude);
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod);
// Add remaining ticks to damage done
basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
}
@@ -6032,7 +6032,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
Item* addWeapon = player->GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK, true);
uint32 enchant_id_add = addWeapon ? addWeapon->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)) : 0;
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id_add);
if (pEnchant && pEnchant->spellid[0] == dummySpell->Id)
if (pEnchant && pEnchant->EffectSpellID[0] == dummySpell->Id)
chance += 14;
if (!roll_chance_i(chance))
@@ -6129,7 +6129,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!triggeredSpell)
return false;
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude);
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod);
}
break;
}
@@ -6143,7 +6143,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!triggeredSpell)
return false;
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude);
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod);
// Add remaining ticks to healing done
basepoints0 += GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL);
}
@@ -6159,7 +6159,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
{
Aura* flameShock = aurEff->GetBase();
int32 maxDuration = flameShock->GetMaxDuration();
int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetAmplitude();
int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetPeriod();
flameShock->SetDuration(newDuration);
// is it blizzlike to change max duration for FS?
@@ -6303,7 +6303,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (AuraEffect* glyph=GetAuraEffect(63332, 0))
AddPct(basepoints0, glyph->GetAmount());
basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].Amplitude);
basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].ApplyAuraPeriod);
basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
break;
}
@@ -6777,7 +6777,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
if (!TriggerPS)
return false;
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].Amplitude);
basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].ApplyAuraPeriod);
basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
break;
}
@@ -7323,12 +7323,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;
@@ -7360,14 +7360,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())
{
@@ -7388,7 +7388,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;
@@ -7407,11 +7407,11 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
bool Unit::IsHostileToPlayers() const
{
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
if (!my_faction || !my_faction->faction)
if (!my_faction || !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();
@@ -7420,11 +7420,11 @@ bool Unit::IsHostileToPlayers() const
bool Unit::IsNeutralToAll() const
{
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
if (!my_faction || !my_faction->faction)
if (!my_faction || !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();
@@ -10322,7 +10322,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;
@@ -11398,7 +11398,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->MaxRangeFriend == spellInfo->RangeEntry->MaxRangeHostile)
return spellInfo->GetMaxRange();
if (target == NULL)
return spellInfo->GetMaxRange(true);
@@ -11409,7 +11409,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->MinRangeFriend == spellInfo->RangeEntry->MinRangeHostile)
return spellInfo->GetMinRange();
return spellInfo->GetMinRange(!IsHostileTo(target));
}
@@ -11420,8 +11420,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;
}
@@ -11454,7 +11454,7 @@ bool Unit::IsInDisallowedMountForm() const
if (!shapeshift)
return true;
if (!(shapeshift->flags1 & 0x1))
if (!(shapeshift->Flags & 0x1))
return true;
}
@@ -11465,12 +11465,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))
@@ -15206,21 +15206,21 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) 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];
}
}
@@ -16037,7 +16037,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))
@@ -16052,7 +16052,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();
+40 -40
View File
@@ -950,7 +950,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;
}
@@ -2373,7 +2373,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui
if (itemSubclass < ITEM_SUBCLASS_ARMOR_CLOTH || itemSubclass > ITEM_SUBCLASS_ARMOR_PLATE)
return 0;
return uint32(armorQuality->Value[quality] * armorTotal->Value[itemSubclass - 1] * location->Value[itemSubclass - 1] + 0.5f);
return uint32(armorQuality->QualityMod[quality] * armorTotal->Value[itemSubclass - 1] * location->Modifier[itemSubclass - 1] + 0.5f);
}
// shields
@@ -2381,7 +2381,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui
if (!shield)
return 0;
return uint32(shield->Value[quality] + 0.5f);
return uint32(shield->Quality[quality] + 0.5f);
}
uint32 FillMaxDurability(uint32 itemClass, uint32 itemSubClass, uint32 inventoryType, uint32 quality, uint32 itemLevel)
@@ -2490,18 +2490,18 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill,
disenchant->MinItemLevel <= itemTemplate.ItemLevel &&
disenchant->MaxItemLevel >= 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;
*disenchantID = disenchant->ID;
*requiredDisenchantSkill = disenchant->RequiredDisenchantSkill;
return;
}
@@ -2792,10 +2792,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);
@@ -3098,10 +3098,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;
}
}
@@ -3188,8 +3188,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;
@@ -5303,7 +5303,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_lang, lastEncounterDungeon);
continue;
}
@@ -5312,7 +5312,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_lang, itr->second->ID, itr->second->Name_lang);
continue;
}
@@ -5326,7 +5326,7 @@ 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_lang);
continue;
}
const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
@@ -5335,29 +5335,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_lang);
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_lang);
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));
}
@@ -5998,9 +5998,9 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
{
// if find graveyard at different map from where entrance placed (or no entrance data), use any first
if (!mapEntry
|| mapEntry->entrance_map < 0
|| uint32(mapEntry->entrance_map) != entry->map_id
|| (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0))
|| mapEntry->CorpseMapID < 0
|| uint32(mapEntry->CorpseMapID) != entry->map_id
|| (mapEntry->CorpsePos.X == 0 && mapEntry->CorpsePos.Y == 0)) // Check X and Y
{
// not have any corrdinates for check distance anyway
entryFar = entry;
@@ -6008,8 +6008,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
}
// at entrance map calculate distance (2D);
float dist2 = (entry->x - mapEntry->entrance_x)*(entry->x - mapEntry->entrance_x)
+(entry->y - mapEntry->entrance_y)*(entry->y - mapEntry->entrance_y);
float dist2 = (entry->x - mapEntry->CorpsePos.X)*(entry->x - mapEntry->CorpsePos.X)
+(entry->y - mapEntry->CorpsePos.Y)*(entry->y - mapEntry->CorpsePos.Y);
if (foundEntr)
{
if (dist2 < distEntr)
@@ -6301,7 +6301,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
bool useParentDbValue = false;
uint32 parentId = 0;
const MapEntry* mapEntry = sMapStore.LookupEntry(Map);
if (!mapEntry || mapEntry->entrance_map < 0)
if (!mapEntry || mapEntry->CorpseMapID < 0)
return NULL;
if (mapEntry->IsDungeon())
@@ -6315,12 +6315,12 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
useParentDbValue = true;
}
uint32 entrance_map = uint32(mapEntry->entrance_map);
uint32 entrance_map = uint32(mapEntry->CorpseMapID);
for (AreaTriggerContainer::const_iterator itr = _areaTriggerStore.begin(); itr != _areaTriggerStore.end(); ++itr)
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->MapID == Map)
return &itr->second;
}
return NULL;
@@ -7079,7 +7079,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;
@@ -7097,7 +7097,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
continue;
}
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);
continue;
@@ -7853,11 +7853,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;
@@ -7865,17 +7865,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;
+16
View File
@@ -1353,8 +1353,24 @@ class ObjectMgr
void LoadRealmNames();
std::string GetRealmName(uint32 realm) const;
ExpansionRequirementContainer const& GetRaceExpansionRequirements() const { return _raceExpansionRequirementStore; }
uint8 GetRaceExpansionRequirement(uint8 race) const
{
auto itr = _raceExpansionRequirementStore.find(race);
if (itr != _raceExpansionRequirementStore.end())
return itr->second;
return EXPANSION_CLASSIC;
}
ExpansionRequirementContainer const& GetClassExpansionRequirements() const { return _classExpansionRequirementStore; }
uint8 GetClassExpansionRequirement(uint8 class_) const
{
auto itr = _classExpansionRequirementStore.find(class_);
if (itr != _classExpansionRequirementStore.end())
return itr->second;
return EXPANSION_CLASSIC;
}
private:
// first free id for selected id type
+4 -4
View File
@@ -1851,7 +1851,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.)
@@ -1881,7 +1881,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
@@ -2008,7 +2008,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
if (method == INSTANCE_RESET_ALL)
{
// the "reset all instances" method can only reset normal maps
if (entry->map_type == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC)
if (entry->IsRaid() || diff == DUNGEON_DIFFICULTY_HEROIC)
{
++itr;
continue;
@@ -2093,7 +2093,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
return NULL;
Difficulty difficulty = GetDifficulty(mapEntry->IsRaid());
return GetBoundInstance(difficulty, mapEntry->MapID);
return GetBoundInstance(difficulty, mapEntry->ID);
}
InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId)
+1 -1
View File
@@ -226,7 +226,7 @@ void GroupMgr::LoadGroups()
diff = 0; // default for both difficaly types
}
InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt64() != 0, true);
InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->ID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt64() != 0, true);
group->BindToInstance(save, fields[3].GetBool(), true);
++count;
}
+6 -6
View File
@@ -2349,8 +2349,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());
@@ -2805,8 +2805,8 @@ void Guild::DeleteMember(ObjectGuid guid, bool isDisbanding, bool isKicked, bool
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);
}
_DeleteMemberFromDB(guid.GetCounter());
@@ -3561,8 +3561,8 @@ void Guild::GiveXP(uint32 xp, Player* source)
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)
+2 -3
View File
@@ -62,10 +62,9 @@ void GuildFinderMgr::LoadGuildSettings()
bool listed = (fields[5].GetUInt8() != 0);
std::string comment = fields[6].GetString();
TeamId guildTeam = TEAM_ALLIANCE;
TeamId guildTeam = TEAM_NEUTRAL;
if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(fields[7].GetUInt8()))
if (raceEntry->TeamID == 1)
guildTeam = TEAM_HORDE;
guildTeam = (TeamId)raceEntry->TeamID;
LFGuildSettings settings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment);
_guildSettings[guildId] = settings;
@@ -67,7 +67,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
WorldPacket data(SMSG_AUCTION_HELLO, 12);
data << guid;
data << uint32(ahEntry->houseId);
data << uint32(ahEntry->ID);
data << uint8(1); // 3.3.3: 1 - AH enabled, 0 - AH disabled
SendPacket(&data);
}
+1 -1
View File
@@ -158,7 +158,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
{
HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(666);
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
+30 -28
View File
@@ -359,17 +359,19 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CharacterCrea
}
// prevent character creating Expansion race without Expansion account
if (raceEntry->expansion > Expansion())
uint8 raceExpansionRequirement = sObjectMgr->GetRaceExpansionRequirement(charCreate.CreateInfo->Race);
if (raceExpansionRequirement > Expansion())
{
TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, charCreate.CreateInfo->Race);
TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceExpansionRequirement, charCreate.CreateInfo->Race);
SendCharCreate(CHAR_CREATE_EXPANSION);
return;
}
// prevent character creating Expansion class without Expansion account
if (classEntry->expansion > Expansion())
uint8 classExpansionRequirement = sObjectMgr->GetClassExpansionRequirement(charCreate.CreateInfo->Class);
if (classExpansionRequirement > Expansion())
{
TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, charCreate.CreateInfo->Class);
TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classExpansionRequirement, charCreate.CreateInfo->Class);
SendCharCreate(CHAR_CREATE_EXPANSION_CLASS);
return;
}
@@ -950,10 +952,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())
@@ -1335,17 +1337,17 @@ 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->getGender())
if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->getRace() || bs_hair->Sex != _player->getGender())
return;
BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair);
if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->getGender())
if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->getRace() || bs_facialHair->Sex != _player->getGender())
return;
BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor);
if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender()))
if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->getRace() || bs_skinColor->Sex != _player->getGender()))
return;
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
@@ -1361,7 +1363,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
@@ -1377,11 +1379,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, 2, uint8(bs_hair->hair_id));
_player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->Data));
_player->SetByteValue(PLAYER_BYTES, 3, uint8(Color));
_player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->hair_id));
_player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->Data));
if (bs_skinColor)
_player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->hair_id));
_player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->Data));
_player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
@@ -1403,7 +1405,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);
}
@@ -2123,28 +2125,28 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
// new team
if (team == TEAM_ALLIANCE)
{
uint32 bitIndex = htitleInfo->bit_index;
uint32 index = bitIndex / 32;
uint32 old_flag = 1 << (bitIndex % 32);
uint32 new_flag = 1 << (atitleInfo->bit_index % 32);
uint32 maskID = htitleInfo->MaskID;
uint32 index = maskID / 32;
uint32 old_flag = 1 << (maskID % 32);
uint32 new_flag = 1 << (atitleInfo->MaskID % 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->MaskID / 32] |= new_flag;
}
}
else
{
uint32 bitIndex = atitleInfo->bit_index;
uint32 index = bitIndex / 32;
uint32 old_flag = 1 << (bitIndex % 32);
uint32 new_flag = 1 << (htitleInfo->bit_index % 32);
uint32 maskID = atitleInfo->MaskID;
uint32 index = maskID / 32;
uint32 old_flag = 1 << (maskID % 32);
uint32 new_flag = 1 << (htitleInfo->MaskID % 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->MaskID / 32] |= new_flag;
}
}
@@ -2218,10 +2220,10 @@ 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
@@ -741,7 +741,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
if (!em)
return;
uint32 emote_anim = em->textid;
uint32 emote_anim = em->EmoteID;
switch (emote_anim)
{
+9 -9
View File
@@ -829,7 +829,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
return;
}
uint32 price = slotEntry->price;
uint32 price = slotEntry->Cost;
if (!_player->HasEnoughMoney(uint64(price)))
{
@@ -1123,19 +1123,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;
}
@@ -1143,7 +1143,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]->EnchantID : 0;
OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i));
}
@@ -1176,7 +1176,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
{
if (iGemProto->ItemId == enchantEntry->GemID)
if (iGemProto->ItemId == enchantEntry->SRCItemID)
{
_player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL);
return;
@@ -1205,13 +1205,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->SRCItemID))
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, NULL);
return;
+1 -1
View File
@@ -810,7 +810,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
return;
}
bodyItem->SetText(mailTemplateEntry->content);
bodyItem->SetText(mailTemplateEntry->Body_lang);
}
else
bodyItem->SetText(m->body);
+19 -19
View File
@@ -863,24 +863,24 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
return;
}
if (player->GetMapId() != atEntry->mapid)
if (player->GetMapId() != atEntry->MapID)
{
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u",
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->mapid, player->GetMapId(), triggerId);
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->MapID, player->GetMapId(), triggerId);
return;
}
// delta is safe radius
const float delta = 5.0f;
if (atEntry->radius > 0)
if (atEntry->Radius > 0)
{
// if we have radius check it
float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z);
if (dist > atEntry->radius + delta)
float dist = player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z);
if (dist > atEntry->Radius + delta)
{
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (radius: %f distance: %f), ignore Area Trigger ID: %u",
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->radius, dist, triggerId);
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->Radius, dist, triggerId);
return;
}
}
@@ -892,26 +892,26 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
// is-in-cube check and we have to calculate only one point instead of 4
// 2PI = 360°, keep in mind that ingame orientation is counter-clockwise
double rotation = 2 * M_PI - atEntry->box_orientation;
double rotation = 2 * M_PI - atEntry->BoxYaw;
double sinVal = std::sin(rotation);
double cosVal = std::cos(rotation);
float playerBoxDistX = player->GetPositionX() - atEntry->x;
float playerBoxDistY = player->GetPositionY() - atEntry->y;
float playerBoxDistX = player->GetPositionX() - atEntry->Pos.X;
float playerBoxDistY = player->GetPositionY() - atEntry->Pos.Y;
float rotPlayerX = float(atEntry->x + playerBoxDistX * cosVal - playerBoxDistY*sinVal);
float rotPlayerY = float(atEntry->y + playerBoxDistY * cosVal + playerBoxDistX*sinVal);
float rotPlayerX = float(atEntry->Pos.X + playerBoxDistX * cosVal - playerBoxDistY*sinVal);
float rotPlayerY = float(atEntry->Pos.Y + playerBoxDistY * cosVal + playerBoxDistX*sinVal);
// box edges are parallel to coordiante axis, so we can treat every dimension independently :D
float dz = player->GetPositionZ() - atEntry->z;
float dx = rotPlayerX - atEntry->x;
float dy = rotPlayerY - atEntry->y;
if ((std::fabs(dx) > atEntry->box_x / 2 + delta) ||
(std::fabs(dy) > atEntry->box_y / 2 + delta) ||
(std::fabs(dz) > atEntry->box_z / 2 + delta))
float dz = player->GetPositionZ() - atEntry->Pos.Z;
float dx = rotPlayerX - atEntry->Pos.X;
float dy = rotPlayerY - atEntry->Pos.Y;
if ((std::fabs(dx) > atEntry->BoxLength / 2 + delta) ||
(std::fabs(dy) > atEntry->BoxWidth / 2 + delta) ||
(std::fabs(dz) > atEntry->BoxHeight / 2 + delta))
{
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u",
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->box_x / 2, atEntry->box_y / 2, atEntry->box_z / 2, rotPlayerX, rotPlayerY, dz, triggerId);
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->BoxLength / 2, atEntry->BoxWidth / 2, atEntry->BoxHeight / 2, rotPlayerX, rotPlayerY, dz, triggerId);
return;
}
}
@@ -931,7 +931,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
{
// set resting flag we are in the inn
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
player->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z);
player->InnEnter(time(NULL), atEntry->MapID, atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z);
player->SetRestType(REST_TYPE_IN_TAVERN);
if (sWorld->IsFFAPvPRealm())
+3 -3
View File
@@ -158,14 +158,14 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if (mInstance)
{
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID, diff))
if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->ID, diff))
{
if (mapDiff->resetTime)
{
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->MapID, diff))
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->ID, diff))
{
uint32 timeleft = uint32(timeReset - time(NULL));
GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft);
GetPlayer()->SendInstanceResetWarning(mEntry->ID, diff, timeleft);
}
}
}
+5 -5
View File
@@ -251,14 +251,14 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket& /*recvData*/)
// search entrance map for proper show entrance
if (MapEntry const* corpseMapEntry = sMapStore.LookupEntry(mapid))
{
if (corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0)
if (corpseMapEntry->IsDungeon() && corpseMapEntry->CorpseMapID >= 0)
{
// if corpse map have entrance
if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->entrance_map))
if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->CorpseMapID))
{
mapid = corpseMapEntry->entrance_map;
x = corpseMapEntry->entrance_x;
y = corpseMapEntry->entrance_y;
mapid = corpseMapEntry->CorpseMapID;
x = corpseMapEntry->CorpsePos.X;
y = corpseMapEntry->CorpsePos.Y;
z = entranceMap->GetHeight(GetPlayer()->GetPhaseMask(), x, y, MAX_HEIGHT);
}
}
@@ -96,7 +96,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
{
// initialize reset time
// for normal instances if no creatures are killed the instance will reset in two hours
if (entry->map_type == MAP_RAID || difficulty > DUNGEON_DIFFICULTY_NORMAL)
if (entry->IsRaid() || difficulty > DUNGEON_DIFFICULTY_NORMAL)
resetTime = GetResetTimeFor(mapId, difficulty);
else
{
@@ -213,7 +213,7 @@ time_t InstanceSave::GetResetTimeForDB()
{
// only save the reset time for normal instances
const MapEntry* entry = sMapStore.LookupEntry(GetMapId());
if (!entry || entry->map_type == MAP_RAID || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC)
if (!entry || entry->IsRaid() || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC)
return 0;
else
return GetResetTime();
+2 -2
View File
@@ -600,11 +600,11 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
DungeonEncounter const* encounter = *itr;
if (encounter->creditType == type && encounter->creditEntry == creditEntry)
{
completedEncounters |= 1 << encounter->dbcEntry->encounterIndex;
completedEncounters |= 1 << encounter->dbcEntry->OrderIndex;
if (encounter->lastEncounterDungeon)
{
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_lang, dungeonId);
break;
}
}
+1 -1
View File
@@ -1568,7 +1568,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
+4 -4
View File
@@ -2038,7 +2038,7 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R
{
if (LiquidTypeEntry const* liquidEntry = sLiquidTypeStore.LookupEntry(_liquidEntry[idx]))
{
entry = liquidEntry->Id;
entry = liquidEntry->ID;
type &= MAP_LIQUID_TYPE_DARK_WATER;
uint32 liqTypeIdx = liquidEntry->Type;
if (entry < 21)
@@ -2272,7 +2272,7 @@ uint16 Map::GetAreaFlag(float x, float y, float z, bool *isOutdoors) const
areaflag = gmap->getArea(x, y);
// this used while not all *.map files generated (instances)
else
areaflag = GetAreaFlagByMapId(i_mapEntry->MapID);
areaflag = GetAreaFlagByMapId(i_mapEntry->ID);
}
if (isOutdoors)
@@ -2470,7 +2470,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_lang : "UNNAMEDMAP\x0";
}
void Map::UpdateObjectVisibility(WorldObject* obj, Cell cell, CellCoord cellpair)
@@ -3212,7 +3212,7 @@ uint32 InstanceMap::GetMaxPlayers() const
if (mapDiff && mapDiff->maxPlayers)
return mapDiff->maxPlayers;
return GetEntry()->maxPlayers;
return GetEntry()->MaxPlayers;
}
uint32 InstanceMap::GetMaxResetDelay() const
+1 -1
View File
@@ -321,7 +321,7 @@ class Map : public GridRefManager<NGridType>
}
time_t GetGridExpiry(void) const { return i_gridExpiry; }
uint32 GetId(void) const { return i_mapEntry->MapID; }
uint32 GetId(void) const { return i_mapEntry->ID; }
static bool ExistMap(uint32 mapid, int gx, int gy);
static bool ExistVMap(uint32 mapid, int gx, int gy);
+1 -10
View File
@@ -227,16 +227,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun
TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId());
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel());
uint8 spawnMode;
if (bracketEntry)
spawnMode = bracketEntry->difficulty;
else
spawnMode = REGULAR_DIFFICULTY;
BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, REGULAR_DIFFICULTY);
ASSERT(map->IsBattlegroundOrArena());
map->SetBG(bg);
bg->SetBgMap(map);
+2 -2
View File
@@ -135,7 +135,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
Difficulty targetDifficulty, requestedDifficulty;
targetDifficulty = requestedDifficulty = player->GetDifficulty(entry->IsRaid());
// Get the highest available difficulty if current setting is higher than the instance allows
MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->MapID, targetDifficulty);
MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->ID, targetDifficulty);
if (!mapDiff)
{
player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, requestedDifficulty);
@@ -146,7 +146,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
if (player->IsGameMaster())
return true;
char const* mapName = entry->name;
char const* mapName = entry->MapName_lang;
Group* group = player->GetGroup();
if (entry->IsRaid())
+30 -30
View File
@@ -86,13 +86,13 @@ 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))
if ((factionEntry->ReputationRaceMask[i] & raceMask ||
(factionEntry->ReputationRaceMask[i] == 0 &&
factionEntry->ReputationClassMask[i] != 0)) &&
(factionEntry->ReputationClassMask[i] & classMask ||
factionEntry->ReputationClassMask[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
@@ -140,11 +140,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];
}
@@ -263,11 +263,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;
@@ -309,12 +309,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->ParentFactionModOut != 0.0f)
{
spillOverRepOut *= factionEntry->spilloverRateOut;
if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->team))
spillOverRepOut *= factionEntry->ParentFactionModOut;
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))
{
@@ -322,7 +322,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
}
else // spill to "sister" factions
{
flist = GetFactionTeamList(factionEntry->team);
flist = GetFactionTeamList(factionEntry->ParentFactionID);
}
}
}
@@ -333,9 +333,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->ParentFactionCapIn))
continue;
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn);
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->ParentFactionModIn);
if (spilloverRep != 0 || !incremental)
res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental);
}
@@ -344,7 +344,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())
{
res = SetOneFactionReputation(factionEntry, standing, incremental);
@@ -356,7 +356,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);
@@ -402,23 +402,23 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
return false;
}
void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry)
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;
@@ -519,9 +519,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
@@ -86,7 +86,7 @@ class ReputationMgr
FactionState const* GetState(FactionEntry const* factionEntry) const
{
return factionEntry->CanHaveReputation() ? GetState(factionEntry->reputationListID) : NULL;
return factionEntry->CanHaveReputation() ? GetState(factionEntry->ReputationIndex) : NULL;
}
FactionState const* GetState(RepListID id) const
@@ -111,7 +111,7 @@ class 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 : NULL;
}
+2 -2
View File
@@ -513,7 +513,7 @@ void ScriptMgr::OnGroupRateCalculation(float& rate, uint32 count, bool isRaid)
MapEntry const* C = I->second->GetEntry(); \
if (!C) \
continue; \
if (C->MapID == V->GetId()) \
if (C->ID == V->GetId()) \
{
#define SCR_MAP_END \
@@ -925,7 +925,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);
}
@@ -113,7 +113,7 @@ WorldPackets::Character::CharEnumResult::CharacterInfo::CharacterInfo(Field* fie
if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId))
{
VisualItems[slot].DisplayEnchantId = enchant->aura_id;
VisualItems[slot].DisplayEnchantId = enchant->ItemVisual;
break;
}
}
+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)
@@ -476,10 +476,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
// default amount calculation
int32 amount = 0;
if (!(m_spellInfo->AttributesEx8 & SPELL_ATTR8_MASTERY_SPECIALIZATION) || G3D::fuzzyEq(m_spellInfo->Effects[m_effIndex].BonusMultiplier, 0.0f))
if (!(m_spellInfo->AttributesEx8 & SPELL_ATTR8_MASTERY_SPECIALIZATION) || G3D::fuzzyEq(m_spellInfo->Effects[m_effIndex].BonusCoefficient, 0.0f))
amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit());
else if (caster && caster->GetTypeId() == TYPEID_PLAYER)
amount = int32(caster->GetFloatValue(PLAYER_MASTERY) * m_spellInfo->Effects[m_effIndex].BonusMultiplier);
amount = int32(caster->GetFloatValue(PLAYER_MASTERY) * m_spellInfo->Effects[m_effIndex].BonusCoefficient);
// check item enchant aura cast
if (!amount && caster)
@@ -498,13 +498,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->EffectSpellID[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;
}
}
@@ -557,7 +557,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 = false;
}
break;
@@ -604,15 +604,15 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= true*/, bool load /*= false*/)
{
m_amplitude = m_spellInfo->Effects[m_effIndex].Amplitude;
m_period = m_spellInfo->Effects[m_effIndex].ApplyAuraPeriod;
// prepare periodics
switch (GetAuraType())
{
case SPELL_AURA_OBS_MOD_POWER:
// 3 spells have no amplitude set
if (!m_amplitude)
m_amplitude = 1 * IN_MILLISECONDS;
if (!m_period)
m_period = 1 * IN_MILLISECONDS;
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_HEAL:
case SPELL_AURA_OBS_MOD_HEALTH:
@@ -631,7 +631,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru
break;
}
GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, m_amplitude);
GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, m_period);
if (!m_isPeriodic)
return;
@@ -639,11 +639,11 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru
Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
// Apply casting time mods
if (m_amplitude)
if (m_period)
{
// Apply periodic time mod
if (modOwner)
modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_amplitude);
modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_period);
if (caster)
{
@@ -651,17 +651,17 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru
if (m_spellInfo->IsChanneled())
{
if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
caster->ModSpellCastTime(m_spellInfo, m_amplitude);
caster->ModSpellCastTime(m_spellInfo, m_period);
}
else if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)
m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
m_period = int32(m_period * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
}
}
if (load) // aura loaded from db
{
m_tickNumber = m_amplitude ? GetBase()->GetDuration() / m_amplitude : 0;
m_periodicTimer = m_amplitude ? GetBase()->GetDuration() % m_amplitude : 0;
m_tickNumber = m_period ? GetBase()->GetDuration() / m_period : 0;
m_periodicTimer = m_period ? GetBase()->GetDuration() % m_period : 0;
if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY)
++m_tickNumber;
}
@@ -675,8 +675,8 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru
{
m_periodicTimer = 0;
// Start periodic on next tick or at aura apply
if (m_amplitude && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY))
m_periodicTimer += m_amplitude;
if (m_period && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY))
m_periodicTimer += m_period;
}
}
}
@@ -859,7 +859,7 @@ void AuraEffect::Update(uint32 diff, Unit* caster)
++m_tickNumber;
// update before tick (aura can be removed in TriggerSpell or PeriodicTick calls)
m_periodicTimer += m_amplitude - diff;
m_periodicTimer += m_period - diff;
UpdatePeriodic(caster);
std::list<AuraApplication*> effectApplications;
@@ -1128,7 +1128,7 @@ void AuraEffect::CleanupTriggeredSpells(Unit* target)
// needed for spell 43680, maybe others
/// @todo is there a spell flag, which can solve this in a more sophisticated way?
if (m_spellInfo->Effects[GetEffIndex()].ApplyAuraName == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
uint32(m_spellInfo->GetDuration()) == m_spellInfo->Effects[GetEffIndex()].Amplitude)
uint32(m_spellInfo->GetDuration()) == m_spellInfo->Effects[GetEffIndex()].ApplyAuraPeriod)
return;
target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
@@ -1250,12 +1250,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->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE)))
continue;
if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
target->CastSpell(target, glyph->SpellId, true, NULL, this);
target->CastSpell(target, glyph->SpellID, true, NULL, this);
}
}
}
@@ -1902,12 +1902,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]);
}
}
}
@@ -4596,7 +4596,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod
if (target->GetTypeId() != TYPEID_PLAYER)
return;
flag96 mask;
flag128 mask;
Unit::AuraEffectList const& noReagent = target->GetAuraEffectsByType(SPELL_AURA_NO_REAGENT_USE);
for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask;
@@ -4604,6 +4604,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod
target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]);
target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+1, mask[1]);
target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+2, mask[2]);
target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+3, mask[3]);
}
void AuraEffect::HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -5293,7 +5294,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, 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->SpellID[i])
target->AddTemporarySpell(spellId);
}
else
@@ -5301,7 +5302,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m
target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, 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->SpellID[i])
target->RemoveTemporarySpell(spellId);
}
}
@@ -47,7 +47,7 @@ class AuraEffect
uint32 GetId() const { return m_spellInfo->Id; }
uint32 GetEffIndex() const { return m_effIndex; }
int32 GetBaseAmount() const { return m_baseAmount; }
int32 GetAmplitude() const { return m_amplitude; }
int32 GetPeriod() const { return m_period; }
int32 GetMiscValueB() const { return m_spellInfo->Effects[m_effIndex].MiscValueB; }
int32 GetMiscValue() const { return m_spellInfo->Effects[m_effIndex].MiscValue; }
@@ -81,8 +81,8 @@ class AuraEffect
void UpdatePeriodic(Unit* caster);
uint32 GetTickNumber() const { return m_tickNumber; }
int32 GetTotalTicks() const { return m_amplitude ? (GetBase()->GetMaxDuration() / m_amplitude) : 1;}
void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_amplitude; m_tickNumber = 0;}
int32 GetTotalTicks() const { return m_period ? (GetBase()->GetMaxDuration() / m_period) : 1;}
void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_period; m_tickNumber = 0;}
bool IsPeriodic() const { return m_isPeriodic; }
void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
@@ -112,7 +112,7 @@ class AuraEffect
SpellModifier* m_spellmod;
int32 m_periodicTimer;
int32 m_amplitude;
int32 m_period;
uint32 m_tickNumber;
uint8 const m_effIndex;
+4 -4
View File
@@ -781,14 +781,14 @@ void Aura::RefreshTimers()
bool resetPeriodic = true;
if (m_spellInfo->AttributesEx8 & SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER)
{
int32 minAmplitude = m_maxDuration;
int32 minPeriod = m_maxDuration;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (AuraEffect const* eff = GetEffect(i))
if (int32 ampl = eff->GetAmplitude())
minAmplitude = std::min(ampl, minAmplitude);
if (int32 period = eff->GetPeriod())
minPeriod = std::min(period, minPeriod);
// If only one tick remaining, roll it over into new duration
if (GetDuration() <= minAmplitude)
if (GetDuration() <= minPeriod)
{
m_maxDuration += GetDuration();
resetPeriodic = false;
+11 -11
View File
@@ -1451,7 +1451,7 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImpli
void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask)
{
uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTarget;
uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTargets;
if (Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, maxTargets, this);
@@ -2626,8 +2626,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
duration = 0;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (AuraEffect const* eff = m_spellAura->GetEffect(i))
if (int32 amplitude = eff->GetAmplitude()) // amplitude is hastened by UNIT_MOD_CAST_SPEED
duration = std::max(std::max(origDuration / amplitude, 1) * amplitude, duration);
if (int32 period = eff->GetPeriod()) // period is hastened by UNIT_MOD_CAST_SPEED
duration = std::max(std::max(origDuration / period, 1) * period, duration);
// if there is no periodic effect
if (!duration)
@@ -4546,7 +4546,7 @@ void Spell::TakeRunePower(bool didHit)
// you can gain some runic power when use runes
if (didHit)
if (int32 rp = int32(runeCostData->runePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME)))
if (int32 rp = int32(runeCostData->RunePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME)))
player->ModifyPower(POWER_RUNIC_POWER, int32(rp));
}
@@ -4815,7 +4815,7 @@ SpellCastResult Spell::CheckCast(bool strict)
{
if (m_spellInfo->CasterAuraState && !m_caster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraState), m_spellInfo, m_caster))
return SPELL_FAILED_CASTER_AURASTATE;
if (m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraStateNot), m_spellInfo, m_caster))
if (m_spellInfo->ExcludeCasterAuraState && m_caster->HasAuraState(AuraStateType(m_spellInfo->ExcludeCasterAuraState), m_spellInfo, m_caster))
return SPELL_FAILED_CASTER_AURASTATE;
// Note: spell 62473 requres casterAuraSpell = triggering spell
@@ -5095,7 +5095,7 @@ SpellCastResult Spell::CheckCast(bool strict)
{
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;
}
@@ -5476,7 +5476,7 @@ SpellCastResult Spell::CheckCast(bool strict)
InstanceTemplate const* it = sObjectMgr->GetInstanceTemplate(m_caster->GetMapId());
if (it)
allowMount = it->AllowMount;
if (m_caster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->AreaGroupId)
if (m_caster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->RequiredAreasID)
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
if (m_caster->IsInDisallowedMountForm())
@@ -5812,7 +5812,7 @@ SpellCastResult Spell::CheckRange(bool strict)
if (m_spellInfo->RangeEntry->ID == 1)
return SPELL_CAST_OK;
range_type = m_spellInfo->RangeEntry->type;
range_type = m_spellInfo->RangeEntry->Flags;
}
Unit* target = m_targets.GetUnitTarget();
@@ -6132,7 +6132,7 @@ SpellCastResult Spell::CheckItems()
{
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)
@@ -6158,7 +6158,7 @@ SpellCastResult Spell::CheckItems()
{
if (!enchantEntry)
return SPELL_FAILED_ERROR;
if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND)
if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND)
return SPELL_FAILED_NOT_TRADEABLE;
}
break;
@@ -6175,7 +6175,7 @@ SpellCastResult Spell::CheckItems()
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;
}
break;
+7 -7
View File
@@ -2447,12 +2447,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)
@@ -2571,7 +2571,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;
@@ -4026,7 +4026,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
{
if (GlyphSlotEntry const* newGlyphSlot = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex)))
{
if (newGlyphProperties->TypeFlags != newGlyphSlot->TypeFlags)
if (newGlyphProperties->Type != newGlyphSlot->Type)
{
SendCastResult(SPELL_FAILED_INVALID_GLYPH);
return; // glyph slot mismatch
@@ -4038,12 +4038,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);
}
@@ -4052,7 +4052,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);
}
+120 -105
View File
@@ -346,30 +346,31 @@ 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;
ApplyAuraPeriod = _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;
PointsPerResource = _effect ? _effect->EffectPointsPerResource : 0.0f;
Amplitude = _effect ? _effect->EffectAmplitude : 0.0f;
ChainAmplitude = _effect ? _effect->EffectChainAmplitude : 0.0f;
BonusCoefficient = _effect ? _effect->EffectBonusCoefficient : 0.0f;
MiscValue = _effect ? _effect->EffectMiscValue : 0;
MiscValueB = _effect ? _effect->EffectMiscValueB : 0;
Mechanic = Mechanics(_effect ? _effect->EffectMechanic : 0);
TargetA = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetA : 0);
TargetB = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetB : 0);
TargetA = SpellImplicitTargetInfo(_effect ? _effect->ImplicitTarget[0] : 0);
TargetB = SpellImplicitTargetInfo(_effect ? _effect->ImplicitTarget[1] : 0);
RadiusEntry = _effect && _effect->EffectRadiusIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusIndex) : NULL;
MaxRadiusEntry = _effect && _effect->EffectRadiusMaxIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusMaxIndex) : NULL;
ChainTarget = _effect ? _effect->EffectChainTarget : 0;
ChainTargets = _effect ? _effect->EffectChainTargets : 0;
ItemType = _effect ? _effect->EffectItemType : 0;
TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0;
SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag96(0);
SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag128();
ImplicitTargetConditions = NULL;
ScalingMultiplier = scaling ? scaling->Multiplier[_effIndex] : 0.0f;
DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[_effIndex] : 0.0f;
ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[_effIndex] : 0.0f;
// TODO: 6.x these values are no longer in dbc
ScalingMultiplier = /*scaling ? scaling->Multiplier[_effIndex] :*/ 0.0f;
DeltaScalingMultiplier = /*scaling ? scaling->RandomMultiplier[_effIndex] :*/ 0.0f;
ComboScalingMultiplier = /*scaling ? scaling->OtherMultiplier[_effIndex] :*/ 0.0f;
}
bool SpellEffectInfo::IsEffect() const
@@ -432,7 +433,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
{
float basePointsPerLevel = RealPointsPerLevel;
int32 basePoints = bp ? *bp : BasePoints;
float comboDamage = PointsPerComboPoint;
float comboDamage = PointsPerResource;
// base amount modification based on spell lvl vs caster lvl
if (ScalingMultiplier != 0.0f)
@@ -589,7 +590,7 @@ int32 SpellEffectInfo::CalcBaseValue(int32 value) const
float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const
{
float multiplier = ValueMultiplier;
float multiplier = Amplitude;
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL))
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_VALUE_MULTIPLIER, multiplier, spell);
return multiplier;
@@ -597,7 +598,7 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const
float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const
{
float multiplier = DamageMultiplier;
float multiplier = ChainAmplitude;
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL))
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplier, spell);
return multiplier;
@@ -863,50 +864,57 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] =
SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects)
{
Id = spellEntry->Id;
Attributes = spellEntry->Attributes;
AttributesEx = spellEntry->AttributesEx;
AttributesEx2 = spellEntry->AttributesEx2;
AttributesEx3 = spellEntry->AttributesEx3;
AttributesEx4 = spellEntry->AttributesEx4;
AttributesEx5 = spellEntry->AttributesEx5;
AttributesEx6 = spellEntry->AttributesEx6;
AttributesEx7 = spellEntry->AttributesEx7;
AttributesEx8 = spellEntry->AttributesEx8;
AttributesEx9 = spellEntry->AttributesEx9;
AttributesEx10 = spellEntry->AttributesEx10;
Id = spellEntry->ID;
SpellName = spellEntry->Name_lang;
//Rank = spellEntry->Rank;
RuneCostID = spellEntry->RuneCostID;
//SpellDifficultyId = spellEntry->DifficultyID;
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->PowerID;
SpellReagentsId = spellEntry->ReagentsID;
SpellShapeshiftId = spellEntry->ShapeshiftID;
SpellTargetRestrictionsId = spellEntry->TargetRestrictionsID;
SpellTotemsId = spellEntry->TotemsID;
SpellMiscId = spellEntry->MiscID;
// SpellMiscEntry
SpellMiscEntry const* _misc = GetSpellMisc();
Attributes = _misc ? _misc->Attributes : 0;
AttributesEx = _misc ? _misc->AttributesEx : 0;
AttributesEx2 = _misc ? _misc->AttributesExB : 0;
AttributesEx3 = _misc ? _misc->AttributesExC : 0;
AttributesEx4 = _misc ? _misc->AttributesExD : 0;
AttributesEx5 = _misc ? _misc->AttributesExE : 0;
AttributesEx6 = _misc ? _misc->AttributesExF : 0;
AttributesEx7 = _misc ? _misc->AttributesExG : 0;
AttributesEx8 = _misc ? _misc->AttributesExH : 0;
AttributesEx9 = _misc ? _misc->AttributesExI : 0;
AttributesEx10 = _misc ? _misc->AttributesExJ : 0;
AttributesEx11 = _misc ? _misc->AttributesExK : 0;
AttributesEx12 = _misc ? _misc->AttributesExL : 0;
AttributesEx13 = _misc ? _misc->AttributesExM : 0;
CastTimeEntry = _misc ? (_misc->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(_misc->CastingTimeIndex) : NULL) : NULL;
DurationEntry = _misc ? (_misc->DurationIndex ? sSpellDurationStore.LookupEntry(_misc->DurationIndex) : NULL) : NULL;
RangeEntry = _misc ? (_misc->RangeIndex ? sSpellRangeStore.LookupEntry(_misc->RangeIndex) : NULL) : NULL;
Speed = _misc ? _misc->Speed : 0;
SchoolMask = _misc ? _misc->SchoolMask : 0;
AttributesCu = 0;
CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : NULL;
DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : NULL;
PowerType = spellEntry->powerType;
RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : NULL;
Speed = spellEntry->speed;
//PowerType = _misc ? _misc->powerType : 0;
for (uint8 i = 0; i < 2; ++i)
SpellVisual[i] = spellEntry->SpellVisual[i];
SpellVisual[i] = _misc ? _misc->SpellVisualID[i] : 0;
SpellIconID = spellEntry->SpellIconID;
ActiveIconID = spellEntry->activeIconID;
SpellName = spellEntry->SpellName;
Rank = spellEntry->Rank;
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;
SpellIconID = _misc ? _misc->SpellIconID : 0;
ActiveIconID = _misc ? _misc->ActiveIconID : 0;
// SpellDifficultyEntry
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -918,46 +926,46 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
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;
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;
ExcludeCasterAuraState = _aura ? _aura->ExcludeCasterAuraState : 0;
ExcludeTargetAuraState = _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;
RequiredAreasID = _castreq ? _castreq->RequiredAreasID : -1;
// SpellCategoriesEntry
SpellCategoriesEntry const* _categorie = GetSpellCategories();
CategoryEntry = _categorie ? sSpellCategoryStore.LookupEntry(_categorie->Category) : NULL;
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->SpellClassMask : flag128(0);
// SpellCooldownsEntry
SpellCooldownsEntry const* _cooldowns = GetSpellCooldowns();
@@ -974,21 +982,22 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellInterruptsEntry
SpellInterruptsEntry const* _interrupt = GetSpellInterrupts();
InterruptFlags = _interrupt ? _interrupt->InterruptFlags : 0;
AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags : 0;
ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags : 0;
// TODO: 6.x these flags have 2 parts
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;
ManaCost = _power ? _power->ManaCost : 0;
ManaCostPerlevel = _power ? _power->ManaCostPerLevel : 0;
ManaCostPercentage = _power ? _power->ManaCostPercentage : 0;
ManaPerSecond = _power ? _power->manaPerSecond : 0;
ManaPerSecond = _power ? _power->ManaCostPerSecond : 0;
// SpellReagentsEntry
SpellReagentsEntry const* _reagents = GetSpellReagents();
@@ -999,8 +1008,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe
// SpellShapeshiftEntry
SpellShapeshiftEntry const* _shapeshift = GetSpellShapeshift();
Stances = _shapeshift ? _shapeshift->Stances : 0;
StancesNot = _shapeshift ? _shapeshift->StancesNot : 0;
// TODO: 6.x these maks have 2 parts
Stances = _shapeshift ? _shapeshift->ShapeshiftMask[0] : 0;
StancesNot = _shapeshift ? _shapeshift->ShapeshiftExclude[0] : 0;
// SpellTargetRestrictionsEntry
SpellTargetRestrictionsEntry const* _target = GetSpellTargetRestrictions();
@@ -1026,7 +1036,7 @@ SpellInfo::~SpellInfo()
uint32 SpellInfo::GetCategory() const
{
return CategoryEntry ? CategoryEntry->Id : 0;
return CategoryEntry ? CategoryEntry->ID : 0;
}
bool SpellInfo::HasEffect(SpellEffects effect) const
@@ -1131,10 +1141,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->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
continue;
if (pAbility->req_skill_value > 0)
if (pAbility->MinSkillLineRank > 0)
return true;
}
@@ -1146,7 +1156,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;
@@ -1490,7 +1500,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)
@@ -1510,7 +1520,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;
@@ -1522,19 +1532,19 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player) const
{
// normal case
if (AreaGroupId > 0)
if (RequiredAreasID > 0)
{
bool found = false;
AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(AreaGroupId);
AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(RequiredAreasID);
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)
@@ -1546,7 +1556,7 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
{
uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
if (!mapEntry || mapEntry->addon < 1 || !mapEntry->IsContinent())
if (!mapEntry || mapEntry->ExpansionID < 1 || !mapEntry->IsContinent())
return SPELL_FAILED_INCORRECT_AREA;
}
@@ -1798,7 +1808,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster))
return SPELL_FAILED_TARGET_AURASTATE;
if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster))
if (ExcludeTargetAuraState && unitTarget->HasAuraState(AuraStateType(ExcludeTargetAuraState), this, caster))
return SPELL_FAILED_TARGET_AURASTATE;
}
@@ -1865,7 +1875,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;
}
@@ -2168,7 +2178,7 @@ SpellSpecificType SpellInfo::GetSpellSpecific() const
return SPELL_SPECIFIC_STING;
// only hunter aspects have this (but not all aspects in hunter family)
if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010))
if (SpellFamilyFlags & flag96(0x00380000, 0x00440000, 0x00001010))
return SPELL_SPECIFIC_ASPECT;
break;
@@ -2238,8 +2248,8 @@ float SpellInfo::GetMinRange(bool positive) const
if (!RangeEntry)
return 0.0f;
if (positive)
return RangeEntry->minRangeFriend;
return RangeEntry->minRangeHostile;
return RangeEntry->MinRangeFriend;
return RangeEntry->MinRangeHostile;
}
float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
@@ -2248,9 +2258,9 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
return 0.0f;
float range;
if (positive)
range = RangeEntry->maxRangeFriend;
range = RangeEntry->MaxRangeFriend;
else
range = RangeEntry->maxRangeHostile;
range = RangeEntry->MaxRangeHostile;
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
@@ -2317,8 +2327,8 @@ uint32 SpellInfo::GetMaxTicks() const
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_HEAL:
case SPELL_AURA_PERIODIC_LEECH:
if (Effects[x].Amplitude != 0)
return DotDuration / Effects[x].Amplitude;
if (Effects[x].ApplyAuraPeriod != 0)
return DotDuration / Effects[x].ApplyAuraPeriod;
break;
}
}
@@ -2881,6 +2891,11 @@ SpellTotemsEntry const* SpellInfo::GetSpellTotems() const
return SpellTotemsId ? sSpellTotemsStore.LookupEntry(SpellTotemsId) : NULL;
}
SpellMiscEntry const* SpellInfo::GetSpellMisc() const
{
return SpellMiscId ? sSpellMiscStore.LookupEntry(SpellMiscId) : NULL;
}
SpellAuraOptionsEntry const* SpellInfo::GetSpellAuraOptions() const
{
return SpellAuraOptionsId ? sSpellAuraOptionsStore.LookupEntry(SpellAuraOptionsId) : NULL;
+19 -14
View File
@@ -233,14 +233,14 @@ class SpellEffectInfo
public:
uint32 Effect;
uint32 ApplyAuraName;
uint32 Amplitude;
uint32 ApplyAuraPeriod;
int32 DieSides;
float RealPointsPerLevel;
int32 BasePoints;
float PointsPerComboPoint;
float ValueMultiplier;
float DamageMultiplier;
float BonusMultiplier;
float PointsPerResource;
float Amplitude;
float ChainAmplitude;
float BonusCoefficient;
int32 MiscValue;
int32 MiscValueB;
Mechanics Mechanic;
@@ -248,19 +248,19 @@ public:
SpellImplicitTargetInfo TargetB;
SpellRadiusEntry const* RadiusEntry;
SpellRadiusEntry const* MaxRadiusEntry;
uint32 ChainTarget;
uint32 ChainTargets;
uint32 ItemType;
uint32 TriggerSpell;
flag96 SpellClassMask;
flag128 SpellClassMask;
std::list<Condition*>* ImplicitTargetConditions;
// SpellScalingEntry
float ScalingMultiplier;
float DeltaScalingMultiplier;
float ComboScalingMultiplier;
SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0),
RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0),
BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTarget(0),
SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), ApplyAuraPeriod(0), DieSides(0),
RealPointsPerLevel(0), BasePoints(0), PointsPerResource(0), Amplitude(0), ChainAmplitude(0),
BonusCoefficient(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTargets(0),
ItemType(0), TriggerSpell(0), ImplicitTargetConditions(NULL) {}
SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* effect);
@@ -316,6 +316,9 @@ public:
uint32 AttributesEx8;
uint32 AttributesEx9;
uint32 AttributesEx10;
uint32 AttributesEx11;
uint32 AttributesEx12;
uint32 AttributesEx13;
uint32 AttributesCu;
uint32 Stances;
uint32 StancesNot;
@@ -325,8 +328,8 @@ public:
uint32 FacingCasterFlags;
uint32 CasterAuraState;
uint32 TargetAuraState;
uint32 CasterAuraStateNot;
uint32 TargetAuraStateNot;
uint32 ExcludeCasterAuraState;
uint32 ExcludeTargetAuraState;
uint32 CasterAuraSpell;
uint32 TargetAuraSpell;
uint32 ExcludeCasterAuraSpell;
@@ -370,10 +373,10 @@ public:
uint32 MaxTargetLevel;
uint32 MaxAffectedTargets;
uint32 SpellFamilyName;
flag96 SpellFamilyFlags;
flag128 SpellFamilyFlags;
uint32 DmgClass;
uint32 PreventionType;
int32 AreaGroupId;
int32 RequiredAreasID;
uint32 SchoolMask;
uint32 SpellDifficultyId;
uint32 SpellScalingId;
@@ -391,6 +394,7 @@ public:
uint32 SpellShapeshiftId;
uint32 SpellTargetRestrictionsId;
uint32 SpellTotemsId;
uint32 SpellMiscId;
// SpellScalingEntry
int32 CastTimeMin;
int32 CastTimeMax;
@@ -418,6 +422,7 @@ public:
SpellScalingEntry const* GetSpellScaling() const;
SpellShapeshiftEntry const* GetSpellShapeshift() const;
SpellTotemsEntry const* GetSpellTotems() const;
SpellMiscEntry const* GetSpellMisc() const;
SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects);
~SpellInfo();
+27 -24
View File
@@ -35,20 +35,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;
@@ -466,9 +466,10 @@ void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id)
mSpellDifficultySearcherMap[spellId] = id;
}
// TODO: 6.x adapt to new spell diff system
uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) const
{
if (!GetSpellInfo(spellId))
/*if (!GetSpellInfo(spellId))
return spellId;
if (!caster || !caster->GetMap() || !caster->GetMap()->IsDungeon())
@@ -506,6 +507,8 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
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]);
*/
return 0;
}
SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const
@@ -2207,7 +2210,7 @@ void SpellMgr::LoadSkillLineAbilityMap()
if (!SkillInfo)
continue;
mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo));
mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->SpellID, SkillInfo));
++count;
}
@@ -2432,7 +2435,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)
@@ -2441,17 +2444,17 @@ void SpellMgr::LoadPetLevelupSpellMap()
if (!skillLine)
continue;
//if (skillLine->skillId != creatureFamily->skillLine[0] &&
// (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1]))
//if (skillLine->skillId != creatureFamily->SkillLine[0] &&
// (!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->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
SpellInfo const* spell = GetSpellInfo(skillLine->spellId);
SpellInfo const* spell = GetSpellInfo(skillLine->SpellID);
if (!spell) // not exist or triggered or talent
continue;
@@ -2543,7 +2546,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))
{
@@ -2813,7 +2816,7 @@ void SpellMgr::LoadSpellInfoStore()
if (!effect)
continue;
effectsBySpell[effect->EffectSpellId].effects[effect->EffectIndex] = effect;
effectsBySpell[effect->SpellID].effects[effect->EffectIndex] = effect;
}
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
@@ -2951,10 +2954,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->EffectSpellID[s]);
if (!procInfo)
continue;
@@ -3188,7 +3191,7 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->ProcCharges = 1;
break;
case 44544: // Fingers of Frost
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0);
spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(685904631, 1151048, 0, 0);
break;
case 74396: // Fingers of Frost visual buff
spellInfo->ProcCharges = 2;
@@ -3212,7 +3215,7 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_0].MiscValue |= 1;
break;
case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster
spellInfo->Effects[EFFECT_0].Amplitude = 3000;
spellInfo->Effects[EFFECT_0].ApplyAuraPeriod = 3000;
break;
// Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data
// To prevent aura staying on target after talent unlearned
@@ -3231,7 +3234,7 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA;
spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2;
spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000);
spellInfo->Effects[EFFECT_1].SpellClassMask = flag128(0x00000000, 0x00004000, 0x00000000, 0x00000000);
break;
case 47569: // Improved Shadowform (Rank 1)
// with this spell atrribute aura can be stacked several times
@@ -3273,7 +3276,7 @@ void SpellMgr::LoadSpellInfoCorrections()
break;
case 53241: // Marked for Death (Rank 1)
case 53243: // Marked for Death (Rank 2)
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00067801, 0x10820001, 0x00000801);
spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00067801, 0x10820001, 0x00000801, 0x00000000);
break;
case 5176: // Wrath
case 2912: // Starfire
@@ -3294,22 +3297,22 @@ void SpellMgr::LoadSpellInfoCorrections()
// this is done because another spell also uses the same SpellFamilyFlags as Icy Touch
// SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a)
// this needs research on modifier applying rules, does not seem to be in Attributes fields
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000);
spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00000040, 0x00000000, 0x00000000, 0x00000000);
break;
case 64949: // Idol of the Flourishing Life
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000);
spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00000000, 0x02000000, 0x00000000, 0x00000000);
spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
break;
case 34231: // Libram of the Lightbringer
case 60792: // Libram of Tolerance
case 64956: // Libram of the Resolute
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000);
spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x80000000, 0x00000000, 0x00000000, 0x00000000);
spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
break;
case 28851: // Libram of Light
case 28853: // Libram of Divinity
case 32403: // Blessed Book of Nagrand
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000);
spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x40000000, 0x00000000, 0x00000000, 0x00000000);
spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
break;
case 45602: // Ride Carpet
@@ -3540,7 +3543,7 @@ void SpellMgr::LoadSpellInfoCorrections()
break;
case 71266: // Swarming Shadows
case 72890: // Swarming Shadows
spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel
spellInfo->RequiredAreasID = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel
break;
case 70602: // Corruption
case 48278: // Paralyze
+5 -5
View File
@@ -277,11 +277,11 @@ public:
if (titleInfo && target->HasTitle(titleInfo))
{
std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale;
std::string name = target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang;
if (name.empty())
continue;
char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID
? handler->GetTrinityString(LANG_ACTIVE)
: "";
@@ -290,9 +290,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, localeNames[loc], knownStr, activeStr);
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->MaskID, id, titleNameStr, localeNames[loc], knownStr, activeStr);
else
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->MaskID, name.c_str(), localeNames[loc], knownStr, activeStr);
}
}
@@ -566,7 +566,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_lang : "#Not found#";
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
+3 -3
View File
@@ -391,9 +391,9 @@ public:
return false;
}
if (!MapManager::IsValidMapCoord(at->mapid, at->x, at->y, at->z))
if (!MapManager::IsValidMapCoord(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z))
{
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->x, at->y, at->mapid);
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->Pos.X, at->Pos.Y, at->MapID);
handler->SetSentErrorMessage(true);
return false;
}
@@ -408,7 +408,7 @@ public:
else
player->SaveRecallPosition();
player->TeleportTo(at->mapid, at->x, at->y, at->z, player->GetOrientation());
player->TeleportTo(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z, player->GetOrientation());
return true;
}
+20 -20
View File
@@ -152,7 +152,7 @@ public:
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->getClass());
if (!classEntry)
return true;
uint32 family = classEntry->spellfamily;
uint32 family = classEntry->SpellClassSet;
for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i)
{
@@ -160,7 +160,7 @@ public:
if (!entry)
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->SpellID);
if (!spellInfo)
continue;
@@ -266,7 +266,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);
@@ -284,7 +284,7 @@ public:
continue;
// prevent learn talent for different family (cheating)
if (((1 << petFamily->petTalentType) & talentTabInfo->petTalentMask) == 0)
if (((1 << petFamily->PetTalentType) & talentTabInfo->petTalentMask) == 0)
continue;
// search highest talent rank
@@ -352,10 +352,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);
}
}
@@ -395,12 +395,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_lang;
if (name.empty())
continue;
@@ -413,10 +413,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;
}
@@ -432,26 +432,26 @@ public:
continue;
// wrong skill
if (skillLine->skillId != skillId)
if (skillLine->SkillLine != skillId)
continue;
// not high rank
if (skillLine->forward_spellid)
if (skillLine->SupercedesSpell)
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->SpellID);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false))
continue;
player->LearnSpell(skillLine->spellId, false);
player->LearnSpell(skillLine->SpellID, false);
}
}
+9 -9
View File
@@ -299,7 +299,7 @@ public:
{
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
std::string name = factionEntry->name;
std::string name = factionEntry->Name_lang;
if (name.empty())
continue;
@@ -461,7 +461,7 @@ public:
ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
if (set)
{
std::string name = set->name;
std::string name = set->Name_lang;
if (name.empty())
continue;
@@ -724,7 +724,7 @@ public:
SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id);
if (skillInfo)
{
std::string name = skillInfo->name;
std::string name = skillInfo->DisplayName_lang;
if (name.empty())
continue;
@@ -1072,7 +1072,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->NameMale_lang : titleInfo->NameFemale_lang;
if (name.empty())
continue;
@@ -1088,7 +1088,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->MaskID
? handler->GetTrinityString(LANG_ACTIVE)
: "";
@@ -1097,9 +1097,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->MaskID, 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->MaskID, titleNameStr, "", knownStr, activeStr);
++counter;
}
@@ -1132,7 +1132,7 @@ public:
{
if (MapEntry const* mapInfo = sMapStore.LookupEntry(id))
{
std::string name = mapInfo->name;
std::string name = mapInfo->MapName_lang;
if (name.empty())
continue;
@@ -1150,7 +1150,7 @@ public:
if (mapInfo->IsContinent())
ss << handler->GetTrinityString(LANG_CONTINENT);
switch (mapInfo->map_type)
switch (mapInfo->InstanceType)
{
case MAP_INSTANCE:
ss << handler->GetTrinityString(LANG_INSTANCE);
+3 -3
View File
@@ -202,7 +202,7 @@ public:
char const* unknown = handler->GetTrinityString(LANG_UNKNOWN);
handler->PSendSysMessage(LANG_MAP_POSITION,
mapId, (mapEntry ? mapEntry->name : unknown),
mapId, (mapEntry ? mapEntry->MapName_lang : unknown),
zoneId, (zoneEntry ? zoneEntry->area_name : unknown),
areaId, (areaEntry ? areaEntry->area_name : unknown),
object->GetPhaseMask(),
@@ -1359,7 +1359,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_lang, handler->GetNameLink(target).c_str(), level, max);
return true;
}
@@ -1714,7 +1714,7 @@ public:
}
if (target)
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name,
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->MapName_lang,
(!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)),
(!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)));
+3 -3
View File
@@ -1233,16 +1233,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_lang, 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_lang, factionId,
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
return true;
}
+1 -1
View File
@@ -93,7 +93,7 @@ public:
return false;
}
uint8 powerType = classEntry->powerType;
uint8 powerType = classEntry->PowerType;
// reset m_form if no aura
if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
+5 -5
View File
@@ -94,9 +94,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->MaskID);
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->NameMale_lang : titleInfo->NameFemale_lang, tNameLink.c_str());
return true;
}
@@ -138,7 +138,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->NameMale_lang : titleInfo->NameFemale_lang, target->GetName().c_str());
target->SetTitle(titleInfo);
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str());
@@ -186,7 +186,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->NameMale_lang : titleInfo->NameFemale_lang, target->GetName().c_str());
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str());
@@ -225,7 +225,7 @@ public:
for (uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
if (CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
titles2 &= ~(uint64(1) << tEntry->bit_index);
titles2 &= ~(uint64(1) << tEntry->MaskID);
titles &= ~titles2; // remove not existed titles
+1 -1
View File
@@ -928,7 +928,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;
@@ -1847,7 +1847,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
SpellInfo const* damageInfo = sSpellMgr->EnsureSpellInfo(SPELL_ROCKET_PACK_DAMAGE);
GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), NULL, TRIGGERED_FULL_MASK);
GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetPeriod()), NULL, TRIGGERED_FULL_MASK);
GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK);
}
@@ -155,7 +155,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;
@@ -192,7 +192,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;
+1 -1
View File
@@ -628,7 +628,7 @@ class spell_dk_death_strike : public SpellScriptLoader
if (AuraEffect* enabler = GetCaster()->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID()))
{
// Call CalculateAmount() to constantly fire the AuraEffect's HandleCalcAmount method
int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier);
int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].ChainAmplitude);
if (AuraEffect const* aurEff = GetCaster()->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_DEATH_STRIKE, EFFECT_2))
heal = AddPct(heal, aurEff->GetAmount());
+6 -6
View File
@@ -312,13 +312,13 @@ class spell_rog_deadly_poison : public SpellScriptLoader
for (uint8 s = 0; s < 3; ++s)
{
if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->EffectSpellID[s]);
if (!spellInfo)
{
TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->spellid[s]);
TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->EffectSpellID[s]);
continue;
}
@@ -327,13 +327,13 @@ class spell_rog_deadly_poison : public SpellScriptLoader
continue;
// Do not reproc deadly
if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0))
if (spellInfo->SpellFamilyFlags == flag96(0x10000, 0x80000, 0))
continue;
if (spellInfo->IsPositive())
player->CastSpell(player, enchant->spellid[s], true, item);
player->CastSpell(player, enchant->EffectSpellID[s], true, item);
else
player->CastSpell(target, enchant->spellid[s], true, item);
player->CastSpell(target, enchant->EffectSpellID[s], true, item);
}
}
}
+1 -1
View File
@@ -1249,7 +1249,7 @@ class spell_warl_soul_swap_dot_marker : public SpellScriptLoader
if (!warlock || !swapVictim)
return;
flag96 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask;
flag128 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask;
Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras();
SoulSwapOverrideAuraScript* swapSpellScript = NULL;
+1 -1
View File
@@ -245,7 +245,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
ApplyPct(damage, 16 * GetSpellInfo()->GetRank());
SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC);
uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].Amplitude;
uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].ApplyAuraPeriod;
// Add remaining ticks to damage done
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, EFFECT_0, caster->GetGUID()))
@@ -180,7 +180,7 @@ class AreaTrigger_at_last_rites : public AreaTriggerScript
WorldLocation pPosition;
switch (trigger->id)
switch (trigger->ID)
{
case 5332:
case 5338:
@@ -233,7 +233,7 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript
if (!player->isDead() && (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) != QUEST_STATUS_NONE ||
(player->GetQuestStatus(QUEST_THE_MAKERS_OVERLOOK) == QUEST_STATUS_REWARDED && player->GetQuestStatus(QUEST_THE_MAKERS_PERCH) == QUEST_STATUS_REWARDED)))
{
switch (trigger->id)
switch (trigger->ID)
{
case AT_SHOLAZAR:
player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, true);
@@ -312,7 +312,7 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override
{
uint32 triggerId = trigger->id;
uint32 triggerId = trigger->ID;
// Second trigger happened too early after first, skip for now
if (sWorld->GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN)
return false;
@@ -370,8 +370,8 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
if (!player->IsAlive())
return false;
uint32 triggerId = trigger->id;
if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN)
uint32 triggerId = trigger->ID;
if (sWorld->GetGameTime() - _triggerTimes[trigger->ID] < SUMMON_COOLDOWN)
return false;
switch (triggerId)
@@ -400,7 +400,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
player->AddAura(SPELL_A52_NEURALYZER, player);
_triggerTimes[trigger->id] = sWorld->GetGameTime();
_triggerTimes[trigger->ID] = sWorld->GetGameTime();
return false;
}
+1 -1
View File
@@ -236,7 +236,7 @@ public:
{
uint32 Spell = 0;
switch (pFaction->faction)
switch (pFaction->Faction)
{
case 1011: Spell = SPELL_REP_LC; break;
case 935: Spell = SPELL_REP_SHAT; break;
+138 -2
View File
@@ -27,6 +27,7 @@
#include <vector>
#include <list>
#include <map>
#include <stdarg.h>
template<typename T>
struct Optional
@@ -388,7 +389,142 @@ class HookList
}
};
class flag96
template<uint8 T_size>
class flag
{
protected:
uint32 part[T_size];
public:
flag()
{
memset(part, 0, sizeof(uint32)*T_size);
}
flag(uint32 first, ...)
{
va_list ap;
part[0] = first;
va_start(ap, first);
for (int i = 1; i < T_size; ++i)
part[i] = va_arg(ap, uint32);
va_end(ap);
}
inline bool operator <(const flag<T_size>& right) const
{
for (uint8 i = T_size; i > 0; --i)
{
if (part[i - 1] < right.part[i - 1])
return true;
else if (part[i - 1] > right.part[i - 1])
return false;
}
return false;
}
inline bool operator ==(const flag<T_size>& right) const
{
for (uint8 i = 0; i < T_size; ++i)
if (part[i] != right.part[i])
return false;
return true;
}
inline bool operator !=(const flag<T_size>& right) const
{
return !this->operator ==(right);
}
inline flag<T_size>& operator =(const flag<T_size>& right)
{
for (uint8 i = 0; i < T_size; ++i)
part[i] = right.part[i];
return *this;
}
inline flag<T_size> operator &(const flag<T_size> &right) const
{
flag<T_size> fl;
for (uint8 i = 0; i < T_size; ++i)
fl.part[i] = part[i] & right.part[i];
return fl;
}
inline flag<T_size>& operator &=(const flag<T_size> &right)
{
for (uint8 i = 0; i < T_size; ++i)
part[i] &= right.part[i];
return *this;
}
inline flag<T_size> operator |(const flag<T_size> &right) const
{
flag<T_size> fl;
for (uint8 i = 0; i < T_size; ++i)
fl.part[i] = part[i] | right.part[i];
return fl;
}
inline flag<T_size>& operator |=(const flag<T_size> &right)
{
for (uint8 i = 0; i < T_size; ++i)
part[i] |= right.part[i];
return *this;
}
inline flag<T_size> operator ~() const
{
flag<T_size> fl;
for (uint8 i = 0; i < T_size; ++i)
fl.part[i] = ~part[i];
return fl;
}
inline flag<T_size> operator ^(const flag<T_size>& right) const
{
flag<T_size> fl;
for (uint8 i = 0; i < T_size; ++i)
fl.part[i] = part[i] ^ right.part[i];
return fl;
}
inline flag<T_size>& operator ^=(const flag<T_size>& right)
{
for (uint8 i = 0; i < T_size; ++i)
part[i] ^= right.part[i];
return *this;
}
inline operator bool() const
{
for (uint8 i = 0; i < T_size; ++i)
if (part[i] != 0)
return true;
return false;
}
inline bool operator !() const
{
return !this->operator bool();
}
inline uint32& operator [](uint8 el)
{
return part[el];
}
inline const uint32& operator [](uint8 el) const
{
return part[el];
}
};
typedef flag<3> flag96;
typedef flag<4> flag128;
/*class flag96
{
private:
uint32 part[3];
@@ -519,7 +655,7 @@ public:
{
return part[el];
}
};
};*/
enum ComparisionType
{
@@ -247,6 +247,7 @@ char const* DBFilesClientList[] =
"DBFilesClient\\WorldStateZoneSounds.dbc",
"DBFilesClient\\ZoneMusic.dbc",
"DBFilesClient\\ZoneIntroMusicTable.dbc",
"DBFilesClient\\WorldSafeLocs.dbc",
"DBFilesClient\\WorldStateUI.dbc",
"DBFilesClient\\WorldState.dbc",
"DBFilesClient\\WorldMapTransforms.dbc",