Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-05-04 10:47:16 -06:00
committed by GitHub
10 changed files with 162 additions and 84 deletions

View File

@@ -0,0 +1,9 @@
-- DB update 2022_05_01_01 -> 2022_05_03_00
-- Fix for the levitate issue
UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 2.14286, `flags_extra` = `flags_extra`|512 WHERE `entry` = 14517;
UPDATE `creature_template_movement` SET `Flight` = 0 WHERE `CreatureId` = 14517;
-- Update Emotes
DELETE FROM `creature_text` WHERE `CreatureID` = 14517 AND `GroupID` IN (3,4);
INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES
(14517,3,0,'%s emits a deafening shriek!',16,0,100,0,0,0,10370,0,'High Priestess Jeklik - EMOTE_SUMMON_BATS'),
(14517,4,0,'%s begins to cast a Great Heal!',16,0,100,0,0,0,10494,0,'High Priestess Jeklik - EMOTE_GREAT_HEAL');

View File

@@ -0,0 +1,3 @@
-- DB update 2022_05_03_00 -> 2022_05_03_01
--
UPDATE `gameobject_template_addon` SET `flags` = `flags` |16 WHERE `entry` = 179116;

View File

@@ -0,0 +1,5 @@
-- DB update 2022_05_03_01 -> 2022_05_03_02
--
DELETE FROM `areatrigger_scripts` WHERE `entry` = 4052 AND `ScriptName` = 'at_battleguard_sartura';
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
(4052, 'at_battleguard_sartura');

View File

@@ -0,0 +1,5 @@
-- DB update 2022_05_03_02 -> 2022_05_04_00
UPDATE `creature_template` SET `faction` = 1216 WHERE (`entry` = 13086);
UPDATE `creature_template` SET `faction` = 1216 WHERE (`entry` = 22670);
UPDATE `creature_template` SET `faction` = 1216 WHERE (`entry` = 31918);
UPDATE `creature_template` SET `faction` = 1216 WHERE (`entry` = 37234);

View File

