aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_scripts_full.sql1
-rw-r--r--src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp34
2 files changed, 33 insertions, 2 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index 7f2667b88ef..84e7fa61c8e 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -1170,6 +1170,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_drakuru_shackles' WHERE (`entry
/* ZUL'FARRAK */
UPDATE `creature_template` SET `ScriptName`='npc_sergeant_bly' WHERE `entry`=7604;
UPDATE `creature_template` SET `ScriptName`='npc_weegli_blastfuse' WHERE `entry`=7607;
+UPDATE `gameobject_template` SET `ScriptName`='go_shallow_grave' WHERE `entry` IN (128308,128403);
/* ZUL'GURUB */
UPDATE `instance_template` SET `script`='instance_zulgurub' WHERE `map`=309;
diff --git a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp
index 4e630368db1..8c6442ade4f 100644
--- a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp
+++ b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp
@@ -38,7 +38,7 @@ EndContentData */
#define SPELL_SHIELD_BASH 11972
#define SPELL_REVENGE 12170
-#define GOSSIP_BLY "[PH] In that case, i will take my reward!"
+#define GOSSIP_BLY "[PH] In that case, I will take my reward!"
struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI
{
@@ -202,6 +202,32 @@ bool GossipSelect_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature, uin
return true;
}
+/*######
+## go_shallow_grave
+######*/
+
+enum {
+ ZOMBIE = 7286,
+ DEAD_HERO = 7276,
+ ZOMBIE_CHANCE = 65,
+ DEAD_HERO_CHANCE = 10
+};
+
+bool GOHello_go_shallow_grave(Player* pPlayer, GameObject* pGo)
+{
+ // randomly summon a zombie or dead hero the first time a grave is used
+ if (pGo->GetUseCount() == 0)
+ {
+ uint32 randomchance = urand(0,100);
+ if (randomchance < ZOMBIE_CHANCE)
+ pGo->SummonCreature(ZOMBIE, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ else if ((randomchance-ZOMBIE_CHANCE) < DEAD_HERO_CHANCE)
+ pGo->SummonCreature(DEAD_HERO, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
+ }
+ pGo->AddUse();
+ return false;
+}
+
void AddSC_zulfarrak()
{
Script *newscript;
@@ -219,5 +245,9 @@ void AddSC_zulfarrak()
newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse;
newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse;
newscript->RegisterSelf();
-}
+ newscript = new Script;
+ newscript->Name="go_shallow_grave";
+ newscript->pGOHello = &GOHello_go_shallow_grave;
+ newscript->RegisterSelf();
+}