Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-08-19 18:59:50 +08:00
12 changed files with 33 additions and 39 deletions

View File

@@ -113,7 +113,7 @@ public:
scheduler.CancelAll();
if (InstanceScript* hyjal = me->GetInstanceScript())
if (!hyjal->GetData(DATA_WAVE_STATUS))
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
void JustEngagedWith(Unit* /*who*/) override
@@ -138,7 +138,7 @@ public:
void IsSummonedBy(WorldObject* /*summoner*/) override
{
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
DoCastSelf(SPELL_SIMPLE_TELEPORT, true);
// Should wait 2400ms
@@ -176,7 +176,7 @@ public:
bool OnGossipSelect(Player* /*player*/ , Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
{
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
if (InstanceScript* hyjal = creature->GetInstanceScript())
{
@@ -213,7 +213,7 @@ public:
scheduler.CancelAll();
if (InstanceScript* hyjal = me->GetInstanceScript())
if (!hyjal->GetData(DATA_WAVE_STATUS))
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
}
void JustEngagedWith(Unit* /*who*/) override
@@ -251,7 +251,7 @@ public:
bool OnGossipSelect(Player* /*player*/, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
{
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
creature->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
if (InstanceScript* hyjal = creature->GetInstanceScript())
{

View File

@@ -1790,7 +1790,7 @@ public:
if (!spellClickHandled)
return;
if (!me->GetUInt32Value(UNIT_NPC_FLAGS))
if (!me->GetNpcFlags())
return;
switch (me->GetArmor())
@@ -1806,7 +1806,7 @@ public:
break;
}
me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
me->DespawnOrUnsummon(1000);
}

View File

@@ -546,7 +546,7 @@ struct npc_salvaged_siege_engine : public VehicleAI
{
if (Unit* turret = vehicle->GetPassenger(7))
{
if (Vehicle* turretVehicle = me->GetVehicleKit())
if (Vehicle* turretVehicle = turret->GetVehicleKit())
{
if (!turretVehicle->IsVehicleInUse())
{

View File

@@ -103,20 +103,6 @@ enum Misc
EVENT_KILL_TALK = 100
};
struct HammerOfJusticeSelector
{
public:
HammerOfJusticeSelector(Unit* me) : _me(me) { }
bool operator()(Unit const* target) const
{
return target && target->GetTypeId() == TYPEID_PLAYER && _me->IsInRange(target, 10.0f, 40.0f, true);
}
private:
Unit const* _me;
};
class VerasEnvenom : public BasicEvent
{
public:
@@ -337,12 +323,13 @@ public:
events.ScheduleEvent(EVENT_SPELL_AURA, 30000);
break;
case EVENT_SPELL_HAMMER_OF_JUSTICE:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, HammerOfJusticeSelector(me)))
{
me->CastSpell(target, SPELL_HAMMER_OF_JUSTICE, false);
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 20000);
break;
}
if (Unit* target = me->GetVictim())
if (target->IsPlayer() && me->IsInRange(target, 10.0f, 40.0f, true))
{
me->CastSpell(target, SPELL_HAMMER_OF_JUSTICE);
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 20s);
break;
}
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 0);
break;
case EVENT_SPELL_SEAL:
@@ -711,4 +698,3 @@ void AddSC_boss_illidari_council()
RegisterSpellScript(spell_illidari_council_judgement);
RegisterSpellScript(spell_illidari_council_deadly_strike_aura);
}