Add script for quest 12687
--HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- Vehicle and summon spell(summon npc 28788) for Acherus Deathcharger
|
||||
UPDATE creature_template SET `spell1`=52362, `VehicleId`=200 WHERE `entry`=28782;
|
||||
|
||||
-- ScriptName for dark rider
|
||||
UPDATE creature_template SET `ScriptName`='npc_ros_dark_rider' WHERE `entry`=28768;
|
||||
|
||||
-- Spellclick spell to mount deathcharger
|
||||
DELETE FROM npc_spellclick_spells WHERE `npc_entry`=28782;
|
||||
INSERT INTO npc_spellclick_spells (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES
|
||||
(28782, 52280, 12687, 3, 1);
|
||||
@@ -108,6 +108,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_kingdom_of_dalaran_quests' WHER
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_taxi' WHERE `entry` IN (17435, 23413, 18725, 19401, 19409, 20235, 25059, 25236, 20903, 20162, 29154, 23415, 27575, 26443, 26949, 23816);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_death_knight_initiate' WHERE `entry`=28406;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_salanar_the_horseman' WHERE `entry`=28653;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_ros_dark_rider' WHERE `entry`=28768;
|
||||
|
||||
/* */
|
||||
/* ZONE */
|
||||
|
||||
@@ -178,6 +178,11 @@ INSERT INTO npc_spellclick_spells (`npc_entry`, `spell_id`, `quest_id`, `quest_s
|
||||
(28606, 52263, 12680, 3, 1),
|
||||
(28607, 52263, 12680, 3, 1);
|
||||
|
||||
-- Spellclick spell to mount deathcharger
|
||||
DELETE FROM npc_spellclick_spells WHERE `npc_entry`=28782;
|
||||
INSERT INTO npc_spellclick_spells (`npc_entry`, `spell_id`, `quest_id`, `quest_status`, `cast_flags`) VALUES
|
||||
(28782, 52280, 12687, 3, 1);
|
||||
|
||||
-- --------
|
||||
-- TARGET
|
||||
-- --------
|
||||
@@ -1562,6 +1567,9 @@ UPDATE creature_template SET VehicleId = 312 WHERE entry IN (31857,31858,31861,3
|
||||
-- Horses for quest 12680 / not sure if its offilike
|
||||
UPDATE creature_template SET `VehicleId`=200 WHERE `entry` IN (28605,28606,28607);
|
||||
|
||||
-- Vehicle and summon spell(summon npc 28788) for Acherus Deathcharger
|
||||
UPDATE creature_template SET `spell1`=52362, `VehicleId`=200 WHERE `entry`=28782;
|
||||
|
||||
-- --------
|
||||
-- Death Knight
|
||||
-- --------
|
||||
|
||||
@@ -502,9 +502,12 @@ struct TRINITY_DLL_DECL npc_salanar_the_horsemanAI : public ScriptedAI
|
||||
{
|
||||
if( Unit *charmer = who->GetCharmer() )
|
||||
{
|
||||
if( charmer->GetTypeId() == TYPEID_PLAYER && ((Player*)charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE )
|
||||
if( charmer->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
((Player*)charmer)->KilledMonster(28767, me->GetGUID());
|
||||
if( ((Player*)charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)charmer)->KilledMonster(28767, me->GetGUID());
|
||||
else if( ((Player*)charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)charmer)->GroupEventHappens(12687, who);
|
||||
((Player*)charmer)->ExitVehicle();
|
||||
//without this we can see npc kill the horse
|
||||
//who->setDeathState(DEAD);
|
||||
@@ -520,6 +523,42 @@ CreatureAI* GetAI_npc_salanar_the_horseman(Creature *_Creature)
|
||||
return new npc_salanar_the_horsemanAI(_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_ros_dark_rider
|
||||
######*/
|
||||
|
||||
struct TRINITY_DLL_DECL npc_ros_dark_riderAI : public ScriptedAI
|
||||
{
|
||||
npc_ros_dark_riderAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Creature* deathcharger = me->FindNearestCreature(28782, 30);
|
||||
if(!deathcharger) return;
|
||||
deathcharger->RestoreFaction();
|
||||
deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
|
||||
deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
Creature* deathcharger = me->FindNearestCreature(28782, 30);
|
||||
if(!deathcharger) return;
|
||||
if( killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->isVehicle() )
|
||||
{
|
||||
deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
|
||||
deathcharger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
deathcharger->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
deathcharger->setFaction(2096);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_ros_dark_rider(Creature *_Creature)
|
||||
{
|
||||
return new npc_ros_dark_riderAI(_Creature);
|
||||
}
|
||||
|
||||
void AddSC_the_scarlet_enclave()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -550,4 +589,9 @@ void AddSC_the_scarlet_enclave()
|
||||
newscript->Name="npc_salanar_the_horseman";
|
||||
newscript->GetAI = &GetAI_npc_salanar_the_horseman;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_ros_dark_rider";
|
||||
newscript->GetAI = &GetAI_npc_ros_dark_rider;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
Reference in New Issue
Block a user