mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Core/Misc: Fixed deprecation warnings for c++20
This commit is contained in:
@@ -6,7 +6,7 @@ index c562f5c920f7..c86b20fd7e97 100644
|
||||
|
||||
/** Resizes this to match the size of \a other and then copies the data from other using memcpy. This is only safe for POD types */
|
||||
void copyPOD(const Array<T>& other) {
|
||||
+ static_assert(std::is_pod<T>::value, "copyPOD called on non-POD type");
|
||||
+ static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "copyPOD called on non-POD type");
|
||||
if (numAllocated < other.num) {
|
||||
m_memoryManager->free(data);
|
||||
data = NULL;
|
||||
@@ -14,7 +14,7 @@ index c562f5c920f7..c86b20fd7e97 100644
|
||||
/** Resizes this to just barely match the size of \a other + itself and then copies the data to the end of the array from other using memcpy.
|
||||
This is only safe for POD types */
|
||||
void appendPOD(const Array<T>& other) {
|
||||
+ static_assert(std::is_pod<T>::value, "appendPOD called on non-POD type");
|
||||
+ static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "appendPOD called on non-POD type");
|
||||
const size_t oldSize = num;
|
||||
num += other.num;
|
||||
if (numAllocated < num) {
|
||||
|
||||
@@ -346,7 +346,7 @@ public:
|
||||
|
||||
/** Resizes this to match the size of \a other and then copies the data from other using memcpy. This is only safe for POD types */
|
||||
void copyPOD(const Array<T>& other) {
|
||||
static_assert(std::is_pod<T>::value, "copyPOD called on non-POD type");
|
||||
static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "copyPOD called on non-POD type");
|
||||
if (numAllocated < other.num) {
|
||||
m_memoryManager->free(data);
|
||||
data = NULL;
|
||||
@@ -365,7 +365,7 @@ public:
|
||||
/** Resizes this to just barely match the size of \a other + itself and then copies the data to the end of the array from other using memcpy.
|
||||
This is only safe for POD types */
|
||||
void appendPOD(const Array<T>& other) {
|
||||
static_assert(std::is_pod<T>::value, "appendPOD called on non-POD type");
|
||||
static_assert(std::is_standard_layout_v<T> && std::is_trivial_v<T>, "appendPOD called on non-POD type");
|
||||
const size_t oldSize = num;
|
||||
num += other.num;
|
||||
if (numAllocated < num) {
|
||||
|
||||
@@ -461,13 +461,13 @@ Item* AuctionHouseMgr::GetAItem(ObjectGuid itemGuid)
|
||||
uint64 AuctionHouseMgr::GetCommodityAuctionDeposit(ItemTemplate const* item, Minutes time, uint32 quantity)
|
||||
{
|
||||
uint32 sellPrice = item->GetSellPrice();
|
||||
return uint64(std::ceil(std::floor(fmax(0.15 * quantity * sellPrice, 100.0)) / SILVER) * SILVER) * (time.count() / (MIN_AUCTION_TIME / MINUTE));
|
||||
return uint64(std::ceil(std::floor(fmax(0.15 * quantity * sellPrice, 100.0)) / int64(SILVER)) * int64(SILVER)) * (time.count() / (MIN_AUCTION_TIME / MINUTE));
|
||||
}
|
||||
|
||||
uint64 AuctionHouseMgr::GetItemAuctionDeposit(Player* player, Item* item, Minutes time)
|
||||
{
|
||||
uint32 sellPrice = item->GetSellPrice(player);
|
||||
return uint64(std::ceil(std::floor(fmax(sellPrice * 0.15, 100.0)) / SILVER) * SILVER) * (time.count() / (MIN_AUCTION_TIME / MINUTE));
|
||||
return uint64(std::ceil(std::floor(fmax(sellPrice * 0.15, 100.0)) / int64(SILVER)) * int64(SILVER)) * (time.count() / (MIN_AUCTION_TIME / MINUTE));
|
||||
}
|
||||
|
||||
std::string AuctionHouseMgr::BuildItemAuctionMailSubject(AuctionMailType type, AuctionPosting const* auction)
|
||||
|
||||
@@ -398,7 +398,7 @@ uint32 AuctionBotBuyer::GetChanceMultiplier(uint32 quality)
|
||||
// Buys the auction and does necessary actions to complete the buyout
|
||||
void AuctionBotBuyer::BuyEntry(AuctionPosting* auction, AuctionHouseObject* auctionHouse)
|
||||
{
|
||||
TC_LOG_DEBUG("ahbot", "AHBot: Entry %u bought at %.2fg", auction->Id, float(auction->BuyoutOrUnitPrice) / GOLD);
|
||||
TC_LOG_DEBUG("ahbot", "AHBot: Entry %u bought at %.2fg", auction->Id, float(auction->BuyoutOrUnitPrice) / float(GOLD));
|
||||
|
||||
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
@@ -426,7 +426,7 @@ void AuctionBotBuyer::BuyEntry(AuctionPosting* auction, AuctionHouseObject* auct
|
||||
// Bids on the auction and does the necessary actions for bidding
|
||||
void AuctionBotBuyer::PlaceBidToEntry(AuctionPosting* auction, AuctionHouseObject* auctionHouse, uint32 bidPrice)
|
||||
{
|
||||
TC_LOG_DEBUG("ahbot", "AHBot: Bid placed to entry %u, %.2fg", auction->Id, float(bidPrice) / GOLD);
|
||||
TC_LOG_DEBUG("ahbot", "AHBot: Bid placed to entry %u, %.2fg", auction->Id, float(bidPrice) / float(GOLD));
|
||||
|
||||
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
|
||||
@@ -991,7 +991,7 @@ bool BfCapturePoint::Update(uint32 diff)
|
||||
}
|
||||
|
||||
// get the difference of numbers
|
||||
float fact_diff = ((float) m_activePlayers[TEAM_ALLIANCE].size() - (float) m_activePlayers[TEAM_HORDE].size()) * diff / BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL;
|
||||
float fact_diff = ((float) m_activePlayers[TEAM_ALLIANCE].size() - (float) m_activePlayers[TEAM_HORDE].size()) * diff / float(BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL);
|
||||
if (G3D::fuzzyEq(fact_diff, 0.0f))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team)
|
||||
|
||||
uint8 capturedNodes = 0;
|
||||
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
if (m_Nodes[i] == GetTeamIndexByTeamId(team) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i])
|
||||
if (m_Nodes[i] == uint8(GetTeamIndexByTeamId(team)) + BG_AB_NODE_TYPE_OCCUPIED && !m_NodeTimers[i])
|
||||
++capturedNodes;
|
||||
|
||||
if (capturedNodes >= 5)
|
||||
@@ -456,7 +456,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* /*targ
|
||||
{
|
||||
UpdatePlayerScore(source, SCORE_BASES_ASSAULTED, 1);
|
||||
m_prevNodes[node] = m_Nodes[node];
|
||||
m_Nodes[node] = teamIndex + BG_AB_NODE_TYPE_CONTESTED;
|
||||
m_Nodes[node] = uint8(teamIndex) + BG_AB_NODE_TYPE_CONTESTED;
|
||||
// burn current contested banner
|
||||
_DelBanner(node, BG_AB_NODE_TYPE_CONTESTED, !teamIndex);
|
||||
// create new contested banner
|
||||
@@ -474,7 +474,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* /*targ
|
||||
{
|
||||
UpdatePlayerScore(source, SCORE_BASES_DEFENDED, 1);
|
||||
m_prevNodes[node] = m_Nodes[node];
|
||||
m_Nodes[node] = teamIndex + BG_AB_NODE_TYPE_OCCUPIED;
|
||||
m_Nodes[node] = uint8(teamIndex) + BG_AB_NODE_TYPE_OCCUPIED;
|
||||
// burn current contested banner
|
||||
_DelBanner(node, BG_AB_NODE_TYPE_CONTESTED, !teamIndex);
|
||||
// create new occupied banner
|
||||
@@ -495,7 +495,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* /*targ
|
||||
{
|
||||
UpdatePlayerScore(source, SCORE_BASES_ASSAULTED, 1);
|
||||
m_prevNodes[node] = m_Nodes[node];
|
||||
m_Nodes[node] = teamIndex + BG_AB_NODE_TYPE_CONTESTED;
|
||||
m_Nodes[node] = uint8(teamIndex) + BG_AB_NODE_TYPE_CONTESTED;
|
||||
// burn current occupied banner
|
||||
_DelBanner(node, BG_AB_NODE_TYPE_OCCUPIED, !teamIndex);
|
||||
// create new contested banner
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
BattlegroundAV::BattlegroundAV(BattlegroundTemplate const* battlegroundTemplate) : Battleground(battlegroundTemplate)
|
||||
{
|
||||
BgObjects.resize(BG_AV_OBJECT_MAX);
|
||||
BgCreatures.resize(AV_CPLACE_MAX+AV_STATICCPLACE_MAX);
|
||||
BgCreatures.resize(AV_CPLACE_MAX + AsUnderlyingType(AV_STATICCPLACE_MAX));
|
||||
|
||||
for (uint8 i = 0; i < 2; i++)
|
||||
{
|
||||
@@ -281,7 +281,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
{
|
||||
bool isStatic = false;
|
||||
Creature* creature = nullptr;
|
||||
ASSERT(type < AV_CPLACE_MAX + AV_STATICCPLACE_MAX);
|
||||
ASSERT(type < AV_CPLACE_MAX + AsUnderlyingType(AV_STATICCPLACE_MAX));
|
||||
if (type >= AV_CPLACE_MAX) //static
|
||||
{
|
||||
type -= AV_CPLACE_MAX;
|
||||
@@ -577,8 +577,8 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
RewardReputationToTeam(owner == ALLIANCE ? 730 : 729, BG_AV_REP_TOWER, owner);
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(BG_AV_KILL_TOWER), owner);
|
||||
|
||||
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp), RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp), RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH + uint32(GetTeamIndexByTeamId(owner)) + (2 * tmp), RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH + uint32(GetTeamIndexByTeamId(owner)) + (2 * tmp), RESPAWN_ONE_DAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -586,8 +586,8 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
SpawnBGObject(object-11, RESPAWN_IMMEDIATELY);
|
||||
else
|
||||
SpawnBGObject(object+11, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION + 3 * node, RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION + uint32(GetTeamIndexByTeamId(owner)) + 3 * node, RESPAWN_IMMEDIATELY);
|
||||
PopulateNode(node);
|
||||
if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy
|
||||
{
|
||||
@@ -892,8 +892,8 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
|
||||
if (!IsTower(node))
|
||||
{
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(team)+3*node, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION + 3 * node, RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION + uint32(GetTeamIndexByTeamId(team)) + 3 * node, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
// despawn old go
|
||||
SpawnBGObject(object, RESPAWN_ONE_DAY);
|
||||
@@ -998,8 +998,8 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
else
|
||||
{
|
||||
//spawning/despawning of aura
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_IMMEDIATELY); //neutral aura spawn
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node, RESPAWN_ONE_DAY); //teeamaura despawn
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION + 3 * node, RESPAWN_IMMEDIATELY); //neutral aura spawn
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION + uint32(GetTeamIndexByTeamId(owner)) + 3 * node, RESPAWN_ONE_DAY); //teeamaura despawn
|
||||
|
||||
RelocateDeadPlayers(BgCreatures[node]);
|
||||
}
|
||||
@@ -1463,7 +1463,7 @@ void BattlegroundAV::Reset()
|
||||
InitNode(BG_AV_NODES_SNOWFALL_GRAVE, AV_NEUTRAL_TEAM, false); //give snowfall neutral owner
|
||||
|
||||
m_Mine_Timer = AV_MINE_TICK_TIMER;
|
||||
for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++)
|
||||
for (uint16 i = 0; i < AV_CPLACE_MAX + AsUnderlyingType(AV_STATICCPLACE_MAX); i++)
|
||||
if (!BgCreatures[i].IsEmpty())
|
||||
DelCreature(i);
|
||||
}
|
||||
|
||||
@@ -427,13 +427,13 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
|
||||
nodePoint[i].timer = BANNER_STATE_CHANGE_TIME; // 1 minute for last change (real faction banner)
|
||||
nodePoint[i].needChange = true;
|
||||
|
||||
RelocateDeadPlayers(BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1 + nodePoint[i].nodeType - 2]);
|
||||
RelocateDeadPlayers(BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1 + uint32(nodePoint[i].nodeType) - 2]);
|
||||
|
||||
// if we are here means that the point has been lost, or it is the first capture
|
||||
|
||||
if (nodePoint[i].nodeType != NODE_TYPE_REFINERY && nodePoint[i].nodeType != NODE_TYPE_QUARRY)
|
||||
if (!BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1 + (nodePoint[i].nodeType) - 2].IsEmpty())
|
||||
DelCreature(BG_IC_NPC_SPIRIT_GUIDE_1 + (nodePoint[i].nodeType) - 2);
|
||||
if (!BgCreatures[BG_IC_NPC_SPIRIT_GUIDE_1 + uint32(nodePoint[i].nodeType) - 2].IsEmpty())
|
||||
DelCreature(BG_IC_NPC_SPIRIT_GUIDE_1 + uint32(nodePoint[i].nodeType) - 2);
|
||||
|
||||
UpdatePlayerScore(player, SCORE_BASES_ASSAULTED, 1);
|
||||
|
||||
@@ -577,7 +577,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture)
|
||||
{
|
||||
if (node->nodeType != NODE_TYPE_REFINERY && node->nodeType != NODE_TYPE_QUARRY)
|
||||
{
|
||||
if (!AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+node->nodeType-2, BG_IC_SpiritGuidePos[node->nodeType], node->faction))
|
||||
if (!AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1 + uint32(node->nodeType) - 2, BG_IC_SpiritGuidePos[node->nodeType], node->faction))
|
||||
TC_LOG_ERROR("bg.battleground", "Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", node->nodeType, node->faction);
|
||||
}
|
||||
|
||||
@@ -878,7 +878,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
||||
}
|
||||
// If not, place ghost on starting location
|
||||
if (!good_entry)
|
||||
good_entry = sObjectMgr->GetWorldSafeLoc(BG_IC_GraveyardIds[teamIndex+MAX_NODE_TYPES]);
|
||||
good_entry = sObjectMgr->GetWorldSafeLoc(BG_IC_GraveyardIds[uint32(teamIndex) + MAX_NODE_TYPES]);
|
||||
|
||||
return good_entry;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ BattlegroundSA::BattlegroundSA(BattlegroundTemplate const* battlegroundTemplate)
|
||||
StartMessageIds[BG_STARTING_EVENT_FOURTH] = 0; // handle by Kanrethad
|
||||
|
||||
BgObjects.resize(BG_SA_MAXOBJ);
|
||||
BgCreatures.resize(BG_SA_MAXNPC + BG_SA_MAX_GY);
|
||||
BgCreatures.resize(AsUnderlyingType(BG_SA_MAXNPC) + AsUnderlyingType(BG_SA_MAX_GY));
|
||||
TimerEnabled = false;
|
||||
UpdateWaitTimer = 0;
|
||||
SignaledRoundTwo = false;
|
||||
@@ -94,7 +94,7 @@ bool BattlegroundSA::ResetObjs()
|
||||
for (uint8 i = 0; i < BG_SA_MAXNPC; i++)
|
||||
DelCreature(i);
|
||||
|
||||
for (uint8 i = BG_SA_MAXNPC; i < BG_SA_MAXNPC + BG_SA_MAX_GY; i++)
|
||||
for (uint8 i = BG_SA_MAXNPC; i < AsUnderlyingType(BG_SA_MAXNPC) + AsUnderlyingType(BG_SA_MAX_GY); i++)
|
||||
DelCreature(i);
|
||||
|
||||
for (uint8 i = 0; i < MAX_GATES; ++i)
|
||||
@@ -750,7 +750,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
|
||||
if (GraveyardStatus[i] == Attackers)
|
||||
return;
|
||||
|
||||
DelCreature(BG_SA_MAXNPC + i);
|
||||
DelCreature(AsUnderlyingType(BG_SA_MAXNPC) + i);
|
||||
TeamId teamId = GetTeamIndexByTeamId(GetPlayerTeam(Source->GetGUID()));
|
||||
GraveyardStatus[i] = teamId;
|
||||
WorldSafeLocsEntry const* sg = sObjectMgr->GetWorldSafeLoc(BG_SA_GYEntries[i]);
|
||||
@@ -760,7 +760,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
|
||||
return;
|
||||
}
|
||||
|
||||
AddSpiritGuide(i + BG_SA_MAXNPC, sg->Loc.GetPositionX(), sg->Loc.GetPositionY(), sg->Loc.GetPositionZ(), BG_SA_GYOrientation[i], GraveyardStatus[i]);
|
||||
AddSpiritGuide(i + AsUnderlyingType(BG_SA_MAXNPC), sg->Loc.GetPositionX(), sg->Loc.GetPositionY(), sg->Loc.GetPositionZ(), BG_SA_GYOrientation[i], GraveyardStatus[i]);
|
||||
uint32 npc = 0;
|
||||
uint32 flag = 0;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void AzeriteEmpoweredItem::ClearSelectedAzeritePowers()
|
||||
int64 AzeriteEmpoweredItem::GetRespecCost() const
|
||||
{
|
||||
if (Player const* owner = GetOwner())
|
||||
return int64(GOLD * sDB2Manager.GetCurveValueAt(CURVE_ID_AZERITE_EMPOWERED_ITEM_RESPEC_COST, float(owner->GetNumRespecs())));
|
||||
return int64(float(GOLD) * sDB2Manager.GetCurveValueAt(CURVE_ID_AZERITE_EMPOWERED_ITEM_RESPEC_COST, float(owner->GetNumRespecs())));
|
||||
|
||||
return MAX_MONEY_AMOUNT + 1;
|
||||
}
|
||||
|
||||
@@ -8240,7 +8240,7 @@ void Player::ApplyArtifactPowerRank(Item* artifact, ArtifactPowerRankEntry const
|
||||
args.SetCastItem(artifact);
|
||||
if (artifactPowerRank->AuraPointsOverride)
|
||||
for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
|
||||
args.AddSpellMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + spellEffectInfo.EffectIndex), artifactPowerRank->AuraPointsOverride);
|
||||
args.AddSpellMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + AsUnderlyingType(spellEffectInfo.EffectIndex)), artifactPowerRank->AuraPointsOverride);
|
||||
|
||||
CastSpell(this, artifactPowerRank->SpellID, args);
|
||||
}
|
||||
@@ -8541,7 +8541,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
|
||||
|
||||
for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
|
||||
if (spellEffectInfo.IsEffect())
|
||||
args.AddSpellMod(static_cast<SpellValueMod>(SPELLVALUE_BASE_POINT0 + spellEffectInfo.EffectIndex), CalculatePct(spellEffectInfo.CalcValue(this), effectPct));
|
||||
args.AddSpellMod(static_cast<SpellValueMod>(SPELLVALUE_BASE_POINT0 + AsUnderlyingType(spellEffectInfo.EffectIndex)), CalculatePct(spellEffectInfo.CalcValue(this), effectPct));
|
||||
}
|
||||
CastSpell(target, spellInfo->Id, args);
|
||||
}
|
||||
@@ -27190,10 +27190,12 @@ void Player::StartLoadingActionButtons(std::function<void()>&& callback /*= null
|
||||
// safe callback, we can't pass this pointer directly
|
||||
// in case player logs out before db response (player would be deleted in that case)
|
||||
if (Player* thisPlayer = mySess->GetPlayer(); thisPlayer && thisPlayer->GetGUID() == myGuid)
|
||||
{
|
||||
thisPlayer->LoadActions(result);
|
||||
|
||||
if (callback)
|
||||
callback();
|
||||
if (callback)
|
||||
callback();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -27292,7 +27294,7 @@ void Player::UpdateTraitConfig(WorldPackets::Traits::TraitConfig&& newConfig, in
|
||||
break;
|
||||
}
|
||||
|
||||
std::function<void()> finalizeTraitConfigUpdate = [=, newConfig = std::move(newConfig)]()
|
||||
std::function<void()> finalizeTraitConfigUpdate = [=, this, newConfig = std::move(newConfig)]()
|
||||
{
|
||||
SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData)
|
||||
.ModifyValue(&UF::ActivePlayerData::TraitConfigs, index)
|
||||
|
||||
@@ -319,7 +319,7 @@ void Player::UpdateMaxPower(Powers power)
|
||||
if (powerIndex == MAX_POWERS || powerIndex >= MAX_POWERS_PER_CLASS)
|
||||
return;
|
||||
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + AsUnderlyingType(power));
|
||||
|
||||
float value = GetFlatModifierValue(unitMod, BASE_VALUE) + GetCreatePowerValue(power);
|
||||
value *= GetPctModifierValue(unitMod, BASE_PCT);
|
||||
@@ -922,7 +922,7 @@ void Creature::UpdateMaxPower(Powers power)
|
||||
if (GetPowerIndex(power) == MAX_POWERS)
|
||||
return;
|
||||
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + AsUnderlyingType(power));
|
||||
|
||||
float value = GetFlatModifierValue(unitMod, BASE_VALUE) + GetCreatePowerValue(power);
|
||||
value *= GetPctModifierValue(unitMod, BASE_PCT);
|
||||
@@ -1173,7 +1173,7 @@ void Guardian::UpdateMaxPower(Powers power)
|
||||
if (GetPowerIndex(power) == MAX_POWERS)
|
||||
return;
|
||||
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + AsUnderlyingType(power));
|
||||
|
||||
float value = GetFlatModifierValue(unitMod, BASE_VALUE) + GetCreatePowerValue(power);
|
||||
value *= GetPctModifierValue(unitMod, BASE_PCT);
|
||||
|
||||
@@ -4924,7 +4924,7 @@ void Unit::UpdateStatBuffMod(Stats stat)
|
||||
float modNeg = 0.0f;
|
||||
float factor = 0.0f;
|
||||
|
||||
UnitMods const unitMod = static_cast<UnitMods>(UNIT_MOD_STAT_START + stat);
|
||||
UnitMods const unitMod = static_cast<UnitMods>(UNIT_MOD_STAT_START + AsUnderlyingType(stat));
|
||||
|
||||
// includes value from items and enchantments
|
||||
float modValue = GetFlatModifierValue(unitMod, BASE_VALUE);
|
||||
@@ -8903,7 +8903,7 @@ void Unit::UpdateAllDamagePctDoneMods()
|
||||
|
||||
float Unit::GetTotalStatValue(Stats stat) const
|
||||
{
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_STAT_START + stat);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_STAT_START + AsUnderlyingType(stat));
|
||||
|
||||
// value = ((base_value * base_pct) + total_value) * total_pct
|
||||
float value = CalculatePct(GetFlatModifierValue(unitMod, BASE_VALUE), std::max(GetFlatModifierValue(unitMod, BASE_PCT_EXCLUDE_CREATE), -100.0f));
|
||||
@@ -12190,7 +12190,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
}
|
||||
}
|
||||
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, vehicleCollisionHeight = vehicle->GetBase()->GetCollisionHeight()](Movement::MoveSplineInit& init)
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, this, vehicleCollisionHeight = vehicle->GetBase()->GetCollisionHeight()](Movement::MoveSplineInit& init)
|
||||
{
|
||||
float height = pos.GetPositionZ() + vehicleCollisionHeight;
|
||||
|
||||
|
||||
@@ -688,7 +688,7 @@ void MotionMaster::MoveCloserAndStop(uint32 id, Unit* target, float distance)
|
||||
else
|
||||
{
|
||||
// We are already close enough. We just need to turn toward the target without changing position.
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, target = target->GetGUID()](Movement::MoveSplineInit& init)
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, this, target = target->GetGUID()](Movement::MoveSplineInit& init)
|
||||
{
|
||||
init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ());
|
||||
if (Unit const* refreshedTarget = ObjectAccessor::GetUnit(*_owner, target))
|
||||
@@ -897,7 +897,7 @@ void MotionMaster::MoveJumpWithGravity(Position const& pos, float speedXY, float
|
||||
|
||||
void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount)
|
||||
{
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=](Movement::MoveSplineInit& init)
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, this](Movement::MoveSplineInit& init)
|
||||
{
|
||||
float step = 2 * float(M_PI) / stepCount * (clockwise ? -1.0f : 1.0f);
|
||||
Position const& pos = { x, y, z, 0.0f };
|
||||
@@ -1022,7 +1022,7 @@ void MotionMaster::MoveFall(uint32 id/* = 0*/)
|
||||
return;
|
||||
}
|
||||
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=](Movement::MoveSplineInit& init)
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, this](Movement::MoveSplineInit& init)
|
||||
{
|
||||
init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz + _owner->GetHoverOffset(), false);
|
||||
init.SetFall();
|
||||
|
||||
@@ -981,7 +981,7 @@ private:
|
||||
// the module which prevents it from unloading.
|
||||
// The module will be unloaded once all scripts provided from the module
|
||||
// are destroyed.
|
||||
if (!ref->second.first.unique())
|
||||
if (ref->second.first.use_count() != 1)
|
||||
{
|
||||
TC_LOG_INFO("scripts.hotswap",
|
||||
"Script module %s is still used by %lu spell, aura or instance scripts. "
|
||||
@@ -1564,7 +1564,7 @@ void SourceUpdateListener::handleFileAction(efsw::WatchID watchid, std::string c
|
||||
return;
|
||||
}
|
||||
|
||||
auto const path = fs::absolute(
|
||||
fs::path path = fs::absolute(
|
||||
filename,
|
||||
dir);
|
||||
|
||||
@@ -1573,7 +1573,7 @@ void SourceUpdateListener::handleFileAction(efsw::WatchID watchid, std::string c
|
||||
return;
|
||||
|
||||
/// Thread safe part
|
||||
sScriptReloadMgr->QueueMessage([=](HotSwapScriptReloadMgr* reloader)
|
||||
sScriptReloadMgr->QueueMessage([=, this, path = std::move(path)](HotSwapScriptReloadMgr* reloader)
|
||||
{
|
||||
TC_LOG_TRACE("scripts.hotswap", "Detected source change on module \"%s\", "
|
||||
"queued for recompilation...", script_module_name_.c_str());
|
||||
|
||||
@@ -100,7 +100,7 @@ WorldPackets::Mail::MailListEntry::MailListEntry(::Mail const* mail, ::Player* p
|
||||
StationeryID = mail->stationery;
|
||||
SentMoney = mail->money;
|
||||
Flags = mail->checked;
|
||||
DaysLeft = float(mail->expire_time - GameTime::GetGameTime()) / DAY;
|
||||
DaysLeft = float(mail->expire_time - GameTime::GetGameTime()) / float(DAY);
|
||||
MailTemplateID = mail->mailTemplateId;
|
||||
Subject = mail->subject;
|
||||
Body = mail->body;
|
||||
|
||||
@@ -3757,8 +3757,7 @@ void AuraEffect::HandleAuraModMaxPower(AuraApplication const* aurApp, uint8 mode
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
Powers power = Powers(GetMiscValue());
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + GetMiscValue());
|
||||
|
||||
target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
|
||||
}
|
||||
@@ -3844,8 +3843,7 @@ void AuraEffect::HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint
|
||||
return;
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + GetMiscValue());
|
||||
|
||||
target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
|
||||
}
|
||||
@@ -3858,7 +3856,7 @@ void AuraEffect::HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurAp
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + GetMiscValue());
|
||||
|
||||
// Save old powers for further calculation
|
||||
int32 oldPower = target->GetPower(powerType);
|
||||
@@ -4003,7 +4001,7 @@ void AuraEffect::HandleAuraModMaxPowerPct(AuraApplication const* aurApp, uint8 m
|
||||
return;
|
||||
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + GetMiscValue());
|
||||
|
||||
// Save old powers for further calculation
|
||||
int32 oldPower = target->GetPower(powerType);
|
||||
|
||||
@@ -477,7 +477,7 @@ struct npc_eye_of_acherus : public ScriptedAI
|
||||
break;
|
||||
case EVENT_LAUNCH_TOWARDS_DESTINATION:
|
||||
{
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=](Movement::MoveSplineInit& init)
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, me = me](Movement::MoveSplineInit& init)
|
||||
{
|
||||
Movement::PointsArray path(EyeOfAcherusPath, EyeOfAcherusPath + EyeOfAcherusPathSize);
|
||||
init.MovebyPath(path);
|
||||
|
||||
@@ -307,12 +307,12 @@ class npc_chromie_start : public CreatureScript
|
||||
{
|
||||
InitGossipMenuFor(player, GOSSIP_MENU_INITIAL);
|
||||
if (player->CanBeGameMaster()) // GM instance state override menu
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, "[GM] Access instance control panel", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_OPEN_GM_MENU);
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, "[GM] Access instance control panel", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_OPEN_GM_MENU));
|
||||
|
||||
uint32 state = instance->GetData(DATA_INSTANCE_PROGRESS);
|
||||
if (state < PURGE_STARTING)
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_MENU_INITIAL, GOSSIP_OPTION_EXPLAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_EXPLAIN);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_INITIAL, GOSSIP_OPTION_EXPLAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_EXPLAIN));
|
||||
{
|
||||
bool shouldAddSkipGossip = true;
|
||||
Map::PlayerList const& players = instance->instance->GetPlayers();
|
||||
@@ -330,13 +330,13 @@ class npc_chromie_start : public CreatureScript
|
||||
}
|
||||
}
|
||||
if (shouldAddSkipGossip)
|
||||
AddGossipItemFor(player, GOSSIP_MENU_INITIAL, GOSSIP_OPTION_SKIP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_SKIP);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_INITIAL, GOSSIP_OPTION_SKIP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_SKIP));
|
||||
}
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_INITIAL, me->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_MENU_INITIAL, GOSSIP_OPTION_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_TELEPORT);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_INITIAL, GOSSIP_OPTION_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_TELEPORT));
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_TELEPORT, me->GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -353,12 +353,12 @@ class npc_chromie_start : public CreatureScript
|
||||
{
|
||||
case GOSSIP_OFFSET_EXPLAIN:
|
||||
InitGossipMenuFor(player, GOSSIP_MENU_EXPLAIN_1);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_EXPLAIN_1, GOSSIP_OPTION_EXPLAIN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_EXPLAIN_1);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_EXPLAIN_1, GOSSIP_OPTION_EXPLAIN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_EXPLAIN_1));
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_EXPLAIN_1, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_OFFSET_SKIP:
|
||||
InitGossipMenuFor(player, GOSSIP_MENU_SKIP_1);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_SKIP_1, GOSSIP_OPTION_SKIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_SKIP_1);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_SKIP_1, GOSSIP_OPTION_SKIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_SKIP_1));
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_SKIP_1, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_OFFSET_SKIP_1:
|
||||
@@ -370,7 +370,7 @@ class npc_chromie_start : public CreatureScript
|
||||
break;
|
||||
case GOSSIP_OFFSET_EXPLAIN_1:
|
||||
InitGossipMenuFor(player, GOSSIP_MENU_EXPLAIN_2);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_EXPLAIN_2, GOSSIP_OPTION_EXPLAIN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_EXPLAIN_2);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_EXPLAIN_2, GOSSIP_OPTION_EXPLAIN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_EXPLAIN_2));
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_EXPLAIN_2, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_OFFSET_EXPLAIN_2:
|
||||
@@ -380,16 +380,16 @@ class npc_chromie_start : public CreatureScript
|
||||
me->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
||||
break;
|
||||
case GOSSIP_OFFSET_OPEN_GM_MENU:
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, "Teleport all players to Arthas", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_GM_INITIAL);
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, "Teleport all players to Arthas", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL));
|
||||
for (uint32 state = 1; state <= COMPLETE; state = state << 1)
|
||||
{
|
||||
if (GetStableStateFor(COSProgressStates(state)) == state)
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, Trinity::StringFormat("Set instance progress to 0x%05X", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_GM_INITIAL + state);
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, Trinity::StringFormat("Set instance progress to 0x%05X", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL) + state);
|
||||
}
|
||||
for (uint32 state = 1; state <= COMPLETE; state = state << 1)
|
||||
{
|
||||
if (GetStableStateFor(COSProgressStates(state)) != state)
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, Trinity::StringFormat("Force state to 0x%05X (UNSTABLE)", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_GM_INITIAL + state);
|
||||
AddGossipItemFor(player, GossipOptionNpc::None, Trinity::StringFormat("Force state to 0x%05X (UNSTABLE)", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL) + state);
|
||||
}
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_SKIP_1, me->GetGUID());
|
||||
break;
|
||||
@@ -405,7 +405,7 @@ class npc_chromie_start : public CreatureScript
|
||||
if (!player->CanBeGameMaster())
|
||||
break;
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
instance->SetData(DATA_GM_OVERRIDE, action - GOSSIP_ACTION_INFO_DEF - GOSSIP_OFFSET_GM_INITIAL);
|
||||
instance->SetData(DATA_GM_OVERRIDE, action - GOSSIP_ACTION_INFO_DEF - AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL));
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
@@ -515,7 +515,7 @@ class npc_chromie_middle : public CreatureScript
|
||||
player->PrepareQuestMenu(me->GetGUID());
|
||||
|
||||
if (Instance->GetData(DATA_INSTANCE_PROGRESS) == CRATES_DONE)
|
||||
AddGossipItemFor(player, GOSSIP_MENU_STEP1, GOSSIP_OPTION_STEP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_STEP1);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_STEP1, GOSSIP_OPTION_STEP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_STEP1));
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_STEP1, me->GetGUID());
|
||||
return true;
|
||||
}
|
||||
@@ -528,12 +528,12 @@ class npc_chromie_middle : public CreatureScript
|
||||
{
|
||||
case GOSSIP_OFFSET_STEP1:
|
||||
InitGossipMenuFor(player, GOSSIP_MENU_STEP2);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_STEP2, GOSSIP_OPTION_STEP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_STEP2);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_STEP2, GOSSIP_OPTION_STEP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_STEP2));
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_STEP2, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_OFFSET_STEP2:
|
||||
InitGossipMenuFor(player, GOSSIP_MENU_STEP3);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_STEP3, GOSSIP_OPTION_STEP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + GOSSIP_OFFSET_STEP3);
|
||||
AddGossipItemFor(player, GOSSIP_MENU_STEP3, GOSSIP_OPTION_STEP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_STEP3));
|
||||
SendGossipMenuFor(player, GOSSIP_TEXT_STEP3, me->GetGUID());
|
||||
break;
|
||||
case GOSSIP_OFFSET_STEP3:
|
||||
|
||||
@@ -56,12 +56,13 @@ enum Sound
|
||||
|
||||
enum Misc
|
||||
{
|
||||
PULL_RANGE = 50,
|
||||
ABUSE_BUG_RANGE = 20,
|
||||
VEKLOR_DIST = 20, // VL will not come to melee when attacking
|
||||
TELEPORTTIME = 30000
|
||||
};
|
||||
|
||||
static constexpr float PULL_RANGE = 50.0f;
|
||||
|
||||
struct boss_twinemperorsAI : public BossAI
|
||||
{
|
||||
boss_twinemperorsAI(Creature* creature): BossAI(creature, DATA_TWIN_EMPERORS)
|
||||
|
||||
@@ -425,12 +425,12 @@ public:
|
||||
break;
|
||||
case PHASE_PLANT_FIRST_STAND: // plant first explosives stage 1 stand
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
_moveTimer = 0.5* IN_MILLISECONDS;
|
||||
_moveTimer = 0.5* AsUnderlyingType(IN_MILLISECONDS);
|
||||
_phase = PHASE_PLANT_FIRST_WORK;
|
||||
break;
|
||||
case PHASE_PLANT_FIRST_WORK: // plant first explosives stage 2 work
|
||||
Talk(SAY_LEGOSO_4);
|
||||
_moveTimer = 17.5 * IN_MILLISECONDS;
|
||||
_moveTimer = 17.5 * AsUnderlyingType(IN_MILLISECONDS);
|
||||
_phase = PHASE_PLANT_FIRST_FINISH;
|
||||
break;
|
||||
case PHASE_PLANT_FIRST_FINISH: // plant first explosives finish
|
||||
@@ -444,7 +444,7 @@ public:
|
||||
// force runoff movement so he will not screw up next waypoint
|
||||
me->GetMotionMaster()->MovePoint(WP_EXPLOSIVES_FIRST_RUNOFF, -1955.6f, -10669.8f, 110.65f, false);
|
||||
Talk(SAY_LEGOSO_5);
|
||||
_moveTimer = 1.5 * IN_MILLISECONDS;
|
||||
_moveTimer = 1.5 * AsUnderlyingType(IN_MILLISECONDS);
|
||||
_phase = PHASE_CONTINUE;
|
||||
break;
|
||||
case PHASE_PLANT_FIRST_TIMER_1: // first explosives detonate timer 1
|
||||
@@ -650,7 +650,7 @@ public:
|
||||
SetEscortPaused(true);
|
||||
me->SetFacingToObject(player);
|
||||
Talk(SAY_LEGOSO_1);
|
||||
_moveTimer = 2.5 * IN_MILLISECONDS;
|
||||
_moveTimer = 2.5 * AsUnderlyingType(IN_MILLISECONDS);
|
||||
_phase = PHASE_CONTINUE;
|
||||
break;
|
||||
case WP_EXPLOSIVES_FIRST_POINT:
|
||||
@@ -670,7 +670,7 @@ public:
|
||||
break;
|
||||
case WP_DEBUG_1:
|
||||
SetEscortPaused(true);
|
||||
_moveTimer = 0.5 * IN_MILLISECONDS;
|
||||
_moveTimer = 0.5 * AsUnderlyingType(IN_MILLISECONDS);
|
||||
_phase = PHASE_WP_26;
|
||||
break;
|
||||
case WP_SIRONAS_HILL:
|
||||
@@ -697,12 +697,12 @@ public:
|
||||
}
|
||||
case WP_EXPLOSIVES_SECOND_BATTLEROAR:
|
||||
SetEscortPaused(true);
|
||||
_moveTimer = 0.2 * IN_MILLISECONDS;
|
||||
_moveTimer = 0.2 * AsUnderlyingType(IN_MILLISECONDS);
|
||||
_phase = PHASE_MEET_SIRONAS_ROAR;
|
||||
break;
|
||||
case WP_EXPLOSIVES_SECOND_PLANT:
|
||||
SetEscortPaused(true);
|
||||
_moveTimer = 0.5 * IN_MILLISECONDS;
|
||||
_moveTimer = 0.5 * AsUnderlyingType(IN_MILLISECONDS);
|
||||
_phase = PHASE_PLANT_SECOND_KNEEL;
|
||||
break;
|
||||
case WP_EXPLOSIVES_SECOND_DETONATE:
|
||||
|
||||
@@ -197,7 +197,7 @@ struct npc_webwrap : public NullCreatureAI
|
||||
victimGUID = guid;
|
||||
if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID))
|
||||
{
|
||||
visibleTimer = (me->GetDistance2d(victim)/WEB_WRAP_MOVE_SPEED + 0.5f) * IN_MILLISECONDS;
|
||||
visibleTimer = (me->GetDistance2d(victim) / WEB_WRAP_MOVE_SPEED + 0.5f) * AsUnderlyingType(IN_MILLISECONDS);
|
||||
victim->CastSpell(victim, SPELL_WEB_WRAP, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
|
||||
.SetOriginalCaster(me->GetGUID()));
|
||||
}
|
||||
|
||||
@@ -58,10 +58,11 @@ enum Creatures
|
||||
enum Misc
|
||||
{
|
||||
DATA_MAX_SPARKS = 5,
|
||||
DATA_MAX_SPARK_DISTANCE = 90, // Distance to boss - prevent runs through the whole instance
|
||||
DATA_POINT_CALLBACK = 0
|
||||
};
|
||||
|
||||
static constexpr float DATA_MAX_SPARK_DISTANCE = 90; // Distance to boss - prevent runs through the whole instance
|
||||
|
||||
/*######
|
||||
## Boss Ionar
|
||||
######*/
|
||||
|
||||
@@ -1927,7 +1927,7 @@ class npc_train_wrecker : public CreatureScript
|
||||
{
|
||||
me->SetFacingTo(target->GetOrientation());
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK1H);
|
||||
_timer = 1.5 * IN_MILLISECONDS;
|
||||
_timer = 1.5 * AsUnderlyingType(IN_MILLISECONDS);
|
||||
_nextAction = EVENT_DO_WRECK;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user