Scripts/Spells: Great/Fish/Gigantic/Small/Bountiful Feast

Port From (https://github.com/TrinityCore/TrinityCore/commit/b160ba206148c0ce32c543e585caa60f693ba5e1)
This commit is contained in:
hondacrx
2022-09-07 12:54:58 -04:00
parent 41420e8332
commit 44334fc4ba
2 changed files with 120 additions and 9 deletions
+82 -8
View File
@@ -117,6 +117,24 @@ namespace Scripts.Spells.Generic
public const uint CreateToken = 50063;
public const uint StealEssenceVisual = 50101;
// Feast
public const uint GreatFeast = 57337;
public const uint FishFeast = 57397;
public const uint GiganticFeast = 58466;
public const uint SmallFeast = 58475;
public const uint BountifulFeast = 66477;
public const uint FeastFood = 45548;
public const uint FeastDrink = 57073;
public const uint BountifulFeastDrink = 66041;
public const uint BountifulFeastFood = 66478;
public const uint GreatFeastRefreshment = 57338;
public const uint FishFeastRefreshment = 57398;
public const uint GiganticFeastRefreshment = 58467;
public const uint SmallFeastRefreshment = 58477;
public const uint BountifulFeastRefreshment = 66622;
//FuriousRage
public const uint Exhaustion = 35492;
@@ -1794,6 +1812,62 @@ namespace Scripts.Spells.Generic
}
}
/* 57337 - Great Feast
57397 - Fish Feast
58466 - Gigantic Feast
58475 - Small Feast
66477 - Bountiful Feast */
[Script]
class spell_gen_feast : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.FeastFood, SpellIds.FeastDrink, SpellIds.BountifulFeastDrink, SpellIds.BountifulFeastFood, SpellIds.GreatFeastRefreshment,
SpellIds.FishFeastRefreshment, SpellIds.GiganticFeastRefreshment, SpellIds.SmallFeastRefreshment, SpellIds.BountifulFeastRefreshment);
}
void HandleScript(uint effIndex)
{
Unit target = GetHitUnit();
switch (GetSpellInfo().Id)
{
case SpellIds.GreatFeast:
target.CastSpell(target, SpellIds.FeastFood);
target.CastSpell(target, SpellIds.FeastDrink);
target.CastSpell(target, SpellIds.GreatFeastRefreshment);
break;
case SpellIds.FishFeast:
target.CastSpell(target, SpellIds.FeastFood);
target.CastSpell(target, SpellIds.FeastDrink);
target.CastSpell(target, SpellIds.FishFeastRefreshment);
break;
case SpellIds.GiganticFeast:
target.CastSpell(target, SpellIds.FeastFood);
target.CastSpell(target, SpellIds.FeastDrink);
target.CastSpell(target, SpellIds.GiganticFeastRefreshment);
break;
case SpellIds.SmallFeast:
target.CastSpell(target, SpellIds.FeastFood);
target.CastSpell(target, SpellIds.FeastDrink);
target.CastSpell(target, SpellIds.SmallFeastRefreshment);
break;
case SpellIds.BountifulFeast:
target.CastSpell(target, SpellIds.BountifulFeastRefreshment);
target.CastSpell(target, SpellIds.BountifulFeastDrink);
target.CastSpell(target, SpellIds.BountifulFeastFood);
break;
default:
break;
}
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
/*
* There are only 3 possible flags Feign Death auras can apply: UNIT_DYNFLAG_DEAD, UnitFlags2.FeignDeath
* and UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT. Some auras can apply only 2 flags
@@ -1937,7 +2011,7 @@ namespace Scripts.Spells.Generic
AfterEffectRemove.Add(new EffectApplyHandler(AfterRemove, 0, AuraType.ModDamagePercentDone, AuraEffectHandleModes.Real));
}
}
[Script] // 46642 - 5,000 Gold
class spell_gen_5000_gold : SpellScript
{
@@ -2119,7 +2193,7 @@ namespace Scripts.Spells.Generic
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
}
}
[Script("spell_hexlord_lifebloom", SpellIds.HexlordMalacrass)]
[Script("spell_tur_ragepaw_lifebloom", SpellIds.TurragePaw)]
[Script("spell_cenarion_scout_lifebloom", SpellIds.CenarionScout)]
@@ -2559,7 +2633,7 @@ namespace Scripts.Spells.Generic
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
[Script("spell_item_soul_harvesters_charm")]
[Script("spell_item_commendation_of_kaelthas")]
[Script("spell_item_corpse_tongue_coin")]
@@ -2686,7 +2760,7 @@ namespace Scripts.Spells.Generic
OnEffectHit.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
[Script]
class spell_gen_profession_research : SpellScript
{
@@ -3615,7 +3689,7 @@ namespace Scripts.Spells.Generic
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
[Script]
class spell_gen_eject_all_passengers : SpellScript
{
@@ -3690,7 +3764,7 @@ namespace Scripts.Spells.Generic
OnEffectHitTarget.Add(new EffectHandler(EjectPassenger, 0, SpellEffectName.ScriptEffect));
}
}
[Script]
class spell_gen_gm_freeze : AuraScript
{
@@ -4315,7 +4389,7 @@ namespace Scripts.Spells.Generic
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
[Script] // 169869 - Transformation Sickness
class spell_gen_decimatus_transformation_sickness : SpellScript
{
@@ -4660,7 +4734,7 @@ namespace Scripts.Spells.Generic
OnCast.Add(new CastHandler(HandleOnCast));
}
}
// 40307 - Stasis Field
class StasisFieldSearcher : ICheck<Unit>
{
+38 -1
View File
@@ -26,7 +26,6 @@ using Game.Spells;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
namespace Scripts.Spells.Items
{
@@ -442,6 +441,13 @@ namespace Scripts.Spells.Items
//TauntFlag
public const uint EmotePlantsFlag = 28008;
//Feast
public const uint GreatFeast = 31843;
public const uint TextFishFeast = 31844;
public const uint TextGiganticFeast = 31846;
public const uint SmallFeast = 31845;
public const uint BountifulFeast = 35153;
}
struct FactionIds
@@ -1357,6 +1363,37 @@ namespace Scripts.Spells.Items
}
}
[Script("spell_item_great_feast", TextIds.GreatFeast)]
[Script("spell_item_fish_feast", TextIds.TextFishFeast)]
[Script("spell_item_gigantic_feast", TextIds.TextGiganticFeast)]
[Script("spell_item_small_feast", TextIds.SmallFeast)]
[Script("spell_item_bountiful_feast", TextIds.BountifulFeast)]
class spell_item_feast : SpellScript
{
uint _text;
public spell_item_feast(uint text)
{
_text = text;
}
public override bool Validate(SpellInfo spellInfo)
{
return CliDB.BroadcastTextStorage.ContainsKey(_text);
}
void HandleScript(uint effIndex)
{
Unit caster = GetCaster();
caster.TextEmote(_text, caster, false);
}
public override void Register()
{
OnEffectHit.Add(new EffectHandler(HandleScript, 0, SpellEffectName.ScriptEffect));
}
}
// http://www.wowhead.com/item=47499 Flask of the North
[Script] // 67019 Flask of the North
class spell_item_flask_of_the_north : SpellScript