mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripts: fix some /W4 warnings
This commit is contained in:
@@ -316,7 +316,7 @@ struct MovementInfo
|
||||
void AddExtraMovementFlag(uint16 flag) { flags2 |= flag; }
|
||||
bool HasExtraMovementFlag(uint16 flag) const { return (flags2 & flag) != 0; }
|
||||
|
||||
void SetFallTime(uint32 time) { fallTime = time; }
|
||||
void SetFallTime(uint32 val) { fallTime = val; }
|
||||
|
||||
void OutDebug();
|
||||
};
|
||||
|
||||
@@ -93,7 +93,7 @@ enum Spells
|
||||
SPELL_ANIMATE_BONES_2 = 53336,
|
||||
};
|
||||
|
||||
enum SummonGroups
|
||||
enum SummonGroups : uint32
|
||||
{
|
||||
SUMMON_GROUP_CRUSHER_1 = 1,
|
||||
SUMMON_GROUP_CRUSHER_2 = 2,
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* Comment: Find in the future best timers and the event is not implemented.
|
||||
*/
|
||||
|
||||
#include "Containers.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
@@ -945,9 +946,7 @@ class spell_gatewatcher_subboss_trigger : public SpellScriptLoader
|
||||
if (!targetList.empty())
|
||||
{
|
||||
// If there are, pick one of them at random
|
||||
std::list<WorldObject*>::iterator it = targetList.begin();
|
||||
std::advance(it, urand(0, targetList.size() - 1));
|
||||
target = *it;
|
||||
target = Trinity::Containers::SelectRandomContainerElement(targetList);
|
||||
}
|
||||
// And hit only that one
|
||||
targetList.clear();
|
||||
|
||||
@@ -793,17 +793,16 @@ class spell_valkyr_essences : public SpellScriptLoader
|
||||
{
|
||||
if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex)
|
||||
{
|
||||
Aura* pAura = owner->GetAura(poweringUp);
|
||||
if (pAura)
|
||||
if (Aura* aura = owner->GetAura(poweringUp))
|
||||
{
|
||||
pAura->ModStackAmount(stacksCount);
|
||||
aura->ModStackAmount(stacksCount);
|
||||
owner->CastSpell(owner, poweringUp, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
owner->CastSpell(owner, poweringUp, true);
|
||||
if ((pAura = owner->GetAura(poweringUp)))
|
||||
pAura->ModStackAmount(stacksCount);
|
||||
if (Aura* newAura = owner->GetAura(poweringUp))
|
||||
newAura->ModStackAmount(stacksCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -817,18 +816,17 @@ class spell_valkyr_essences : public SpellScriptLoader
|
||||
if (dmgInfo.GetSpellInfo()->Id == unleashedDark || dmgInfo.GetSpellInfo()->Id == unleashedLight)
|
||||
{
|
||||
// need to do the things in this order, else players might have 100 charges of Powering Up without anything happening
|
||||
Aura* pAura = owner->GetAura(poweringUp);
|
||||
if (pAura)
|
||||
if (Aura* aura = owner->GetAura(poweringUp))
|
||||
{
|
||||
// 2 lines together add the correct amount of buff stacks
|
||||
pAura->ModStackAmount(stacksCount);
|
||||
aura->ModStackAmount(stacksCount);
|
||||
owner->CastSpell(owner, poweringUp, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
owner->CastSpell(owner, poweringUp, true);
|
||||
if ((pAura = owner->GetAura(poweringUp)))
|
||||
pAura->ModStackAmount(stacksCount);
|
||||
if (Aura* newAura = owner->GetAura(poweringUp))
|
||||
newAura->ModStackAmount(stacksCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,12 +232,12 @@ public:
|
||||
events.ScheduleEvent(EVENT_TALK_6, Seconds(17));
|
||||
break;
|
||||
case 35:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
|
||||
Talk(TALK_7, player);
|
||||
if (Player* pl = ObjectAccessor::GetPlayer(*me, _player))
|
||||
Talk(TALK_7, pl);
|
||||
break;
|
||||
case 40:
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, _player))
|
||||
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
|
||||
if (Player* pl = ObjectAccessor::GetPlayer(*me, _player))
|
||||
pl->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
|
||||
events.ScheduleEvent(EVENT_TALK_8, Seconds(4));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,10 @@ uint32 const EP_PWT_CM = 17698;
|
||||
|
||||
uint32 const EPBuffZones[EPBuffZonesNum] = { 139, 2017, 2057 };
|
||||
|
||||
/*
|
||||
uint32 const EPTowerPlayerEnterEvents[EP_TOWER_NUM] = { 10691, 10699, 10701, 10705 };
|
||||
uint32 const EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = { 10692, 10698, 10700, 10704 };
|
||||
*/
|
||||
|
||||
go_type const EPCapturePoints[EP_TOWER_NUM] =
|
||||
{
|
||||
|
||||
@@ -31,8 +31,10 @@ uint32 const OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 356
|
||||
|
||||
uint32 const HP_CREDITMARKER[HP_TOWER_NUM] = { 19032, 19028, 19029 };
|
||||
|
||||
/*
|
||||
uint32 const HP_CapturePointEvent_Enter[HP_TOWER_NUM] = { 11404, 11396, 11388 };
|
||||
uint32 const HP_CapturePointEvent_Leave[HP_TOWER_NUM] = { 11403, 11395, 11387 };
|
||||
*/
|
||||
|
||||
uint32 const HP_MAP_N[HP_TOWER_NUM] = { 0x9b5, 0x9b2, 0x9a8 };
|
||||
uint32 const HP_MAP_A[HP_TOWER_NUM] = { 0x9b3, 0x9b0, 0x9a7 };
|
||||
|
||||
@@ -334,15 +334,12 @@ public:
|
||||
{
|
||||
if (Creature* teron = _instance->GetCreature(DATA_TERON_GOREFIEND))
|
||||
{
|
||||
if (Unit* target = teron->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_SPIRITUAL_VENGEANCE))
|
||||
{
|
||||
DoResetThreat();
|
||||
AttackStart(target);
|
||||
me->AddThreat(target, 1000000.0f);
|
||||
targetGUID = target->GetGUID();
|
||||
}
|
||||
Unit* target = teron->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_SPIRITUAL_VENGEANCE);
|
||||
// He should target Vengeful Spirits only if has no other player available
|
||||
else if (Unit* target = teron->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
if (!target)
|
||||
target = teron->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (target)
|
||||
{
|
||||
DoResetThreat();
|
||||
AttackStart(target);
|
||||
|
||||
@@ -112,8 +112,8 @@ class instance_magtheridons_lair : public InstanceMapScript
|
||||
HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, hall);
|
||||
break;
|
||||
case DATA_COLLAPSE_2:
|
||||
for (MLDataTypes data : collapseObjectDatas)
|
||||
if (GameObject* go = GetGameObject(data))
|
||||
for (MLDataTypes type : collapseObjectDatas)
|
||||
if (GameObject* go = GetGameObject(type))
|
||||
HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, go);
|
||||
break;
|
||||
case DATA_CALL_WARDERS:
|
||||
|
||||
@@ -199,8 +199,8 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
||||
if (!target || me->GetVictim() != target)
|
||||
{
|
||||
Unit* ownerTarget = nullptr;
|
||||
if (Player* owner = me->GetCharmerOrOwner()->ToPlayer())
|
||||
ownerTarget = owner->GetSelectedUnit();
|
||||
if (Player* playerOwner = me->GetCharmerOrOwner()->ToPlayer())
|
||||
ownerTarget = playerOwner->GetSelectedUnit();
|
||||
|
||||
// recognize which victim will be choosen
|
||||
if (ownerTarget && ownerTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
|
||||
@@ -1317,8 +1317,8 @@ class spell_pal_infusion_of_light : public SpellScriptLoader
|
||||
int32 bp0 = CalculatePct(healInfo->GetHeal() / duration, pct);
|
||||
|
||||
// Item - Paladin T9 Holy 4P Bonus
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_PALADIN_T9_HOLY_4P_BONUS, 0))
|
||||
AddPct(bp0, aurEff->GetAmount());
|
||||
if (AuraEffect const* bonus = target->GetAuraEffect(SPELL_PALADIN_T9_HOLY_4P_BONUS, 0))
|
||||
AddPct(bp0, bonus->GetAmount());
|
||||
|
||||
target->CastCustomSpell(SPELL_PALADIN_FLASH_OF_LIGHT_PROC, SPELLVALUE_BASE_POINT0, bp0, procTarget, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user