Skip to content

Instantly share code, notes, and snippets.

@residentkrm
Last active August 29, 2015 14:02
Show Gist options
  • Save residentkrm/3f374bebf02fb968b0ec to your computer and use it in GitHub Desktop.
Save residentkrm/3f374bebf02fb968b0ec to your computer and use it in GitHub Desktop.
boss_twin_walkyrAI::SummonColorballs
void SummonColorballs(uint8 quantity)
{
// ToCCommonLoc[1]: {563.672974f, 139.571f, 393.837006f, 0}
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
float y = y0;
for (uint8 i = 0; i < quantity; i++)
{
float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
if (urand(0, 1))
y = y0 + sqrt(pow(r, 2) - pow((x-x0), 2));
else
y = y0 - sqrt(pow(r, 2) - pow((x-x0), 2));
me->SummonCreature(m_uiColorballNpcId, x, y, me->GetPositionZ(), TEMPSUMMON_CORPSE_DESPAWN);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment