case EVENT_FROST_BOMB:
{
++_bombCount;
float destX, destY, destZ;
std::list<GameObject*> gl;
me->GetGameObjectListWithEntryInGrid(
gl,
GO_ICE_BLOCK,
SIZE_OF_GRIDS
);
uint8 triesLeft = 10;
do
{
destX = float(rand_norm()) * 75.0f + 4350.0f;
destY = float(rand_norm()) * 75.0f + 2450.0f;
destZ = 205.0f;
me->UpdateGroundPositionZ(destX, destY, destZ);
bool ok = true;
for (std::list<GameObject*>::const_iterator itr = gl.begin();
itr != gl.end();
++itr)
{
if ((*itr)->GetExactDist2dSq(destX, destY) < 3.0f * 3.0f)
{
ok = false;
break;
}
}
if (ok)
break;
} while (--triesLeft);
me->CastSpell(
destX,
destY,
destZ,
SPELL_FROST_BOMB_TRIGGER,
false
);
if (_bombCount >= 4)
events.ScheduleEvent(EVENT_LAND, 5500ms);
else
events.ScheduleEvent(EVENT_FROST_BOMB, 6s);
break;
}