Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
Yunfan Li
2024-03-12 16:54:14 +08:00
committed by GitHub
15 changed files with 1313 additions and 36 deletions

View File

@@ -1944,13 +1944,13 @@ struct npc_chesspiece : public ScriptedAI
void sGossipHello(Player* player) override
{
uint32 chessPhase = _instance->GetData(DATA_CHESS_GAME_PHASE);
if (player->GetTeamId() == TEAM_ALLIANCE && me->GetFaction() != CHESS_FACTION_ALLIANCE && chessPhase < CHESS_PHASE_PVE_FINISHED)
if (_instance->GetData(CHESS_EVENT_TEAM) == TEAM_ALLIANCE && me->GetFaction() != CHESS_FACTION_ALLIANCE && chessPhase < CHESS_PHASE_PVE_FINISHED)
{
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
return;
}
if (player->GetTeamId() == TEAM_HORDE && me->GetFaction() != CHESS_FACTION_HORDE && chessPhase < CHESS_PHASE_PVE_FINISHED)
if (_instance->GetData(CHESS_EVENT_TEAM) == TEAM_HORDE && me->GetFaction() != CHESS_FACTION_HORDE && chessPhase < CHESS_PHASE_PVE_FINISHED)
{
SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
return;

View File

@@ -139,7 +139,7 @@ struct boss_alar : public BossAI
if (_noQuillTimes++ > 0)
{
me->SetOrientation(alarPoints[_platform].GetOrientation());
SpawnPhoenixes(1, me, false);
SpawnPhoenixes(1, me);
}
me->GetMotionMaster()->MovePoint(POINT_PLATFORM, alarPoints[_platform], false, true);
_platform = (_platform+1)%4;
@@ -247,21 +247,14 @@ struct boss_alar : public BossAI
ScheduleMainSpellAttack(0s);
}
void SpawnPhoenixes(uint8 count, Unit* targetToSpawnAt, bool onPosition)
void SpawnPhoenixes(uint8 count, Unit* targetToSpawnAt)
{
if (targetToSpawnAt)
{
Position spawnPosition = DeterminePhoenixPosition(targetToSpawnAt->GetPosition());
for (uint8 i = 0; i < count; ++i)
{
if (onPosition)
{
Position spawnPosition = DeterminePhoenixPosition(targetToSpawnAt->GetPosition());
me->SummonCreature(NPC_EMBER_OF_ALAR, spawnPosition, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
}
else
{
me->SummonCreature(NPC_EMBER_OF_ALAR, *targetToSpawnAt, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
}
me->SummonCreature(NPC_EMBER_OF_ALAR, spawnPosition, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
}
}
}
@@ -273,7 +266,7 @@ struct boss_alar : public BossAI
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true))
{
SpawnPhoenixes(2, target, true);
SpawnPhoenixes(2, target);
}
}).Schedule(6s, [this](TaskContext)
{

View File

@@ -227,11 +227,6 @@ struct boss_high_astromancer_solarian : public BossAI
summon->SetInCombatWithZone();
}
}
bool CheckEvadeIfOutOfCombatArea() const override
{
return me->GetDistance2d(432.59f, -371.93f) > 105.0f;
}
};
class spell_astromancer_wrath_of_the_astromancer : public AuraScript

View File

