Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 9a5996b38a6b233b02b5001878f940dda489de48 Mon Sep 17 00:00:00 2001
- From: unknown <cristi@cristis-PC.(none)>
- Date: Fri, 20 Jul 2012 20:13:54 +0300
- Subject: [PATCH] Fix quests: Fungal Monstrosities and Sprout No More
- ---
- src/server/scripts/Maelstrom/deepholm.cpp | 159 +++++++++++++++++++++++++++++
- 1 file changed, 159 insertions(+)
- diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
- index a4dbbac..5c0391e 100644
- --- a/src/server/scripts/Maelstrom/deepholm.cpp
- +++ b/src/server/scripts/Maelstrom/deepholm.cpp
- @@ -620,6 +620,162 @@ class npc_terrath_the_steady: public CreatureScript
- }
- };
- +/*##
- +# Support for quests: - Fungal Monstrosities
- +# - Sprout No More
- +########*/
- +
- +enum eWarGuardianEntries
- +{
- + QUEST_FUNGAL_MONSTROSITIES = 26792,
- + QUEST_SPROUT_NO_MORE = 26791,
- + SPELL_SUMMON_WAR_GUARDIAN = 82535,
- + SPELL_EXPLODE = 65429,
- + SPELL_CHOCKING_WOUND = 35247,
- + SPELL_EARTH_SHOCK = 25025,
- + SPELL_GROUND_SMASH = 82120,
- + SPELL_THUNDERCLAP = 8079,
- + NPC_WAR_GUARDIAN_FOLLOWER = 44118,
- + NPC_GIANT_MUSHROOM = 44049,
- + NPC_STONE_TROGG_EARTHRAGER = 43616
- +};
- +
- +class npc_war_guardian : public CreatureScript
- +{
- + public:
- + npc_war_guardian() : CreatureScript("npc_war_guardian") { }
- +
- + bool OnGossipHello(Player* player, Creature* creature)
- + {
- + if(player->GetQuestStatus(QUEST_FUNGAL_MONSTROSITIES)==QUEST_STATUS_INCOMPLETE
- + || player->GetQuestStatus(QUEST_SPROUT_NO_MORE)==QUEST_STATUS_INCOMPLETE)
- + {
- + player->CastSpell(player,SPELL_SUMMON_WAR_GUARDIAN);
- + }
- + return true;
- + }
- +};
- +
- +class npc_war_guardian_follower : public CreatureScript
- +{
- + public:
- + npc_war_guardian_follower() : CreatureScript("npc_war_guardian_follower") { }
- +
- + struct npc_war_guardian_followerAI : public ScriptedAI
- + {
- + npc_war_guardian_followerAI(Creature* creature) : ScriptedAI(creature) { }
- +
- + uint32 uiChokingWoundTimer;
- + uint32 uiEarthShockTimer;
- + uint32 uiGroundSmashTimer;
- + uint32 uiThunderClapTimer;
- +
- + void Reset()
- + {
- + uiChokingWoundTimer = urand(20000,25000);
- + uiEarthShockTimer = urand(5000,7000);
- + uiGroundSmashTimer = urand(3000,5000);
- + uiThunderClapTimer = urand(12000,15000);
- + }
- +
- + void UpdateAI(uint32 const diff)
- + {
- + if (!UpdateVictim())
- + return;
- + sLog->outError("1");
- + //choking wound
- + if(uiChokingWoundTimer <= diff)
- + { sLog->outError("2");
- + //if(Unit* victim = me->getVictim())
- + //me->CastSpell(victim,SPELL_CHOCKING_WOUND);
- + DoCastVictim(SPELL_CHOCKING_WOUND);
- + uiChokingWoundTimer = urand(20000,25000);
- + }
- + else uiChokingWoundTimer -= diff;
- +
- + //earth shok
- + if(uiEarthShockTimer <= diff)
- + {
- + DoCastVictim(SPELL_EARTH_SHOCK);
- + //if(Unit* victim = me->getVictim())
- + //me->CastSpell(victim,SPELL_EARTH_SHOCK);
- + uiEarthShockTimer = urand(5000,7000);
- + }
- + else uiEarthShockTimer -= diff;
- +
- + //ground smash
- + if(uiGroundSmashTimer <= diff)
- + {
- + //if(Unit* victim = me->getVictim())
- + //me->CastSpell(victim,SPELL_GROUND_SMASH);
- + DoCastVictim(SPELL_GROUND_SMASH);
- + uiGroundSmashTimer = urand(3000,5000);
- + }
- + else uiGroundSmashTimer -= diff;
- +
- + //thunderclap
- + if(uiThunderClapTimer <= diff)
- + {
- + DoCastVictim(SPELL_THUNDERCLAP);
- + //if(Unit* victim = me->getVictim())
- + //me->CastSpell(victim,SPELL_THUNDERCLAP);
- + uiThunderClapTimer = urand(12000,15000);
- + }
- + else uiThunderClapTimer -= diff;
- +
- + DoMeleeAttackIfReady();
- + }
- +
- + };
- +
- + CreatureAI* GetAI(Creature *creature) const
- + {
- + return new npc_war_guardian_followerAI(creature);
- + }
- +};
- +
- +
- +class npc_giant_mushroom : public CreatureScript
- +{
- + public:
- + npc_giant_mushroom() : CreatureScript("npc_giant_mushroom") { }
- +
- + struct npc_giant_mushroomAI : public ScriptedAI
- + {
- + npc_giant_mushroomAI(Creature* creature) : ScriptedAI(creature) { }
- +
- + void Reset()
- + {
- + }
- +
- + void MoveInLineOfSight(Unit* who)
- + {
- + Player* player = who->ToPlayer();
- +
- + if(player && (me->GetDistance(player) < 10.0f) &&
- + (player->GetQuestStatus(QUEST_FUNGAL_MONSTROSITIES)==QUEST_STATUS_INCOMPLETE))
- + {
- + Unit* unit = player->GetSelectedUnit();
- + if(unit && unit->GetGUID() == me->GetGUID())
- + {
- + me->CastSpell(me,SPELL_EXPLODE);
- + player->KilledMonsterCredit(NPC_GIANT_MUSHROOM,0);
- + Unit* unit = me->SummonCreature(NPC_STONE_TROGG_EARTHRAGER,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0.0f);
- + me->DespawnOrUnsummon();
- +
- + if(unit)
- + unit->Attack(player,true);
- + }
- + }
- + }
- + };
- +
- + CreatureAI* GetAI(Creature *creature) const
- + {
- + return new npc_giant_mushroomAI(creature);
- + }
- +};
- +
- void AddSC_deepholm()
- {
- new npc_lodestone();
- @@ -633,4 +789,7 @@ void AddSC_deepholm()
- new npc_red_mist();
- new npc_terrath_the_steady();
- new npc_opalescent_guardian();
- + new npc_war_guardian();
- + new npc_war_guardian_follower();
- + new npc_giant_mushroom();
- }
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment