fix(Scripts/BlackwingLair): Correct Bone Constructs abilities (#12180)

This commit is contained in:
Skjalf
2022-06-26 04:45:15 -03:00
committed by GitHub
parent f78ccf2621
commit 46789d5df6
4 changed files with 16 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
--
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 14605;
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 14605) 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`, `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
(14605, 0, 0, 0, 67, 0, 100, 0, 3000, 10000, 0, 0, 0, 11, 8355, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Bone Construct - On Behind Target - Cast \'Exploit Weakness\'');

View File

@@ -487,7 +487,7 @@ bool Creature::InitEntry(uint32 Entry, const CreatureData* data)
return true;
}
bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changelevel)
bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changelevel, bool updateAI)
{
if (!InitEntry(Entry, data))
return false;
@@ -596,6 +596,12 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
SetDetectionDistance(cInfo->detection_range);
LoadSpellTemplateImmunity();
if (updateAI)
{
AIM_Initialize();
}
return true;
}

View File

@@ -169,7 +169,8 @@ public:
void UpdateMovementFlags();
uint32 GetRandomId(uint32 id1, uint32 id2, uint32 id3);
bool UpdateEntry(uint32 entry, const CreatureData* data = nullptr, bool changelevel = true );
bool UpdateEntry(uint32 entry, const CreatureData* data = nullptr, bool changelevel = true, bool updateAI = false);
bool UpdateEntry(uint32 entry, bool updateAI) { return UpdateEntry(entry, nullptr, true, updateAI); }
bool UpdateStats(Stats stat) override;
bool UpdateAllStats() override;
void UpdateResistances(uint32 school) override;

View File

@@ -982,7 +982,7 @@ struct npc_drakonid_spawner : public ScriptedAI
{
if (Creature* construct = ObjectAccessor::GetCreature(*me, summonGuid))
{
construct->UpdateEntry(NPC_BONE_CONSTRUCT);
construct->UpdateEntry(NPC_BONE_CONSTRUCT, true);
construct->SetReactState(REACT_PASSIVE);
construct->SetStandState(UNIT_STAND_STATE_DEAD);
construct->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);