aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_10_20_01_world_spell_script_names.sql8
-rw-r--r--src/server/scripts/Kalimdor/feralas.cpp33
2 files changed, 41 insertions, 0 deletions
diff --git a/sql/updates/world/2012_10_20_01_world_spell_script_names.sql b/sql/updates/world/2012_10_20_01_world_spell_script_names.sql
new file mode 100644
index 00000000000..a8830806a83
--- /dev/null
+++ b/sql/updates/world/2012_10_20_01_world_spell_script_names.sql
@@ -0,0 +1,8 @@
+-- Spellscript and conditions for spells of quest Gordunni Cobalt
+DELETE FROM `spell_script_names` WHERE `spell_id`=19395;
+INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES
+(19395,'spell_gordunni_trap');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=11757;
+INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES
+(11757,1,13,31,5,144050,'Digging for Cobalt targets Gordunni Trap');
diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp
index 4fcd20951c9..c978b9c7531 100644
--- a/src/server/scripts/Kalimdor/feralas.cpp
+++ b/src/server/scripts/Kalimdor/feralas.cpp
@@ -27,6 +27,7 @@ EndScriptData */
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
+#include "SpellScript.h"
/*######
## npc_gregan_brewspewer
@@ -201,6 +202,37 @@ public:
}
};
+enum GordunniTrap
+{
+ GO_GORDUNNI_DIRT_MOUND = 144064,
+};
+class spell_gordunni_trap : public SpellScriptLoader
+{
+ public:
+ spell_gordunni_trap() : SpellScriptLoader("spell_gordunni_trap") { }
+
+ class spell_gordunni_trap_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gordunni_trap_SpellScript);
+
+ void HandleDummy()
+ {
+ if (Unit* caster = GetCaster())
+ if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0))
+ chest->SetSpellId(GetSpellInfo()->Id);
+ }
+
+ void Register()
+ {
+ OnCast += SpellCastFn(spell_gordunni_trap_SpellScript::HandleDummy);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gordunni_trap_SpellScript();
+ }
+};
/*######
## AddSC
@@ -211,4 +243,5 @@ void AddSC_feralas()
new npc_gregan_brewspewer();
new npc_oox22fe();
new npc_screecher_spirit();
+ new spell_gordunni_trap();
}