mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
fix(DB/SAI): Move Drakuru Shackles & Captured Rageclaw behaviour on SAI. (#24467)
This commit is contained in:
35
data/sql/updates/pending_db_world/captured_rageclaw.sql
Normal file
35
data/sql/updates/pending_db_world/captured_rageclaw.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
-- Edit Spawn Time (Captured Rageclaw & Drakuru Shackles)
|
||||
UPDATE `creature` SET `spawntimesecs` = 30 WHERE (`id1` IN (29700, 29686));
|
||||
|
||||
-- Add creature template movement to Drakuru Shackles
|
||||
DELETE FROM `creature_template_movement` WHERE (`CreatureId` = 29700);
|
||||
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES
|
||||
(29700, 0, 0, 1, 1, 0, 0, 0);
|
||||
|
||||
-- Remove C++ script and set SAI for Drakuru Shackles & Captured Rageclaw
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE (`entry` IN (29700, 29686));
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`source_type` = 0) AND (`entryorguid` IN (29700, 29686));
|
||||
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
|
||||
(29700, 0, 0, 0, 8, 0, 100, 0, 54990, 0, 0, 0, 0, 0, 11, 55009, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Drakuru Shackles - On Spellhit \'Chains of the Scourge\' - Cast \'Chains of the Scourge\''),
|
||||
(29700, 0, 1, 2, 8, 0, 100, 0, 55083, 0, 0, 0, 0, 0, 33, 29686, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Drakuru Shackles - On Spellhit \'Unlock Shackle\' - Quest Credit \'Captured Rageclaw\''),
|
||||
(29700, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 27, 0, 0, 0, 0, 0, 9, 29686, 0, 5, 1, 0, 0, 0, 0, 'Drakuru Shackles - On Spellhit \'Unlock Shackle\' - Do Action ID 27'),
|
||||
(29686, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 90, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Rageclaw - On Respawn - Set Flag Standstate Kneel'),
|
||||
(29686, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 54990, 0, 0, 0, 0, 0, 9, 29700, 0, 5, 1, 0, 0, 0, 0, 'Captured Rageclaw - On Respawn - Cast \'Chains of the Scourge\''),
|
||||
(29686, 0, 2, 3, 72, 0, 100, 0, 27, 0, 0, 0, 0, 0, 91, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Rageclaw - On Action 27 Done - Remove FlagStandstate Kneel'),
|
||||
(29686, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Rageclaw - On Action 27 Done - Remove Aura \'all\''),
|
||||
(29686, 0, 4, 5, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 55085, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Rageclaw - On Action 27 Done - Cast \'Unshackled!\''),
|
||||
(29686, 0, 5, 6, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Rageclaw - On Action 27 Done - Say Line 0'),
|
||||
(29686, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 89, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Rageclaw - On Action 27 Done - Start Random Movement'),
|
||||
(29686, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 12000, 30000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Rageclaw - On Action 27 Done - Despawn In 12000 ms');
|
||||
|
||||
-- Set condition for Chains of the Scourge
|
||||
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 54990) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 3) AND (`ConditionValue2` = 29700) AND (`ConditionValue3` = 0);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 54990, 0, 0, 31, 0, 3, 29700, 0, 0, 0, 0, '', 'Chains of the Scourge has Drakuru Shackles as implicit target');
|
||||
|
||||
-- Set condition for Unlock Shackle (prevent item spamming if Rageclaw is not chained/present)
|
||||
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 3) AND (`SourceEntry` = 55083) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 1) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 54990) AND (`ConditionValue2` = 0) AND (`ConditionValue3` = 0);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 3, 55083, 0, 0, 1, 0, 54990, 0, 0, 0, 0, 0, '', 'Unlock Shackle target must have Chains of the Scourge aura.');
|
||||
@@ -610,150 +610,6 @@ private:
|
||||
BetrayalState _state;
|
||||
};
|
||||
|
||||
/*####
|
||||
## npc_drakuru_shackles
|
||||
####*/
|
||||
|
||||
enum DrakuruShackles
|
||||
{
|
||||
NPC_RAGECLAW = 29686,
|
||||
QUEST_TROLLS_IS_GONE_CRAZY = 12861,
|
||||
SPELL_LEFT_CHAIN = 59951,
|
||||
SPELL_RIGHT_CHAIN = 59952,
|
||||
SPELL_UNLOCK_SHACKLE = 55083,
|
||||
SPELL_FREE_RAGECLAW = 55223
|
||||
};
|
||||
|
||||
class npc_drakuru_shackles : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_drakuru_shackles() : CreatureScript("npc_drakuru_shackles") { }
|
||||
|
||||
struct npc_drakuru_shacklesAI : public NullCreatureAI
|
||||
{
|
||||
npc_drakuru_shacklesAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
_rageclawGUID.Clear();
|
||||
timer = 0;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
timer += diff;
|
||||
if (timer >= 2000)
|
||||
{
|
||||
timer = 0;
|
||||
if (_rageclawGUID)
|
||||
return;
|
||||
|
||||
if (Creature* cr = me->FindNearestCreature(NPC_RAGECLAW, 10.0f))
|
||||
{
|
||||
_rageclawGUID = cr->GetGUID();
|
||||
LockRageclaw(cr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LockRageclaw(Creature* rageclaw)
|
||||
{
|
||||
// pointer check not needed
|
||||
me->SetFacingToObject(rageclaw);
|
||||
rageclaw->SetFacingToObject(me);
|
||||
|
||||
DoCast(rageclaw, SPELL_LEFT_CHAIN, true);
|
||||
DoCast(rageclaw, SPELL_RIGHT_CHAIN, true);
|
||||
}
|
||||
|
||||
void UnlockRageclaw(Unit* /*who*/, Creature* rageclaw)
|
||||
{
|
||||
// pointer check not needed
|
||||
DoCast(rageclaw, SPELL_FREE_RAGECLAW, true);
|
||||
_rageclawGUID.Clear();
|
||||
me->DespawnOrUnsummon(1ms);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_UNLOCK_SHACKLE)
|
||||
{
|
||||
if (caster->ToPlayer()->GetQuestStatus(QUEST_TROLLS_IS_GONE_CRAZY) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* rageclaw = ObjectAccessor::GetCreature(*me, _rageclawGUID))
|
||||
{
|
||||
UnlockRageclaw(caster, rageclaw);
|
||||
caster->ToPlayer()->KilledMonster(rageclaw->GetCreatureTemplate(), _rageclawGUID);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
else
|
||||
me->setDeathState(DeathState::JustDied);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
ObjectGuid _rageclawGUID;
|
||||
uint32 timer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_drakuru_shacklesAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*####
|
||||
## npc_captured_rageclaw
|
||||
####*/
|
||||
|
||||
enum Rageclaw
|
||||
{
|
||||
SPELL_UNSHACKLED = 55085,
|
||||
SPELL_KNEEL = 39656,
|
||||
SAY_RAGECLAW = 0
|
||||
};
|
||||
|
||||
class npc_captured_rageclaw : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_captured_rageclaw() : CreatureScript("npc_captured_rageclaw") { }
|
||||
|
||||
struct npc_captured_rageclawAI : public NullCreatureAI
|
||||
{
|
||||
npc_captured_rageclawAI(Creature* creature) : NullCreatureAI(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
me->SetFaction(FACTION_FRIENDLY);
|
||||
DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_FREE_RAGECLAW)
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
|
||||
me->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
|
||||
me->RemoveAurasDueToSpell(SPELL_KNEEL);
|
||||
me->SetFaction(me->GetCreatureTemplate()->faction);
|
||||
DoCast(me, SPELL_UNSHACKLED, true);
|
||||
Talk(SAY_RAGECLAW);
|
||||
me->GetMotionMaster()->MoveRandom(10);
|
||||
me->DespawnOrUnsummon(10s);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_captured_rageclawAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*####
|
||||
## npc_released_offspring_harkoa
|
||||
####*/
|
||||
@@ -973,8 +829,6 @@ void AddSC_zuldrak()
|
||||
new npc_finklestein();
|
||||
new go_finklestein_cauldron();
|
||||
RegisterCreatureAI(npc_overlord_drakuru_betrayal);
|
||||
new npc_drakuru_shackles();
|
||||
new npc_captured_rageclaw();
|
||||
new npc_released_offspring_harkoa();
|
||||
new npc_crusade_recruit();
|
||||
new go_scourge_enclosure();
|
||||
|
||||
Reference in New Issue
Block a user