Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-05-16 13:11:42 -06:00
committed by GitHub
9 changed files with 147 additions and 103 deletions

View File

@@ -0,0 +1,9 @@
-- DB update 2022_05_12_00 -> 2022_05_16_00
-- fixed quest 12924 spell area
UPDATE `spell_area` SET `quest_start` = 12956 WHERE `spell` = 55858;
-- (Quests) Forging an Alliance require A Spark of Hope + Mending Fences
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 19 AND `SourceEntry`=12924;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(19, 0, 12924, 0, 0, 8, 0, 12956, 0, 0, 0, 0, 0, '', 'Forging an Alliance - Requires quest rewarded'),
(19, 0, 12924, 0, 0, 8, 0, 12915, 0, 0, 0, 0, 0, '', 'Forging an Alliance - Requires quest rewarded');

View File

@@ -0,0 +1,5 @@
-- DB update 2022_05_16_00 -> 2022_05_16_01
--
DELETE FROM `smart_scripts` WHERE `entryorguid`=30331 AND `source_type`=0 AND `id`=5;
INSERT INTO `smart_scripts` VALUES
(30331,0,5,0,54,0,100,0,0,0,0,0,0,85,56606,0,0,0,0,0,1,0,0,0,0,0,0,0,0,'Jokkum - on just summoned - Cast Riding Jokkum');

View File

@@ -1550,6 +1550,10 @@ void Player::UpdateVisibilityForPlayer(bool mapChange)
void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
{
// Prevent updating visibility if player is not in world (example: LoadFromDB sets drunkstate which updates invisibility while player is not in map)
if (!IsInWorld())
return;
if (!forced)
AddToNotify(NOTIFY_VISIBILITY_CHANGED);
else if (!isBeingLoaded())

View File

@@ -764,7 +764,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData)
WorldPacket data(MSG_MOVE_KNOCK_BACK, 66);
data << guid.WriteAsPacked();
_player->m_mover->BuildMovementPacket(&data);
_player->SetCanTeleport(true);
// knockback specific info
data << movementInfo.jump.sinAngle;
data << movementInfo.jump.cosAngle;

View File

