fix(Scripts/Temple of AhnQiraj): Qiraji Champion. (#12965)
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `smart_scripts` WHERE `entryorguid` = 15252 AND `source_type` = 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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
|
||||||
|
(15252,0,0,0,11,0,100,256,0,0,0,0,211,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Champion - On Respawn - Set not phase reset"),
|
||||||
|
(15252,0,1,0,0,0,100,0,500,500,6000,15000,11,40504,0,0,0,0,0,2,0,0,0,0,0,0,0,"Qiraji Champion - In Combat - Cast 'Cleave'"),
|
||||||
|
(15252,0,2,0,0,0,100,0,20000,40000,20000,40000,11,19134,0,0,0,0,0,2,0,0,0,0,0,0,0,"Qiraji Champion - In Combat - Cast 'Frightening Shout'"),
|
||||||
|
(15252,0,3,0,0,0,100,0,7500,12500,10000,20000,11,11130,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Champion - In Combat - Cast 'Knock Away'"),
|
||||||
|
(15252,0,4,5,38,0,100,0,0,1,0,0,11,25164,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Champion - On Data Set 0 1 - Cast 'Vengeance'"),
|
||||||
|
(15252,0,5,6,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Champion - On Link - Say Line 0"),
|
||||||
|
(15252,0,6,0,61,0,100,256,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Champion - On Link - Set Phase 1"),
|
||||||
|
(15252,0,7,0,0,1,100,0,60000,60000,60000,60000,11,25164,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Champion - IC - Cast 'Vengeance' (Phase 1)");
|
||||||
|
|
||||||
|
DELETE FROM `creature_text` WHERE `CreatureID`=15252;
|
||||||
|
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||||
|
(15252,0,0,'%s becomes enraged!',16,0,100,0,0,0,24144,0,'Qiraji Champion');
|
||||||
@@ -406,13 +406,16 @@ bool CreatureGroup::IsFormationInCombat()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreatureGroup::IsAnyMemberAlive()
|
bool CreatureGroup::IsAnyMemberAlive(bool ignoreLeader /*= false*/)
|
||||||
{
|
{
|
||||||
for (auto const& itr : m_members)
|
for (auto const& itr : m_members)
|
||||||
{
|
{
|
||||||
if (itr.first && itr.first->IsAlive())
|
if (itr.first && itr.first->IsAlive())
|
||||||
{
|
{
|
||||||
return true;
|
if (!ignoreLeader || itr.first != m_leader)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public:
|
|||||||
void MemberEvaded(Creature* member);
|
void MemberEvaded(Creature* member);
|
||||||
void RespawnFormation(bool force = false);
|
void RespawnFormation(bool force = false);
|
||||||
[[nodiscard]] bool IsFormationInCombat();
|
[[nodiscard]] bool IsFormationInCombat();
|
||||||
[[nodiscard]] bool IsAnyMemberAlive();
|
[[nodiscard]] bool IsAnyMemberAlive(bool ignoreLeader = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Creature* m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
|
Creature* m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
|
||||||
|
|||||||
@@ -15,9 +15,11 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "CreatureGroups.h"
|
||||||
#include "InstanceScript.h"
|
#include "InstanceScript.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
|
#include "TaskScheduler.h"
|
||||||
#include "temple_of_ahnqiraj.h"
|
#include "temple_of_ahnqiraj.h"
|
||||||
|
|
||||||
ObjectData const creatureData[] =
|
ObjectData const creatureData[] =
|
||||||
@@ -69,6 +71,8 @@ public:
|
|||||||
uint32 BugTrioDeathCount;
|
uint32 BugTrioDeathCount;
|
||||||
uint32 CthunPhase;
|
uint32 CthunPhase;
|
||||||
|
|
||||||
|
TaskScheduler scheduler;
|
||||||
|
|
||||||
void Initialize() override
|
void Initialize() override
|
||||||
{
|
{
|
||||||
BugTrioDeathCount = 0;
|
BugTrioDeathCount = 0;
|
||||||
@@ -140,6 +144,37 @@ public:
|
|||||||
InstanceScript::OnGameObjectCreate(go);
|
InstanceScript::OnGameObjectCreate(go);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnUnitDeath(Unit* unit) override
|
||||||
|
{
|
||||||
|
switch (unit->GetEntry())
|
||||||
|
{
|
||||||
|
case NPC_QIRAJI_SLAYER:
|
||||||
|
case NPC_QIRAJI_MINDSLAYER:
|
||||||
|
if (Creature* creature = unit->ToCreature())
|
||||||
|
{
|
||||||
|
if (CreatureGroup* formation = creature->GetFormation())
|
||||||
|
{
|
||||||
|
scheduler.Schedule(100ms, [formation](TaskContext /*context*/)
|
||||||
|
{
|
||||||
|
if (!formation->IsAnyMemberAlive(true))
|
||||||
|
{
|
||||||
|
if (Creature* leader = formation->GetLeader())
|
||||||
|
{
|
||||||
|
if (leader->IsAlive())
|
||||||
|
{
|
||||||
|
leader->AI()->SetData(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint32 GetData(uint32 type) const override
|
uint32 GetData(uint32 type) const override
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
@@ -217,6 +252,11 @@ public:
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Update(uint32 diff) override
|
||||||
|
{
|
||||||
|
scheduler.Update(diff);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ enum Creatures
|
|||||||
NPC_VEKNILASH = 15275,
|
NPC_VEKNILASH = 15275,
|
||||||
NPC_OURO = 15517,
|
NPC_OURO = 15517,
|
||||||
NPC_OURO_SPAWNER = 15957,
|
NPC_OURO_SPAWNER = 15957,
|
||||||
NPC_SARTURA = 15516
|
NPC_SARTURA = 15516,
|
||||||
|
|
||||||
|
NPC_QIRAJI_SLAYER = 15250,
|
||||||
|
NPC_QIRAJI_MINDSLAYER = 15246
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ObjectsAQ40
|
enum ObjectsAQ40
|
||||||
|
|||||||
Reference in New Issue
Block a user