mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(DB/SmartAI): quest 'The Drakkensryd' (#23843)
Co-authored-by: Killyana <morphone1@gmail.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 29796) AND (`source_type` = 0) AND (`id` IN (0));
|
||||||
|
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||||
|
(29796, 0, 0, 0, 19, 0, 100, 0, 12886, 0, 0, 0, 0, 0, 11, 55253, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Gretta the Arbiter - On Quest \'The Drakkensryd\' Taken - Cast \'Force Cast Initial Proto-Drake\'');
|
||||||
|
|
||||||
|
UPDATE `creature_template` SET `speed_run` = 3.2 WHERE (`entry` = 29679);
|
||||||
|
|
||||||
|
-- 55971 Eagle Flight
|
||||||
|
UPDATE `creature_template_addon` SET `auras` = '55971' WHERE (`entry` = 29679);
|
||||||
|
|
||||||
|
-- Update comments, Exit vehicle on death
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 29694) AND (`source_type` = 0) AND (`id` IN (0, 1, 2));
|
||||||
|
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||||
|
(29694, 0, 0, 0, 0, 0, 100, 0, 2000, 5000, 5000, 9000, 0, 0, 11, 32736, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Hyldsmeet Drakerider - In Combat - Cast \'Mortal Strike\''),
|
||||||
|
(29694, 0, 1, 2, 6, 0, 100, 512, 0, 0, 0, 0, 0, 0, 33, 29800, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Hyldsmeet Drakerider - On Just Died - Quest Credit \'null\''),
|
||||||
|
(29694, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 203, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hyldsmeet Drakerider - On Just Died - Exit vehicle');
|
||||||
|
|
||||||
|
-- Hyldsmeet Drakerider eject NPC passenger vertically
|
||||||
|
DELETE FROM `vehicle_seat_addon` WHERE (`SeatEntry` = 2101);
|
||||||
|
INSERT INTO `vehicle_seat_addon` (`SeatEntry`, `SeatOrientation`, `ExitParamX`, `ExitParamY`, `ExitParamZ`, `ExitParamO`, `ExitParamValue`) VALUES
|
||||||
|
(2101, 0, 0, 0, 4, 0, 1);
|
||||||
|
|
||||||
|
-- Update Comments, Reduce despawn time from 2s to 1s
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 29679) AND (`source_type` = 0) AND (`id` IN (0, 1, 2));
|
||||||
|
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||||
|
(29679, 0, 0, 0, 60, 0, 100, 513, 1000, 1000, 0, 0, 0, 0, 53, 2, 29679, 0, 0, 1000, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hyldsmeet Proto-Drake - On Update - Start Waypoint Path 29679 (No Repeat)'),
|
||||||
|
(29679, 0, 1, 0, 60, 0, 100, 513, 500, 500, 0, 0, 0, 0, 60, 1, 500, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hyldsmeet Proto-Drake - On Update - Set Fly On (No Repeat)'),
|
||||||
|
(29679, 0, 2, 0, 28, 0, 100, 512, 0, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hyldsmeet Proto-Drake - On Passenger Removed - Despawn In 1000 ms');
|
||||||
|
|
||||||
|
DELETE FROM `spell_area` WHERE `spell` IN (55012, 72914) AND `area` IN (4430, 4431, 4432) AND `quest_start` = 12886;
|
||||||
|
INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES
|
||||||
|
(55012, 4430, 12886, 0, 0, 0, 2, 1, 10, 0),
|
||||||
|
(55012, 4431, 12886, 0, 0, 0, 2, 1, 10, 0),
|
||||||
|
(55012, 4432, 12886, 0, 0, 0, 2, 1, 10, 0),
|
||||||
|
(72914, 4430, 12886, 0, 0, 0, 2, 1, 10, 0),
|
||||||
|
(72914, 4431, 12886, 0, 0, 0, 2, 1, 10, 0),
|
||||||
|
(72914, 4432, 12886, 0, 0, 0, 2, 1, 10, 0);
|
||||||
@@ -915,72 +915,40 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class npc_hyldsmeet_protodrake : public CreatureScript
|
enum HyldsmeetProtoDrake
|
||||||
{
|
{
|
||||||
enum NPCs
|
NPC_HYLDSMEET_DRAKERIDER = 29694
|
||||||
|
};
|
||||||
|
|
||||||
|
struct npc_hyldsmeet_protodrake : public CreatureAI
|
||||||
|
{
|
||||||
|
explicit npc_hyldsmeet_protodrake(Creature* creature) : CreatureAI(creature), _accessoryRespawnTimer(0) { }
|
||||||
|
|
||||||
|
void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) override
|
||||||
{
|
{
|
||||||
NPC_HYLDSMEET_DRAKERIDER = 29694
|
if (apply)
|
||||||
};
|
return;
|
||||||
|
|
||||||
public:
|
if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER)
|
||||||
npc_hyldsmeet_protodrake() : CreatureScript("npc_hyldsmeet_protodrake") { }
|
_accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS;
|
||||||
|
|
||||||
class npc_hyldsmeet_protodrakeAI : public CreatureAI
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
npc_hyldsmeet_protodrakeAI(Creature* creature) : CreatureAI(creature), _accessoryRespawnTimer(0), _vehicleKit(creature->GetVehicleKit()) { }
|
|
||||||
|
|
||||||
void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) override
|
|
||||||
{
|
|
||||||
if (apply)
|
|
||||||
{
|
|
||||||
class DelayedTransportPositionOffsets : public BasicEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DelayedTransportPositionOffsets(Unit* owner) : _owner(owner) { }
|
|
||||||
|
|
||||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
|
|
||||||
{
|
|
||||||
_owner->m_movementInfo.transport.pos.Relocate(-3.5f, 0.f, -0.2f, 0.f);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
Unit* _owner;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (who->IsPlayer())
|
|
||||||
who->m_Events.AddEventAtOffset(new DelayedTransportPositionOffsets(who), 500ms);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER)
|
|
||||||
_accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
|
||||||
{
|
|
||||||
//! We need to manually reinstall accessories because the vehicle itself is friendly to players,
|
|
||||||
//! so EnterEvadeMode is never triggered. The accessory on the other hand is hostile and killable.
|
|
||||||
if (_accessoryRespawnTimer && _accessoryRespawnTimer <= diff && _vehicleKit)
|
|
||||||
{
|
|
||||||
_vehicleKit->InstallAllAccessories(true);
|
|
||||||
_accessoryRespawnTimer = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
_accessoryRespawnTimer -= diff;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
uint32 _accessoryRespawnTimer;
|
|
||||||
Vehicle* _vehicleKit;
|
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new npc_hyldsmeet_protodrakeAI(creature);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateAI(uint32 diff) override
|
||||||
|
{
|
||||||
|
//! We need to manually reinstall accessories because the vehicle itself is friendly to players,
|
||||||
|
//! so EnterEvadeMode is never triggered. The accessory on the other hand is hostile and killable.
|
||||||
|
Vehicle* vehicleKit = me->GetVehicleKit();
|
||||||
|
if (_accessoryRespawnTimer && _accessoryRespawnTimer <= diff && vehicleKit)
|
||||||
|
{
|
||||||
|
vehicleKit->InstallAllAccessories(true);
|
||||||
|
_accessoryRespawnTimer = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_accessoryRespawnTimer -= diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint32 _accessoryRespawnTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CloseRift
|
enum CloseRift
|
||||||
@@ -1215,7 +1183,7 @@ void AddSC_storm_peaks()
|
|||||||
new npc_brunnhildar_prisoner();
|
new npc_brunnhildar_prisoner();
|
||||||
new npc_freed_protodrake();
|
new npc_freed_protodrake();
|
||||||
new npc_icefang();
|
new npc_icefang();
|
||||||
new npc_hyldsmeet_protodrake();
|
RegisterCreatureAI(npc_hyldsmeet_protodrake);
|
||||||
RegisterSpellScript(spell_close_rift_aura);
|
RegisterSpellScript(spell_close_rift_aura);
|
||||||
new npc_vehicle_d16_propelled_delivery();
|
new npc_vehicle_d16_propelled_delivery();
|
||||||
RegisterSpellScript(spell_q12823_remove_collapsing_cave_aura);
|
RegisterSpellScript(spell_q12823_remove_collapsing_cave_aura);
|
||||||
|
|||||||
Reference in New Issue
Block a user