[3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)

Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation.

- CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments
- This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one
  - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object.
- A gajillion refactors to make everything behave the way it always has

(cherry picked from commit d507a7e3388382960108b24143da48e5f912b4a7)
This commit is contained in:
Treeston
2021-04-16 15:22:42 +02:00
committed by Shauren
parent 2ea8f5e6fc
commit 9b141207d1
138 changed files with 1240 additions and 1028 deletions
+5 -1
View File
@@ -98,7 +98,11 @@ int32 CritterAI::Permissible(Creature const* creature)
void TriggerAI::IsSummonedBy(Unit* summoner)
{
if (me->m_spells[0])
me->CastSpell(me, me->m_spells[0], false, nullptr, nullptr, summoner->GetGUID());
{
CastSpellExtraArgs extra;
extra.OriginalCaster = summoner->GetGUID();
me->CastSpell(me, me->m_spells[0], extra);
}
}
int32 TriggerAI::Permissible(Creature const* creature)
+1 -1
View File
@@ -243,7 +243,7 @@ void PetAI::UpdateAI(uint32 diff)
SpellCastTargets targets;
targets.SetUnitTarget(target);
spell->prepare(&targets);
spell->prepare(targets);
}
// deleted cached Spell objects
+7 -17
View File
@@ -96,7 +96,7 @@ bool UnitAI::DoSpellAttackIfReady(uint32 spellId)
{
if (me->IsWithinCombatRange(me->GetVictim(), spellInfo->GetMaxRange(false)))
{
me->CastSpell(me->GetVictim(), spellInfo, TRIGGERED_NONE);
me->CastSpell(me->GetVictim(), spellId, me->GetMap()->GetDifficultyID());
me->resetAttackTimer();
return true;
}
@@ -167,28 +167,18 @@ void UnitAI::DoCast(uint32 spellId)
me->CastSpell(target, spellId, false);
}
void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
void UnitAI::DoCast(Unit* victim, uint32 spellId, CastSpellExtraArgs const& args)
{
if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
if (me->HasUnitState(UNIT_STATE_CASTING) && !(args.TriggerFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS))
return;
me->CastSpell(victim, spellId, triggered);
me->CastSpell(victim, spellId, args);
}
void UnitAI::DoCastVictim(uint32 spellId, bool triggered)
void UnitAI::DoCastVictim(uint32 spellId, CastSpellExtraArgs const& args)
{
if (!me->GetVictim() || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered))
return;
me->CastSpell(me->GetVictim(), spellId, triggered);
}
void UnitAI::DoCastAOE(uint32 spellId, bool triggered)
{
if (!triggered && me->HasUnitState(UNIT_STATE_CASTING))
return;
me->CastSpell(nullptr, spellId, triggered);
if (Unit* victim = me->GetVictim())
DoCast(victim, spellId, args);
}
#define UPDATE_TARGET(a) {if (AIInfo->target<a) AIInfo->target=a;}
+4 -4
View File
@@ -298,10 +298,10 @@ class TC_GAME_API UnitAI
void AttackStartCaster(Unit* victim, float dist);
void DoCast(uint32 spellId);
void DoCast(Unit* victim, uint32 spellId, bool triggered = false);
void DoCastSelf(uint32 spellId, bool triggered = false) { DoCast(me, spellId, triggered); }
void DoCastVictim(uint32 spellId, bool triggered = false);
void DoCastAOE(uint32 spellId, bool triggered = false);
void DoCast(Unit* victim, uint32 spellId, CastSpellExtraArgs const& args = {});
void DoCastSelf(uint32 spellId, CastSpellExtraArgs const& args = {}) { DoCast(me, spellId, args); }
void DoCastVictim(uint32 spellId, CastSpellExtraArgs const& args = {});
void DoCastAOE(uint32 spellId, CastSpellExtraArgs const& args = {}) { DoCast(nullptr, spellId, args); }
virtual bool ShouldSparWith(Unit const* /*target*/) const { return false; }
+1 -1
View File
@@ -575,7 +575,7 @@ void PlayerAI::DoCastAtTarget(TargetedSpell spell)
{
SpellCastTargets targets;
targets.SetUnitTarget(spell.second);
spell.first->prepare(&targets);
spell.first->prepare(targets);
}
void PlayerAI::DoRangedAttackIfReady()
@@ -176,7 +176,7 @@ void ScriptedAI::DoCastSpell(Unit* target, SpellInfo const* spellInfo, bool trig
return;
me->StopMoving();
me->CastSpell(target, spellInfo, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
me->CastSpell(target, spellInfo->Id, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
}
void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
@@ -212,7 +212,7 @@ void BattlefieldTB::OnPlayerJoinWar(Player* player)
// Bonus damage buff for attackers
if (player->GetTeamId() == GetAttackerTeam() && GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED) > 0)
player->CastCustomSpell(SPELL_TOWER_ATTACK_BONUS, SPELLVALUE_AURA_STACK, GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED), player, TRIGGERED_FULL_MASK);
player->CastSpell(player, SPELL_TOWER_ATTACK_BONUS, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_AURA_STACK, GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED)));
}
@@ -759,7 +759,7 @@ void BattlefieldTB::TowerDestroyed(TBTowerId tbTowerId)
// Attack bonus buff
for (ObjectGuid const& guid : m_PlayersInWar[GetAttackerTeam()])
if (Player* player = ObjectAccessor::FindPlayer(guid))
player->CastCustomSpell(SPELL_TOWER_ATTACK_BONUS, SPELLVALUE_AURA_STACK, GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED), player, TRIGGERED_FULL_MASK);
player->CastSpell(player, SPELL_TOWER_ATTACK_BONUS, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_AURA_STACK, GetData(BATTLEFIELD_TB_DATA_TOWERS_DESTROYED)));
// Honor reward
TeamCastSpell(GetAttackerTeam(), SPELL_REWARD_TOWER_DESTROYED);
@@ -2123,8 +2123,7 @@ void GameObject::Use(Unit* user)
if (!spellId)
return;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID());
if (!spellInfo)
if (!sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID()))
{
if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this))
TC_LOG_ERROR("misc", "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
@@ -2137,7 +2136,7 @@ void GameObject::Use(Unit* user)
sOutdoorPvPMgr->HandleCustomSpell(player, spellId, this);
if (spellCaster)
spellCaster->CastSpell(user, spellInfo, triggered);
spellCaster->CastSpell(user, spellId, triggered);
else
CastSpell(user, spellId);
}
@@ -2166,7 +2165,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge
if (self)
{
if (target)
target->CastSpell(target, spellInfo, triggered);
target->CastSpell(target, spellInfo->Id, triggered);
return;
}
@@ -2179,6 +2178,8 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge
trigger->SetImmuneToAll(false);
PhasingHandler::InheritPhaseShift(trigger, this);
CastSpellExtraArgs args;
args.TriggerFlags = triggered;
if (Unit* owner = GetOwner())
{
trigger->SetFaction(owner->GetFaction());
@@ -2188,14 +2189,17 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge
trigger->SetPvpFlags(owner->GetPvpFlags());
// needed for GO casts for proper target validation checks
trigger->SetOwnerGUID(owner->GetGUID());
trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, owner->GetGUID());
args.OriginalCaster = owner->GetGUID();
trigger->CastSpell(target ? target : trigger, spellInfo->Id, args);
}
else
{
trigger->SetFaction(spellInfo->IsPositive() ? FACTION_FRIENDLY : FACTION_MONSTER);
// Set owner guid for target if no owner available - needed by trigger auras
// - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, target ? target->GetGUID() : ObjectGuid::Empty);
args.OriginalCaster = target ? target->GetGUID() : ObjectGuid::Empty;
trigger->CastSpell(target ? target : trigger, spellInfo->Id, args);
}
}
+6 -6
View File
@@ -1702,13 +1702,13 @@ void Pet::CastPetAura(PetAura const* aura)
if (!auraId)
return;
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
if (auraId == 35696) // Demonic Knowledge
{
int32 basePoints = CalculatePct(aura->GetDamage(), GetStat(STAT_STAMINA) + GetStat(STAT_INTELLECT));
CastCustomSpell(this, auraId, &basePoints, nullptr, nullptr, true);
}
else
CastSpell(this, auraId, true);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, CalculatePct(aura->GetDamage(), GetStat(STAT_STAMINA) + GetStat(STAT_INTELLECT)));
CastSpell(this, auraId, args);
}
bool Pet::IsPetAura(Aura const* aura)
+29 -28
View File
@@ -7862,7 +7862,7 @@ void Player::ApplyItemObtainSpells(Item* item, bool apply)
if (apply)
{
if (!HasAura(spellId))
CastSpell(this, spellId, true, item);
CastSpell(this, spellId, item);
}
else
RemoveAurasDueToSpell(spellId);
@@ -7994,7 +7994,7 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply,
TC_LOG_DEBUG("entities.player", "Player::ApplyEquipSpell: Player '%s' (%s) cast %s equip spell (ID: %i)",
GetName().c_str(), GetGUID().ToString().c_str(), (item ? "item" : "itemset"), spellInfo->Id);
CastSpell(this, spellInfo, true, item);
CastSpell(this, spellInfo->Id, item);
}
else
{
@@ -8103,13 +8103,15 @@ void Player::ApplyArtifactPowerRank(Item* artifact, ArtifactPowerRankEntry const
}
else if (apply)
{
CustomSpellValues csv;
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.CastItem = artifact;
if (artifactPowerRank->AuraPointsOverride)
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (spellInfo->GetEffect(i))
csv.AddSpellMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), artifactPowerRank->AuraPointsOverride);
args.AddSpellMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), artifactPowerRank->AuraPointsOverride);
CastCustomSpell(artifactPowerRank->SpellID, csv, this, TRIGGERED_FULL_MASK, artifact);
CastSpell(this, artifactPowerRank->SpellID, args);
}
}
else
@@ -8166,7 +8168,7 @@ void Player::ApplyAzeriteItemMilestonePower(AzeriteItem* item, AzeriteItemMilest
if (AzeritePowerEntry const* azeritePower = sAzeritePowerStore.LookupEntry(azeriteItemMilestonePower->AzeritePowerID))
{
if (apply)
CastSpell(this, azeritePower->SpellID, true, item);
CastSpell(this, azeritePower->SpellID, item);
else
RemoveAurasDueToItemSpell(azeritePower->SpellID, item->GetGUID());
}
@@ -8183,7 +8185,7 @@ void Player::ApplyAzeriteEssence(AzeriteItem* item, uint32 azeriteEssenceId, uin
if (major && currentRank == 1)
{
if (apply)
CastCustomSpell(SPELL_ID_HEART_ESSENCE_ACTION_BAR_OVERRIDE, SPELLVALUE_BASE_POINT0, azeriteEssencePower->MajorPowerDescription, this, TRIGGERED_FULL_MASK);
CastSpell(this, SPELL_ID_HEART_ESSENCE_ACTION_BAR_OVERRIDE, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellBP0(azeriteEssencePower->MajorPowerDescription));
else
RemoveAurasDueToSpell(SPELL_ID_HEART_ESSENCE_ACTION_BAR_OVERRIDE);
}
@@ -8196,7 +8198,7 @@ void Player::ApplyAzeriteEssencePower(AzeriteItem* item, AzeriteEssencePowerEntr
if (SpellInfo const* powerSpell = sSpellMgr->GetSpellInfo(azeriteEssencePower->MinorPowerDescription, DIFFICULTY_NONE))
{
if (apply)
CastSpell(this, powerSpell, true, item);
CastSpell(this, powerSpell->Id, item);
else
RemoveAurasDueToItemSpell(powerSpell->Id, item->GetGUID());
}
@@ -8208,7 +8210,7 @@ void Player::ApplyAzeriteEssencePower(AzeriteItem* item, AzeriteEssencePowerEntr
if (powerSpell->IsPassive())
{
if (apply)
CastSpell(this, powerSpell, true, item);
CastSpell(this, powerSpell->Id, item);
else
RemoveAurasDueToItemSpell(powerSpell->Id, item->GetGUID());
}
@@ -8228,7 +8230,7 @@ void Player::ApplyAzeritePower(AzeriteEmpoweredItem* item, AzeritePowerEntry con
if (apply)
{
if (!azeritePower->SpecSetID || sDB2Manager.IsSpecSetMember(azeritePower->SpecSetID, GetPrimarySpecialization()))
CastSpell(this, azeritePower->SpellID, true, item);
CastSpell(this, azeritePower->SpellID, item);
}
else
RemoveAurasDueToItemSpell(azeritePower->SpellID, item->GetGUID());
@@ -8320,7 +8322,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
chance = GetWeaponProcChance();
if (roll_chance_f(chance) && sScriptMgr->OnCastItemCombatSpell(this, damageInfo.GetVictim(), spellInfo, item))
CastSpell(damageInfo.GetVictim(), spellInfo->Id, true, item);
CastSpell(damageInfo.GetVictim(), spellInfo->Id, item);
}
}
@@ -8384,17 +8386,17 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
if (roll_chance_f(chance))
{
if (spellInfo->IsPositive())
CastSpell(this, spellInfo, true, item);
CastSpell(this, spellInfo->Id, item);
else
CastSpell(damageInfo.GetVictim(), spellInfo, true, item);
CastSpell(damageInfo.GetVictim(), spellInfo->Id, item);
}
if (roll_chance_f(chance))
{
Unit* target = spellInfo->IsPositive() ? this : damageInfo.GetVictim();
CastSpellExtraArgs args(item);
// reduce effect values if enchant is limited
CustomSpellValues values;
if (entry && (entry->AttributesMask & ENCHANT_PROC_ATTR_LIMIT_60) && target->GetLevelForTarget(this) > 60)
{
int32 const lvlDifference = target->GetLevelForTarget(this) - 60;
@@ -8405,11 +8407,10 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (spellInfo->GetEffect(i)->IsEffect())
values.AddSpellMod(static_cast<SpellValueMod>(SPELLVALUE_BASE_POINT0 + i), CalculatePct(spellInfo->GetEffect(i)->CalcValue(this), effectPct));
args.SpellValueOverrides.AddMod(static_cast<SpellValueMod>(SPELLVALUE_BASE_POINT0 + i), CalculatePct(spellInfo->GetEffect(i)->CalcValue(this), effectPct));
}
}
CastCustomSpell(spellInfo->Id, values, target, TRIGGERED_FULL_MASK, item);
CastSpell(target, spellInfo->Id, args);
}
}
}
@@ -8443,7 +8444,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, Objec
spell->m_fromClient = true;
spell->m_CastItem = item;
spell->SetSpellValue(SPELLVALUE_BASE_POINT0, learning_spell_id);
spell->prepare(&targets);
spell->prepare(targets);
return;
}
}
@@ -8473,7 +8474,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, Objec
spell->m_CastItem = item;
spell->m_misc.Raw.Data[0] = misc[0];
spell->m_misc.Raw.Data[1] = misc[1];
spell->prepare(&targets);
spell->prepare(targets);
return;
}
@@ -8507,7 +8508,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, Objec
spell->m_CastItem = item;
spell->m_misc.Raw.Data[0] = misc[0];
spell->m_misc.Raw.Data[1] = misc[1];
spell->prepare(&targets);
spell->prepare(targets);
return;
}
}
@@ -14301,7 +14302,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
if (enchant_spell_id)
{
if (apply)
CastSpell(this, enchant_spell_id, true, item);
CastSpell(this, enchant_spell_id, item);
else
RemoveAurasDueToItemSpell(enchant_spell_id, item->GetGUID());
}
@@ -14918,7 +14919,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 optionIndex, uint32 menu
break;
case GOSSIP_OPTION_SPIRITHEALER:
if (isDead())
source->ToCreature()->CastSpell(source->ToCreature(), 17251, true, nullptr, nullptr, GetGUID());
source->ToCreature()->CastSpell(source->ToCreature(), 17251, GetGUID());
break;
case GOSSIP_OPTION_QUESTGIVER:
PrepareQuestMenu(guid);
@@ -15604,7 +15605,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver)
if (Unit* unit = questGiver->ToUnit())
caster = unit;
caster->CastSpell(this, spellInfo, true);
caster->CastSpell(this, spellInfo->Id, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetCastDifficulty(spellInfo->Difficulty));
}
SetQuestSlot(log_slot, quest_id, qtime);
@@ -15941,7 +15942,7 @@ void Player::RewardQuest(Quest const* quest, LootItemType rewardType, uint32 rew
if (Unit* unit = questGiver->ToUnit())
caster = unit;
caster->CastSpell(this, spellInfo, true);
caster->CastSpell(this, spellInfo->Id, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetCastDifficulty(spellInfo->Difficulty));
}
else
{
@@ -15957,7 +15958,7 @@ void Player::RewardQuest(Quest const* quest, LootItemType rewardType, uint32 rew
if (Unit* unit = questGiver->ToUnit())
caster = unit;
caster->CastSpell(this, spellInfo, true);
caster->CastSpell(this, spellInfo->Id, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetCastDifficulty(spellInfo->Difficulty));
}
}
@@ -22449,7 +22450,7 @@ void Player::VehicleSpellInitialize()
}
if (spellInfo->IsPassive())
vehicle->CastSpell(vehicle, spellInfo, true);
vehicle->CastSpell(vehicle, spellInfo->Id, true);
petSpells.ActionButtons[i] = MAKE_UNIT_ACTION_BUTTON(spellId, i + 8);
}
@@ -25794,7 +25795,7 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
void Player::ResurrectUsingRequestData()
{
/// Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse
// Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse
TeleportTo(_resurrectionData->Location);
if (IsBeingTeleported())
@@ -25825,7 +25826,7 @@ void Player::ResurrectUsingRequestDataImpl()
SetPower(POWER_LUNAR_POWER, 0);
if (uint32 aura = resurrectAura)
CastSpell(this, aura, true, nullptr, nullptr, resurrectGUID);
CastSpell(this, aura, resurrectGUID);
SpawnCorpseBones();
}
+47 -135
View File
@@ -1001,147 +1001,46 @@ void Unit::CastStop(uint32 except_spellid)
InterruptSpell(CurrentSpellTypes(i), false);
}
void Unit::CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastSpell(SpellCastTargets const& targets, uint32 spellId, CastSpellExtraArgs const& args)
{
if (!spellInfo)
SpellInfo const* info = sSpellMgr->GetSpellInfo(spellId, args.CastDifficulty != DIFFICULTY_NONE ? args.CastDifficulty : GetMap()->GetDifficultyID());
if (!info)
{
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell by caster: %s", GetGUID().ToString().c_str());
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell %u by caster %s", spellId, GetGUID().ToString().c_str());
return;
}
Spell* spell = new Spell(this, spellInfo, triggerFlags, originalCaster);
Spell* spell = new Spell(this, info, args.TriggerFlags, args.OriginalCaster);
for (auto const& pair : args.SpellValueOverrides)
spell->SetSpellValue(pair.first, pair.second);
if (value)
for (CustomSpellValues::const_iterator itr = value->begin(); itr != value->end(); ++itr)
spell->SetSpellValue(itr->first, itr->second);
spell->m_CastItem = castItem;
spell->prepare(&targets, triggeredByAura);
spell->m_CastItem = args.CastItem;
spell->prepare(targets, args.TriggeringAura);
}
void Unit::CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
CastSpell(victim, spellId, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags /*= TRIGGER_NONE*/, Item* castItem /*= nullptr*/, AuraEffect const* triggeredByAura /*= nullptr*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID());
if (!spellInfo)
{
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s", spellId, GetGUID().ToString().c_str());
return;
}
CastSpell(victim, spellInfo, triggerFlags, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem/*= nullptr*/, AuraEffect const* triggeredByAura /*= nullptr*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/)
{
CastSpell(victim, spellInfo, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastSpell(WorldObject* target, uint32 spellId, CastSpellExtraArgs const& args)
{
SpellCastTargets targets;
targets.SetUnitTarget(victim);
CastSpell(targets, spellInfo, nullptr, triggerFlags, castItem, triggeredByAura, originalCaster);
}
void Unit::CastCustomSpell(Unit* target, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
CustomSpellValues values;
if (bp0)
values.AddSpellMod(SPELLVALUE_BASE_POINT0, *bp0);
if (bp1)
values.AddSpellMod(SPELLVALUE_BASE_POINT1, *bp1);
if (bp2)
values.AddSpellMod(SPELLVALUE_BASE_POINT2, *bp2);
CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
CustomSpellValues values;
values.AddSpellMod(mod, value);
CastCustomSpell(spellId, values, target, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* target, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
CustomSpellValues values;
values.AddSpellMod(mod, value);
CastCustomSpell(spellId, values, target, triggerFlags, castItem, triggeredByAura, originalCaster);
}
void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID());
if (!spellInfo)
if (target)
{
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s", spellId, GetGUID().ToString().c_str());
return;
if (Unit* unitTarget = target->ToUnit())
targets.SetUnitTarget(unitTarget);
else if (GameObject* goTarget = target->ToGameObject())
targets.SetGOTarget(goTarget);
else
{
TC_LOG_ERROR("entities.unit", "CastSpell: Invalid target %s passed to spell cast by %s", target->GetGUID().ToString().c_str(), GetGUID().ToString().c_str());
return;
}
}
SpellCastTargets targets;
targets.SetUnitTarget(victim);
CastSpell(targets, spellInfo, &value, triggerFlags, castItem, triggeredByAura, originalCaster);
CastSpell(targets, spellId, args);
}
void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
void Unit::CastSpell(Position const& dest, uint32 spellId, CastSpellExtraArgs const& args)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID());
if (!spellInfo)
{
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s", spellId, GetGUID().ToString().c_str());
return;
}
SpellCastTargets targets;
targets.SetDst(x, y, z, GetOrientation());
CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(float x, float y, float z, uint32 spellId, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID());
if (!spellInfo)
{
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s", spellId, GetGUID().ToString().c_str());
return;
}
SpellCastTargets targets;
targets.SetDst(x, y, z, GetOrientation());
CastSpell(targets, spellInfo, nullptr, triggerFlags, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID());
if (!spellInfo)
{
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s", spellId, GetGUID().ToString().c_str());
return;
}
SpellCastTargets targets;
targets.SetGOTarget(go);
CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(Item* target, uint32 spellId, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId, GetMap()->GetDifficultyID());
if (!spellInfo)
{
TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s", spellId, GetGUID().ToString().c_str());
return;
}
SpellCastTargets targets;
targets.SetItemTarget(target);
CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
targets.SetDst(dest);
CastSpell(targets, spellId, args);
}
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit)
@@ -2125,7 +2024,10 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
}
else
{
CastSpell(victim, meleeAttackSpellId, true, nullptr, meleeAttackAuraEffect);
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.TriggeringAura = meleeAttackAuraEffect;
CastSpell(victim, meleeAttackSpellId, args);
uint32 hitInfo = HITINFO_AFFECTS_VICTIM | HITINFO_NO_ANIMATION;
if (attType == OFF_ATTACK)
@@ -2996,7 +2898,7 @@ void Unit::_UpdateAutoRepeatSpell()
// we want to shoot
Spell* spell = new Spell(this, autoRepeatSpellInfo, TRIGGERED_FULL_MASK);
spell->prepare(&(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_targets));
spell->prepare(m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_targets);
// all went good, reset attack
resetAttackTimer(RANGED_ATTACK);
@@ -5991,7 +5893,7 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
if (!spellInfo || !spellInfo->IsPassive())
continue;
if (spellInfo->CasterAuraState == uint32(flag))
CastSpell(this, itr->first, true, nullptr);
CastSpell(this, itr->first, true);
}
}
else if (Pet* pet = ToCreature()->ToPet())
@@ -6004,7 +5906,7 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
if (!spellInfo || !spellInfo->IsPassive())
continue;
if (spellInfo->CasterAuraState == uint32(flag))
CastSpell(this, itr->first, true, nullptr);
CastSpell(this, itr->first, true);
}
}
}
@@ -10181,7 +10083,10 @@ void Unit::TriggerOnPowerChangeAuras(Powers power, int32 oldVal, int32 newVal)
break;
}
CastSpell(this, triggerSpell, true, nullptr, effect);
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.TriggeringAura = effect;
CastSpell(this, triggerSpell, args);
}
}
}
@@ -10452,7 +10357,7 @@ void CharmInfo::InitPossessCreateSpells()
if (spellInfo)
{
if (spellInfo->IsPassive())
_unit->CastSpell(_unit, spellInfo, true);
_unit->CastSpell(_unit, spellInfo->Id, true);
else
AddSpellToActionBar(spellInfo, ACT_PASSIVE, i % MAX_UNIT_ACTION_BAR_INDEX);
}
@@ -10485,7 +10390,7 @@ void CharmInfo::InitCharmCreateSpells()
if (spellInfo->IsPassive())
{
_unit->CastSpell(_unit, spellInfo, true);
_unit->CastSpell(_unit, spellInfo->Id, true);
_charmspells[x].SetActionAndType(spellId, ACT_PASSIVE);
}
else
@@ -13012,7 +12917,12 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
}
if (IsInMap(caster))
caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0 + i), seatId + 1, target, flags, nullptr, nullptr, origCasterGUID);
{
CastSpellExtraArgs args(flags);
args.OriginalCaster = origCasterGUID;
args.SpellValueOverrides.AddMod(SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1);
caster->CastSpell(target, itr->second.spellId, args);
}
else // This can happen during Player::_LoadAuras
{
int32 bp0[MAX_SPELL_EFFECTS];
@@ -13027,7 +12937,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
else
{
if (IsInMap(caster))
caster->CastSpell(target, spellEntry, flags, nullptr, nullptr, origCasterGUID);
caster->CastSpell(target, spellEntry->Id, CastSpellExtraArgs().SetOriginalCaster(origCasterGUID));
else
Aura::TryRefreshStackOrCreate(spellEntry, ObjectGuid::Create<HighGuid::Cast>(SPELL_CAST_SOURCE_NORMAL, GetMapId(), spellEntry->Id, GetMap()->GenerateLowGuid<HighGuid::Cast>()), MAX_EFFECT_MASK, this, clicker, GetMap()->GetDifficultyID(), nullptr, nullptr, origCasterGUID);
}
@@ -13044,7 +12954,9 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
void Unit::EnterVehicle(Unit* base, int8 seatId)
{
CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId + 1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
CastSpellExtraArgs args(TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
args.SpellValueOverrides.AddBP0(seatId + 1);
CastSpell(base, VEHICLE_SPELL_RIDE_HARDCODED, args);
}
void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp)
+4 -164
View File
@@ -39,125 +39,6 @@
#define SPELL_DH_DOUBLE_JUMP 196055
#define DISPLAYID_HIDDEN_MOUNT 73200
enum class SpellModOp : uint8
{
HealingAndDamage = 0,
Duration = 1,
Hate = 2,
PointsIndex0 = 3,
ProcCharges = 4,
Range = 5,
Radius = 6,
CritChance = 7,
Points = 8,
ResistPushback = 9,
ChangeCastTime = 10,
Cooldown = 11,
PointsIndex1 = 12,
TargetResistance = 13,
PowerCost0 = 14, // Used when SpellPowerEntry::PowerIndex == 0
CritDamageAndHealing = 15,
HitChance = 16,
ChainTargets = 17,
ProcChance = 18,
Period = 19,
ChainAmplitude = 20,
StartCooldown = 21,
PeriodicHealingAndDamage = 22,
PointsIndex2 = 23,
BonusCoefficient = 24,
TriggerDamage = 25, // NYI
ProcFrequency = 26,
Amplitude = 27,
DispelResistance = 28,
CrowdDamage = 29, // NYI
PowerCostOnMiss = 30,
Doses = 31,
PointsIndex3 = 32,
PointsIndex4 = 33,
PowerCost1 = 34, // Used when SpellPowerEntry::PowerIndex == 1
ChainJumpDistance = 35,
AreaTriggerMaxSummons = 36, // NYI
MaxAuraStacks = 37,
ProcCooldown = 38,
PowerCost2 = 39, // Used when SpellPowerEntry::PowerIndex == 2
};
#define MAX_SPELLMOD 40
enum SpellValueMod : uint8
{
SPELLVALUE_BASE_POINT0,
SPELLVALUE_BASE_POINT1,
SPELLVALUE_BASE_POINT2,
SPELLVALUE_BASE_POINT3,
SPELLVALUE_BASE_POINT4,
SPELLVALUE_BASE_POINT5,
SPELLVALUE_BASE_POINT6,
SPELLVALUE_BASE_POINT7,
SPELLVALUE_BASE_POINT8,
SPELLVALUE_BASE_POINT9,
SPELLVALUE_BASE_POINT10,
SPELLVALUE_BASE_POINT11,
SPELLVALUE_BASE_POINT12,
SPELLVALUE_BASE_POINT13,
SPELLVALUE_BASE_POINT14,
SPELLVALUE_BASE_POINT15,
SPELLVALUE_BASE_POINT16,
SPELLVALUE_BASE_POINT17,
SPELLVALUE_BASE_POINT18,
SPELLVALUE_BASE_POINT19,
SPELLVALUE_BASE_POINT20,
SPELLVALUE_BASE_POINT21,
SPELLVALUE_BASE_POINT22,
SPELLVALUE_BASE_POINT23,
SPELLVALUE_BASE_POINT24,
SPELLVALUE_BASE_POINT25,
SPELLVALUE_BASE_POINT26,
SPELLVALUE_BASE_POINT27,
SPELLVALUE_BASE_POINT28,
SPELLVALUE_BASE_POINT29,
SPELLVALUE_BASE_POINT30,
SPELLVALUE_BASE_POINT31,
SPELLVALUE_BASE_POINT_END,
SPELLVALUE_RADIUS_MOD,
SPELLVALUE_MAX_TARGETS,
SPELLVALUE_AURA_STACK
};
class CustomSpellValues
{
typedef std::pair<SpellValueMod, int32> CustomSpellValueMod;
typedef std::vector<CustomSpellValueMod> StorageType;
public:
typedef StorageType::const_iterator const_iterator;
public:
void AddSpellMod(SpellValueMod mod, int32 value)
{
storage_.push_back(CustomSpellValueMod(mod, value));
}
const_iterator begin() const
{
return storage_.begin();
}
const_iterator end() const
{
return storage_.end();
}
private:
StorageType storage_;
};
enum SpellFacingFlags
{
SPELL_FACING_FLAG_INFRONT = 0x0001
};
#define MAX_SPELL_CHARM 4
#define MAX_SPELL_VEHICLE 6
#define MAX_SPELL_POSSESS 8
@@ -284,36 +165,6 @@ enum WeaponDamageRange
MAXDAMAGE
};
enum TriggerCastFlags : uint32
{
TRIGGERED_NONE = 0x00000000, //! Not triggered
TRIGGERED_IGNORE_GCD = 0x00000001, //! Will ignore GCD
TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD = 0x00000002, //! Will ignore Spell and Category cooldowns
TRIGGERED_IGNORE_POWER_AND_REAGENT_COST = 0x00000004, //! Will ignore power and reagent cost
TRIGGERED_IGNORE_CAST_ITEM = 0x00000008, //! Will not take away cast item or update related achievement criteria
TRIGGERED_IGNORE_AURA_SCALING = 0x00000010, //! Will ignore aura scaling
TRIGGERED_IGNORE_CAST_IN_PROGRESS = 0x00000020, //! Will not check if a current cast is in progress
TRIGGERED_IGNORE_COMBO_POINTS = 0x00000040, //! Will ignore combo point requirement
TRIGGERED_CAST_DIRECTLY = 0x00000080, //! In Spell::prepare, will be cast directly without setting containers for executed spell
TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS = 0x00000100, //! Will ignore interruptible aura's at cast
TRIGGERED_IGNORE_SET_FACING = 0x00000200, //! Will not adjust facing to target (if any)
TRIGGERED_IGNORE_SHAPESHIFT = 0x00000400, //! Will ignore shapeshift checks
TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state
TRIGGERED_DISALLOW_PROC_EVENTS = 0x00001000, //! Disallows proc events from triggered spell (default)
TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions
// reuse = 0x00004000,
// reuse = 0x00008000,
TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements
TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions
TRIGGERED_FULL_MASK = 0x0007FFFF, //! Used when doing CastSpell with triggered == true
// debug flags (used with .cast triggered commands)
TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //! Will ignore equipped item requirements
TRIGGERED_IGNORE_TARGET_CHECK = 0x00100000, //! Will ignore most target checks (mostly DBC target checks)
TRIGGERED_FULL_DEBUG_MASK = 0xFFFFFFFF
};
enum UnitMods
{
UNIT_MOD_STAT_STRENGTH, // UNIT_MOD_STAT_STRENGTH..UNIT_MOD_STAT_INTELLECT must be in existed order, it's accessed by index values of Stats enum.
@@ -1326,21 +1177,10 @@ class TC_GAME_API Unit : public WorldObject
void EnergizeBySpell(Unit* victim, uint32 spellId, int32 damage, Powers powerType);
void EnergizeBySpell(Unit* victim, SpellInfo const* spellInfo, int32 damage, Powers powerType);
void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(std::nullptr_t, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty) { CastSpell((Unit*)nullptr, spellId, triggered, castItem, triggeredByAura, originalCaster); }
void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(std::nullptr_t, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty) { CastSpell((Unit*)nullptr, spellId, triggerFlags, castItem, triggeredByAura, originalCaster); }
void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(float x, float y, float z, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastSpell(Item* target, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
void CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
// CastSpell's third arg can be a variety of things - check out CastSpellExtraArgs' constructors!
void CastSpell(SpellCastTargets const& targets, uint32 spellId, CastSpellExtraArgs const& args = {});
void CastSpell(WorldObject* target, uint32 spellId, CastSpellExtraArgs const& args = {});
void CastSpell(Position const& dest, uint32 spellId, CastSpellExtraArgs const& args = {});
Aura* AddAura(uint32 spellId, Unit* target);
Aura* AddAura(SpellInfo const* spellInfo, uint32 effMask, Unit* target);
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
@@ -98,54 +98,6 @@ enum UnitPetFlag : uint8
UNIT_PET_FLAG_CAN_BE_ABANDONED = 0x02
};
// high byte (3 from 0..3) of UNIT_FIELD_BYTES_2
enum ShapeshiftForm
{
FORM_NONE = 0,
FORM_CAT_FORM = 1,
FORM_TREE_OF_LIFE = 2,
FORM_TRAVEL_FORM = 3,
FORM_AQUATIC_FORM = 4,
FORM_BEAR_FORM = 5,
FORM_AMBIENT = 6,
FORM_GHOUL = 7,
FORM_DIRE_BEAR_FORM = 8,
FORM_CRANE_STANCE = 9,
FORM_THARONJA_SKELETON = 10,
FORM_DARKMOON_TEST_OF_STRENGTH = 11,
FORM_BLB_PLAYER = 12,
FORM_SHADOW_DANCE = 13,
FORM_CREATURE_BEAR = 14,
FORM_CREATURE_CAT = 15,
FORM_GHOST_WOLF = 16,
FORM_BATTLE_STANCE = 17,
FORM_DEFENSIVE_STANCE = 18,
FORM_BERSERKER_STANCE = 19,
FORM_SERPENT_STANCE = 20,
FORM_ZOMBIE = 21,
FORM_METAMORPHOSIS = 22,
FORM_OX_STANCE = 23,
FORM_TIGER_STANCE = 24,
FORM_UNDEAD = 25,
FORM_FRENZY = 26,
FORM_FLIGHT_FORM_EPIC = 27,
FORM_SHADOWFORM = 28,
FORM_FLIGHT_FORM = 29,
FORM_STEALTH = 30,
FORM_MOONKIN_FORM = 31,
FORM_SPIRIT_OF_REDEMPTION = 32,
FORM_GLADIATOR_STANCE = 33,
FORM_METAMORPHOSIS_2 = 34,
FORM_MOONKIN_FORM_RESTORATION = 35,
FORM_TREANT_FORM = 36,
FORM_SPIRIT_OWL_FORM = 37,
FORM_SPIRIT_OWL_FORM_2 = 38,
FORM_WISP_FORM = 39,
FORM_WISP_FORM_2 = 40,
FORM_SOULSHAPE = 41,
FORM_FORGEBORNE_REVERIES = 42
};
enum UnitMoveType
{
MOVE_WALK = 0,
@@ -1217,10 +1217,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
{
// not blizz like, we must correctly save and load player instead...
if (pCurrChar->getRace() == RACE_NIGHTELF && !pCurrChar->HasAura(20584))
pCurrChar->CastSpell(pCurrChar, 20584, true, nullptr);// auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
pCurrChar->CastSpell(pCurrChar, 20584, true);// auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
if (!pCurrChar->HasAura(8326))
pCurrChar->CastSpell(pCurrChar, 8326, true, nullptr); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
pCurrChar->CastSpell(pCurrChar, 8326, true); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
pCurrChar->SetWaterWalking(true);
}
+2 -2
View File
@@ -387,7 +387,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
}
}
spell->prepare(&(spell->m_targets));
spell->prepare(spell->m_targets);
}
else
{
@@ -713,7 +713,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell&
spellPrepare.ServerCastID = spell->m_castId;
SendPacket(spellPrepare.Write());
spell->prepare(&targets);
spell->prepare(targets);
}
else
{
+3 -7
View File
@@ -342,7 +342,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPackets::Spells::CastSpell& cast)
spell->m_fromClient = true;
spell->m_misc.Raw.Data[0] = cast.Cast.Misc[0];
spell->m_misc.Raw.Data[1] = cast.Cast.Misc[1];
spell->prepare(&targets);
spell->prepare(targets);
}
void WorldSession::HandleCancelCastOpcode(WorldPackets::Spells::CancelCast& packet)
@@ -489,14 +489,10 @@ void WorldSession::HandleSelfResOpcode(WorldPackets::Spells::SelfRes& selfRes)
if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
return; // silent return, client should display error by itself and not send this opcode
auto const& selfResSpells = _player->m_activePlayerData->SelfResSpells;
if (std::find(selfResSpells.begin(), selfResSpells.end(), selfRes.SpellID) == selfResSpells.end())
if (_player->m_activePlayerData->SelfResSpells.FindIndex(selfRes.SpellID) < 0)
return;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(selfRes.SpellID, _player->GetMap()->GetDifficultyID());
if (spellInfo)
_player->CastSpell(_player, spellInfo, false, nullptr);
_player->CastSpell(_player, selfRes.SpellID, _player->GetMap()->GetDifficultyID());
_player->RemoveSelfResSpell(selfRes.SpellID);
}
+1 -1
View File
@@ -93,7 +93,7 @@ void WorldSession::HandleUseToy(WorldPackets::Toy::UseToy& packet)
spell->m_misc.Raw.Data[0] = packet.Cast.Misc[0];
spell->m_misc.Raw.Data[1] = packet.Cast.Misc[1];
spell->m_castFlagsEx |= CAST_FLAG_EX_USE_TOY_SPELL;
spell->prepare(&targets);
spell->prepare(targets);
}
void WorldSession::HandleToyClearFanfare(WorldPackets::Toy::ToyClearFanfare& toyClearFanfare)
+2 -2
View File
@@ -509,10 +509,10 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPackets::Trade::AcceptTrade& acc
trader->ModifyMoney(my_trade->GetMoney());
if (my_spell)
my_spell->prepare(&my_targets);
my_spell->prepare(my_targets);
if (his_spell)
his_spell->prepare(&his_targets);
his_spell->prepare(his_targets);
// cleanup
clearAcceptTradeMode(my_trade, his_trade);
@@ -591,4 +591,52 @@ enum AuraObjectType
DYNOBJ_AURA_TYPE
};
// high byte (3 from 0..3) of UNIT_FIELD_BYTES_2
enum ShapeshiftForm
{
FORM_NONE = 0,
FORM_CAT_FORM = 1,
FORM_TREE_OF_LIFE = 2,
FORM_TRAVEL_FORM = 3,
FORM_AQUATIC_FORM = 4,
FORM_BEAR_FORM = 5,
FORM_AMBIENT = 6,
FORM_GHOUL = 7,
FORM_DIRE_BEAR_FORM = 8,
FORM_CRANE_STANCE = 9,
FORM_THARONJA_SKELETON = 10,
FORM_DARKMOON_TEST_OF_STRENGTH = 11,
FORM_BLB_PLAYER = 12,
FORM_SHADOW_DANCE = 13,
FORM_CREATURE_BEAR = 14,
FORM_CREATURE_CAT = 15,
FORM_GHOST_WOLF = 16,
FORM_BATTLE_STANCE = 17,
FORM_DEFENSIVE_STANCE = 18,
FORM_BERSERKER_STANCE = 19,
FORM_SERPENT_STANCE = 20,
FORM_ZOMBIE = 21,
FORM_METAMORPHOSIS = 22,
FORM_OX_STANCE = 23,
FORM_TIGER_STANCE = 24,
FORM_UNDEAD = 25,
FORM_FRENZY = 26,
FORM_FLIGHT_FORM_EPIC = 27,
FORM_SHADOWFORM = 28,
FORM_FLIGHT_FORM = 29,
FORM_STEALTH = 30,
FORM_MOONKIN_FORM = 31,
FORM_SPIRIT_OF_REDEMPTION = 32,
FORM_GLADIATOR_STANCE = 33,
FORM_METAMORPHOSIS_2 = 34,
FORM_MOONKIN_FORM_RESTORATION = 35,
FORM_TREANT_FORM = 36,
FORM_SPIRIT_OWL_FORM = 37,
FORM_SPIRIT_OWL_FORM_2 = 38,
FORM_WISP_FORM = 39,
FORM_WISP_FORM_2 = 40,
FORM_SOULSHAPE = 41,
FORM_FORGEBORNE_REVERIES = 42
};
#endif
@@ -1234,16 +1234,16 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (apply)
{
if (spellId)
target->CastSpell(target, spellId, true, nullptr, this);
target->CastSpell(target, spellId, this);
if (spellId2)
target->CastSpell(target, spellId2, true, nullptr, this);
target->CastSpell(target, spellId2, this);
if (spellId3)
target->CastSpell(target, spellId3, true, nullptr, this);
target->CastSpell(target, spellId3, this);
if (spellId4)
target->CastSpell(target, spellId4, true, nullptr, this);
target->CastSpell(target, spellId4, this);
if (target->GetTypeId() == TYPEID_PLAYER)
{
@@ -1267,7 +1267,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
continue;
if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
target->CastSpell(target, itr->first, true, nullptr, this);
target->CastSpell(target, itr->first, this);
}
}
}
@@ -1703,12 +1703,12 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
case FORM_BEAR_FORM:
case FORM_CAT_FORM:
if (AuraEffect* dummy = target->GetAuraEffect(37315, 0))
target->CastSpell(target, 37316, true, nullptr, dummy);
target->CastSpell(target, 37316, dummy);
break;
// Nordrassil Regalia - bonus
case FORM_MOONKIN_FORM:
if (AuraEffect* dummy = target->GetAuraEffect(37324, 0))
target->CastSpell(target, 37325, true, nullptr, dummy);
target->CastSpell(target, 37325, dummy);
break;
default:
break;
@@ -4382,7 +4382,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 13139: // net-o-matic
// root to self part of (root_target->charge->root_self sequence
if (caster)
caster->CastSpell(caster, 13138, true, nullptr, this);
caster->CastSpell(caster, 13138, this);
break;
case 34026: // kill command
{
@@ -4390,7 +4390,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (!pet)
break;
target->CastSpell(target, 34027, true, nullptr, this);
target->CastSpell(target, 34027, this);
// set 3 stacks and 3 charges (to make all auras not disappear at once)
Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
@@ -4411,15 +4411,15 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (caster)
{
if (caster->getGender() == GENDER_FEMALE)
caster->CastSpell(target, 37095, true, nullptr, this); // Blood Elf Disguise
caster->CastSpell(target, 37095, this); // Blood Elf Disguise
else
caster->CastSpell(target, 37093, true, nullptr, this);
caster->CastSpell(target, 37093, this);
}
break;
}
case 39850: // Rocket Blast
if (roll_chance_i(20)) // backfire stun
target->CastSpell(target, 51581, true, nullptr, this);
target->CastSpell(target, 51581, this);
break;
case 43873: // Headless Horseman Laugh
target->PlayDistanceSound(11965);
@@ -4428,9 +4428,9 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (caster)
{
if (caster->getGender() == GENDER_FEMALE)
caster->CastSpell(target, 46356, true, nullptr, this);
caster->CastSpell(target, 46356, this);
else
caster->CastSpell(target, 46355, true, nullptr, this);
caster->CastSpell(target, 46355, this);
}
break;
case 46361: // Reinforced Net
@@ -4468,7 +4468,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
}
if (finalSpelId)
caster->CastSpell(target, finalSpelId, true, nullptr, this);
caster->CastSpell(target, finalSpelId, this);
}
switch (m_spellInfo->SpellFamilyName)
@@ -4488,7 +4488,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
case 36730: // Flame Strike
{
target->CastSpell(target, 36731, true, nullptr, this);
target->CastSpell(target, 36731, this);
break;
}
case 44191: // Flame Strike
@@ -4497,7 +4497,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
{
uint32 spellId = target->GetMap()->IsHeroic() ? 46163 : 44190;
target->CastSpell(target, spellId, true, nullptr, this);
target->CastSpell(target, spellId, this);
}
break;
}
@@ -4511,14 +4511,14 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
}
case 42783: // Wrath of the Astromancer
target->CastSpell(target, GetAmount(), true, nullptr, this);
target->CastSpell(target, GetAmount(), this);
break;
case 46308: // Burning Winds cast only at creatures at spawn
target->CastSpell(target, 47287, true, nullptr, this);
target->CastSpell(target, 47287, this);
break;
case 52172: // Coyote Spirit Despawn Aura
case 60244: // Blood Parrot Despawn Aura
target->CastSpell(nullptr, GetAmount(), true, nullptr, this);
target->CastSpell(nullptr, GetAmount(), this);
break;
case 91604: // Restricted Flight Area
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
@@ -4558,9 +4558,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (apply && caster)
{
SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId, GetBase()->GetCastDifficulty());
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.OriginalCaster = GetCasterGUID();
args.CastDifficulty = spell->Difficulty;
for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spell, true, nullptr, nullptr, GetCasterGUID());
caster->CastSpell(target, spell->Id, args);
break;
}
target->RemoveAurasDueToSpell(spellId);
@@ -4573,8 +4577,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (apply && caster)
{
SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId, GetBase()->GetCastDifficulty());
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.OriginalCaster = GetCasterGUID();
args.CastDifficulty = spell->Difficulty;
for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spell, true, nullptr, nullptr, GetCasterGUID());
caster->CastSpell(target, spell->Id, args);
break;
}
target->RemoveAurasDueToSpell(spellId);
@@ -4860,11 +4869,13 @@ void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, boo
{
if (apply)
{
// If amount avalible cast with basepoints (Crypt Fever for example)
if (GetAmount())
caster->CastCustomSpell(target, triggeredSpellId, &m_amount, nullptr, nullptr, true, nullptr, this);
else
caster->CastSpell(target, triggeredSpellId, true, nullptr, this);
CastSpellExtraArgs args(this);
if (GetAmount()) // If amount avalible cast with basepoints (Crypt Fever for example)
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, GetAmount());
caster->CastSpell(target, triggeredSpellId, args);
}
else
{
@@ -5081,12 +5092,12 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
{
if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target)
{
triggerCaster->CastSpell(target, triggeredSpellInfo, true, nullptr, this);
triggerCaster->CastSpell(target, triggerSpellId, this);
TC_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id);
}
}
else
TC_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
TC_LOG_WARN("spells", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefore not triggered.", GetId(), triggerSpellId, GetEffIndex());
}
void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const
@@ -5096,13 +5107,15 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit*
{
if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target)
{
int32 basepoints = GetAmount();
triggerCaster->CastCustomSpell(target, triggerSpellId, &basepoints, &basepoints, &basepoints, true, nullptr, this);
CastSpellExtraArgs args(this);
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
args.SpellValueOverrides.AddMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), GetAmount());
triggerCaster->CastSpell(target, triggerSpellId, args);
TC_LOG_DEBUG("spells", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id);
}
}
else
TC_LOG_DEBUG("spells","AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
TC_LOG_WARN("spells","AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefore not triggered.", GetId(), triggerSpellId, GetEffIndex());
}
void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
@@ -5152,7 +5165,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000))
{
if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
caster->CastSpell(caster, 95810, true, nullptr, this);
caster->CastSpell(caster, 95810, this);
}
if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC)
{
@@ -5515,7 +5528,10 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
if (manaFeedVal > 0)
{
int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);
caster->CastCustomSpell(caster, 32554, &feedAmount, nullptr, nullptr, true, nullptr, this);
CastSpellExtraArgs args(this);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, feedAmount);
caster->CastSpell(caster, 32554, args);
}
}
@@ -5654,7 +5670,7 @@ void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEve
if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
{
TC_LOG_DEBUG("spells", "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell %u from aura %u proc", triggeredSpellInfo->Id, GetId());
triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, nullptr, this);
triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo->Id, this);
}
else if (triggerSpellId && GetAuraType() != SPELL_AURA_DUMMY)
TC_LOG_ERROR("spells","AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId());
@@ -5668,9 +5684,10 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp
uint32 triggerSpellId = GetSpellEffectInfo()->TriggerSpell;
if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
{
int32 basepoints0 = GetAmount();
TC_LOG_DEBUG("spells", "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, basepoints0, GetId());
triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, nullptr, nullptr, true, nullptr, this);
CastSpellExtraArgs args(this);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, GetAmount());
triggerCaster->CastSpell(triggerTarget, triggerSpellId, args);
TC_LOG_DEBUG("spells", "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, GetAmount(), GetId());
}
else
TC_LOG_ERROR("spells","AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId());
@@ -5853,7 +5870,13 @@ void AuraEffect::HandleLinkedSummon(AuraApplication const* aurApp, uint8 mode, b
// on apply cast summon spell
if (apply)
target->CastSpell(target, triggerSpellInfo, true, nullptr, this);
{
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.TriggeringAura = this;
args.CastDifficulty = triggerSpellInfo->Difficulty;
target->CastSpell(target, triggerSpellInfo->Id, args);
}
// on unapply we need to search for and remove the summoned creature
else
{
+9 -7
View File
@@ -1249,7 +1249,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (*itr < 0)
target->RemoveAurasDueToSpell(-(*itr));
else if (removeMode != AURA_REMOVE_BY_DEATH)
target->CastSpell(target, *itr, true, nullptr, nullptr, GetCasterGUID());
target->CastSpell(target, *itr, GetCasterGUID());
}
}
if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
@@ -1311,8 +1311,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
// Druid T8 Restoration 4P Bonus
if (caster->HasAura(64760))
{
int32 heal = GetEffect(EFFECT_0)->GetAmount();
caster->CastCustomSpell(target, 64801, &heal, nullptr, nullptr, true, nullptr, GetEffect(EFFECT_0));
CastSpellExtraArgs args(GetEffect(EFFECT_0));
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, GetEffect(EFFECT_0)->GetAmount());
caster->CastSpell(target, 64801, args);
}
}
break;
@@ -1329,7 +1330,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 66: // Invisibility
if (removeMode != AURA_REMOVE_BY_EXPIRE)
break;
target->CastSpell(target, 32612, true, nullptr, GetEffect(1));
target->CastSpell(target, 32612, GetEffect(1));
target->CombatStop();
break;
default:
@@ -1363,8 +1364,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (AuraEffect const* aurEff = aura->GetEffect(0))
{
float multiplier = float(aurEff->GetAmount());
int32 basepoints0 = int32(CalculatePct(caster->GetMaxPower(POWER_MANA), multiplier));
caster->CastCustomSpell(caster, 47755, &basepoints0, nullptr, nullptr, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(CalculatePct(caster->GetMaxPower(POWER_MANA), multiplier));
caster->CastSpell(caster, 47755, args);
}
}
}
@@ -1391,7 +1393,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (owner->HasAura(34692))
{
if (apply)
owner->CastSpell(owner, 34471, true, nullptr, GetEffect(0));
owner->CastSpell(owner, 34471, GetEffect(0));
else
owner->RemoveAurasDueToSpell(34471);
}
+5 -5
View File
@@ -2767,7 +2767,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint32 effMask)
{
if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance))
{
m_caster->CastSpell(unit, i->triggeredSpell, TRIGGERED_FULL_MASK);
m_caster->CastSpell(unit, i->triggeredSpell->Id, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetCastDifficulty(i->triggeredSpell->Difficulty));
TC_LOG_DEBUG("spells", "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->triggeredSpell->Id);
// SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration
@@ -2798,7 +2798,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint32 effMask)
if (*i < 0)
unit->RemoveAurasDueToSpell(-(*i));
else
unit->CastSpell(unit, *i, true, nullptr, nullptr, m_caster->GetGUID());
unit->CastSpell(unit, *i, m_caster->GetGUID());
}
}
}
@@ -2916,7 +2916,7 @@ bool Spell::UpdateChanneledTargetList()
return channelTargetEffectMask == 0;
}
void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura)
void Spell::prepare(SpellCastTargets const& targets, AuraEffect const* triggeredByAura)
{
if (m_CastItem)
{
@@ -2935,7 +2935,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
}
}
InitExplicitTargets(*targets);
InitExplicitTargets(targets);
m_spellState = SPELL_STATE_PREPARING;
@@ -5597,7 +5597,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
{
if (strict) //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
if (Pet* pet = m_caster->ToPlayer()->GetPet())
pet->CastSpell(pet, 32752, true, nullptr, nullptr, pet->GetGUID());
pet->CastSpell(pet, 32752, pet->GetGUID());
}
else if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET))
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
+1 -1
View File
@@ -522,7 +522,7 @@ class TC_GAME_API Spell
GameObject* SearchSpellFocus();
void prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura = nullptr);
void prepare(SpellCastTargets const& targets, AuraEffect const* triggeredByAura = nullptr);
void cancel();
void update(uint32 difftime);
void cast(bool skipCheck = false);
+168
View File
@@ -20,6 +20,12 @@
#include "Define.h"
#include "EnumFlag.h"
#include "ObjectGuid.h"
#include <vector>
class Item;
class AuraEffect;
enum Difficulty : uint8;
namespace UF
{
@@ -122,6 +128,168 @@ enum class SpellAuraInterruptFlags2 : uint32
DEFINE_ENUM_FLAG(SpellAuraInterruptFlags2);
enum class SpellModOp : uint8
{
HealingAndDamage = 0,
Duration = 1,
Hate = 2,
PointsIndex0 = 3,
ProcCharges = 4,
Range = 5,
Radius = 6,
CritChance = 7,
Points = 8,
ResistPushback = 9,
ChangeCastTime = 10,
Cooldown = 11,
PointsIndex1 = 12,
TargetResistance = 13,
PowerCost0 = 14, // Used when SpellPowerEntry::PowerIndex == 0
CritDamageAndHealing = 15,
HitChance = 16,
ChainTargets = 17,
ProcChance = 18,
Period = 19,
ChainAmplitude = 20,
StartCooldown = 21,
PeriodicHealingAndDamage = 22,
PointsIndex2 = 23,
BonusCoefficient = 24,
TriggerDamage = 25, // NYI
ProcFrequency = 26,
Amplitude = 27,
DispelResistance = 28,
CrowdDamage = 29, // NYI
PowerCostOnMiss = 30,
Doses = 31,
PointsIndex3 = 32,
PointsIndex4 = 33,
PowerCost1 = 34, // Used when SpellPowerEntry::PowerIndex == 1
ChainJumpDistance = 35,
AreaTriggerMaxSummons = 36, // NYI
MaxAuraStacks = 37,
ProcCooldown = 38,
PowerCost2 = 39, // Used when SpellPowerEntry::PowerIndex == 2
};
#define MAX_SPELLMOD 40
enum SpellValueMod : uint8
{
SPELLVALUE_BASE_POINT0,
SPELLVALUE_BASE_POINT1,
SPELLVALUE_BASE_POINT2,
SPELLVALUE_BASE_POINT3,
SPELLVALUE_BASE_POINT4,
SPELLVALUE_BASE_POINT5,
SPELLVALUE_BASE_POINT6,
SPELLVALUE_BASE_POINT7,
SPELLVALUE_BASE_POINT8,
SPELLVALUE_BASE_POINT9,
SPELLVALUE_BASE_POINT10,
SPELLVALUE_BASE_POINT11,
SPELLVALUE_BASE_POINT12,
SPELLVALUE_BASE_POINT13,
SPELLVALUE_BASE_POINT14,
SPELLVALUE_BASE_POINT15,
SPELLVALUE_BASE_POINT16,
SPELLVALUE_BASE_POINT17,
SPELLVALUE_BASE_POINT18,
SPELLVALUE_BASE_POINT19,
SPELLVALUE_BASE_POINT20,
SPELLVALUE_BASE_POINT21,
SPELLVALUE_BASE_POINT22,
SPELLVALUE_BASE_POINT23,
SPELLVALUE_BASE_POINT24,
SPELLVALUE_BASE_POINT25,
SPELLVALUE_BASE_POINT26,
SPELLVALUE_BASE_POINT27,
SPELLVALUE_BASE_POINT28,
SPELLVALUE_BASE_POINT29,
SPELLVALUE_BASE_POINT30,
SPELLVALUE_BASE_POINT31,
SPELLVALUE_BASE_POINT_END,
SPELLVALUE_RADIUS_MOD,
SPELLVALUE_MAX_TARGETS,
SPELLVALUE_AURA_STACK
};
enum SpellFacingFlags
{
SPELL_FACING_FLAG_INFRONT = 0x0001
};
enum TriggerCastFlags : uint32
{
TRIGGERED_NONE = 0x00000000, //! Not triggered
TRIGGERED_IGNORE_GCD = 0x00000001, //! Will ignore GCD
TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD = 0x00000002, //! Will ignore Spell and Category cooldowns
TRIGGERED_IGNORE_POWER_AND_REAGENT_COST = 0x00000004, //! Will ignore power and reagent cost
TRIGGERED_IGNORE_CAST_ITEM = 0x00000008, //! Will not take away cast item or update related achievement criteria
TRIGGERED_IGNORE_AURA_SCALING = 0x00000010, //! Will ignore aura scaling
TRIGGERED_IGNORE_CAST_IN_PROGRESS = 0x00000020, //! Will not check if a current cast is in progress
TRIGGERED_IGNORE_COMBO_POINTS = 0x00000040, //! Will ignore combo point requirement
TRIGGERED_CAST_DIRECTLY = 0x00000080, //! In Spell::prepare, will be cast directly without setting containers for executed spell
TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS = 0x00000100, //! Will ignore interruptible aura's at cast
TRIGGERED_IGNORE_SET_FACING = 0x00000200, //! Will not adjust facing to target (if any)
TRIGGERED_IGNORE_SHAPESHIFT = 0x00000400, //! Will ignore shapeshift checks
TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state
TRIGGERED_DISALLOW_PROC_EVENTS = 0x00001000, //! Disallows proc events from triggered spell (default)
TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions
// reuse = 0x00004000,
// reuse = 0x00008000,
TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements
TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions
TRIGGERED_FULL_MASK = 0x0007FFFF, //! Used when doing CastSpell with triggered == true
// debug flags (used with .cast triggered commands)
TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //! Will ignore equipped item requirements
TRIGGERED_IGNORE_TARGET_CHECK = 0x00100000, //! Will ignore most target checks (mostly DBC target checks)
TRIGGERED_FULL_DEBUG_MASK = 0xFFFFFFFF
};
struct TC_GAME_API CastSpellExtraArgs
{
CastSpellExtraArgs() = default;
CastSpellExtraArgs(bool triggered) : TriggerFlags(triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE) {}
CastSpellExtraArgs(TriggerCastFlags trigger) : TriggerFlags(trigger) {}
CastSpellExtraArgs(Item* item) : TriggerFlags(TRIGGERED_FULL_MASK), CastItem(item) {}
CastSpellExtraArgs(AuraEffect const* eff) : TriggerFlags(TRIGGERED_FULL_MASK), TriggeringAura(eff) {}
CastSpellExtraArgs(ObjectGuid const& origCaster) : TriggerFlags(TRIGGERED_FULL_MASK), OriginalCaster(origCaster) {}
CastSpellExtraArgs(AuraEffect const* eff, ObjectGuid const& origCaster) : TriggerFlags(TRIGGERED_FULL_MASK), TriggeringAura(eff), OriginalCaster(origCaster) {}
CastSpellExtraArgs(Difficulty castDifficulty) : CastDifficulty(castDifficulty) {}
CastSpellExtraArgs(SpellValueMod mod, int32 val) { SpellValueOverrides.AddMod(mod, val); }
CastSpellExtraArgs& SetTriggerFlags(TriggerCastFlags flag) { TriggerFlags = flag; return *this; }
CastSpellExtraArgs& SetCastItem(Item* item) { CastItem = item; return *this; }
CastSpellExtraArgs& SetTriggeringAura(AuraEffect const* triggeringAura) { TriggeringAura = triggeringAura; return *this; }
CastSpellExtraArgs& SetOriginalCaster(ObjectGuid const& guid) { OriginalCaster = guid; return *this; }
CastSpellExtraArgs& SetCastDifficulty(Difficulty castDifficulty) { CastDifficulty = castDifficulty; return *this; }
CastSpellExtraArgs& AddSpellMod(SpellValueMod mod, int32 val) { SpellValueOverrides.AddMod(mod, val); return *this; }
CastSpellExtraArgs& AddSpellBP0(int32 val) { SpellValueOverrides.AddBP0(val); return *this; }
TriggerCastFlags TriggerFlags = TRIGGERED_NONE;
Item* CastItem = nullptr;
AuraEffect const* TriggeringAura = nullptr;
ObjectGuid OriginalCaster = ObjectGuid::Empty;
Difficulty CastDifficulty = Difficulty(0);
struct
{
public:
void AddMod(SpellValueMod mod, int32 val) { data.emplace_back(mod, val); }
void AddBP0(int32 bp0) { AddMod(SPELLVALUE_BASE_POINT0, bp0); } // because i don't want to type SPELLVALUE_BASE_POINT0 300 times
private:
auto begin() const { return data.cbegin(); }
auto end() const { return data.cend(); }
std::vector<std::pair<SpellValueMod, int32>> data;
friend class Unit;
} SpellValueOverrides;
};
struct SpellCastVisual
{
uint32 SpellXSpellVisualID = 0;
+45 -45
View File
@@ -714,17 +714,14 @@ void Spell::EffectTriggerSpell(SpellEffIndex /*effIndex*/)
targets.SetUnitTarget(m_caster);
}
CustomSpellValues values;
CastSpellExtraArgs args(m_originalCasterGUID);
// set basepoints for trigger with value effect
if (effectInfo->Effect == SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE)
{
values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT1, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT2, damage);
}
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
args.SpellValueOverrides.AddMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), damage);
// original caster guid only for GO cast
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, nullptr, nullptr, m_originalCasterGUID);
m_caster->CastSpell(targets, spellInfo->Id, args);
}
void Spell::EffectTriggerMissileSpell(SpellEffIndex /*effIndex*/)
@@ -761,18 +758,14 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex /*effIndex*/)
targets.SetUnitTarget(m_caster);
}
CustomSpellValues values;
CastSpellExtraArgs args(m_originalCasterGUID);
// set basepoints for trigger with value effect
if (effectInfo->Effect == SPELL_EFFECT_TRIGGER_MISSILE_SPELL_WITH_VALUE)
{
// maybe need to set value only when basepoints == 0?
values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT1, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT2, damage);
}
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
args.SpellValueOverrides.AddMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), damage);
// original caster guid only for GO cast
m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, nullptr, nullptr, m_originalCasterGUID);
m_caster->CastSpell(targets, spellInfo->Id, args);
}
void Spell::EffectForceCast(SpellEffIndex /*effIndex*/)
@@ -804,32 +797,28 @@ void Spell::EffectForceCast(SpellEffIndex /*effIndex*/)
break;
case 52463: // Hide In Mine Car
case 52349: // Overtake
unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, nullptr, nullptr, true, nullptr, nullptr, m_originalCasterGUID);
{
CastSpellExtraArgs args(m_originalCasterGUID);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, damage);
unitTarget->CastSpell(unitTarget, spellInfo->Id, args);
return;
}
}
}
switch (spellInfo->Id)
{
case 72298: // Malleable Goo Summon
unitTarget->CastSpell(unitTarget, spellInfo->Id, true, nullptr, nullptr, m_originalCasterGUID);
unitTarget->CastSpell(unitTarget, spellInfo->Id, m_originalCasterGUID);
return;
}
CustomSpellValues values;
// set basepoints for trigger with value effect
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
if (effectInfo->Effect == SPELL_EFFECT_FORCE_CAST_WITH_VALUE)
{
// maybe need to set value only when basepoints == 0?
values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT1, damage);
values.AddSpellMod(SPELLVALUE_BASE_POINT2, damage);
}
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
args.SpellValueOverrides.AddMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), damage);
SpellCastTargets targets;
targets.SetUnitTarget(m_caster);
unitTarget->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK);
unitTarget->CastSpell(m_caster, spellInfo->Id, args);
}
void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex /*effIndex*/)
@@ -848,7 +837,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex /*effIndex*/)
finish();
m_caster->CastSpell(nullptr, spellInfo, false);
m_caster->CastSpell(nullptr, spellInfo->Id, false);
}
void Spell::EffectJump(SpellEffIndex /*effIndex*/)
@@ -2048,11 +2037,13 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
spellId = spellInfo->Id;
}
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
// if we have small value, it indicates seat position
if (basePoints > 0 && basePoints < MAX_VEHICLE_SEATS)
m_originalCaster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, basePoints, summon, true);
else
m_originalCaster->CastSpell(summon, spellId, true);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, basePoints);
m_originalCaster->CastSpell(summon, spellId, args);
uint32 faction = properties->Faction;
if (!faction)
@@ -2809,7 +2800,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
// Skyshatter Harness item set bonus
// Stormstrike
if (AuraEffect* aurEff = m_caster->IsScriptOverriden(m_spellInfo, 5634))
m_caster->CastSpell(m_caster, 38430, true, nullptr, aurEff);
m_caster->CastSpell(m_caster, 38430, aurEff);
break;
}
case SPELLFAMILY_DRUID:
@@ -3076,7 +3067,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
uint32 spell_id = roll_chance_i(20) ? 8854 : 8855;
m_caster->CastSpell(m_caster, spell_id, true, nullptr);
m_caster->CastSpell(m_caster, spell_id, true);
return;
}
// Brittle Armor - need remove one 24575 Brittle Armor aura
@@ -3281,7 +3272,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
for (uint8 i = 0; i < 15; ++i)
{
m_caster->GetRandomPoint(*destTarget, radius, x, y, z);
m_caster->CastSpell(x, y, z, 54522, true);
m_caster->CastSpell({x, y, z}, 54522, true);
}
break;
}
@@ -3386,7 +3377,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
// proc a spellcast
if (Aura* chargesAura = m_caster->GetAura(59907))
{
m_caster->CastSpell(unitTarget, spell_heal, true, nullptr, nullptr, m_caster->ToTempSummon()->GetSummonerGUID());
m_caster->CastSpell(unitTarget, spell_heal, m_caster->ToTempSummon()->GetSummonerGUID());
if (chargesAura->ModCharges(-1))
m_caster->ToTempSummon()->UnSummon();
}
@@ -3405,7 +3396,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 58590: // Rank 9
case 58591: // Rank 10
{
int32 basepoints0 = damage;
// Cast Absorb on totems
for (uint8 slot = SUMMON_SLOT_TOTEM; slot < MAX_TOTEM_SLOT; ++slot)
{
@@ -3415,7 +3405,9 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
Creature* totem = unitTarget->GetMap()->GetCreature(unitTarget->m_SummonSlot[slot]);
if (totem && totem->IsTotem())
{
m_caster->CastCustomSpell(totem, 55277, &basepoints0, nullptr, nullptr, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, damage);
m_caster->CastSpell(totem, 55277, args);
}
}
break;
@@ -3808,7 +3800,9 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex)
player->DestroyItemCount(foodItem, count, true);
/// @todo fix crash when a spell has two effects, both pointed at the same item target
m_caster->CastCustomSpell(pet, effectInfo->TriggerSpell, &benefit, nullptr, nullptr, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, benefit);
m_caster->CastSpell(pet, effectInfo->TriggerSpell, args);
}
void Spell::EffectDismissPet(SpellEffIndex effIndex)
@@ -4172,7 +4166,7 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
m_caster->Attack(unitTarget, true);
if (effectInfo->TriggerSpell)
m_caster->CastSpell(unitTarget, effectInfo->TriggerSpell, true, nullptr, nullptr, m_originalCasterGUID);
m_caster->CastSpell(unitTarget, effectInfo->TriggerSpell, m_originalCasterGUID);
}
}
@@ -4197,7 +4191,7 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
else if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT)
{
if (effectInfo->TriggerSpell)
m_caster->CastSpell(destTarget->GetPositionX(), destTarget->GetPositionY(), destTarget->GetPositionZ(), effectInfo->TriggerSpell, true, nullptr, nullptr, m_originalCasterGUID);
m_caster->CastSpell(*destTarget, effectInfo->TriggerSpell, m_originalCasterGUID);
}
}
@@ -4485,7 +4479,11 @@ void Spell::EffectDestroyAllTotems(SpellEffIndex /*effIndex*/)
ApplyPct(mana, damage);
if (mana)
m_caster->CastCustomSpell(m_caster, 39104, &mana, nullptr, nullptr, true);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, mana);
m_caster->CastSpell(m_caster, 39104, args);
}
}
void Spell::EffectDurabilityDamage(SpellEffIndex effIndex)
@@ -5276,8 +5274,10 @@ void Spell::EffectCastButtons(SpellEffIndex /*effIndex*/)
if (!spellInfo->HasAttribute(SPELL_ATTR9_SUMMON_PLAYER_TOTEM))
continue;
TriggerCastFlags triggerFlags = TriggerCastFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_CAST_DIRECTLY | TRIGGERED_DONT_REPORT_CAST_ERROR);
m_caster->CastSpell(m_caster, spellInfo, triggerFlags);
CastSpellExtraArgs args;
args.TriggerFlags = TriggerCastFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_CAST_DIRECTLY | TRIGGERED_DONT_REPORT_CAST_ERROR);
args.CastDifficulty = GetCastDifficulty();
m_caster->CastSpell(m_caster, spellInfo->Id, args);
}
}
+5 -3
View File
@@ -3455,14 +3455,16 @@ void SpellMgr::LoadSpellInfoCorrections()
52438, // Summon Skittering Swarmer (Force Cast)
52449, // Summon Skittering Infector (Force Cast)
53609, // Summon Anub'ar Assassin (Force Cast)
53457 // Summon Impale Trigger (AoE)
53457, // Summon Impale Trigger (AoE)
45907 // Torch Target Picker
}, [](SpellInfo* spellInfo)
{
spellInfo->MaxAffectedTargets = 1;
});
// Skartax Purple Beam
ApplySpellFix({ 36384 }, [](SpellInfo* spellInfo)
ApplySpellFix({
36384 // Skartax Purple Beam
}, [](SpellInfo* spellInfo)
{
spellInfo->MaxAffectedTargets = 2;
});
@@ -526,7 +526,7 @@ class spell_garothi_apocalypse_drive : public AuraScript
void HandlePeriodic(AuraEffect const* aurEff)
{
GetTarget()->CastSpell(GetTarget(), SPELL_APOCALYPSE_DRIVE_PERIODIC_DAMAGE, true, nullptr, aurEff);
GetTarget()->CastSpell(GetTarget(), SPELL_APOCALYPSE_DRIVE_PERIODIC_DAMAGE, aurEff);
}
void Register() override
@@ -630,7 +630,7 @@ class spell_garothi_searing_barrage_dummy : public SpellScript
void HandleHit(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastCustomSpell(SPELL_SEARING_BARRAGE_SELECTOR, SPELLVALUE_BASE_POINT0, GetSpellInfo()->Id, GetHitUnit(), true);
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_SEARING_BARRAGE_SELECTOR, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_BASE_POINT0, GetSpellInfo()->Id));
}
void Register() override
@@ -870,7 +870,7 @@ class spell_garothi_cannon_chooser : public SpellScript
float x = AnnihilationCenterReferencePos.GetPositionX() + cos(frand(0.0f, float(M_PI * 2))) * frand(15.0f, 30.0f);
float y = AnnihilationCenterReferencePos.GetPositionY() + sin(frand(0.0f, float(M_PI * 2))) * frand(15.0f, 30.0f);
float z = caster->GetMap()->GetHeight(caster->GetPhaseShift(), x, y, AnnihilationCenterReferencePos.GetPositionZ());
annihilator->CastSpell(x, y, z, SPELL_ANNIHILATION_SUMMON, true);
annihilator->CastSpell({ x, y, z }, SPELL_ANNIHILATION_SUMMON, true);
}
annihilator->CastSpell(annihilator, SPELL_ANNIHILATION_DUMMY);
+2 -3
View File
@@ -171,8 +171,7 @@ public:
TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
float x, y, z;
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist);
handler->GetSession()->GetPlayer()->CastSpell(x, y, z, spellId, triggered);
handler->GetSession()->GetPlayer()->CastSpell({ x, y, z }, spellId, triggered);
return true;
}
@@ -274,7 +273,7 @@ public:
}
TriggerCastFlags triggered = (triggeredStr != nullptr) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
caster->CastSpell(x, y, z, spellId, triggered);
caster->CastSpell({ x, y, z }, spellId, triggered);
return true;
}
@@ -364,7 +364,7 @@ class spell_occuthar_occuthars_destruction : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
if (IsExpired())
caster->CastSpell(nullptr, SPELL_OCCUTHARS_DESTUCTION, true, nullptr, aurEff);
caster->CastSpell(nullptr, SPELL_OCCUTHARS_DESTUCTION, aurEff);
caster->ToCreature()->DespawnOrUnsummon(500);
}
@@ -259,9 +259,14 @@ struct boss_coren_direbrew : public BossAI
SummonSister(NPC_URSULA_DIREBREW);
break;
case EVENT_SUMMON_MOLE_MACHINE:
me->CastCustomSpell(SPELL_MOLE_MACHINE_TARGET_PICKER, SPELLVALUE_MAX_TARGETS, 1, nullptr, true);
{
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, 1);
me->CastSpell(nullptr, SPELL_MOLE_MACHINE_TARGET_PICKER, args);
events.Repeat(Seconds(15));
break;
}
case EVENT_DIREBREW_DISARM:
DoCastSelf(SPELL_DIREBREW_DISARM_PRE_CAST, true);
events.Repeat(Seconds(20));
@@ -135,8 +135,12 @@ class spell_baron_geddon_inferno : public SpellScriptLoader
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
int32 damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
GetTarget()->CastCustomSpell(SPELL_INFERNO_DMG, SPELLVALUE_BASE_POINT0, damageForTick[aurEff->GetTickNumber() - 1], nullptr, TRIGGERED_FULL_MASK, nullptr, aurEff);
int32 const damageForTick[8] = { 500, 500, 1000, 1000, 2000, 2000, 3000, 5000 };
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.TriggeringAura = aurEff;
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, damageForTick[aurEff->GetTickNumber() - 1]);
GetTarget()->CastSpell(nullptr, SPELL_INFERNO_DMG, args);
}
void Register() override
@@ -339,7 +339,10 @@ public:
enfeeble_targets[i] = target->GetGUID();
enfeeble_health[i] = target->GetHealth();
target->CastSpell(target, SPELL_ENFEEBLE, true, nullptr, nullptr, me->GetGUID());
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.OriginalCaster = me->GetGUID();
target->CastSpell(target, SPELL_ENFEEBLE, args);
target->SetHealth(1);
}
}
@@ -479,7 +479,7 @@ public:
Unit* unit = ObjectAccessor::GetUnit(*me, FlameWreathTarget[i]);
if (unit && !unit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
{
unit->CastSpell(unit, 20476, true, nullptr, nullptr, me->GetGUID());
unit->CastSpell(unit, 20476, me->GetGUID());
unit->CastSpell(unit, 11027, true);
FlameWreathTarget[i].Clear();
}
@@ -235,8 +235,13 @@ public:
{
Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
{
// Knockback into the air
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, nullptr, nullptr, me->GetGUID());
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.OriginalCaster = me->GetGUID();
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, args);
}
}
}
@@ -250,7 +255,10 @@ public:
if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
{
// Also needs an exception in spell system.
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, nullptr, nullptr, me->GetGUID());
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.OriginalCaster = me->GetGUID();
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, args);
unit->SetCanFly(true);
}
}
@@ -121,7 +121,7 @@ class spell_hexlord_unstable_affliction : public SpellScriptLoader
void HandleDispel(DispelInfo* dispelInfo)
{
if (Unit* caster = GetCaster())
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, nullptr, GetEffect(EFFECT_0));
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, GetEffect(EFFECT_0));
}
void Register() override
@@ -500,10 +500,12 @@ class spell_mandokir_bloodletting : public SpellScriptLoader
if (!caster)
return;
int32 damage = std::max<int32>(7500, target->CountPctFromCurHealth(aurEff->GetAmount()));
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.AddSpellMod(SPELLVALUE_BASE_POINT0, std::max<int32>(7500, target->CountPctFromCurHealth(aurEff->GetAmount())));
caster->CastCustomSpell(target, SPELL_BLOODLETTING_DAMAGE, &damage, nullptr, nullptr, true);
target->CastCustomSpell(caster, SPELL_BLOODLETTING_HEAL, &damage, nullptr, nullptr, true);
caster->CastSpell(target, SPELL_BLOODLETTING_DAMAGE, args);
target->CastSpell(caster, SPELL_BLOODLETTING_HEAL, args);
}
void Register() override
@@ -606,7 +608,7 @@ class spell_mandokir_devastating_slam : public SpellScriptLoader
angle = float(rand_norm()) * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
caster->GetClosePoint(x, y, z, 4.0f, frand(-2.5f, 50.0f), angle);
caster->CastSpell(x, y, z, SPELL_DEVASTATING_SLAM_DAMAGE, true);
caster->CastSpell({ x, y, z }, SPELL_DEVASTATING_SLAM_DAMAGE, true);
}
}
}
@@ -284,8 +284,10 @@ class spell_anetheron_vampiric_aura : public SpellScriptLoader
if (!damageInfo || !damageInfo->GetDamage())
return;
int32 bp = damageInfo->GetDamage() * 3;
eventInfo.GetActor()->CastCustomSpell(SPELL_VAMPIRIC_AURA_HEAL, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), true, nullptr, aurEff);
Unit* actor = eventInfo.GetActor();
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, damageInfo->GetDamage() * 3);
actor->CastSpell(actor, SPELL_VAMPIRIC_AURA_HEAL, args);
}
void Register() override
@@ -472,8 +472,10 @@ public:
DoomfireSpiritGUID = summoned->GetGUID();
break;
case NPC_DOOMFIRE:
{
summoned->CastSpell(summoned, SPELL_DOOMFIRE_SPAWN, false);
summoned->CastSpell(summoned, SPELL_DOOMFIRE, true, nullptr, nullptr, me->GetGUID());
summoned->CastSpell(summoned, SPELL_DOOMFIRE, me->GetGUID());
if (Unit* DoomfireSpirit = ObjectAccessor::GetUnit(*me, DoomfireSpiritGUID))
{
@@ -481,6 +483,7 @@ public:
DoomfireSpiritGUID.Clear();
}
break;
}
default:
break;
}
@@ -216,7 +216,7 @@ class spell_mark_of_kazrogal : public SpellScriptLoader
if (target->GetPower(POWER_MANA) == 0)
{
target->CastSpell(target, SPELL_MARK_DAMAGE, true, nullptr, aurEff);
target->CastSpell(target, SPELL_MARK_DAMAGE, aurEff);
// Remove aura
SetDuration(0);
}
@@ -1339,7 +1339,7 @@ public:
{
if (StrikeTimer <= diff)
{
me->CastSpell(DummyTarget[0], DummyTarget[1], DummyTarget[2], SPELL_GARGOYLE_STRIKE, false);
me->CastSpell({ DummyTarget[0], DummyTarget[1], DummyTarget[2] }, SPELL_GARGOYLE_STRIKE, false);
StrikeTimer = 2000 + rand32() % 1000;
} else StrikeTimer -= diff;
}
@@ -1452,8 +1452,9 @@ public:
EnterEvadeMode();
return;
}
int dmg = 500 + rand32() % 700;
me->CastCustomSpell(me->GetVictim(), SPELL_EXPLODING_SHOT, &dmg, nullptr, nullptr, false);
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, 500 + rand32() % 700);
me->CastSpell(me->GetVictim(), SPELL_EXPLODING_SHOT, args);
ExplodeTimer = 5000 + rand32() % 5000;
} else ExplodeTimer -= diff;
DoMeleeAttackIfReady();
@@ -385,9 +385,9 @@ public:
{
if (Unit* caster = GetCaster())
{
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount());
caster->CastCustomSpell(aurEff->GetSpellEffectInfo()->TriggerSpell, values, GetTarget());
CastSpellExtraArgs args;
args.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount());
caster->CastSpell(GetTarget(), aurEff->GetSpellEffectInfo()->TriggerSpell, args);
}
}
@@ -261,8 +261,9 @@ class spell_egg_explosion : public SpellScriptLoader
{
if (Unit* target = GetHitUnit())
{
int32 damage = std::max<int32>(0, -16 * GetCaster()->GetDistance(target) + 500);
GetCaster()->CastCustomSpell(SPELL_EXPLOSION_DAMAGE, SPELLVALUE_BASE_POINT0, damage, target, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.AddSpellBP0(std::max<int32>(0, -16 * GetCaster()->GetDistance(target) + 500));
GetCaster()->CastSpell(target, SPELL_EXPLOSION_DAMAGE, args);
}
}
@@ -757,7 +757,7 @@ public:
//Set target in stomach
Stomach_Map[target->GetGUID()] = true;
target->InterruptNonMeleeSpells(false);
target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, nullptr, nullptr, me->GetGUID());
target->CastSpell(target, SPELL_MOUTH_TENTACLE, me->GetGUID());
StomachEnterTarget = target->GetGUID();
StomachEnterVisTimer = 3800;
}
@@ -503,7 +503,7 @@ public:
DoCast(player, SPELL_ARCANE_CHANNELING, true);//Arcane Channeling
break;
case 35:
me->CastSpell(-8088, 1520.43f, 2.67f, SPELL_TIME_STOP, true);
me->CastSpell({ -8088, 1520.43f, 2.67f }, SPELL_TIME_STOP, true);
break;
case 36:
DoCast(player, SPELL_CALL_PRISMATIC_BARRIER, true);
@@ -553,7 +553,7 @@ public:
break;
case 50:
Fandral->AI()->Talk(FANDRAL_EMOTE_2);
Fandral->CastSpell(-8127, 1525, 17.5f, SPELL_THROW_HAMMER, true);
Fandral->CastSpell({ -8127, 1525, 17.5f }, SPELL_THROW_HAMMER, true);
break;
case 51:
{
@@ -1419,7 +1419,7 @@ class spell_silithus_summon_cultist_periodic : public AuraScript
// All these spells trigger a spell that requires reagents; if the
// triggered spell is cast as "triggered", reagents are not consumed
if (Unit* caster = GetCaster())
caster->CastSpell(nullptr, GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST), nullptr, aurEff);
caster->CastSpell(nullptr, GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell, CastSpellExtraArgs(TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)).SetTriggeringAura(aurEff));
}
void Register() override
@@ -697,8 +697,8 @@ public:
return;
target->ExitVehicle();
DynamicObject* dynamicObject = GetCaster()->GetDynObject(SPELL_SEISMIC_SHARD_TARGETING);
target->CastSpell(dynamicObject->GetPositionX(), dynamicObject->GetPositionY(), dynamicObject->GetPositionZ(), SPELL_SEISMIC_SHARD_MISSLE, true);
if (DynamicObject* dynamicObject = GetCaster()->GetDynObject(SPELL_SEISMIC_SHARD_TARGETING))
target->CastSpell(dynamicObject->GetPosition(), SPELL_SEISMIC_SHARD_MISSLE, true);
}
void Register() override
@@ -258,7 +258,12 @@ class spell_ahn_kahet_swarm : public SpellScriptLoader
aura->RefreshDuration();
}
else
GetCaster()->CastCustomSpell(SPELL_SWARM_BUFF, SPELLVALUE_AURA_STACK, _targetCount, GetCaster(), TRIGGERED_FULL_MASK);
{
CastSpellExtraArgs args;
args.TriggerFlags = TRIGGERED_FULL_MASK;
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, _targetCount);
GetCaster()->CastSpell(GetCaster(), SPELL_SWARM_BUFF, args);
}
}
else
GetCaster()->RemoveAurasDueToSpell(SPELL_SWARM_BUFF);
@@ -349,7 +349,7 @@ class boss_halion : public CreatureScript
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true, true, -SPELL_TWILIGHT_REALM))
{
_meteorStrikePos = target->GetPosition();
me->CastSpell(_meteorStrikePos.GetPositionX(), _meteorStrikePos.GetPositionY(), _meteorStrikePos.GetPositionZ(), SPELL_METEOR_STRIKE, true, nullptr, nullptr, me->GetGUID());
me->CastSpell(_meteorStrikePos, SPELL_METEOR_STRIKE, me->GetGUID());
Talk(SAY_METEOR_STRIKE);
}
events.ScheduleEvent(EVENT_METEOR_STRIKE, Seconds(38));
@@ -1246,11 +1246,15 @@ class npc_combustion_consumption : public CreatureScript
if (type != DATA_STACKS_DISPELLED || !_damageSpell || !_explosionSpell || !summoner)
return;
me->CastCustomSpell(SPELL_SCALE_AURA, SPELLVALUE_AURA_STACK, stackAmount + 1, me);
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, stackAmount + 1);
me->CastSpell(me, SPELL_SCALE_AURA, args);
DoCastSelf(_damageSpell);
int32 damage = 1200 + (stackAmount * 1290); // Needs more research.
summoner->CastCustomSpell(_explosionSpell, SPELLVALUE_BASE_POINT0, damage, summoner);
CastSpellExtraArgs args2;
args2.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, damage);
summoner->CastSpell(summoner, _explosionSpell, args2);
}
void UpdateAI(uint32 /*diff*/) override { }
@@ -1515,7 +1519,10 @@ class spell_halion_combustion_consumption_periodic : public SpellScriptLoader
uint32 triggerSpell = aurEff->GetSpellEffectInfo()->TriggerSpell;
int32 radius = caster->GetObjectScale() * M_PI * 10000 / 3;
caster->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, radius, nullptr, TRIGGERED_FULL_MASK, nullptr, aurEff, caster->GetGUID());
CastSpellExtraArgs args(aurEff);
args.OriginalCaster = caster->GetGUID();
args.SpellValueOverrides.AddMod(SPELLVALUE_RADIUS_MOD, radius);
caster->CastSpell(nullptr, triggerSpell, args);
}
void Register() override
@@ -1567,7 +1574,9 @@ class spell_halion_marks : public SpellScriptLoader
return;
// Stacks marker
GetTarget()->CastCustomSpell(_summonSpellId, SPELLVALUE_BASE_POINT1, aurEff->GetBase()->GetStackAmount(), GetTarget(), TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
CastSpellExtraArgs args(GetCasterGUID());
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT1, aurEff->GetBase()->GetStackAmount());
GetTarget()->CastSpell(GetTarget(), _summonSpellId, args);
}
void Register() override
@@ -1792,7 +1801,7 @@ class spell_halion_twilight_phasing : public SpellScriptLoader
void Phase()
{
Unit* caster = GetCaster();
caster->CastSpell(caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), SPELL_SUMMON_TWILIGHT_PORTAL, true);
caster->CastSpell(caster->GetPosition(), SPELL_SUMMON_TWILIGHT_PORTAL, true);
caster->GetMap()->SummonCreature(NPC_TWILIGHT_HALION, HalionSpawnPos);
}
@@ -196,7 +196,11 @@ class spell_ruby_sanctum_rallying_shout : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (_targetCount && !GetCaster()->HasAura(SPELL_RALLY))
GetCaster()->CastCustomSpell(SPELL_RALLY, SPELLVALUE_AURA_STACK, _targetCount, GetCaster(), TRIGGERED_FULL_MASK);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, _targetCount);
GetCaster()->CastSpell(GetCaster(), SPELL_RALLY, args);
}
}
void Register() override
@@ -668,7 +668,7 @@ class spell_paletress_summon_memory : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastSpell(GetHitUnit(), memorySpellId[urand(0, 24)], true, nullptr, nullptr, GetCaster()->GetGUID());
GetHitUnit()->CastSpell(GetHitUnit(), memorySpellId[urand(0, 24)], GetCaster()->GetGUID());
}
void Register() override
@@ -308,12 +308,20 @@ class boss_anubarak_trial : public CreatureScript
events.ScheduleEvent(EVENT_FREEZE_SLASH, 15*IN_MILLISECONDS, 0, PHASE_MELEE);
return;
case EVENT_PENETRATING_COLD:
me->CastCustomSpell(SPELL_PENETRATING_COLD, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5, 2, 5));
events.ScheduleEvent(EVENT_PENETRATING_COLD, 20*IN_MILLISECONDS, 0, PHASE_MELEE);
{
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5, 2, 5));
me->CastSpell(nullptr, SPELL_PENETRATING_COLD, args);
events.ScheduleEvent(EVENT_PENETRATING_COLD, 20 * IN_MILLISECONDS, 0, PHASE_MELEE);
return;
}
case EVENT_SUMMON_NERUBIAN:
if (IsHeroic() || !_reachedPhase3)
me->CastCustomSpell(SPELL_SUMMON_BURROWER, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 2, 2, 4));
{
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 2, 2, 4));
me->CastSpell(nullptr, SPELL_SUMMON_BURROWER, args);
}
events.ScheduleEvent(EVENT_SUMMON_NERUBIAN, 45*IN_MILLISECONDS, 0, PHASE_MELEE);
return;
case EVENT_NERUBIAN_SHADOW_STRIKE:
@@ -925,10 +933,12 @@ class spell_anubarak_leeching_swarm : public SpellScriptLoader
int32 lifeLeeched = target->CountPctFromCurHealth(aurEff->GetAmount());
if (lifeLeeched < 250)
lifeLeeched = 250;
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT0, lifeLeeched);
// Damage
caster->CastCustomSpell(target, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, nullptr, nullptr, true);
caster->CastSpell(target, SPELL_LEECHING_SWARM_DMG, args);
// Heal
caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, nullptr, nullptr, true);
caster->CastSpell(caster, SPELL_LEECHING_SWARM_HEAL, args);
}
}
@@ -2264,7 +2264,7 @@ class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader
void HandleDispel(DispelInfo* dispelInfo)
{
if (Unit* caster = GetCaster())
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, true, nullptr, GetEffect(EFFECT_0));
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, GetEffect(EFFECT_0));
}
void Register() override
@@ -219,9 +219,13 @@ class boss_jaraxxus : public CreatureScript
events.ScheduleEvent(EVENT_INCINERATE_FLESH, urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS));
break;
case EVENT_NETHER_POWER:
me->CastCustomSpell(SPELL_NETHER_POWER, SPELLVALUE_AURA_STACK, RAID_MODE<uint32>(5, 10, 5, 10), me, true);
events.ScheduleEvent(EVENT_NETHER_POWER, 40*IN_MILLISECONDS);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, RAID_MODE(5, 10, 5, 10));
me->CastSpell(me, SPELL_NETHER_POWER, args);
events.ScheduleEvent(EVENT_NETHER_POWER, 40 * IN_MILLISECONDS);
break;
}
case EVENT_LEGION_FLAME:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, true, -SPELL_LORD_HITTIN))
{
@@ -1152,7 +1152,7 @@ class spell_jormungars_paralytic_toxin : public AuraScript
slowEff->ChangeAmount(newAmount);
if (newAmount == -100 && !GetTarget()->HasAura(SPELL_PARALYSIS))
GetTarget()->CastSpell(GetTarget(), SPELL_PARALYSIS, true, nullptr, slowEff, GetCasterGUID());
GetTarget()->CastSpell(GetTarget(), SPELL_PARALYSIS, CastSpellExtraArgs(slowEff).SetOriginalCaster(GetCasterGUID()));
}
}
@@ -1197,7 +1197,9 @@ class spell_jormungars_slime_pool : public AuraScript
PreventDefaultAction();
int32 const radius = static_cast<int32>(((aurEff->GetTickNumber() / 60.f) * 0.9f + 0.1f) * 10000.f * 2.f / 3.f);
GetTarget()->CastCustomSpell(GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell, SPELLVALUE_RADIUS_MOD, radius, nullptr, true, nullptr, aurEff);
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddMod(SPELLVALUE_RADIUS_MOD, radius);
GetTarget()->CastSpell(nullptr, GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell, args);
}
void Register() override
@@ -312,7 +312,11 @@ struct boss_twin_baseAI : public BossAI
break;
case EVENT_TOUCH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true, true, OtherEssenceSpellId))
me->CastCustomSpell(TouchSpellId, SPELLVALUE_MAX_TARGETS, 1, target, false);
{
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, 1); // @todo spellmgr correction instead?
me->CastSpell(target, TouchSpellId, args);
}
events.ScheduleEvent(EVENT_TOUCH, urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS));
break;
case EVENT_BERSERK:
@@ -716,8 +720,11 @@ class spell_bullet_controller : public AuraScript
if (!caster)
return;
caster->CastCustomSpell(SPELL_SUMMON_PERIODIC_LIGHT, SPELLVALUE_MAX_TARGETS, urand(1, 6), GetTarget(), true);
caster->CastCustomSpell(SPELL_SUMMON_PERIODIC_DARK, SPELLVALUE_MAX_TARGETS, urand(1, 6), GetTarget(), true);
CastSpellExtraArgs args1(TRIGGERED_FULL_MASK), args2(TRIGGERED_FULL_MASK);
args1.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, urand(1, 6));
args2.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, urand(1, 6));
caster->CastSpell(GetTarget(), SPELL_SUMMON_PERIODIC_LIGHT, args1);
caster->CastSpell(GetTarget(), SPELL_SUMMON_PERIODIC_DARK, args2);
}
void Register() override
@@ -139,7 +139,7 @@ class boss_trollgore : public CreatureScript
case EVENT_SPAWN:
for (uint8 i = 0; i < 3; ++i)
if (Creature* trigger = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_TROLLGORE_INVADER_SUMMONER_1 + i)))
trigger->CastSpell(trigger, RAND(SPELL_SUMMON_INVADER_A, SPELL_SUMMON_INVADER_B, SPELL_SUMMON_INVADER_C), true, nullptr, nullptr, me->GetGUID());
trigger->CastSpell(trigger, RAND(SPELL_SUMMON_INVADER_A, SPELL_SUMMON_INVADER_B, SPELL_SUMMON_INVADER_C), me->GetGUID());
events.ScheduleEvent(EVENT_SPAWN, urand(30000, 40000));
break;
@@ -277,7 +277,7 @@ class spell_trollgore_corpse_explode : public SpellScriptLoader
{
if (aurEff->GetTickNumber() == 2)
if (Unit* caster = GetCaster())
caster->CastSpell(GetTarget(), SPELL_CORPSE_EXPLODE_DAMAGE, true, nullptr, aurEff);
caster->CastSpell(GetTarget(), SPELL_CORPSE_EXPLODE_DAMAGE, aurEff);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -197,7 +197,7 @@ class boss_bronjahm : public CreatureScript
me->CastSpell(me, SPELL_SOULSTORM, false);
break;
case EVENT_FEAR:
me->CastCustomSpell(SPELL_FEAR, SPELLVALUE_MAX_TARGETS, 1, nullptr, false);
me->CastSpell(nullptr, SPELL_FEAR, { SPELLVALUE_MAX_TARGETS, 1 });
events.ScheduleEvent(EVENT_FEAR, urand(8000, 12000), 0, PHASE_2);
break;
default:
@@ -409,8 +409,9 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader
if (!damageInfo || !damageInfo->GetDamage())
return;
int32 damage = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), 45);
GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetCaster(), true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(CalculatePct(damageInfo->GetDamage(), 45));
GetTarget()->CastSpell(GetCaster(), SPELL_MIRRORED_SOUL_DAMAGE, args);
}
void Register() override
@@ -151,7 +151,11 @@ class spell_marwyn_shared_suffering : public SpellScriptLoader
{
int32 remainingDamage = aurEff->GetAmount() * aurEff->GetRemainingTicks();
if (remainingDamage > 0)
caster->CastCustomSpell(SPELL_SHARED_SUFFERING_DISPEL, SPELLVALUE_BASE_POINT1, remainingDamage, GetTarget(), TRIGGERED_FULL_MASK);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT1, remainingDamage);
caster->CastSpell(GetTarget(), SPELL_SHARED_SUFFERING_DISPEL, args);
}
}
}
@@ -266,7 +266,7 @@ class boss_ick : public CreatureScript
krick->AI()->Talk(SAY_KRICK_BARRAGE_1);
krick->AI()->Talk(SAY_KRICK_BARRAGE_2);
krick->CastSpell(krick, SPELL_EXPLOSIVE_BARRAGE_KRICK, true);
DoCast(me, SPELL_EXPLOSIVE_BARRAGE_ICK);
DoCastAOE(SPELL_EXPLOSIVE_BARRAGE_ICK);
}
events.DelayEvents(20000);
break;
@@ -275,12 +275,12 @@ class boss_ick : public CreatureScript
krick->AI()->Talk(SAY_KRICK_POISON_NOVA);
Talk(SAY_ICK_POISON_NOVA);
DoCast(me, SPELL_POISON_NOVA);
DoCastAOE(SPELL_POISON_NOVA);
break;
case EVENT_PURSUIT:
if (Creature* krick = GetKrick())
krick->AI()->Talk(SAY_KRICK_CHASE);
me->CastCustomSpell(SPELL_PURSUIT, SPELLVALUE_MAX_TARGETS, 1, me);
DoCastSelf(SPELL_PURSUIT, { SPELLVALUE_MAX_TARGETS, 1 });
break;
default:
break;
@@ -404,13 +404,21 @@ class player_overlord_brandAI : public PlayerAI
{
if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _tyrannusGUID))
if (Unit* victim = tyrannus->GetVictim())
me->CastCustomSpell(SPELL_OVERLORD_BRAND_DAMAGE, SPELLVALUE_BASE_POINT0, damage, victim, true, nullptr, nullptr, tyrannus->GetGUID());
{
CastSpellExtraArgs args(tyrannus->GetGUID());
args.SpellValueOverrides.AddBP0(damage);
me->CastSpell(victim, SPELL_OVERLORD_BRAND_DAMAGE, args);
}
}
void HealDone(Unit* /*target*/, uint32& addHealth) override
{
if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _tyrannusGUID))
me->CastCustomSpell(SPELL_OVERLORD_BRAND_HEAL, SPELLVALUE_BASE_POINT0, int32(addHealth * 5.5f), tyrannus, true, nullptr, nullptr, tyrannus->GetGUID());
{
CastSpellExtraArgs args(tyrannus->GetGUID());
args.SpellValueOverrides.AddBP0(addHealth * 5.5f);
me->CastSpell(tyrannus, SPELL_OVERLORD_BRAND_HEAL, args);
}
}
void UpdateAI(uint32 /*diff*/) override { }
@@ -235,7 +235,9 @@ class spell_moorabi_mojo_frenzy : public SpellScriptLoader
Unit* owner = GetUnitOwner();
int32 castSpeedBonus = (100.0f - owner->GetHealthPct()) * 4; // between 0% and 400% cast speed bonus
owner->CastCustomSpell(SPELL_MOJO_FRENZY_CAST_SPEED, SPELLVALUE_BASE_POINT0, castSpeedBonus, owner, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(castSpeedBonus);
owner->CastSpell(owner, SPELL_MOJO_FRENZY_CAST_SPEED, args);
}
void Register() override
@@ -805,7 +805,7 @@ class boss_prince_valanar_icc : public CreatureScript
{
case NPC_KINETIC_BOMB_TARGET:
summon->SetReactState(REACT_PASSIVE);
summon->CastSpell(summon, SPELL_KINETIC_BOMB, true, nullptr, nullptr, me->GetGUID());
summon->CastSpell(summon, SPELL_KINETIC_BOMB, me->GetGUID());
break;
case NPC_KINETIC_BOMB:
{
@@ -1472,7 +1472,7 @@ class spell_blood_council_shadow_prison : public SpellScriptLoader
void HandleDummyTick(AuraEffect const* aurEff)
{
if (GetTarget()->isMoving())
GetTarget()->CastSpell(GetTarget(), SPELL_SHADOW_PRISON_DAMAGE, true, nullptr, aurEff);
GetTarget()->CastSpell(GetTarget(), SPELL_SHADOW_PRISON_DAMAGE, aurEff);
}
void Register() override
@@ -726,8 +726,9 @@ class spell_blood_queen_essence_of_the_blood_queen : public SpellScriptLoader
if (!damageInfo || !damageInfo->GetDamage())
return;
int32 heal = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, nullptr, aurEff);
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddBP0(CalculatePct(damageInfo->GetDamage(), aurEff->GetAmount()));
GetTarget()->CastSpell(GetTarget(), SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, args);
}
void Register() override
@@ -811,7 +812,10 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg : public SpellScriptLoader
int32 damage = damageSpell->GetEffect(EFFECT_0)->CalcValue();
float multiplier = 0.3375f + 0.1f * uint32(aurEff->GetTickNumber() / 10); // do not convert to 0.01f - we need tick number/10 as INT (damage increases every 10 ticks)
damage = int32(damage * multiplier);
GetTarget()->CastCustomSpell(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget(), true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(damage);
GetTarget()->CastSpell(GetTarget(), SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE, args);
}
void Register() override
@@ -433,7 +433,11 @@ class boss_deathbringer_saurfang : public CreatureScript
case 72445:
case 72446:
if (me->GetPower(POWER_ENERGY) != me->GetMaxPower(POWER_ENERGY))
target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, nullptr, true);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(1);
target->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, args);
}
break;
default:
break;
@@ -1015,7 +1019,9 @@ class spell_deathbringer_blood_link : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_POWER, SPELLVALUE_BASE_POINT0, GetEffectValue(), GetHitUnit(), true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(GetEffectValue());
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_BLOOD_LINK_POWER, args);
PreventHitDefaultEffect(EFFECT_0);
}
@@ -1131,7 +1137,7 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex); // make this the default handler
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, nullptr, true);
GetHitUnit()->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellBP0(1));
}
void Register() override
@@ -1164,7 +1170,7 @@ class spell_deathbringer_blood_beast_blood_link : public SpellScriptLoader
void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetProcTarget()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 3, nullptr, true, nullptr, aurEff);
eventInfo.GetProcTarget()->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, CastSpellExtraArgs(aurEff).AddSpellBP0(3));
}
void Register() override
@@ -1196,7 +1202,7 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex); // make this the default handler
GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, nullptr, true);
GetHitUnit()->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellBP0(2));
}
void Register() override
@@ -199,7 +199,7 @@ class boss_festergut : public CreatureScript
// just cast and dont bother with target, conditions will handle it
++_inhaleCounter;
if (_inhaleCounter < 3)
me->CastSpell(me, gaseousBlight[_inhaleCounter], true, nullptr, nullptr, me->GetGUID());
me->CastSpell(me, gaseousBlight[_inhaleCounter], me->GetGUID());
}
events.ScheduleEvent(EVENT_INHALE_BLIGHT, urand(33500, 35000));
@@ -234,7 +234,7 @@ class boss_festergut : public CreatureScript
case EVENT_GAS_SPORE:
Talk(EMOTE_WARN_GAS_SPORE);
Talk(EMOTE_GAS_SPORE);
me->CastCustomSpell(SPELL_GAS_SPORE, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 3, 2, 3), me);
me->CastSpell(me, SPELL_GAS_SPORE, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 3, 2, 3)));
events.ScheduleEvent(EVENT_GAS_SPORE, urand(40000, 45000));
events.RescheduleEvent(EVENT_VILE_GAS, urand(28000, 35000));
break;
@@ -1841,7 +1841,10 @@ class spell_igb_rocket_pack : public SpellScriptLoader
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
SpellInfo const* damageInfo = sSpellMgr->AssertSpellInfo(SPELL_ROCKET_PACK_DAMAGE, GetCastDifficulty());
GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->GetEffect(EFFECT_0)->CalcValue() + aurEff->GetTickNumber() * aurEff->GetPeriod()), nullptr, TRIGGERED_FULL_MASK);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.CastDifficulty = GetCastDifficulty();
args.SpellValueOverrides.AddBP0(2 * (damageInfo->GetEffect(EFFECT_0)->CalcValue() + aurEff->GetTickNumber() * aurEff->GetPeriod()));
GetTarget()->CastSpell(nullptr, SPELL_ROCKET_PACK_DAMAGE, args);
GetTarget()->CastSpell(nullptr, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK);
}
@@ -2250,7 +2253,9 @@ class spell_igb_burning_pitch : public SpellScriptLoader
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->CastCustomSpell(uint32(GetEffectValue()), SPELLVALUE_BASE_POINT0, 8000, nullptr, TRIGGERED_FULL_MASK);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(8000);
GetCaster()->CastSpell(nullptr, GetEffectValue(), args);
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_BURNING_PITCH, TRIGGERED_FULL_MASK);
}
@@ -2316,7 +2321,11 @@ class spell_igb_rocket_artillery_explosion : public SpellScriptLoader
void DamageGunship(SpellEffIndex /*effIndex*/)
{
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
GetCaster()->CastCustomSpell(instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? SPELL_BURNING_PITCH_DAMAGE_A : SPELL_BURNING_PITCH_DAMAGE_H, SPELLVALUE_BASE_POINT0, 5000, nullptr, TRIGGERED_FULL_MASK);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(5000);
GetCaster()->CastSpell(nullptr, instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? SPELL_BURNING_PITCH_DAMAGE_A : SPELL_BURNING_PITCH_DAMAGE_H, args);
}
}
void Register() override
@@ -435,7 +435,9 @@ class boss_lady_deathwhisper : public CreatureScript
})
.Schedule(Seconds(12), GROUP_TWO, [this](TaskContext summonShade)
{
me->CastCustomSpell(SPELL_SUMMON_SPIRITS, SPELLVALUE_MAX_TARGETS, Is25ManRaid() ? 2 : 1);
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, Is25ManRaid() ? 2 : 1);
me->CastSpell(nullptr, SPELL_SUMMON_SPIRITS, args);
summonShade.Repeat();
});
@@ -380,7 +380,7 @@ class boss_professor_putricide : public CreatureScript
me->SetSpeedRate(MOVE_RUN, _baseSpeed);
DoAction(ACTION_FESTERGUT_GAS);
if (Creature* festergut = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FESTERGUT)))
festergut->CastSpell(festergut, SPELL_GASEOUS_BLIGHT_LARGE, false, nullptr, nullptr, festergut->GetGUID());
festergut->CastSpell(festergut, SPELL_GASEOUS_BLIGHT_LARGE, CastSpellExtraArgs().SetOriginalCaster(festergut->GetGUID()));
break;
case POINT_ROTFACE:
instance->SetBossState(DATA_ROTFACE, IN_PROGRESS); // needed here for delayed gate close
@@ -477,7 +477,7 @@ class boss_professor_putricide : public CreatureScript
case ACTION_ROTFACE_OOZE:
Talk(SAY_ROTFACE_OOZE_FLOOD);
if (Creature* dummy = ObjectAccessor::GetCreature(*me, _oozeFloodDummyGUIDs[_oozeFloodStage]))
dummy->CastSpell(dummy, oozeFloodSpells[_oozeFloodStage], true, nullptr, nullptr, me->GetGUID()); // cast from self for LoS (with prof's GUID for logs)
dummy->CastSpell(dummy, oozeFloodSpells[_oozeFloodStage], me->GetGUID()); // cast from self for LoS (with prof's GUID for logs)
if (++_oozeFloodStage == 4)
_oozeFloodStage = 0;
break;
@@ -586,7 +586,7 @@ class boss_professor_putricide : public CreatureScript
EnterEvadeMode();
break;
case EVENT_FESTERGUT_GOO:
me->CastCustomSpell(SPELL_MALLEABLE_GOO_SUMMON, SPELLVALUE_MAX_TARGETS, 1, nullptr, true);
DoCastAOE(SPELL_MALLEABLE_GOO_SUMMON, CastSpellExtraArgs(true).AddSpellMod(SPELLVALUE_MAX_TARGETS, 1));
events.ScheduleEvent(EVENT_FESTERGUT_GOO, (Is25ManRaid() ? 10000 : 30000) + urand(0, 5000), 0, PHASE_FESTERGUT);
break;
case EVENT_ROTFACE_DIES:
@@ -819,7 +819,9 @@ class npc_gas_cloud : public CreatureScript
void CastMainSpell() override
{
me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false);
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, 10);
me->CastSpell(me, SPELL_GASEOUS_BLOAT, args);
}
private:
@@ -848,7 +850,11 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader
{
target->RemoveAuraFromStack(GetSpellInfo()->Id, GetCasterGUID());
if (!target->HasAura(GetId()))
caster->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, caster, false);
{
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, 10);
caster->CastSpell(caster, SPELL_GASEOUS_BLOAT, args);
}
}
}
@@ -862,7 +868,9 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader
for (uint8 i = 1; i <= stack; ++i)
dmg += mod * i;
caster->CastCustomSpell(SPELL_EXPUNGED_GAS, SPELLVALUE_BASE_POINT0, dmg);
CastSpellExtraArgs args;
args.SpellValueOverrides.AddBP0(dmg);
caster->CastSpell(nullptr, SPELL_EXPUNGED_GAS, args);
}
void Register() override
@@ -1116,7 +1124,7 @@ class spell_putricide_ooze_tank_protection : public SpellScriptLoader
PreventDefaultAction();
Unit* actionTarget = eventInfo.GetActionTarget();
actionTarget->CastSpell(nullptr, aurEff->GetSpellEffectInfo()->TriggerSpell, true, nullptr, aurEff);
actionTarget->CastSpell(nullptr, aurEff->GetSpellEffectInfo()->TriggerSpell, aurEff);
}
void Register() override
@@ -1150,7 +1158,7 @@ class spell_putricide_choking_gas_bomb : public SpellScriptLoader
continue;
uint32 spellId = uint32(effect->CalcValue());
GetCaster()->CastSpell(GetCaster(), spellId, true, nullptr, nullptr, GetCaster()->GetGUID());
GetCaster()->CastSpell(GetCaster(), spellId, GetCaster()->GetGUID());
}
}
@@ -1317,7 +1325,10 @@ class spell_putricide_mutated_plague : public SpellScriptLoader
damage *= int32(pow(multiplier, GetStackAmount()));
damage = int32(damage * 1.5f);
GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_BASE_POINT0, damage, GetTarget(), true, nullptr, aurEff, GetCasterGUID());
CastSpellExtraArgs args(aurEff);
args.OriginalCaster = GetCasterGUID();
args.SpellValueOverrides.AddBP0(damage);
GetTarget()->CastSpell(GetTarget(), triggerSpell, args);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1329,7 +1340,9 @@ class spell_putricide_mutated_plague : public SpellScriptLoader
return;
int32 heal = healSpellInfo->GetEffect(EFFECT_0)->CalcValue() * GetStackAmount();
GetTarget()->CastCustomSpell(healSpell, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, nullptr, nullptr, GetCasterGUID());
CastSpellExtraArgs args(GetCasterGUID());
args.SpellValueOverrides.AddBP0(heal);
GetTarget()->CastSpell(GetTarget(), healSpell, args);
}
void Register() override
@@ -472,7 +472,7 @@ class spell_rotface_ooze_flood : public SpellScriptLoader
return;
triggers.sort(Trinity::ObjectDistanceOrderPred(GetHitUnit()));
GetHitUnit()->CastSpell(triggers.back(), uint32(GetEffectValue()), false, nullptr, nullptr, GetOriginalCaster() ? GetOriginalCaster()->GetGUID() : ObjectGuid::Empty);
GetHitUnit()->CastSpell(triggers.back(), uint32(GetEffectValue()), GetOriginalCaster() ? GetOriginalCaster()->GetGUID() : ObjectGuid::Empty);
}
void FilterTargets(std::list<WorldObject*>& targets)
@@ -550,7 +550,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->CastSpell(target, uint32(GetSpellInfo()->GetEffect(EFFECT_2)->CalcValue()), true, nullptr, aurEff, GetCasterGUID());
target->CastSpell(target, uint32(GetSpellInfo()->GetEffect(EFFECT_2)->CalcValue()), { aurEff, GetCasterGUID() });
}
void Register() override
@@ -678,7 +678,7 @@ class spell_rotface_large_ooze_buff_combine : public SpellScriptLoader
if (Creature* cre = GetCaster()->ToCreature())
cre->AI()->DoAction(EVENT_STICKY_OOZE);
GetCaster()->CastSpell(GetCaster(), SPELL_UNSTABLE_OOZE_EXPLOSION, false, nullptr, nullptr, GetCaster()->GetGUID());
GetCaster()->CastSpell(GetCaster(), SPELL_UNSTABLE_OOZE_EXPLOSION, CastSpellExtraArgs().SetOriginalCaster(GetCaster()->GetGUID()));
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
instance->SetData(DATA_OOZE_DANCE_ACHIEVEMENT, uint32(false));
}
@@ -759,7 +759,7 @@ class spell_rotface_unstable_ooze_explosion : public SpellScriptLoader
// let Rotface handle the cast - caster dies before this executes
if (InstanceScript* script = GetCaster()->GetInstanceScript())
if (Creature* rotface = script->instance->GetCreature(script->GetGuidData(DATA_ROTFACE)))
rotface->CastSpell(x, y, z, triggered_spell_id, true, nullptr, nullptr, GetCaster()->GetGUID());
rotface->CastSpell({x, y, z}, triggered_spell_id, GetCaster()->GetGUID());
}
void Register() override
@@ -195,7 +195,7 @@ class FrostBombExplosion : public BasicEvent
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
{
_owner->CastSpell(nullptr, SPELL_FROST_BOMB, false, nullptr, nullptr, _sindragosaGUID);
_owner->CastSpell(nullptr, SPELL_FROST_BOMB, CastSpellExtraArgs().SetOriginalCaster(_sindragosaGUID));
_owner->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL);
return true;
}
@@ -369,11 +369,15 @@ class boss_sindragosa : public CreatureScript
events.ScheduleEvent(EVENT_AIR_MOVEMENT, 1);
break;
case POINT_AIR_PHASE:
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6), nullptr, TRIGGERED_FULL_MASK);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6));
me->CastSpell(nullptr, SPELL_ICE_TOMB_TARGET, args);
me->SetFacingTo(float(M_PI), true);
events.ScheduleEvent(EVENT_AIR_MOVEMENT_FAR, 1);
events.ScheduleEvent(EVENT_FROST_BOMB, 9000);
break;
}
case POINT_AIR_PHASE_FAR:
me->SetFacingTo(float(M_PI), true);
events.ScheduleEvent(EVENT_LAND, 30000);
@@ -507,9 +511,13 @@ class boss_sindragosa : public CreatureScript
me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE_FAR, SindragosaAirPosFar);
break;
case EVENT_ICE_TOMB:
me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, 1, nullptr, TRIGGERED_FULL_MASK);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, 1);
me->CastSpell(nullptr, SPELL_ICE_TOMB_TARGET, args);
events.ScheduleEvent(EVENT_ICE_TOMB, urand(16000, 23000));
break;
}
case EVENT_FROST_BOMB:
{
float destX, destY, destZ;
@@ -517,7 +525,7 @@ class boss_sindragosa : public CreatureScript
destY = float(rand_norm()) * 75.0f + 2450.0f;
destZ = 205.0f; // random number close to ground, get exact in next call
me->UpdateGroundPositionZ(destX, destY, destZ);
me->CastSpell(destX, destY, destZ, SPELL_FROST_BOMB_TRIGGER, false);
me->CastSpell({ destX, destY, destZ }, SPELL_FROST_BOMB_TRIGGER, false);
events.ScheduleEvent(EVENT_FROST_BOMB, urand(6000, 8000));
break;
}
@@ -1242,7 +1250,12 @@ class spell_sindragosa_instability : public SpellScriptLoader
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
GetTarget()->CastCustomSpell(SPELL_BACKLASH, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff, GetCasterGUID());
{
CastSpellExtraArgs args(aurEff);
args.OriginalCaster = GetCasterGUID();
args.SpellValueOverrides.AddBP0(aurEff->GetAmount());
GetTarget()->CastSpell(GetTarget(), SPELL_BACKLASH, args);
}
}
void Register() override
@@ -470,7 +470,7 @@ class TriggerWickedSpirit : public BasicEvent
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_owner->CastCustomSpell(SPELL_TRIGGER_VILE_SPIRIT_HEROIC, SPELLVALUE_MAX_TARGETS, 1, nullptr, true);
_owner->CastSpell(nullptr, SPELL_TRIGGER_VILE_SPIRIT_HEROIC, { SPELLVALUE_MAX_TARGETS, 1 });
if (--_counter)
{
@@ -2117,10 +2117,9 @@ class spell_the_lich_king_necrotic_plague : public SpellScriptLoader
return;
}
CustomSpellValues values;
//values.AddSpellMod(SPELLVALUE_AURA_STACK, 2);
values.AddSpellMod(SPELLVALUE_MAX_TARGETS, 1);
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, nullptr, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
CastSpellExtraArgs args(GetCasterGUID());
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, 1);
GetTarget()->CastSpell(nullptr, SPELL_NECROTIC_PLAGUE_JUMP, args);
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
}
@@ -2217,9 +2216,9 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
return;
}
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, nullptr, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
CastSpellExtraArgs args(GetCasterGUID());
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, GetStackAmount());
GetTarget()->CastSpell(nullptr, SPELL_NECROTIC_PLAGUE_JUMP, args);
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
}
@@ -2235,10 +2234,10 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
if (aurEff->GetAmount() > _lastAmount)
return;
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
values.AddSpellMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, nullptr, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
CastSpellExtraArgs args(GetCasterGUID());
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, GetStackAmount());
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
GetTarget()->CastSpell(nullptr, SPELL_NECROTIC_PLAGUE_JUMP, args);
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
@@ -2651,7 +2650,9 @@ class spell_the_lich_king_life_siphon : public SpellScriptLoader
void TriggerHeal()
{
GetHitUnit()->CastCustomSpell(SPELL_LIFE_SIPHON_HEAL, SPELLVALUE_BASE_POINT0, GetHitDamage() * 10, GetCaster(), true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(GetHitDamage() * 10);
GetHitUnit()->CastSpell(GetCaster(), SPELL_LIFE_SIPHON_HEAL, args);
}
void Register() override
@@ -2691,7 +2692,7 @@ class spell_the_lich_king_vile_spirits : public SpellScriptLoader
void OnPeriodic(AuraEffect const* aurEff)
{
if (_is25Man || ((aurEff->GetTickNumber() - 1) % 5))
GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo()->TriggerSpell, true, nullptr, aurEff, GetCasterGUID());
GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo()->TriggerSpell, { aurEff, GetCasterGUID() });
}
void Register() override
@@ -2849,7 +2850,7 @@ class spell_the_lich_king_harvest_soul : public SpellScriptLoader
{
// m_originalCaster to allow stacking from different casters, meh
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
GetTarget()->CastSpell(nullptr, SPELL_HARVESTED_SOUL, true, nullptr, nullptr, GetTarget()->GetInstanceScript()->GetGuidData(DATA_THE_LICH_KING));
GetTarget()->CastSpell(nullptr, SPELL_HARVESTED_SOUL, GetTarget()->GetInstanceScript()->GetGuidData(DATA_THE_LICH_KING));
}
void Register() override
@@ -2915,7 +2916,12 @@ class spell_the_lich_king_soul_rip : public SpellScriptLoader
PreventDefaultAction();
// shouldn't be needed, this is channeled
if (Unit* caster = GetCaster())
caster->CastCustomSpell(SPELL_SOUL_RIP_DAMAGE, SPELLVALUE_BASE_POINT0, 5000 * aurEff->GetTickNumber(), GetTarget(), true, nullptr, aurEff, GetCasterGUID());
{
CastSpellExtraArgs args(aurEff);
args.OriginalCaster = GetCasterGUID();
args.SpellValueOverrides.AddBP0(5000 * aurEff->GetTickNumber());
caster->CastSpell(GetTarget(), SPELL_SOUL_RIP_DAMAGE, args);
}
}
void Register() override
@@ -3014,8 +3020,9 @@ class spell_the_lich_king_dark_hunger : public SpellScriptLoader
if (!damageInfo || !damageInfo->GetDamage())
return;
int32 heal = static_cast<int32>(damageInfo->GetDamage()) / 2;
GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, nullptr, aurEff);
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddBP0(damageInfo->GetDamage() / 2);
GetTarget()->CastSpell(GetTarget(), SPELL_DARK_HUNGER_HEAL, args);
}
void Register() override
@@ -3048,7 +3055,7 @@ class spell_the_lich_king_in_frostmourne_room : public SpellScriptLoader
{
// m_originalCaster to allow stacking from different casters, meh
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
GetTarget()->CastSpell(nullptr, SPELL_HARVESTED_SOUL, true, nullptr, nullptr, GetTarget()->GetInstanceScript()->GetGuidData(DATA_THE_LICH_KING));
GetTarget()->CastSpell(nullptr, SPELL_HARVESTED_SOUL, GetTarget()->GetInstanceScript()->GetGuidData(DATA_THE_LICH_KING));
}
void Register() override
@@ -183,7 +183,7 @@ class DelayedCastEvent : public BasicEvent
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
{
_trigger->CastSpell(_trigger, _spellId, false, nullptr, nullptr, _originalCaster);
_trigger->CastSpell(_trigger, _spellId, _originalCaster);
if (_despawnTime)
_trigger->DespawnOrUnsummon(_despawnTime);
return true;
@@ -1111,7 +1111,7 @@ class npc_dream_cloud : public CreatureScript
case EVENT_EXPLODE:
me->GetMotionMaster()->MoveIdle();
// must use originalCaster the same for all clouds to allow stacking
me->CastSpell(me, EMERALD_VIGOR, false, nullptr, nullptr, _instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER));
me->CastSpell(me, EMERALD_VIGOR, _instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER));
me->DespawnOrUnsummon(100);
break;
default:
@@ -1239,7 +1239,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader
if (!GetHitUnit())
return;
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true, nullptr, nullptr, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING));
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING));
}
void Register() override
@@ -1330,7 +1330,7 @@ class spell_dreamwalker_summon_suppresser_effect : public SpellScriptLoader
if (!GetHitUnit())
return;
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true, nullptr, nullptr, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING));
GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING));
}
void Register() override
@@ -1466,7 +1466,7 @@ class spell_dreamwalker_twisted_nightmares : public SpellScriptLoader
// return;
if (InstanceScript* instance = GetHitUnit()->GetInstanceScript())
GetHitUnit()->CastSpell(nullptr, GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true, nullptr, nullptr, instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER));
GetHitUnit()->CastSpell(nullptr, GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER));
}
void Register() override
@@ -832,7 +832,7 @@ class boss_sister_svalna : public CreatureScript
switch (action)
{
case ACTION_KILL_CAPTAIN:
me->CastCustomSpell(SPELL_CARESS_OF_DEATH, SPELLVALUE_MAX_TARGETS, 1, me, true);
DoCastSelf(SPELL_CARESS_OF_DEATH, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_MAX_TARGETS, 1));
break;
case ACTION_START_GAUNTLET:
me->setActive(true);
@@ -887,7 +887,9 @@ class boss_sister_svalna : public CreatureScript
if (TempSummon* summon = target->SummonCreature(NPC_IMPALING_SPEAR, *target))
{
Talk(EMOTE_SVALNA_IMPALE, target);
summon->CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, 1, target, false);
CastSpellExtraArgs args;
args.SpellValueOverrides.AddBP0(1);
summon->CastSpell(target, VEHICLE_SPELL_RIDE_HARDCODED, args);
summon->AddUnitFlag2(UnitFlags2(UNIT_FLAG2_UNK1 | UNIT_FLAG2_ALLOW_ENEMY_INTERACT));
}
break;
@@ -68,7 +68,7 @@ class icecrown_citadel_teleport : public GameObjectScript
return true;
}
player->CastSpell(player, spell, true);
player->CastSpell(player, spell->Id, true);
return true;
}
};
@@ -143,7 +143,7 @@ public:
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER)
victim->CastSpell(victim, SPELL_SUMMON_CORPSE_SCARABS_PLR, true, nullptr, nullptr, me->GetGUID());
victim->CastSpell(victim, SPELL_SUMMON_CORPSE_SCARABS_PLR, me->GetGUID());
Talk(SAY_SLAY);
}
@@ -198,7 +198,7 @@ public:
{
if (Creature* creatureTarget = ObjectAccessor::GetCreature(*me, Trinity::Containers::SelectRandomContainerElement(guardCorpses)))
{
creatureTarget->CastSpell(creatureTarget, SPELL_SUMMON_CORPSE_SCARABS_MOB, true, nullptr, nullptr, me->GetGUID());
creatureTarget->CastSpell(creatureTarget, SPELL_SUMMON_CORPSE_SCARABS_MOB, me->GetGUID());
creatureTarget->AI()->Talk(EMOTE_SCARAB);
creatureTarget->DespawnOrUnsummon();
}
@@ -735,7 +735,11 @@ class spell_four_horsemen_mark : public SpellScriptLoader
break;
}
if (damage)
caster->CastCustomSpell(SPELL_MARK_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget());
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(damage);
caster->CastSpell(GetTarget(), SPELL_MARK_DAMAGE, args);
}
}
}
@@ -316,7 +316,11 @@ public:
{
int32 damage = int32(unit->GetHealth()) - int32(unit->CountPctFromMaxHealth(5));
if (damage > 0)
GetCaster()->CastCustomSpell(SPELL_DECIMATE_DMG, SPELLVALUE_BASE_POINT0, damage, unit);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(damage);
GetCaster()->CastSpell(unit, SPELL_DECIMATE_DMG, args);
}
}
}
@@ -165,7 +165,7 @@ class spell_grobbulus_mutating_injection : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
caster->CastSpell(GetTarget(), SPELL_MUTATING_EXPLOSION, true);
GetTarget()->CastSpell(GetTarget(), SPELL_POISON_CLOUD, true, nullptr, aurEff, GetCasterGUID());
GetTarget()->CastSpell(GetTarget(), SPELL_POISON_CLOUD, { aurEff, GetCasterGUID() });
}
}
@@ -205,7 +205,10 @@ class spell_grobbulus_poison_cloud : public SpellScriptLoader
uint32 triggerSpell = aurEff->GetSpellEffectInfo()->TriggerSpell;
int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, nullptr, TRIGGERED_FULL_MASK, nullptr, aurEff);
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddMod(SPELLVALUE_RADIUS_MOD, mod);
GetTarget()->CastSpell(nullptr, triggerSpell, args);
}
void Register() override
@@ -928,7 +928,9 @@ public:
if (int32 mana = int32(target->GetMaxPower(POWER_MANA) / 10))
{
mana = target->ModifyPower(POWER_MANA, -mana);
target->CastCustomSpell(SPELL_MANA_DETONATION_DAMAGE, SPELLVALUE_BASE_POINT0, -mana * 10, target, true, nullptr, aurEff);
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddBP0(-mana * 10);
target->CastSpell(target, SPELL_MANA_DETONATION_DAMAGE, args);
}
}
@@ -960,7 +962,11 @@ class spell_kelthuzad_frost_blast : public AuraScript
// Stuns the target, dealing 26% of the target's maximum health in Frost damage every second for 4 sec.
if (Unit* caster = GetCaster())
caster->CastCustomSpell(SPELL_FROST_BLAST_DMG, SPELLVALUE_BASE_POINT0, int32(GetTarget()->CountPctFromMaxHealth(26)), GetTarget(), true, nullptr, aurEff);
{
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddBP0(GetTarget()->CountPctFromMaxHealth(26));
caster->CastSpell(GetTarget(), SPELL_FROST_BLAST_DMG, args);
}
}
void Register() override
@@ -181,7 +181,7 @@ class spell_loatheb_deathbloom : public SpellScriptLoader
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
return;
GetTarget()->CastSpell(nullptr, SPELL_DEATHBLOOM_FINAL_DAMAGE, true, nullptr, eff, GetCasterGUID());
GetTarget()->CastSpell(nullptr, SPELL_DEATHBLOOM_FINAL_DAMAGE, CastSpellExtraArgs(eff).SetOriginalCaster(GetCasterGUID()));
}
void Register() override
@@ -221,7 +221,7 @@ public:
if (Unit* victim = ObjectAccessor::GetUnit(*me, victimGUID))
{
visibleTimer = (me->GetDistance2d(victim)/WEB_WRAP_MOVE_SPEED + 0.5f) * IN_MILLISECONDS;
victim->CastSpell(victim, SPELL_WEB_WRAP, true, nullptr, nullptr, me->GetGUID());
victim->CastSpell(victim, SPELL_WEB_WRAP, me->GetGUID());
}
}
@@ -776,14 +776,12 @@ public:
switch (eventId)
{
case EVENT_START_FIRST_RANDOM_PORTAL:
me->CastCustomSpell(SPELL_RANDOM_PORTAL, SPELLVALUE_MAX_TARGETS, 1);
case EVENT_RANDOM_PORTAL:
DoCastAOE(SPELL_RANDOM_PORTAL, { SPELLVALUE_MAX_TARGETS,1 });
break;
case EVENT_STOP_PORTAL_BEAM:
me->InterruptNonMeleeSpells(true);
break;
case EVENT_RANDOM_PORTAL:
me->CastCustomSpell(SPELL_RANDOM_PORTAL, SPELLVALUE_MAX_TARGETS, 1);
break;
case EVENT_LAND_START_ENCOUNTER:
if (GameObject* iris = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_FOCUSING_IRIS_GUID)))
{
@@ -2029,7 +2027,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader
void TriggerDamageSpellFromPlayer()
{
if (Player* hitTarget = GetHitPlayer())
hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, true, nullptr, nullptr, GetCaster()->GetGUID());
hitTarget->CastSpell(hitTarget, SPELL_ARCANE_BARRAGE_DAMAGE, GetCaster()->GetGUID());
}
void Register() override
@@ -200,7 +200,7 @@ public:
summoned->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f);
// Why healing when just summoned?
summoned->CastSpell(summoned, SPELL_HEAT, false, nullptr, nullptr, me->GetGUID());
summoned->CastSpell(summoned, SPELL_HEAT, CastSpellExtraArgs().SetOriginalCaster(me->GetGUID()));
}
}
@@ -735,7 +735,7 @@ class spell_assembly_rune_of_summoning : public SpellScriptLoader
void HandlePeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_RUNE_OF_SUMMONING_SUMMON, true, nullptr, aurEff, GetTarget()->IsSummon() ? GetTarget()->ToTempSummon()->GetSummonerGUID() : ObjectGuid::Empty);
GetTarget()->CastSpell(GetTarget(), SPELL_RUNE_OF_SUMMONING_SUMMON, { aurEff, GetTarget()->IsSummon() ? GetTarget()->ToTempSummon()->GetSummonerGUID() : ObjectGuid::Empty });
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1010,7 +1010,7 @@ public:
{
if (Creature* trigger = DoSummonFlyer(NPC_MIMIRON_TARGET_BEACON, me, 20, 0, 1000, TEMPSUMMON_TIMED_DESPAWN))
{
trigger->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), SPELL_MIMIRON_S_INFERNO, true);
trigger->CastSpell(me->GetPosition(), SPELL_MIMIRON_S_INFERNO, true);
infernoTimer = 2000;
}
}
@@ -379,7 +379,9 @@ class boss_freya : public CreatureScript
else
Talk(SAY_AGGRO_WITH_ELDER);
me->CastCustomSpell(SPELL_ATTUNED_TO_NATURE, SPELLVALUE_AURA_STACK, 150, me, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, 150);
me->CastSpell(me, SPELL_ATTUNED_TO_NATURE, args);
events.ScheduleEvent(EVENT_WAVE, 10000);
events.ScheduleEvent(EVENT_EONAR_GIFT, 25000);
@@ -754,7 +756,9 @@ class boss_elder_brightleaf : public CreatureScript
uint8 stackAmount = 0;
if (Aura* aura = me->GetAura(SPELL_FLUX_AURA))
stackAmount = aura->GetStackAmount();
me->CastCustomSpell(SPELL_SOLAR_FLARE, SPELLVALUE_MAX_TARGETS, stackAmount, me, false);
CastSpellExtraArgs args;
args.SpellValueOverrides.AddMod(SPELLVALUE_MAX_TARGETS, stackAmount);
me->CastSpell(me, SPELL_SOLAR_FLARE, args);
events.ScheduleEvent(EVENT_SOLAR_FLARE, urand(5000, 10000));
break;
}
@@ -839,8 +843,9 @@ class boss_elder_stonebark : public CreatureScript
if (me->HasAura(SPELL_PETRIFIED_BARK))
{
int32 reflect = damage;
who->CastCustomSpell(who, SPELL_PETRIFIED_BARK_DMG, &reflect, nullptr, nullptr, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(damage);
who->CastSpell(who, SPELL_PETRIFIED_BARK_DMG, args);
damage = 0;
}
}
@@ -465,7 +465,11 @@ class spell_general_vezax_mark_of_the_faceless : public SpellScriptLoader
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
if (Unit* caster = GetCaster())
caster->CastCustomSpell(SPELL_MARK_OF_THE_FACELESS_DAMAGE, SPELLVALUE_BASE_POINT1, aurEff->GetAmount(), GetTarget(), true);
{
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_BASE_POINT1, aurEff->GetAmount());
caster->CastSpell(GetTarget(), SPELL_MARK_OF_THE_FACELESS_DAMAGE, args);
}
}
void Register() override
@@ -528,9 +532,11 @@ class spell_general_vezax_saronite_vapors : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
int32 mana = int32(aurEff->GetAmount() * std::pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount
int32 damage = mana * 2;
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, &mana, nullptr, nullptr, true);
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, &damage, nullptr, nullptr, true);
CastSpellExtraArgs args1(TRIGGERED_FULL_MASK), args2(TRIGGERED_FULL_MASK);
args1.SpellValueOverrides.AddBP0(mana);
args2.SpellValueOverrides.AddBP0(mana * 2);
caster->CastSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, args1);
caster->CastSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, args2);
}
}
@@ -1051,7 +1051,9 @@ public:
return;
int32 damage = int32(200 * std::pow(2.0f, GetStackAmount()));
caster->CastCustomSpell(caster, SPELL_BITING_COLD_DAMAGE, &damage, nullptr, nullptr, true);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddBP0(damage);
caster->CastSpell(caster, SPELL_BITING_COLD_DAMAGE, args);
if (caster->isMoving())
caster->RemoveAuraFromStack(SPELL_BITING_COLD_TRIGGERED);
@@ -343,7 +343,7 @@ class spell_ulduar_rubble_summon : public SpellScriptLoader
ObjectGuid originalCaster = caster->GetInstanceScript() ? caster->GetInstanceScript()->GetGuidData(BOSS_KOLOGARN) : ObjectGuid::Empty;
uint32 spellId = GetEffectValue();
for (uint8 i = 0; i < 5; ++i)
caster->CastSpell(caster, spellId, true, nullptr, nullptr, originalCaster);
caster->CastSpell(caster, spellId, originalCaster);
}
void Register() override
@@ -495,7 +495,7 @@ class boss_mimiron : public CreatureScript
{
case EVENT_SUMMON_FLAMES:
if (Creature* worldtrigger = instance->GetCreature(DATA_MIMIRON_WORLD_TRIGGER))
worldtrigger->CastCustomSpell(SPELL_SCRIPT_EFFECT_SUMMON_FLAMES_INITIAL, SPELLVALUE_MAX_TARGETS, 3, nullptr, true, nullptr, nullptr, me->GetGUID());
worldtrigger->CastSpell(nullptr, SPELL_SCRIPT_EFFECT_SUMMON_FLAMES_INITIAL, CastSpellExtraArgs(me->GetGUID()).AddSpellMod(SPELLVALUE_MAX_TARGETS, 3));
events.RescheduleEvent(EVENT_SUMMON_FLAMES, 28000);
break;
case EVENT_INTRO_1:
@@ -1234,15 +1234,15 @@ class boss_aerial_command_unit : public CreatureScript
switch (eventId)
{
case EVENT_SUMMON_FIRE_BOTS:
me->CastCustomSpell(SPELL_SUMMON_FIRE_BOT_TRIGGER, SPELLVALUE_MAX_TARGETS, 3, nullptr, true);
DoCastAOE(SPELL_SUMMON_FIRE_BOT_TRIGGER, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_MAX_TARGETS, 3));
events.RescheduleEvent(EVENT_SUMMON_FIRE_BOTS, 45000, 0, PHASE_AERIAL_COMMAND_UNIT);
break;
case EVENT_SUMMON_JUNK_BOT:
me->CastCustomSpell(SPELL_SUMMON_JUNK_BOT_TRIGGER, SPELLVALUE_MAX_TARGETS, 1, nullptr, true);
DoCastAOE(SPELL_SUMMON_JUNK_BOT_TRIGGER, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_MAX_TARGETS, 1));
events.RescheduleEvent(EVENT_SUMMON_JUNK_BOT, urand(11000, 12000), 0, PHASE_AERIAL_COMMAND_UNIT);
break;
case EVENT_SUMMON_ASSAULT_BOT:
me->CastCustomSpell(SPELL_SUMMON_ASSAULT_BOT_TRIGGER, SPELLVALUE_MAX_TARGETS, 1, nullptr, true);
DoCastAOE(SPELL_SUMMON_ASSAULT_BOT_TRIGGER, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_MAX_TARGETS, 1));
events.RescheduleEvent(EVENT_SUMMON_ASSAULT_BOT, 30000, 0, PHASE_AERIAL_COMMAND_UNIT);
break;
case EVENT_SUMMON_BOMB_BOT:
@@ -2143,7 +2143,7 @@ class spell_mimiron_rapid_burst : public SpellScriptLoader
void HandleDummyTick(AuraEffect const* aurEff)
{
if (GetCaster())
GetCaster()->CastSpell(GetTarget(), aurEff->GetTickNumber() % 2 == 0 ? SPELL_RAPID_BURST_RIGHT : SPELL_RAPID_BURST_LEFT, true, nullptr, aurEff);
GetCaster()->CastSpell(GetTarget(), aurEff->GetTickNumber() % 2 == 0 ? SPELL_RAPID_BURST_RIGHT : SPELL_RAPID_BURST_LEFT, aurEff);
}
void Register() override
@@ -2191,7 +2191,7 @@ class spell_mimiron_rocket_strike : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->CastSpell(nullptr, SPELL_SCRIPT_EFFECT_ROCKET_STRIKE, true, nullptr, nullptr, GetCaster()->GetGUID());
GetHitUnit()->CastSpell(nullptr, SPELL_SCRIPT_EFFECT_ROCKET_STRIKE, GetCaster()->GetGUID());
}
void Register() override
@@ -2289,7 +2289,7 @@ class spell_mimiron_rocket_strike_target_select : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_ROCKET_STRIKE, true, nullptr, nullptr, instance->GetGuidData(DATA_VX_001));
GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_ROCKET_STRIKE, instance->GetGuidData(DATA_VX_001));
GetCaster()->SetDisplayId(11686);
}
@@ -2354,7 +2354,7 @@ class spell_mimiron_summon_assault_bot : public SpellScriptLoader
if (Unit* caster = GetCaster())
if (InstanceScript* instance = caster->GetInstanceScript())
if (instance->GetBossState(BOSS_MIMIRON) == IN_PROGRESS)
caster->CastSpell(caster, SPELL_SUMMON_ASSAULT_BOT, false, nullptr, aurEff, instance->GetGuidData(DATA_AERIAL_COMMAND_UNIT));
caster->CastSpell(caster, SPELL_SUMMON_ASSAULT_BOT, { aurEff, instance->GetGuidData(DATA_AERIAL_COMMAND_UNIT) });
}
void Register() override
@@ -2421,7 +2421,7 @@ class spell_mimiron_summon_fire_bot : public SpellScriptLoader
if (Unit* caster = GetCaster())
if (InstanceScript* instance = caster->GetInstanceScript())
if (instance->GetBossState(BOSS_MIMIRON) == IN_PROGRESS)
caster->CastSpell(caster, SPELL_SUMMON_FIRE_BOT, false, nullptr, aurEff, instance->GetGuidData(DATA_AERIAL_COMMAND_UNIT));
caster->CastSpell(caster, SPELL_SUMMON_FIRE_BOT, { aurEff, instance->GetGuidData(DATA_AERIAL_COMMAND_UNIT) });
}
void Register() override
@@ -2609,7 +2609,7 @@ class spell_mimiron_summon_junk_bot : public SpellScriptLoader
if (Unit* caster = GetCaster())
if (InstanceScript* instance = caster->GetInstanceScript())
if (instance->GetBossState(BOSS_MIMIRON) == IN_PROGRESS)
caster->CastSpell(caster, SPELL_SUMMON_JUNK_BOT, false, nullptr, aurEff, instance->GetGuidData(DATA_AERIAL_COMMAND_UNIT));
caster->CastSpell(caster, SPELL_SUMMON_JUNK_BOT, { aurEff, instance->GetGuidData(DATA_AERIAL_COMMAND_UNIT) });
}
void Register() override
@@ -961,7 +961,7 @@ class spell_xt002_heart_overload_periodic : public SpellScriptLoader
{
uint8 a = urand(0, 4);
uint32 spellId = spells[a];
toyPile->CastSpell(toyPile, spellId, true, nullptr, nullptr, instance->GetGuidData(BOSS_XT002));
toyPile->CastSpell(toyPile, spellId, instance->GetGuidData(BOSS_XT002));
}
}
}
@@ -518,7 +518,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
instance->DoStartCriteriaTimer(CRITERIA_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
me->CastCustomSpell(SPELL_SUMMON_GUARDIAN_2, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_SUMMON_GUARDIAN_2, { SPELLVALUE_MAX_TARGETS, 1 });
DoCast(me, SPELL_SANITY_PERIODIC);
events.ScheduleEvent(EVENT_LOCK_DOOR, 15000);
@@ -562,7 +562,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
events.ScheduleEvent(EVENT_EXTINGUISH_ALL_LIFE, 10000); // cast it again after a short while, players can survive
break;
case EVENT_SUMMON_GUARDIAN_OF_YOGG_SARON:
me->CastCustomSpell(SPELL_SUMMON_GUARDIAN_2, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_SUMMON_GUARDIAN_2, { SPELLVALUE_MAX_TARGETS, 1 });
++_guardiansCount;
if (_guardiansCount <= 6 && _guardiansCount % 3 == 0)
_guardianTimer -= 5000;
@@ -573,7 +573,7 @@ class boss_voice_of_yogg_saron : public CreatureScript
events.ScheduleEvent(EVENT_SUMMON_CORRUPTOR_TENTACLE, 30000, EVENT_GROUP_SUMMON_TENTACLES, PHASE_TWO);
break;
case EVENT_SUMMON_CONSTRICTOR_TENTACLE:
me->CastCustomSpell(SPELL_CONSTRICTOR_TENTACLE, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_CONSTRICTOR_TENTACLE, { SPELLVALUE_MAX_TARGETS, 1 });
events.ScheduleEvent(EVENT_SUMMON_CONSTRICTOR_TENTACLE, 25000, EVENT_GROUP_SUMMON_TENTACLES, PHASE_TWO);
break;
case EVENT_SUMMON_CRUSHER_TENTACLE:
@@ -795,15 +795,15 @@ class boss_sara : public CreatureScript
switch (eventId)
{
case EVENT_SARAS_FERVOR:
me->CastCustomSpell(SPELL_SARAS_FERVOR_TARGET_SELECTOR, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_SARAS_FERVOR_TARGET_SELECTOR, { SPELLVALUE_MAX_TARGETS, 1 });
_events.ScheduleEvent(EVENT_SARAS_FERVOR, 6000, 0, PHASE_ONE);
break;
case EVENT_SARAS_ANGER:
me->CastCustomSpell(SPELL_SARAS_ANGER_TARGET_SELECTOR, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_SARAS_ANGER_TARGET_SELECTOR, { SPELLVALUE_MAX_TARGETS, 1 });
_events.ScheduleEvent(EVENT_SARAS_ANGER, urand(6000, 8000), 0, PHASE_ONE);
break;
case EVENT_SARAS_BLESSING:
me->CastCustomSpell(SPELL_SARAS_BLESSING_TARGET_SELECTOR, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_SARAS_BLESSING_TARGET_SELECTOR, { SPELLVALUE_MAX_TARGETS, 1 });
_events.ScheduleEvent(EVENT_SARAS_BLESSING, urand(6000, 30000), 0, PHASE_ONE);
break;
case EVENT_TRANSFORM_1:
@@ -837,15 +837,15 @@ class boss_sara : public CreatureScript
_events.ScheduleEvent(EVENT_DEATH_RAY, 21000, 0, PHASE_TWO);
break;
case EVENT_MALADY_OF_THE_MIND:
me->CastCustomSpell(SPELL_MALADY_OF_THE_MIND, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_MALADY_OF_THE_MIND, { SPELLVALUE_MAX_TARGETS, 1 });
_events.ScheduleEvent(EVENT_MALADY_OF_THE_MIND, urand(18000, 25000), 0, PHASE_TWO);
break;
case EVENT_PSYCHOSIS:
me->CastCustomSpell(SPELL_PSYCHOSIS, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_PSYCHOSIS, { SPELLVALUE_MAX_TARGETS, 1 });
_events.ScheduleEvent(EVENT_PSYCHOSIS, 4000, 0, PHASE_TWO);
break;
case EVENT_BRAIN_LINK:
me->CastCustomSpell(SPELL_BRAIN_LINK, SPELLVALUE_MAX_TARGETS, 2);
DoCastAOE(SPELL_BRAIN_LINK, { SPELLVALUE_MAX_TARGETS, 2 });
_events.ScheduleEvent(EVENT_BRAIN_LINK, urand(23000, 26000), 0, PHASE_TWO);
break;
default:
@@ -1641,7 +1641,7 @@ class npc_yogg_saron_keeper : public CreatureScript
switch (eventId)
{
case EVENT_DESTABILIZATION_MATRIX:
me->CastCustomSpell(SPELL_DESTABILIZATION_MATRIX, SPELLVALUE_MAX_TARGETS, 1);
DoCastAOE(SPELL_DESTABILIZATION_MATRIX, { SPELLVALUE_MAX_TARGETS, 1 });
_events.ScheduleEvent(EVENT_DESTABILIZATION_MATRIX, urand(15000, 25000), 0, PHASE_TWO);
break;
case EVENT_HODIRS_PROTECTIVE_GAZE:
@@ -2495,7 +2495,9 @@ class spell_yogg_saron_empowered : public SpellScriptLoader // 64161
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->CastCustomSpell(SPELL_EMPOWERED_BUFF, SPELLVALUE_AURA_STACK, 9, GetTarget(), TRIGGERED_FULL_MASK);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, 9);
GetTarget()->CastSpell(GetTarget(), SPELL_EMPOWERED_BUFF, args);
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
@@ -2507,7 +2509,9 @@ class spell_yogg_saron_empowered : public SpellScriptLoader // 64161
if (stack)
{
target->RemoveAurasDueToSpell(SPELL_WEAKENED);
target->CastCustomSpell(SPELL_EMPOWERED_BUFF, SPELLVALUE_AURA_STACK, stack, target, TRIGGERED_FULL_MASK);
CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
args.SpellValueOverrides.AddMod(SPELLVALUE_AURA_STACK, stack);
target->CastSpell(target, SPELL_EMPOWERED_BUFF, args);
}
else if (!target->HealthAbovePct(1) && !target->HasAura(SPELL_WEAKENED))
target->CastSpell(target, SPELL_WEAKENED, true);
@@ -2735,8 +2739,9 @@ class spell_yogg_saron_grim_reprisal : public SpellScriptLoader // 63305
if (!damageInfo || !damageInfo->GetDamage())
return;
int32 damage = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), 60);
GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, damageInfo->GetAttacker(), true, nullptr, aurEff);
CastSpellExtraArgs args(aurEff);
args.SpellValueOverrides.AddBP0(CalculatePct(damageInfo->GetDamage(), 60));
GetTarget()->CastSpell(damageInfo->GetAttacker(), SPELL_GRIM_REPRISAL_DAMAGE, args);
}
void Register() override
@@ -470,7 +470,7 @@ class spell_ingvar_woe_strike : public SpellScriptLoader
void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(eventInfo.GetActor(), SPELL_WOE_STRIKE_EFFECT, true, nullptr, aurEff);
GetTarget()->CastSpell(eventInfo.GetActor(), SPELL_WOE_STRIKE_EFFECT, aurEff);
}
void Register() override
@@ -223,7 +223,7 @@ class spell_uk_second_wind : public SpellScriptLoader
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActionTarget();
caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, true, nullptr, aurEff);
caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, aurEff);
}
void Register() override
@@ -132,7 +132,7 @@ public:
bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
{
_owner->CastCustomSpell(SPELL_AWAKEN_SUBBOSS, SPELLVALUE_MAX_TARGETS, 1, _owner);
_owner->CastSpell(_owner, SPELL_AWAKEN_SUBBOSS, { SPELLVALUE_MAX_TARGETS, 1 });
return true;
}
@@ -287,7 +287,7 @@ public:
if (_encountersCount == _dungeonMode)
orb->CastSpell(orb, SPELL_AWAKEN_GORTOK, true);
else
orb->CastCustomSpell(SPELL_AWAKEN_SUBBOSS, SPELLVALUE_MAX_TARGETS, 1, orb, true);
orb->CastSpell(orb, SPELL_AWAKEN_SUBBOSS, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellMod(SPELLVALUE_MAX_TARGETS, 1));
break;
}
case ACTION_START_FIGHT:
@@ -201,7 +201,7 @@ class spell_koralon_meteor_fists : public SpellScriptLoader
void TriggerFists(AuraEffect* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_METEOR_FISTS_DAMAGE, true, nullptr, aurEff);
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_METEOR_FISTS_DAMAGE, aurEff);
}
void Register() override
@@ -276,7 +276,7 @@ class spell_flame_warder_meteor_fists : public SpellScriptLoader
void TriggerFists(AuraEffect* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_FW_METEOR_FISTS_DAMAGE, true, nullptr, aurEff);
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_FW_METEOR_FISTS_DAMAGE, aurEff);
}
void Register() override
@@ -78,9 +78,11 @@ struct boss_toravon : public BossAI
switch (eventId)
{
case EVENT_FROZEN_ORB:
me->CastCustomSpell(SPELL_FROZEN_ORB, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 3), me);
{
me->CastSpell(me, SPELL_FROZEN_ORB, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 3)));
events.Repeat(Seconds(32));
break;
}
case EVENT_WHITEOUT:
DoCastSelf(SPELL_WHITEOUT);
events.Repeat(Seconds(38));
@@ -109,7 +109,7 @@ class spell_moragg_ray : public SpellScriptLoader
if (Unit* target = GetTarget()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
{
uint32 triggerSpell = aurEff->GetSpellEffectInfo()->TriggerSpell;
GetTarget()->CastSpell(target, triggerSpell, TRIGGERED_FULL_MASK, nullptr, aurEff);
GetTarget()->CastSpell(target, triggerSpell, aurEff);
}
}
@@ -149,12 +149,12 @@ public:
if (Unit* caster = GetCaster())
{
if (aurEff->GetTickNumber() >= 8)
caster->CastSpell(GetTarget(), SPELL_OPTIC_LINK_LEVEL_3, TRIGGERED_FULL_MASK, nullptr, aurEff);
caster->CastSpell(GetTarget(), SPELL_OPTIC_LINK_LEVEL_3, aurEff);
if (aurEff->GetTickNumber() >= 4)
caster->CastSpell(GetTarget(), SPELL_OPTIC_LINK_LEVEL_2, TRIGGERED_FULL_MASK, nullptr, aurEff);
caster->CastSpell(GetTarget(), SPELL_OPTIC_LINK_LEVEL_2, aurEff);
caster->CastSpell(GetTarget(), SPELL_OPTIC_LINK_LEVEL_1, TRIGGERED_FULL_MASK, nullptr, aurEff);
caster->CastSpell(GetTarget(), SPELL_OPTIC_LINK_LEVEL_1, aurEff);
}
}
@@ -97,7 +97,7 @@ public:
break;
case 1:
Talk(SAY_WP_3);
me->CastSpell(5918.33f, 5372.91f, -98.770f, SPELL_EXPLODE_CRYSTAL, true);
me->CastSpell({ 5918.33f, 5372.91f, -98.770f }, SPELL_EXPLODE_CRYSTAL, true);
me->SummonGameObject(184743, 5918.33f, 5372.91f, -98.770f, 0, QuaternionData(), TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
break;
@@ -108,7 +108,7 @@ public:
Talk(SAY_WP_5);
break;
case 8:
me->CastSpell(5887.37f, 5379.39f, -91.289f, SPELL_EXPLODE_CRYSTAL, true);
me->CastSpell({ 5887.37f, 5379.39f, -91.289f }, SPELL_EXPLODE_CRYSTAL, true);
me->SummonGameObject(184743, 5887.37f, 5379.39f, -91.289f, 0, QuaternionData(), TEMPSUMMON_MANUAL_DESPAWN); //approx 3 to 4 seconds
me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
break;
@@ -829,7 +829,7 @@ public:
if (seatId != SEAT_INITIAL)
return;
me->CastCustomSpell(SPELL_GRIP, SPELLVALUE_AURA_STACK, 50);
me->CastSpell(nullptr, SPELL_GRIP, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_AURA_STACK, 50));
DoCastAOE(SPELL_CLAW_SWIPE_PERIODIC);
_scheduler.Async([this]

Some files were not shown because too many files have changed in this diff Show More