Skip to content

Commit

Permalink
[Core/Boss] Oculus/Orum, fix spawn mob position
Browse files Browse the repository at this point in the history
  • Loading branch information
lellonicole committed Jul 10, 2016
1 parent 9fd2287 commit c1db268
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
Expand Up @@ -124,7 +124,7 @@ class boss_urom : public CreatureScript
me->ApplySpellImmune(0, IMMUNITY_ID, 49838, true);
}

void EnterCombat(Unit* who)
void EnterCombat(Unit* /*who*/)
{
if( lock )
return;
Expand Down Expand Up @@ -198,32 +198,54 @@ class boss_urom : public CreatureScript
me->ResetPlayerDamageReq();
}

void JustDied(Unit* killer)
void JustDied(Unit* /*killer*/)
{
Talk(SAY_DEATH);

if (pInstance)
pInstance->SetData(DATA_UROM, DONE);
}

void KilledUnit(Unit *victim)
void KilledUnit(Unit* /*victim*/)
{
Talk(SAY_PLAYER_KILL);
}

void SpellHit(Unit* caster, const SpellInfo* spell)
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
{
switch( spell->Id )
{
case SPELL_SUMMON_MENAGERIE_1:
{
for( uint8 i=0; i<4; ++i )
me->SummonCreature(summons[0][i], cords[0][0] + ((i%2) ? 4.0f : -4.0f), cords[0][1] + (i<2 ? 4.0f : -4.0f), cords[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
uint8 phase = GetPhaseByCurrentPosition();
me->SetHomePosition(cords[phase+1][0], cords[phase+1][1], cords[phase+1][2], cords[phase+1][3]);
me->DestroyForNearbyPlayers();
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATION, true);
releaseLockTimer = 1;
}
break;
case SPELL_SUMMON_MENAGERIE_2:
{
for( uint8 i=0; i<4; ++i )
me->SummonCreature(summons[1][i], cords[1][0] + ((i%2) ? 4.0f : -4.0f), cords[1][1] + (i<2 ? 4.0f : -4.0f), cords[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
uint8 phase = GetPhaseByCurrentPosition();
me->SetHomePosition(cords[phase+1][0], cords[phase+1][1], cords[phase+1][2], cords[phase+1][3]);
me->DestroyForNearbyPlayers();
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATION, true);
releaseLockTimer = 1;
}
break;
case SPELL_SUMMON_MENAGERIE_3:
{
me->DestroyForNearbyPlayers();
uint8 phase = GetPhaseByCurrentPosition();
for( uint8 i=0; i<4; ++i )
me->SummonCreature(summons[phase][i], cords[phase][0] + ((i%2) ? 4.0f : -4.0f), cords[phase][1] + (i<2 ? 4.0f : -4.0f), cords[phase][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
+ me->SummonCreature(summons[2][i], cords[2][0] + ((i%2) ? 4.0f : -4.0f), cords[2][1] + (i<2 ? 4.0f : -4.0f), cords[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
uint8 phase = GetPhaseByCurrentPosition();
me->SetHomePosition(cords[phase+1][0], cords[phase+1][1], cords[phase+1][2], cords[phase+1][3]);
me->DestroyForNearbyPlayers();
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATION, true);
releaseLockTimer = 1;
Expand All @@ -249,7 +271,7 @@ class boss_urom : public CreatureScript
}
}

void MoveInLineOfSight(Unit* who) {}
void MoveInLineOfSight(Unit* /*who*/) {}

void UpdateAI(uint32 diff)
{
Expand Down

8 comments on commit c1db268

@lellonicole
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks but I do not care what you think.
It works and that's okay

@lellonicole
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's so wrong with the code? Leaving aside the formatting

@lellonicole
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before when? What are you saying? What are you comparing it to?

@lellonicole
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without my changes mobs spawn in incorrect position... my changes isn't useless... -.- is not a beautiful vision (formatting), but works done.

@lellonicole
Copy link
Contributor Author

@lellonicole lellonicole commented on c1db268 Aug 10, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lellonicole
Copy link
Contributor Author

@lellonicole lellonicole commented on c1db268 Aug 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:
-Teleport boss when he was hitted by spell menagerie
-uint8 phase = GetPhaseByCurrentPosition();
-me->SummonCreature(summons[phase][i]

-me->DestroyForNearbyPlayers(); (off combat)..

Now:
-Teleport boss to next platform when he was hitted by spell
-Specify position of previous platform and spawn mobs: me->SummonCreature(summons**[2][i]**, cords[2][0] + ((i%2) ecc..
-uint8 phase = **GetPhase**ByCurrentPosition();
-me->DestroyForNearbyPlayers(); (off combat)..

@lellonicole
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DevRival are you sure you understand the code? XD

@FrancescoBorzi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DevRival if you think some code can be cleaned, you can open a PR to do that

Please sign in to comment.