Skip to content

Commit

Permalink
Updated blackrock spire code, rookery whelp eggs now trigger & spawn …
Browse files Browse the repository at this point in the history
…as expected without causing errors, overrides bad database data WCELL-33 #resolve #comment This needs further testing but there should be no issues with this anymore
  • Loading branch information
jaddie committed Jun 1, 2014
1 parent 45f24c9 commit 63f73a5
Showing 1 changed file with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using WCell.Constants;
using WCell.Constants.Factions;
using WCell.Constants.GameObjects;
using WCell.Constants.NPCs;
using WCell.Constants.Spells;
Expand All @@ -21,29 +22,15 @@ namespace WCell.Addons.Default.Instances
{
public class BlackrockSpire : BaseInstance
{
[Initialization]
[DependentInitialization(typeof (GOMgr))]
public static void InitGOs()
{
var rookeryEgg = GOMgr.GetEntry(GOEntryId.RookeryEgg) as GOTrapEntry;
if (rookeryEgg != null)
{
var rookerySpell = SpellHandler.Get(SpellId.SummonRookeryWhelp);

rookeryEgg.Fields[3] = 15745; // GO Entry Rookery Egg Id: 175124 -- Spell: Summon Rookery Whelp Note: Unsure this has any affect but best update it anyway.
//rookeryEgg.Type = GameObjectType.SpellCaster;
rookeryEgg.Spell = rookerySpell;
}
}

[Initialization]
[DependentInitialization(typeof(GOMgr))]
public static void InitSpells()
{
SpellHandler.Apply(spell =>
{
spell.GetEffect(SpellEffectType.Summon).SpellEffectHandlerCreator = (cast, effect) => new SummonRookeryWhelpHandler(cast, effect);
}, SpellId.SummonRookeryWhelp);
spell.HasHarmfulEffects = true;
spell.GetEffect(SpellEffectType.SummonObjectWild).SpellEffectHandlerCreator = (cast, effect) => new SummonRookeryWhelpHandler(cast, effect);
},SpellId.CreateRookerySpawner);
}

public class SummonRookeryWhelpHandler : SpellEffectHandler
Expand All @@ -55,6 +42,8 @@ public SummonRookeryWhelpHandler(SpellCast cast, SpellEffect effect) : base(cast
protected override void Apply(WorldObject target)
{
var whelp = NPCMgr.GetEntry(NPCId.RookeryWhelp);
whelp.AllianceFactionId = FactionTemplateId.Enemy;
whelp.HordeFactionId = FactionTemplateId.Enemy;
whelp.UnitFlags = UnitFlags.Combat;
whelp.SpawnAt(target.Map, target.Position);
}
Expand Down

0 comments on commit 63f73a5

Please sign in to comment.