Scripts/Nagrand: Fix quest Totem of Kar'dash

Closes #3032
This commit is contained in:
Discover-
2011-10-22 17:30:53 +01:00
committed by Nay
parent 04a798dc8b
commit 6e1107f5fc
2 changed files with 223 additions and 0 deletions
@@ -0,0 +1,36 @@
-- Kurenai Captive
UPDATE `creature_template` SET `ScriptName`='npc_kurenai_captive' WHERE `entry`=18209;
DELETE FROM `creature_template_addon` WHERE `entry`=18209;
INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (18209,0,0,8,0,0,''); -- Kneel
DELETE FROM `script_waypoint` WHERE `entry`=18209;
INSERT INTO `script_waypoint` (`entry`,`pointid`,`location_x`,`location_y`,`location_z`,`waittime`,`point_comment`) VALUES
(18209,1,-1518.593872,8469.956055,-4.101756,0,''),
(18209,2,-1511.784546,8480.531250,-4.033919,0,''),
(18209,3,-1513.447754,8509.764698,-0.109888,0,''),
(18209,4,-1498.857788,8508.805664,0.844676,0,''),
(18209,5,-1454.215088,8495.808594,4.912439,0,''),
(18209,6,-1437.483521,8504.165039,6.879123,0,''),
(18209,7,-1382.29,8539.87,11.139,7500,''),
(18209,8,-1361.22,8521.44,11.144,0,''),
(18209,9,-1324.8,8510.69,13.05,0,''),
(18209,10,-1312.08,8492.71,14.235,0,'');
DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000482 AND -1000488;
DELETE FROM `creature_text` WHERE `entry` IN (18209,18210);
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
-- Maghar Captive
(18210,0,0,"Look out!",12,0,100,0,0,0,"Maghar Captive"),
(18210,1,0,"Don't let them escape! Kill the strong one first!",12,0,100,0,0,0,"Maghar Captive"),
(18210,2,0,"More of them are coming! Watch out!",12,0,100,0,0,0,"Maghar Captive"),
(18210,3,0,"Where do you think you're going? Kill them all!",12,0,100,0,0,0,"Maghar Captive"),
(18210,4,0,"Ride the lightning, filth!",12,0,100,0,0,0,"Maghar Captive"),
(18210,5,0,"FROST SHOCK!",14,0,100,0,0,0,"Maghar Captive"),
(18210,6,0,"It is best that we split up now, in case they send more after us. Hopefully one of us will make it back to Garrosh. Farewell, stranger.",12,0,100,0,0,0,"Maghar Captive"),
-- Kurenai Captive
(18209,0,0,"Look out!",12,0,100,0,0,0,"Kurenai Captive"),
(18209,1,0,"Don't let them escape! Kill the strong one first!",12,0,100,0,0,0,"Kurenai Captive"),
(18209,2,0,"More of them are coming! Watch out!",12,0,100,0,0,0,"Kurenai Captive"),
(18209,3,0,"Where do you think you're going? Kill them all!",12,0,100,0,0,0,"Kurenai Captive"),
(18209,4,0,"Ride the lightning, filth!",12,0,100,0,0,0,"Kurenai Captive"),
(18209,5,0,"FROST SHOCK!",14,0,100,0,0,0,"Kurenai Captive"),
(18209,6,0,"Up ahead is the road to Telaar. We will split up when we reach the fork as they will surely send more Murkblood after us. Hopefully one of us makes it back to Telaar alive.",14,0,100,0,0,0,"Kurenai Captive");
+187
View File
@@ -970,6 +970,192 @@ public:
}; };
}; };
/*#####
## npc_kurenai_captive
#####*/
enum KurenaiCaptive
{
SAY_KUR_START = 0,
SAY_KUR_NO_ESCAPE = 1,
SAY_KUR_MORE = 2,
SAY_KUR_MORE_TWO = 3,
SAY_KUR_LIGHTNING = 4,
SAY_KUR_SHOCK = 5,
SAY_KUR_COMPLETE = 6,
SPELL_KUR_CHAIN_LIGHTNING = 16006,
SPELL_KUR_EARTHBIND_TOTEM = 15786,
SPELL_KUR_FROST_SHOCK = 12548,
SPELL_KUR_HEALING_WAVE = 12491,
QUEST_TOTEM_KARDASH_A = 9879,
NPC_KUR_MURK_RAIDER = 18203,
NPC_KUR_MURK_BRUTE = 18211,
NPC_KUR_MURK_SCAVENGER = 18207,
NPC_KUR_MURK_PUTRIFIER = 18202,
};
static float kurenaiAmbushA[]= {-1568.805786f, 8533.873047f, 1.958f};
static float kurenaiAmbushB[]= {-1491.554321f, 8506.483398f, 1.248f};
class npc_kurenai_captive : public CreatureScript
{
public:
npc_kurenai_captive() : CreatureScript("npc_kurenai_captive") { }
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
{
if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_A)
{
if (npc_kurenai_captiveAI* EscortAI = dynamic_cast<npc_kurenai_captiveAI*>(creature->AI()))
{
creature->SetStandState(UNIT_STAND_STATE_STAND);
EscortAI->Start(true, false, player->GetGUID(), quest);
DoScriptText(SAY_KUR_START, creature);
creature->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0]+2.5f, kurenaiAmbushA[1]-2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
creature->SummonCreature(NPC_KUR_MURK_BRUTE, kurenaiAmbushA[0]-2.5f, kurenaiAmbushA[1]+2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
creature->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushA[0], kurenaiAmbushA[1], kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
}
}
return true;
}
CreatureAI* GetAI(Creature* creature) const
{
return new npc_kurenai_captiveAI(creature);
}
struct npc_kurenai_captiveAI : public npc_escortAI
{
npc_kurenai_captiveAI(Creature* creature) : npc_escortAI(creature) { }
uint32 ChainLightningTimer;
uint32 HealTimer;
uint32 FrostShockTimer;
void Reset()
{
ChainLightningTimer = 1000;
HealTimer = 0;
FrostShockTimer = 6000;
}
void EnterCombat(Unit* /*who*/)
{
DoCast(me, SPELL_KUR_EARTHBIND_TOTEM, false);
}
void JustDied(Unit* /*killer*/)
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
return;
if (Player* player = GetPlayerForEscort())
{
if (player->GetQuestStatus(QUEST_TOTEM_KARDASH_A) != QUEST_STATUS_COMPLETE)
player->FailQuest(QUEST_TOTEM_KARDASH_A);
}
}
void WaypointReached(uint32 PointId)
{
switch(PointId)
{
case 3:
{
Talk(SAY_KUR_MORE);
if (Creature* temp = me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0], kurenaiAmbushB[1], kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
Talk(SAY_KUR_MORE_TWO);
me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0]-2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]+2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
}
case 7:
{
Talk(SAY_KUR_COMPLETE);
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
SetRun();
break;
}
}
}
void JustSummoned(Creature* summoned)
{
if (summoned->GetEntry() == NPC_KUR_MURK_BRUTE)
Talk(SAY_KUR_NO_ESCAPE);
// This function is for when we summoned enemies to fight - so that does NOT mean we should make our totem count in this!
if (summoned->isTotem())
return;
summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
summoned->AI()->AttackStart(me);
}
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell)
{
if (spell->Id == SPELL_KUR_CHAIN_LIGHTNING)
{
if (rand()%30)
return;
Talk(SAY_KUR_LIGHTNING);
}
if (spell->Id == SPELL_KUR_FROST_SHOCK)
{
if (rand()%30)
return;
Talk(SAY_KUR_SHOCK);
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (me->HasUnitState(UNIT_STAT_CASTING))
return;
if (ChainLightningTimer <= diff)
{
DoCast(me->getVictim(), SPELL_KUR_CHAIN_LIGHTNING);
ChainLightningTimer = urand(7000,14000);
} else ChainLightningTimer -= diff;
if (HealthBelowPct(30))
{
if (HealTimer <= diff)
{
DoCast(me, SPELL_KUR_HEALING_WAVE);
HealTimer = 5000;
} else HealTimer -= diff;
}
if (FrostShockTimer <= diff)
{
DoCast(me->getVictim(), SPELL_KUR_FROST_SHOCK);
FrostShockTimer = urand(7500,15000);
} else FrostShockTimer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_nagrand() void AddSC_nagrand()
{ {
new mob_shattered_rumbler(); new mob_shattered_rumbler();
@@ -982,4 +1168,5 @@ void AddSC_nagrand()
new mob_sparrowhawk(); new mob_sparrowhawk();
new npc_corki(); new npc_corki();
new go_corkis_prison(); new go_corkis_prison();
new npc_kurenai_captive();
} }