DB/Quest: King of the Foulweald - Improve Questevent

* closes #2381
This commit is contained in:
Rushor
2016-02-07 11:14:51 +01:00
parent fe2a0fda44
commit 644b9dcd59
2 changed files with 116 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ EndContentData */
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "Player.h"
#include "SpellScript.h"
/*####
# npc_ruul_snowhoof
@@ -344,9 +345,42 @@ class go_naga_brazier : public GameObjectScript
}
};
enum KingoftheFoulwealdMisc
{
GO_BANNER = 178205
};
class spell_destroy_karangs_banner : public SpellScriptLoader
{
public:
spell_destroy_karangs_banner() : SpellScriptLoader("spell_destroy_karangs_banner") { }
class spell_destroy_karangs_banner_SpellScript : public SpellScript
{
PrepareSpellScript(spell_destroy_karangs_banner_SpellScript);
void HandleAfterCast()
{
if (GameObject* banner = GetCaster()->FindNearestGameObject(GO_BANNER, GetSpellInfo()->GetMaxRange(true)))
banner->Delete();
}
void Register() override
{
AfterCast += SpellCastFn(spell_destroy_karangs_banner_SpellScript::HandleAfterCast);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_destroy_karangs_banner_SpellScript();
}
};
void AddSC_ashenvale()
{
new npc_ruul_snowhoof();
new npc_muglash();
new go_naga_brazier();
new spell_destroy_karangs_banner();
}