diff options
| author | maximius <none@none> | 2009-09-10 23:23:59 -0700 |
|---|---|---|
| committer | maximius <none@none> | 2009-09-10 23:23:59 -0700 |
| commit | 5475986fee1c14182ce5915f284cd86244356dec (patch) | |
| tree | ff1f8d24d8b46feff86c92a1e126812676082b36 /src | |
| parent | bcf19139afae87b71cee87ea6a70e70fb444ea14 (diff) | |
*GO Script: Zul'Farrak Shallow Grave, by totoro
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
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(); +} |
