Core/Spells: Removed useless calls of Spell.GetEffect and SpellInfo.GetEffect
This commit is contained in:
@@ -5334,7 +5334,7 @@ namespace Game.Spells
|
||||
Player caster = m_caster.ToPlayer();
|
||||
Guild guild = caster.GetGuild();
|
||||
if (guild != null)
|
||||
guild.HandleBuyBankTab(caster.GetSession(), (byte)(effectInfo.BasePoints - 1)); // Bank tabs start at zero internally
|
||||
guild.HandleBuyBankTab(caster.GetSession(), (byte)(damage - 1)); // Bank tabs start at zero internally
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.ResurrectWithAura)]
|
||||
@@ -5411,9 +5411,7 @@ namespace Game.Spells
|
||||
return;
|
||||
|
||||
Player player = unitTarget.ToPlayer();
|
||||
SpellEffectInfo effect = GetEffect(effIndex);
|
||||
uint itemId = effect.ItemType;
|
||||
Item item = player.GetItemByEntry(itemId);
|
||||
Item item = player.GetItemByEntry(effectInfo.ItemType);
|
||||
if (item)
|
||||
player.DestroyItem(item.GetBagSlot(), item.GetSlot(), true);
|
||||
}
|
||||
@@ -5429,7 +5427,7 @@ namespace Game.Spells
|
||||
|
||||
Garrison garrison = unitTarget.ToPlayer().GetGarrison();
|
||||
if (garrison != null)
|
||||
garrison.LearnBlueprint((uint)GetEffect(effIndex).MiscValue);
|
||||
garrison.LearnBlueprint((uint)effectInfo.MiscValue);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.CreateGarrison)]
|
||||
@@ -5441,7 +5439,7 @@ namespace Game.Spells
|
||||
if (!unitTarget || !unitTarget.IsTypeId(TypeId.Player))
|
||||
return;
|
||||
|
||||
unitTarget.ToPlayer().CreateGarrison((uint)GetEffect(effIndex).MiscValue);
|
||||
unitTarget.ToPlayer().CreateGarrison((uint)effectInfo.MiscValue);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.CreateConversation)]
|
||||
@@ -5467,7 +5465,7 @@ namespace Game.Spells
|
||||
|
||||
Garrison garrison = unitTarget.ToPlayer().GetGarrison();
|
||||
if (garrison != null)
|
||||
garrison.AddFollower((uint)GetEffect(effIndex).MiscValue);
|
||||
garrison.AddFollower((uint)effectInfo.MiscValue);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.CreateHeirloomItem)]
|
||||
@@ -5502,7 +5500,7 @@ namespace Game.Spells
|
||||
|
||||
Garrison garrison = unitTarget.ToPlayer().GetGarrison();
|
||||
if (garrison != null)
|
||||
garrison.ActivateBuilding((uint)GetEffect(effIndex).MiscValue);
|
||||
garrison.ActivateBuilding((uint)effectInfo.MiscValue);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.HealBattlepetPct)]
|
||||
@@ -5516,7 +5514,7 @@ namespace Game.Spells
|
||||
|
||||
BattlePetMgr battlePetMgr = unitTarget.ToPlayer().GetSession().GetBattlePetMgr();
|
||||
if (battlePetMgr != null)
|
||||
battlePetMgr.HealBattlePetsPct((byte)GetEffect(effIndex).BasePoints);
|
||||
battlePetMgr.HealBattlePetsPct((byte)damage);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.EnableBattlePets)]
|
||||
|
||||
@@ -1203,7 +1203,7 @@ namespace Scripts.Spells.Generic
|
||||
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
if (GetSpellInfo().GetEffect(effIndex).Effect == SpellEffectName.Dummy || GetSpellInfo().GetEffect(effIndex).Effect == SpellEffectName.ScriptEffect)
|
||||
if (GetEffectInfo().IsEffect(SpellEffectName.Dummy) || GetEffectInfo().IsEffect(SpellEffectName.ScriptEffect))
|
||||
GetCaster().ToCreature().DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
@@ -1922,8 +1922,8 @@ namespace Scripts.Spells.Generic
|
||||
void HandleDummy(uint effIndex)
|
||||
{
|
||||
Player player = GetCaster().ToPlayer();
|
||||
uint factionId = (uint)GetSpellInfo().GetEffect(effIndex).CalcValue();
|
||||
int repChange = GetSpellInfo().GetEffect(1).CalcValue();
|
||||
uint factionId = (uint)GetEffectInfo(effIndex).CalcValue();
|
||||
int repChange = GetEffectInfo(1).CalcValue();
|
||||
|
||||
FactionRecord factionEntry = CliDB.FactionStorage.LookupByKey(factionId);
|
||||
|
||||
|
||||
@@ -626,7 +626,7 @@ namespace Scripts.Spells.Holiday
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
// All this spells trigger a spell that requires reagents; if the
|
||||
// triggered spell is cast as "triggered", reagents are not consumed
|
||||
GetHitUnit().CastSpell(null, GetSpellInfo().GetEffect(effIndex).TriggerSpell, TriggerCastFlags.FullMask & ~TriggerCastFlags.IgnorePowerAndReagentCost);
|
||||
GetHitUnit().CastSpell(null, GetEffectInfo().TriggerSpell, TriggerCastFlags.FullMask & ~TriggerCastFlags.IgnorePowerAndReagentCost);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
|
||||
Reference in New Issue
Block a user