Misc stuff

This commit is contained in:
hondacrx
2022-05-30 15:09:02 -04:00
parent 2472177ef6
commit af29d3158e
5 changed files with 36 additions and 26 deletions
+29
View File
@@ -3398,6 +3398,35 @@ namespace Scripts.Spells.Generic
}
}
[Script]
class spell_gen_whisper_to_controller : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return CliDB.BroadcastTextStorage.HasRecord((uint)spellInfo.GetEffect(0).CalcValue());
}
void HandleScript(uint effIndex)
{
Unit caster = GetCaster();
if (caster != null)
{
TempSummon casterSummon = caster.ToTempSummon();
if (casterSummon != null)
{
Player target = casterSummon.GetSummonerUnit().ToPlayer();
if (target != null)
casterSummon.Whisper((uint)GetEffectValue(), target, false);
}
}
}
public override void Register()
{
OnEffectHit.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
[Script]
class spell_gen_eject_all_passengers : SpellScript
{