Skip to content

Commit

Permalink
Scripts/Trial of the Crusader: Fix height position of Permafrost cast…
Browse files Browse the repository at this point in the history
…ed by Frost Sphere.

It needs option "vmap.enableHeight = 1" to work properly.
  • Loading branch information
Norfik committed Jan 7, 2012
1 parent 9919349 commit fbe3eaf
Showing 1 changed file with 8 additions and 18 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -568,12 +568,11 @@ class mob_frost_sphere : public CreatureScript
} }


bool m_bFall; bool m_bFall;
uint32 m_uiPermafrostTimer; float x, y, z;


void Reset() void Reset()
{ {
m_bFall = false; m_bFall = false;
m_uiPermafrostTimer = 0;
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
me->SetFlying(true); me->SetFlying(true);
me->SetDisplayId(25144); me->SetDisplayId(25144);
Expand All @@ -590,11 +589,13 @@ class mob_frost_sphere : public CreatureScript
if (!m_bFall) if (!m_bFall)
{ {
m_bFall = true; m_bFall = true;
me->SetFlying(false);
me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MoveIdle();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//At hit the ground //At hit the ground
me->GetMotionMaster()->MoveFall(142.2f, 0); me->GetPosition(x, y, z);
z = me->GetMap()->GetHeight(x, y, z, true, 50);
me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
me->GetMotionMaster()->MoveFall(z, 0);
//me->FallGround(); //need correct vmap use (i believe it isn't working properly right now) //me->FallGround(); //need correct vmap use (i believe it isn't working properly right now)
} }
} }
Expand All @@ -607,24 +608,13 @@ class mob_frost_sphere : public CreatureScript
switch (uiId) switch (uiId)
{ {
case 0: case 0:
m_uiPermafrostTimer = IN_MILLISECONDS;
break;
}
}

void UpdateAI(const uint32 uiDiff)
{
if (m_uiPermafrostTimer)
{
if (m_uiPermafrostTimer <= uiDiff)
{
m_uiPermafrostTimer = 0;
me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE); me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
me->SetDisplayId(11686); me->SetDisplayId(11686);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); me->Relocate(x, y, z, me->GetOrientation());
DoCast(SPELL_PERMAFROST_VISUAL); DoCast(SPELL_PERMAFROST_VISUAL);
DoCast(SPELL_PERMAFROST); DoCast(SPELL_PERMAFROST);
} else m_uiPermafrostTimer -= uiDiff; me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f);
break;
} }
} }
}; };
Expand Down

0 comments on commit fbe3eaf

Please sign in to comment.