@@ -4270,6 +4270,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21);
});
// Jokkum Summon
ApplySpellFix({ 56541 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].MiscValueB = 844;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo* spellInfo = mSpellInfoMap[i];

View File

@@ -27,120 +27,133 @@
#include "SpellInfo.h"
#include "SpellScript.h"
#include "Vehicle.h"
#include "MoveSplineInit.h"
// Ours
enum eyeOfAcherus
/*######
## npc_eye_of_acherus
######*/
enum EyeOfAcherusMisc
{
EVENT_REMOVE_CONTROL = 1,
EVENT_SPEAK_1 = 2,
EVENT_LAUNCH = 3,
EVENT_REGAIN_CONTROL = 4,
SPELL_THE_EYE_OF_ACHERUS = 51852,
SPELL_EYE_OF_ACHERUS_VISUAL = 51892,
SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST = 51923,
SPELL_EYE_OF_ACHERUS_FLIGHT = 51890,
SPELL_ROOT_SELF = 51860,
EYE_TEXT_LAUNCH = 0,
EYE_TEXT_CONTROL = 1,
EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION = 1,
EVENT_UNROOT = 2,
EVENT_LAUNCH_TOWARDS_DESTINATION = 3,
EVENT_GRANT_CONTROL = 4,
EYE_POINT_DESTINATION_1 = 0,
EYE_POINT_DESTINATION_2 = 1,
SAY_LAUNCH_TOWARDS_DESTINATION = 0,
SAY_EYE_UNDER_CONTROL = 1,
SPELL_EYE_OF_ACHERUS_VISUAL = 51892,
POINT_NEW_AVALON = 1,
EYE_POINT_DESTINATION_0 = 0,
EYE_POINT_DESTINATION_1 = 1,
EYE_POINT_DESTINATION_2 = 2,
EYE_POINT_DESTINATION_3 = 3
};
class npc_eye_of_acherus : public CreatureScript
struct npc_eye_of_acherus : public ScriptedAI
{
public:
npc_eye_of_acherus() : CreatureScript("npc_eye_of_acherus") { }
CreatureAI* GetAI(Creature* creature) const override
npc_eye_of_acherus(Creature* creature) : ScriptedAI(creature)
{
return new npc_eye_of_acherusAI(creature);
creature->SetDisplayId(creature->GetCreatureTemplate()->Modelid1);
creature->SetReactState(REACT_PASSIVE);
}
struct npc_eye_of_acherusAI : public NullCreatureAI
void InitializeAI() override
{
npc_eye_of_acherusAI(Creature* creature) : NullCreatureAI(creature) { }
DoCastSelf(SPELL_ROOT_SELF);
DoCastSelf(SPELL_EYE_OF_ACHERUS_VISUAL);
_events.ScheduleEvent(EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION, 400ms);
}
EventMap events;
void InitializeAI() override
void OnCharmed(bool apply) override
{
if (!apply)
{
events.Reset();
events.ScheduleEvent(EVENT_REMOVE_CONTROL, 500);
events.ScheduleEvent(EVENT_SPEAK_1, 4000);
events.ScheduleEvent(EVENT_LAUNCH, 7000);
me->CastSpell(me, SPELL_EYE_OF_ACHERUS_VISUAL, true);
me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_THE_EYE_OF_ACHERUS);
me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST);
}
}
void MovementInform(uint32 type, uint32 point) override
void UpdateAI(uint32 diff) override
{
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
if (type == POINT_MOTION_TYPE && point == EYE_POINT_DESTINATION_2)
switch (eventId)
{
events.ScheduleEvent(EVENT_REGAIN_CONTROL, 1000);
case EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION:
if (Unit* owner = me->GetCharmerOrOwner())
{
Talk(SAY_LAUNCH_TOWARDS_DESTINATION, owner);
}
_events.ScheduleEvent(EVENT_UNROOT, 400ms);
break;
case EVENT_UNROOT:
me->RemoveAurasDueToSpell(SPELL_ROOT_SELF);
DoCastSelf(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST);
_events.ScheduleEvent(EVENT_LAUNCH_TOWARDS_DESTINATION, 1s + 200ms);
break;
case EVENT_LAUNCH_TOWARDS_DESTINATION:
{
Position const EYE_DESTINATION_1 = { 2361.21f, -5660.45f, 496.744f, 0.0f };
Position const EYE_DESTINATION_2 = { 2341.571f, -5672.797f, 538.3942f, 0.0f };
Position const EYE_DESTINATION_3 = { 1957.4f, -5844.1f, 273.867f, 0.0f };
Position const EYE_DESTINATION_4 = { 1758.01f, -5876.79f, 166.867f, 0.0f };
Movement::MoveSplineInit init(me);
init.SetFly();
if (Unit* owner = me->GetCharmerOrOwner())
{
init.SetVelocity(owner->GetSpeed(MOVE_RUN));
}
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_0, EYE_DESTINATION_1);
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_1, EYE_DESTINATION_2);
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_2, EYE_DESTINATION_3);
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_3, EYE_DESTINATION_4);
_events.ScheduleEvent(EVENT_GRANT_CONTROL, 22s);
break;
}
case EVENT_GRANT_CONTROL:
if (Unit* owner = me->GetCharmerOrOwner())
{
Talk(SAY_EYE_UNDER_CONTROL, owner);
}
me->RemoveAurasDueToSpell(SPELL_ROOT_SELF);
DoCastSelf(SPELL_EYE_OF_ACHERUS_FLIGHT);
me->RemoveAurasDueToSpell(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST);
break;
default:
break;
}
}
}
void SetControl(Player* player, bool on)
void MovementInform(uint32 movementType, uint32 pointId) override
{
if (movementType != POINT_MOTION_TYPE)
return;
switch (pointId)
{
WorldPacket data(SMSG_CLIENT_CONTROL_UPDATE, me->GetPackGUID().size() + 1);
data << me->GetPackGUID();
data << uint8(on ? 1 : 0);
player->GetSession()->SendPacket(&data);
case POINT_NEW_AVALON:
DoCastSelf(SPELL_ROOT_SELF);
break;
default:
break;
}
}
void JustSummoned(Creature* creature) override
{
if (Unit* target = creature->SelectNearbyTarget())
creature->AI()->AttackStart(target);
}
void UpdateAI(uint32 diff) override
{
events.Update(diff);
switch (events.ExecuteEvent())
{
case EVENT_REMOVE_CONTROL:
if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself())
{
me->SetUnitFlag(UNIT_FLAG_STUNNED);
SetControl(player, false);
}
break;
case EVENT_SPEAK_1:
Talk(EYE_TEXT_LAUNCH, me->GetCharmerOrOwnerPlayerOrPlayerItself());
break;
case EVENT_LAUNCH:
{
if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself())
{
player->AddAura(SPELL_EYE_OF_ACHERUS_VISUAL, player);
}
me->SetSpeed(MOVE_FLIGHT, 5.0f, true);
const Position EYE_DESTINATION_1 = { me->GetPositionX() - 40.0f, me->GetPositionY(), me->GetPositionZ() + 10.0f, 0.0f };
const Position EYE_DESTINATION_2 = { 1768.0f, -5876.0f, 153.0f, 0.0f };
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_1, EYE_DESTINATION_1);
me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_2, EYE_DESTINATION_2);
if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself())
{
player->RemoveAura(SPELL_EYE_OF_ACHERUS_VISUAL);
}
break;
}
case EVENT_REGAIN_CONTROL:
if (Player* player = me->GetCharmerOrOwnerPlayerOrPlayerItself())
{
me->RemoveUnitFlag(UNIT_FLAG_STUNNED);
me->SetSpeed(MOVE_FLIGHT, 3.3f, true);
SetControl(player, true);
Talk(EYE_TEXT_CONTROL, player);
}
break;
}
}
};
private:
EventMap _events;
};
class spell_q12641_death_comes_from_on_high_summon_ghouls : public SpellScriptLoader
@@ -1220,7 +1233,7 @@ class spell_death_knight_initiate_visual : public SpellScript
void AddSC_the_scarlet_enclave_c1()
{
// Ours
new npc_eye_of_acherus();
RegisterCreatureAI(npc_eye_of_acherus);
new spell_q12641_death_comes_from_on_high_summon_ghouls();
new npc_death_knight_initiate();
new spell_item_gift_of_the_harvester();

View File

@@ -358,7 +358,7 @@ public:
events.RepeatEvent(urand(3000, 6000));
break;
case EVENT_RANGE_CHECK:
if (!me->GetVictim()->IsWithinDist2d(me, 60.0f))
if (!me->GetVictim() || !me->GetVictim()->IsWithinDist2d(me, 60.0f))
{
EnterEvadeMode();
}

View File

@@ -942,16 +942,8 @@ namespace MMAP
return static_cast<uint32>(m_mapid) != mapID;
if (m_skipContinents)
switch (mapID)
{
case 0:
case 1:
case 530:
case 571:
return true;
default:
break;
}
if (isContinentMap(mapID))
return true;
if (m_skipJunkMaps)
switch (mapID)
@@ -1031,6 +1023,20 @@ namespace MMAP
}
}
bool MapBuilder::isContinentMap(uint32 mapID) const
{
switch (mapID)
{
case 0:
case 1:
case 530:
case 571:
return true;
default:
return false;
}
}
/**************************************************************************/
bool TileBuilder::shouldSkipTile(uint32 mapID, uint32 tileX, uint32 tileY) const
{

View File

@@ -185,6 +185,7 @@ namespace MMAP
bool shouldSkipMap(uint32 mapID) const;
bool isTransportMap(uint32 mapID) const;
bool isContinentMap(uint32 mapID) const;
rcConfig GetMapSpecificConfig(uint32 mapID, float bmin[3], float bmax[3], const TileConfig &tileConfig) const;