Scripts: Fix quests "...Or Maybe We Don't" and "Smoke 'Em Out"

Author: Lopin
Closes issue 4741

--HG--
branch : trunk
This commit is contained in:
Spp
2010-11-16 11:52:31 +01:00
parent 0dc3d771e1
commit 3e2c1a4169
4 changed files with 196 additions and 0 deletions
+7
View File
@@ -2621,6 +2621,13 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`
(33288,-1603340,'Destroy them minion, your master commands it!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,15760,5,0,0,'YoggSaron WHISP_INSANITY_2'),
(33288,-1603341,'Your fate is sealed. The end of days is finally upon you and ALL who inhabit this miserable little seedling. Uulwi ifis halahs gag erh''ongg w''ssh.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,15761,1,0,0,'YoggSaron SAY_DEATH'),
-- Quest Smoke Em Out
(27570,-1603535,'We\'re all gonna die!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say1'),
(27570,-1603536,'Gotta get out of here!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say2'),
(27570,-1603537,'No way I\'m stickin\' around!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say3'),
(27570,-1603538,'Forget this! I\'m going home!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say4'),
(27570,-1603539,'I didn\'t sign up for this!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say5'),
-- -1 604 000 GUNDRAK
/* Moorabi */
(29305,-1604010,'We fought back da Scourge. What chance joo be thinkin'' JOO got?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,'SAY_AGGRO boss_moorabi'),
@@ -0,0 +1,6 @@
-- Quest ...Or Maybe We Don't (12138, 12198)
UPDATE `creature_template` SET `ScriptName`='npc_lightning_sentry' WHERE `entry`=26407; -- Lightning Sentry
-- Quest Smoke 'Em Out (12323, 12324)
UPDATE `creature_template` SET `ScriptName`='npc_venture_co_straggler',`AIName`='' WHERE `entry`=27570;
+9
View File
@@ -0,0 +1,9 @@
-- Quest Smoke Em Out
DELETE FROM `script_texts` WHERE `entry` BETWEEN (-1603539) AND (-1603535);
INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`,`sound`,`type`,`language`,`emote`,`comment`) VALUES
(27570,-1603535,'We\'re all gonna die!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say1'),
(27570,-1603536,'Gotta get out of here!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say2'),
(27570,-1603537,'No way I\'m stickin\' around!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say3'),
(27570,-1603538,'Forget this! I\'m going home!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say4'),
(27570,-1603539,'I didn\'t sign up for this!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'Smoke \'Em Out - Say5');
@@ -626,6 +626,178 @@ public:
}
};
/*Lightning Sentry - if you kill it when you have your Minion with you, you will get a quest credit*/
enum eSentry
{
QUEST_OR_MAYBE_WE_DONT_A = 12138,
QUEST_OR_MAYBE_WE_DONT_H = 12198,
NPC_LIGHTNING_SENTRY = 26407,
NPC_WAR_GOLEM = 27017,
SPELL_CHARGED_SENTRY_TOTEM = 52703,
};
class npc_lightning_sentry : public CreatureScript
{
public:
npc_lightning_sentry() : CreatureScript("npc_lightning_sentry") { }
CreatureAI *GetAI(Creature *pCreature) const
{
return new npc_lightning_sentryAI(pCreature);
}
struct npc_lightning_sentryAI : public ScriptedAI
{
npc_lightning_sentryAI(Creature *pCreature) : ScriptedAI(pCreature) { }
uint32 uiChargedSentryTotem;
void Reset()
{
uiChargedSentryTotem = urand(10000,12000);
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
if (uiChargedSentryTotem <= uiDiff)
{
DoCast(SPELL_CHARGED_SENTRY_TOTEM);
uiChargedSentryTotem = urand(10000,12000);
}
else
uiChargedSentryTotem -= uiDiff;
DoMeleeAttackIfReady();
}
void JustDied(Unit * pKiller)
{
if (pKiller->ToPlayer() && pKiller->ToPlayer()->GetTypeId() == TYPEID_PLAYER)
{
if (me->FindNearestCreature(NPC_WAR_GOLEM, 10.0f, true))
{
if (pKiller->ToPlayer()->GetQuestStatus(QUEST_OR_MAYBE_WE_DONT_A) == QUEST_STATUS_INCOMPLETE ||
pKiller->ToPlayer()->GetQuestStatus(QUEST_OR_MAYBE_WE_DONT_H) == QUEST_STATUS_INCOMPLETE)
pKiller->ToPlayer()->KilledMonsterCredit(NPC_WAR_GOLEM, 0);
}
}
}
};
};
/*Venture co. Straggler - when you cast Smoke Bomb, he will yell and run away*/
enum eSmokeEmOut
{
SAY_SEO1 = -1603535,
SAY_SEO2 = -1603536,
SAY_SEO3 = -1603537,
SAY_SEO4 = -1603538,
SAY_SEO5 = -1603539,
QUEST_SMOKE_EM_OUT_A = 12323,
QUEST_SMOKE_EM_OUT_H = 12324,
SPELL_SMOKE_BOMB = 49075,
SPELL_CHOP = 43410,
NPC_VENTURE_CO_STABLES_KC = 27568,
};
class npc_venture_co_straggler : public CreatureScript
{
public:
npc_venture_co_straggler() : CreatureScript("npc_venture_co_straggler") { }
CreatureAI *GetAI(Creature *pCreature) const
{
return new npc_venture_co_stragglerAI(pCreature);
}
struct npc_venture_co_stragglerAI : public ScriptedAI
{
npc_venture_co_stragglerAI(Creature *pCreature) : ScriptedAI(pCreature) { }
uint64 uiPlayerGUID;
uint32 uiRunAwayTimer;
uint32 uiTimer;
uint32 uiChopTimer;
void Reset()
{
uiPlayerGUID = 0;
uiTimer = 0;
uiChopTimer = urand(10000,12500);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
}
void UpdateAI(const uint32 uiDiff)
{
if (uiRunAwayTimer <= uiDiff)
{
if (Player *pPlayer = Unit::GetPlayer(*me, uiPlayerGUID))
{
switch (uiTimer)
{
case 0:
if (pPlayer->GetQuestStatus(QUEST_SMOKE_EM_OUT_A) == QUEST_STATUS_INCOMPLETE ||
pPlayer->GetQuestStatus(QUEST_SMOKE_EM_OUT_H) == QUEST_STATUS_INCOMPLETE)
pPlayer->KilledMonsterCredit(NPC_VENTURE_CO_STABLES_KC, 0);
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()+7, me->GetPositionZ());
uiRunAwayTimer = 2500;
++uiTimer;
break;
case 1:
DoScriptText(RAND(SAY_SEO1, SAY_SEO2, SAY_SEO3, SAY_SEO4, SAY_SEO5), me);
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-7, me->GetPositionY()-5, me->GetPositionZ());
uiRunAwayTimer = 2500;
++uiTimer;
break;
case 2:
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()-5, me->GetPositionY()-5, me->GetPositionZ());
uiRunAwayTimer = 2500;
++uiTimer;
break;
case 3:
me->DisappearAndDie();
uiTimer = 0;
break;
}
}
}
else
uiRunAwayTimer -= uiDiff;
if (!UpdateVictim())
return;
if (uiChopTimer <= uiDiff)
{
DoCast(me->getVictim(), SPELL_CHOP);
uiChopTimer = urand(10000,12000);
}
else
uiChopTimer -= uiDiff;
DoMeleeAttackIfReady();
}
void SpellHit(Unit *pCaster, const SpellEntry *pSpell)
{
if (pCaster && pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_SMOKE_BOMB)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
me->CombatStop(false);
uiPlayerGUID = pCaster->GetGUID();
uiRunAwayTimer = 3500;
}
}
};
};
void AddSC_grizzly_hills()
{
new npc_orsonn_and_kodian;
@@ -635,4 +807,6 @@ void AddSC_grizzly_hills()
new npc_tallhorn_stag;
new npc_amberpine_woodsman;
new npc_wounded_skirmisher;
new npc_lightning_sentry();
new npc_venture_co_straggler();
}