@@ -9671,7 +9671,7 @@ ReputationRank Unit::GetReactionTo(Unit const* target, bool checkOriginalFaction
return REP_FRIENDLY;
// duel - always hostile to opponent
if (selfPlayerOwner->duel && selfPlayerOwner->duel->Opponent == targetPlayerOwner && selfPlayerOwner->duel->StartTime != 0)
if (selfPlayerOwner->duel && selfPlayerOwner->duel->Opponent == targetPlayerOwner && selfPlayerOwner->duel->State == DUEL_STATE_IN_PROGRESS)
return REP_HOSTILE;
// same group - checks dependant only on our faction - skip FFA_PVP for example
@@ -13352,7 +13352,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
// check duel - before sanctuary checks
if (playerAffectingAttacker && playerAffectingTarget)
if (playerAffectingAttacker->duel && playerAffectingAttacker->duel->Opponent == playerAffectingTarget && playerAffectingAttacker->duel->StartTime != 0)
if (playerAffectingAttacker->duel && playerAffectingAttacker->duel->Opponent == playerAffectingTarget && playerAffectingAttacker->duel->State == DUEL_STATE_IN_PROGRESS)
return true;
// PvP case - can't attack when attacker or target are in sanctuary

View File

@@ -83,6 +83,9 @@ public:
_breathSpells = { SPELL_INCINERATE, SPELL_TIMELAPSE, SPELL_CORROSIVEACID, SPELL_IGNITEFLESH, SPELL_FROSTBURN };
Acore::Containers::RandomResize(_breathSpells, 2);
// Hack fix: This is here to prevent him from being pulled from the floor underneath, remove it once maps are fixed.
creature->SetReactState(REACT_PASSIVE);
}
void Initialize()
@@ -118,6 +121,8 @@ public:
if (id == GUID_LEVER_USER)
{
_playerGUID = guid;
// Hack fix: This is here to prevent him from being pulled from the floor underneath, remove it once maps are fixed.
me->SetReactState(REACT_AGGRESSIVE);
}
}
@@ -237,14 +242,14 @@ class go_chromaggus_lever : public GameObjectScript
{
if (_instance->GetBossState(DATA_CHROMAGGUS) != DONE && _instance->GetBossState(DATA_CHROMAGGUS) != IN_PROGRESS)
{
if (Creature* creature = _instance->instance->GetCreature(_instance->GetGuidData(DATA_CHROMAGGUS)))
if (Creature* creature = _instance->GetCreature(DATA_CHROMAGGUS))
{
creature->SetHomePosition(homePos);
creature->GetMotionMaster()->MovePath(creature->GetEntry() * 10, false);
creature->AI()->SetGUID(player->GetGUID(), GUID_LEVER_USER);
}
if (GameObject* go = _instance->instance->GetGameObject(_instance->GetGuidData(DATA_GO_CHROMAGGUS_DOOR)))
if (GameObject* go = _instance->GetGameObject(DATA_GO_CHROMAGGUS_DOOR))
_instance->HandleGameObject(ObjectGuid::Empty, true, go);
}

View File

@@ -35,7 +35,7 @@ DoorData const doorData[] =
{ GO_PORTCULLIS_RAZORGORE_ROOM, DATA_RAZORGORE_THE_UNTAMED, DOOR_TYPE_ROOM, }, // ID 176964 || GUID 75158
{ GO_PORTCULLIS_VAELASTRASZ, DATA_VAELASTRAZ_THE_CORRUPT, DOOR_TYPE_PASSAGE }, // ID 175185 || GUID 7229
{ GO_PORTCULLIS_BROODLORD, DATA_BROODLORD_LASHLAYER, DOOR_TYPE_PASSAGE }, // ID 179365 || GUID 75159
{ GO_PORTCULLIS_CHROMAGGUS, DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179116 || GUID 75161
{ GO_PORTCULLIS_NEFARIAN, DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179116 || GUID 75161
{ GO_PORTCULLIS_NEFARIAN, DATA_NEFARIAN, DOOR_TYPE_ROOM }, // ID 179117 || GUID 75164
{ 0, 0, DOOR_TYPE_ROOM } // END
};
@@ -44,7 +44,13 @@ ObjectData const creatureData[] =
{
{ NPC_GRETHOK, DATA_GRETHOK },
{ NPC_NEFARIAN_TROOPS, DATA_NEFARIAN_TROOPS },
{ NPC_VICTOR_NEFARIUS, DATA_LORD_VICTOR_NEFARIUS }
{ NPC_VICTOR_NEFARIUS, DATA_LORD_VICTOR_NEFARIUS },
{ NPC_CHROMAGGUS, DATA_CHROMAGGUS }
};
ObjectData const objectData[] =
{
{ GO_PORTCULLIS_CHROMAGGUS, DATA_GO_CHROMAGGUS_DOOR }
};
Position const SummonPosition[8] =
@@ -73,7 +79,7 @@ public:
//SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
LoadDoorData(doorData);
LoadObjectData(creatureData, nullptr);
LoadObjectData(creatureData, objectData);
}
void Initialize() override
@@ -101,9 +107,6 @@ public:
case NPC_RAZORGORE:
razorgoreGUID = creature->GetGUID();
break;
case NPC_CHROMAGGUS:
chromaggusGUID = creature->GetGUID();
break;
case NPC_BLACKWING_DRAGON:
++addsCount[0];
if (Creature* razor = instance->GetCreature(razorgoreGUID))
@@ -166,19 +169,6 @@ public:
EggList.push_back(go->GetGUID());
}
break;
case GO_PORTCULLIS_NEFARIAN:
AddDoor(go, true);
nefarianDoorGUID = go->GetGUID();
if (GetBossState(DATA_CHROMAGGUS) != DONE)
{
HandleGameObject(ObjectGuid::Empty, false, go);
}
break;
case GO_PORTCULLIS_CHROMAGGUS:
AddDoor(go, true);
chromaggusDoorGUID = go->GetGUID();
go->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
break;
default:
break;
}
@@ -200,6 +190,8 @@ public:
return NefarianLeftTunnel;
case DATA_NEFARIAN_RIGHT_TUNNEL:
return NefarianRightTunnel;
case DATA_EGG_EVENT:
return EggEvent;
default:
break;
}
@@ -243,12 +235,6 @@ public:
}
}
break;
case DATA_CHROMAGGUS:
if (state == DONE)
{
HandleGameObject(nefarianDoorGUID, true);
}
break;
case DATA_NEFARIAN:
switch (state)
{
@@ -257,7 +243,9 @@ public:
[[fallthrough]];
case NOT_STARTED:
if (Creature* nefarian = instance->GetCreature(nefarianGUID))
{
nefarian->DespawnOrUnsummon();
}
break;
default:
break;
@@ -339,10 +327,6 @@ public:
{
case DATA_RAZORGORE_THE_UNTAMED:
return razorgoreGUID;
case DATA_CHROMAGGUS:
return chromaggusGUID;
case DATA_GO_CHROMAGGUS_DOOR:
return chromaggusDoorGUID;
default:
break;
}
@@ -496,8 +480,6 @@ public:
protected:
ObjectGuid razorgoreGUID;
ObjectGuid chromaggusGUID;
ObjectGuid chromaggusDoorGUID;
ObjectGuid nefarianGUID;
ObjectGuid nefarianDoorGUID;

View File

@@ -22,20 +22,31 @@
enum Says
{
SAY_AGGRO = 0,
SAY_RAIN_FIRE = 1,
SAY_DEATH = 2
SAY_CALL_RIDERS = 1,
SAY_DEATH = 2,
EMOTE_SUMMON_BATS = 3,
EMOTE_GREAT_HEAL = 4
};
enum Spells
{
// Intro
SPELL_GREEN_CHANNELING = 13540,
SPELL_BAT_FORM = 23966,
// Phase one
SPELL_PIERCE_ARMOR = 12097,
SPELL_BLOOD_LEECH = 22644,
SPELL_CHARGE = 22911,
SPELL_SONICBURST = 23918,
SPELL_SCREECH = 6605,
SPELL_SONIC_BURST = 23918,
SPELL_SWOOP = 23919,
// Phase two
SPELL_CURSE_OF_BLOOD = 16098,
SPELL_PSYCHIC_SCREAM = 22884,
SPELL_SHADOW_WORD_PAIN = 23952,
SPELL_MIND_FLAY = 23953,
SPELL_CHAIN_MIND_FLAY = 26044, // Right ID unknown. So disabled
SPELL_GREATERHEAL = 23954,
SPELL_BAT_FORM = 23966,
SPELL_GREATER_HEAL = 23954,
// Batriders Spell
SPELL_BOMB = 40332 // Wrong ID but Magmadars bomb is not working...
@@ -49,13 +60,19 @@ enum BatIds
enum Events
{
// Phase one
EVENT_CHARGE_JEKLIK = 1,
EVENT_PIERCE_ARMOR,
EVENT_BLOOD_LEECH,
EVENT_SONIC_BURST,
EVENT_SCREECH,
EVENT_SWOOP,
EVENT_SPAWN_BATS,
// Phase two
EVENT_CURSE_OF_BLOOD,
EVENT_PSYCHIC_SCREAM,
EVENT_SHADOW_WORD_PAIN,
EVENT_MIND_FLAY,
EVENT_CHAIN_MIND_FLAY,
EVENT_GREATER_HEAL,
EVENT_SPAWN_FLYING_BATS
};
@@ -87,6 +104,7 @@ public:
void Reset() override
{
DoCastSelf(SPELL_GREEN_CHANNELING);
_Reset();
}
@@ -100,15 +118,17 @@ public:
{
_EnterCombat();
Talk(SAY_AGGRO);
me->RemoveAurasDueToSpell(SPELL_GREEN_CHANNELING);
me->SetDisableGravity(true);
DoCastSelf(SPELL_BAT_FORM);
events.SetPhase(PHASE_ONE);
events.ScheduleEvent(EVENT_CHARGE_JEKLIK, 20000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SONIC_BURST, 8000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SCREECH, 13000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SPAWN_BATS, 60000, 0, PHASE_ONE);
me->SetCanFly(true);
DoCast(me, SPELL_BAT_FORM);
events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(10000, 20000), PHASE_ONE);
events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(5000, 15000), PHASE_ONE);
events.ScheduleEvent(EVENT_BLOOD_LEECH, urand(5000, 15000), PHASE_ONE);
events.ScheduleEvent(EVENT_SONIC_BURST, urand(5000, 15000), PHASE_ONE);
events.ScheduleEvent(EVENT_SWOOP, 20000, PHASE_ONE);
events.ScheduleEvent(EVENT_SPAWN_BATS, 30000, PHASE_ONE);
}
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override
@@ -116,14 +136,17 @@ public:
if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(50))
{
me->RemoveAurasDueToSpell(SPELL_BAT_FORM);
me->SetCanFly(false);
me->SetDisableGravity(false);
DoResetThreat();
events.SetPhase(PHASE_TWO);
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 6000, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_MIND_FLAY, 11000, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_CHAIN_MIND_FLAY, 26000, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_GREATER_HEAL, 50000, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, 10000, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, urand(5000, 15000), PHASE_TWO);
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(10000, 15000), PHASE_TWO);
events.ScheduleEvent(EVENT_PSYCHIC_SCREAM, urand(25000, 35000), PHASE_TWO);
events.ScheduleEvent(EVENT_MIND_FLAY, urand(10000, 30000), PHASE_TWO);
events.ScheduleEvent(EVENT_GREATER_HEAL, 25000, PHASE_TWO);
events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, 10000, PHASE_TWO);
return;
}
}
@@ -142,53 +165,68 @@ public:
{
switch (eventId)
{
// Phase one
case EVENT_CHARGE_JEKLIK:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
DoCast(target, SPELL_CHARGE);
AttackStart(target);
}
events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(15000, 30000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(15000, 30000), PHASE_ONE);
break;
case EVENT_PIERCE_ARMOR:
DoCastVictim(SPELL_PIERCE_ARMOR);
events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(20000, 30000), PHASE_ONE);
break;
case EVENT_BLOOD_LEECH:
DoCastVictim(SPELL_BLOOD_LEECH);
events.ScheduleEvent(EVENT_BLOOD_LEECH, urand(10000, 20000), PHASE_ONE);
break;
case EVENT_SONIC_BURST:
DoCastVictim(SPELL_SONICBURST);
events.ScheduleEvent(EVENT_SONIC_BURST, urand(8000, 13000), 0, PHASE_ONE);
DoCastVictim(SPELL_SONIC_BURST);
events.ScheduleEvent(EVENT_SONIC_BURST, urand(20000, 30000), PHASE_ONE);
break;
case EVENT_SCREECH:
DoCastVictim(SPELL_SCREECH);
events.ScheduleEvent(EVENT_SCREECH, urand(18000, 26000), 0, PHASE_ONE);
case EVENT_SWOOP:
DoCastVictim(SPELL_SWOOP);
events.ScheduleEvent(EVENT_SWOOP, urand(20000, 30000), PHASE_ONE);
break;
case EVENT_SPAWN_BATS:
Talk(EMOTE_SUMMON_BATS);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
for (uint8 i = 0; i < 6; ++i)
if (Creature* bat = me->SummonCreature(NPC_BLOODSEEKER_BAT, SpawnBat[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
bat->AI()->AttackStart(target);
events.ScheduleEvent(EVENT_SPAWN_BATS, 60000, 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SPAWN_BATS, 30000, PHASE_ONE);
break;
//Phase two
case EVENT_CURSE_OF_BLOOD:
DoCastSelf(SPELL_CURSE_OF_BLOOD);
events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, urand(25000, 30000), PHASE_TWO);
break;
case EVENT_PSYCHIC_SCREAM:
DoCastVictim(SPELL_PSYCHIC_SCREAM);
events.ScheduleEvent(EVENT_PSYCHIC_SCREAM, urand(35000, 45000), PHASE_TWO);
break;
case EVENT_SHADOW_WORD_PAIN:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
DoCast(target, SPELL_SHADOW_WORD_PAIN);
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(12000, 18000), 0, PHASE_TWO);
DoCastRandomTarget(SPELL_SHADOW_WORD_PAIN, 0, true);
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(12000, 18000), PHASE_TWO);
break;
case EVENT_MIND_FLAY:
DoCastVictim(SPELL_MIND_FLAY);
events.ScheduleEvent(EVENT_MIND_FLAY, 16000, 0, PHASE_TWO);
break;
case EVENT_CHAIN_MIND_FLAY:
me->InterruptNonMeleeSpells(false);
DoCastVictim(SPELL_CHAIN_MIND_FLAY);
events.ScheduleEvent(EVENT_CHAIN_MIND_FLAY, urand(15000, 30000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_MIND_FLAY, urand(20000, 40000), PHASE_TWO);
break;
case EVENT_GREATER_HEAL:
Talk(EMOTE_GREAT_HEAL);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_GREATERHEAL);
events.ScheduleEvent(EVENT_GREATER_HEAL, urand(25000, 35000), 0, PHASE_TWO);
DoCastSelf(SPELL_GREATER_HEAL);
events.ScheduleEvent(EVENT_GREATER_HEAL, 25000, PHASE_TWO);
break;
case EVENT_SPAWN_FLYING_BATS:
Talk(SAY_CALL_RIDERS);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
if (Creature* flyingBat = me->SummonCreature(NPC_FRENZIED_BAT, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
flyingBat->AI()->AttackStart(target);
events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, urand(10000, 15000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, urand(10000, 15000), PHASE_TWO);
break;
default:
break;

View File

@@ -23,9 +23,15 @@ SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "InstanceScript.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "temple_of_ahnqiraj.h"
ObjectData const creatureData[] =
{
{ NPC_SARTURA, DATA_SARTURA },
};
class instance_temple_of_ahnqiraj : public InstanceMapScript
{
public:
@@ -38,7 +44,10 @@ public:
struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript
{
instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) { }
instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map)
{
LoadObjectData(creatureData, nullptr);
}
//If Vem is dead...
bool IsBossDied[3];
@@ -89,12 +98,8 @@ public:
ViscidusGUID = creature->GetGUID();
break;
}
}
bool IsEncounterInProgress() const override
{
//not active in AQ40
return false;
InstanceScript::OnCreatureCreate(creature);
}
uint32 GetData(uint32 type) const override
@@ -174,7 +179,31 @@ public:
};
};
// 4052, At Battleguard Sartura
class at_battleguard_sartura : public AreaTriggerScript
{
public:
at_battleguard_sartura() : AreaTriggerScript("at_battleguard_sartura") { }
bool OnTrigger(Player* player, const AreaTrigger* /*at*/) override
{
if (InstanceScript* instance = player->GetInstanceScript())
{
if (Creature* sartura = instance->GetCreature(DATA_SARTURA))
{
if (sartura->IsAlive())
{
sartura->SetInCombatWith(player);
}
}
}
return true;
}
};
void AddSC_instance_temple_of_ahnqiraj()
{
new instance_temple_of_ahnqiraj();
new at_battleguard_sartura();
}

View File

@@ -37,7 +37,8 @@ enum DataTypes
DATA_VEKNILASH_DEATH = 11,
DATA_BUG_TRIO_DEATH = 14,
DATA_CTHUN_PHASE = 20,
DATA_VISCIDUS = 21
DATA_VISCIDUS = 21,
DATA_SARTURA = 22
};
enum Creatures
@@ -61,7 +62,8 @@ enum Creatures
NPC_KRI = 15511,
NPC_VEKLOR = 15276,
NPC_VEKNILASH = 15275,
NPC_OURO = 15517
NPC_OURO = 15517,
NPC_SARTURA = 15516
};
template <class AI, class T>