fix(Scripts/IcecrownCitadel): Fix Nerubar Broodkeeper flickering anim… (#15642)

* fix(Scripts/IcecrownCitadel): Fix Nerubar Broodkeeper flickering animation

partial cherry-pick of f8db738e8d

Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
Co-Authored-By: Houston <69751143+HoustonCore@users.noreply.github.com>
Co-Authored-By: Lucas Nascimento <keader.android@gmail.com>

* Update icecrown_citadel.cpp

* fix the spiders before sindragosa as well

* Update icecrown_citadel.cpp

---------

Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
Co-authored-by: Houston <69751143+HoustonCore@users.noreply.github.com>
Co-authored-by: Lucas Nascimento <keader.android@gmail.com>
This commit is contained in:
Skjalf
2023-03-29 01:16:37 -03:00
committed by GitHub
parent a20ce07f08
commit 8e697633b8
2 changed files with 20 additions and 8 deletions

View File

@@ -3347,13 +3347,19 @@ public:
EventMap events;
bool _didWebBeam;
void InitializeAI() override
{
me->SetDisableGravity(true);
me->SetImmuneToAll(true);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_03);
}
void Reset() override
{
events.Reset();
events.ScheduleEvent(1, 3s, 10s); // Crypt Scarabs
events.ScheduleEvent(2, 15s, 25s); // Dark Mending
events.ScheduleEvent(3, 8s, 15s); // Web Wrap
me->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD);
}
void MoveInLineOfSight(Unit* who) override
@@ -3364,9 +3370,10 @@ public:
float nx = me->GetPositionX();
float ny = me->GetPositionY();
float nz = me->GetFloorZ();
DoCastSelf(SPELL_WEB_BEAM);
me->SetHomePosition(nx, ny, nz, me->GetOrientation());
me->CastSpell(me, SPELL_WEB_BEAM, false);
me->GetMotionMaster()->MovePoint(1, nx, ny, nz, false);
me->GetMotionMaster()->MoveLand(1, nx, ny, nz, false);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
return;
}
@@ -3386,20 +3393,19 @@ public:
if (me->IsLevitating())
{
me->SetDisableGravity(false);
me->SetImmuneToAll(false);
me->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
}
}
void MovementInform(uint32 type, uint32 id) override
void MovementInform(uint32 /*type*/, uint32 id) override
{
if (type == POINT_MOTION_TYPE && id == 1)
if (id == 1)
{
if (me->IsLevitating())
{
me->SetDisableGravity(false);
me->SetOrientation(0.0f);
me->NearTeleportTo(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
me->ClearUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD);
}
}
}
@@ -3516,7 +3522,7 @@ public:
if (spider->GetPositionZ() > 220.0f)
{
spider->CastSpell(spider, SPELL_WEB_BEAM2, false);
spider->GetMotionMaster()->MovePoint(POINT_ENTER_COMBAT, spider->GetPositionX(), spider->GetPositionY(), 213.03f, false);
spider->GetMotionMaster()->MoveLand(POINT_ENTER_COMBAT, spider->GetPositionX(), spider->GetPositionY(), 213.03f, false);
}
}