mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(DB/Script): Rewrite Scarlet Courier using SmartAI. (#26903)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
-- Remove ScriptName & set SAI.
|
||||
UPDATE `creature_template` SET `ScriptName` = '', `AIName` = 'SmartAI' WHERE `entry` = 29076;
|
||||
|
||||
-- Set General SAI.
|
||||
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 29076);
|
||||
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
|
||||
(29076, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - On Just Summoned - Set Reactstate Passive'),
|
||||
(29076, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2907600, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - On Just Summoned - Run Script'),
|
||||
(29076, 0, 2, 0, 34, 0, 100, 0, 8, 15, 0, 0, 0, 0, 80, 2907601, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - On Reached Point 15 - Run Script'),
|
||||
(29076, 0, 3, 4, 4, 0, 100, 0, 0, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - On Aggro - Dismount'),
|
||||
(29076, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - On Aggro - Set Reactstate Aggressive'),
|
||||
(29076, 0, 5, 6, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 207, 2, 191144, 200, 0, 0, 0, 0, 0, 'Scarlet Courier - On Evade - Despawn Instant'),
|
||||
(29076, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - On Evade - Despawn Instant'),
|
||||
(29076, 0, 7, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 207, 2, 191144, 200, 0, 0, 0, 0, 0, 'Scarlet Courier - On Just Died - Despawn Instant');
|
||||
|
||||
-- Set Action Lists.
|
||||
DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (2907600, 2907601));
|
||||
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
|
||||
(2907600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Set Run Off'),
|
||||
(2907600, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Say Line 0'),
|
||||
(2907600, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 69, 15, 0, 0, 2, 0, 0, 207, 2, 191144, 200, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Move To Owner Summoned GO'),
|
||||
(2907601, 9, 0, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Set Reactstate Aggressive'),
|
||||
(2907601, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 53061, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Remove Aura \'Cover\''),
|
||||
(2907601, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Dismount'),
|
||||
(2907601, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Say Line 1'),
|
||||
(2907601, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 207, 2, 191144, 200, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Despawn In 1000 ms'),
|
||||
(2907601, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Scarlet Courier - Actionlist - Start Attacking');
|
||||
@@ -698,87 +698,6 @@ private:
|
||||
ObjectGuid _valrothGUID;
|
||||
};
|
||||
|
||||
/*######
|
||||
## Npc Scarlet Courier
|
||||
## Quest: Ambush At The Overlook
|
||||
######*/
|
||||
|
||||
enum ScarletCourierEnum
|
||||
{
|
||||
SAY_TREE1 = 0,
|
||||
SAY_TREE2 = 1,
|
||||
SPELL_SHOOT = 52818,
|
||||
GO_INCONSPICUOUS_TREE = 191144,
|
||||
NPC_SCARLET_COURIER = 29076
|
||||
};
|
||||
|
||||
struct npc_scarlet_courier : public ScriptedAI
|
||||
{
|
||||
npc_scarlet_courier(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 uiStage;
|
||||
uint32 uiStage_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->Mount(14338); // not sure about this id
|
||||
uiStage = 1;
|
||||
uiStage_timer = 3000;
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
Talk(SAY_TREE2);
|
||||
me->Dismount();
|
||||
uiStage = 0;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (id == 1)
|
||||
uiStage = 2;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (uiStage && !me->IsInCombat())
|
||||
{
|
||||
if (uiStage_timer <= diff)
|
||||
{
|
||||
switch (uiStage)
|
||||
{
|
||||
case 1:
|
||||
me->SetWalk(true);
|
||||
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
|
||||
{
|
||||
Talk(SAY_TREE1);
|
||||
float x, y, z;
|
||||
tree->GetContactPoint(me, x, y, z);
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, z);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
|
||||
if (Unit* unit = tree->GetOwner())
|
||||
AttackStart(unit);
|
||||
break;
|
||||
}
|
||||
uiStage_timer = 3000;
|
||||
uiStage = 0;
|
||||
}
|
||||
else uiStage_timer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## Gothik the Harvester and Acherus Necromancer AI
|
||||
## Phase 4 Internal Mechanics.
|
||||
@@ -2761,7 +2680,6 @@ void AddSC_the_scarlet_enclave()
|
||||
RegisterCreatureAI(npc_valkyr_battle_maiden);
|
||||
RegisterCreatureAI(npc_scarlet_ghoul);
|
||||
RegisterCreatureAI(npc_dkc1_gothik);
|
||||
RegisterCreatureAI(npc_scarlet_courier);
|
||||
RegisterCreatureAI(npc_koltira_deathweaver);
|
||||
RegisterCreatureAI(npc_acherus_necromancer);
|
||||
RegisterCreatureAI(npc_gothik_the_harvester);
|
||||
|
||||
Reference in New Issue
Block a user