@@ -1014,7 +1014,7 @@ struct npc_thaladred : public ScriptedAI
scheduler.CancelAll();
me->SetReactState(REACT_PASSIVE);
_hasDied = false;
me->SetWalk(true);
me->SetWalk(false);
}
void JustEngagedWith(Unit* /*who*/) override
@@ -1023,6 +1023,7 @@ struct npc_thaladred : public ScriptedAI
{
Talk(SAY_THALADRED_AGGRO);
}
me->SetWalk(true);
ScheduleTimedEvent(100ms, [&]
{
DoResetThreatList();
@@ -1046,7 +1047,7 @@ struct npc_thaladred : public ScriptedAI
{
if (victim->IsNonMeleeSpellCast(false, false, true))
{
DoCastVictim(SPELL_SILENCE);
DoCastSelf(SPELL_SILENCE);
}
}
}, 3600ms, 15200ms);
@@ -1302,6 +1303,25 @@ class spell_kaelthas_summon_nether_vapor : public SpellScript
}
};
class spell_kael_pyroblast : public SpellScript
{
PrepareSpellScript(spell_kael_pyroblast);
void FilterTargets(std::list<WorldObject*>& targets)
{
if (GetCaster()->GetVictim())
{
if (Unit* victim = GetCaster()->GetVictim())
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), false));
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kael_pyroblast::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
void AddSC_boss_kaelthas()
{
RegisterTheEyeAI(boss_kaelthas);
@@ -1319,5 +1339,6 @@ void AddSC_boss_kaelthas()
RegisterSpellScript(spell_kaelthas_gravity_lapse);
RegisterSpellScript(spell_kaelthas_nether_beam);
RegisterSpellScript(spell_kaelthas_summon_nether_vapor);
RegisterSpellScript(spell_kael_pyroblast);
}

View File

@@ -107,11 +107,6 @@ struct boss_void_reaver : public BossAI
});
}
bool CheckEvadeIfOutOfCombatArea() const override
{
return me->GetDistance2d(432.59f, 371.93f) > 105.0f;
}
private:
bool _recentlySpoken;
};

View File

@@ -33,7 +33,21 @@ ObjectData const creatureData[] =
ObjectData const gameObjectData[] =
{
{ 0, 0 }
{ 0, 0, }
};
DoorData const doorData[] =
{
{ GO_KAEL_DOOR_1, DATA_KAELTHAS, DOOR_TYPE_ROOM },
{ GO_KAEL_DOOR_2, DATA_KAELTHAS, DOOR_TYPE_ROOM },
{ 0, 0, DOOR_TYPE_ROOM }
};
BossBoundaryData const boundaries =
{
{ DATA_REAVER, new CircleBoundary(Position(432.741809f, 371.859589f), 105.052554f) },
{ DATA_ALAR, new CircleBoundary(Position(331.000000f, -2.38000000f), 108.29246f) },
{ DATA_ASTROMANCER, new CircleBoundary(Position(432.869202f, -374.213806f), 103.74374f) }
};
class instance_the_eye : public InstanceMapScript
@@ -46,8 +60,10 @@ public:
instance_the_eye_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
LoadObjectData(creatureData, gameObjectData);
SetBossNumber(MAX_ENCOUNTER);
LoadObjectData(creatureData, gameObjectData);
LoadDoorData(doorData);
LoadBossBoundaries(boundaries);
}
ObjectGuid ThaladredTheDarkenerGUID;
@@ -100,6 +116,7 @@ public:
KaelStateLeftGUID = gobject->GetGUID();
break;
}
InstanceScript::OnGameObjectCreate(gobject);
}
ObjectGuid GetGuidData(uint32 identifier) const override

View File

@@ -39,7 +39,10 @@ enum EyeData
DATA_THALADRED = 10,
DATA_LORD_SANGUINAR = 11,
DATA_CAPERNIAN = 12,
DATA_TELONICUS = 13
DATA_TELONICUS = 13,
DATA_KAEL_DOOR_1 = 14,
DATA_KAEL_DOOR_2 = 15
};
enum EyeNPCs
@@ -56,7 +59,9 @@ enum EyeGOs
{
GO_BRIDGE_WINDOW = 184069,
GO_KAEL_STATUE_RIGHT = 184596,
GO_KAEL_STATUE_LEFT = 184597
GO_KAEL_STATUE_LEFT = 184597,
GO_KAEL_DOOR_1 = 184324,
GO_KAEL_DOOR_2 = 184325
};
template <class AI, class T>