mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 07:07:45 +00:00
if the 'boss' is killed instantly, spawn all add phases instantly
no mercy for //gm kill
This commit is contained in:
parent
859a4a5d68
commit
92f41f8d41
1 changed files with 15 additions and 11 deletions
|
@ -61,23 +61,20 @@ public:
|
||||||
auto papa = instance.getActiveBNpcByLevelId( INIT_P_POP_PAPARIMO );
|
auto papa = instance.getActiveBNpcByLevelId( INIT_P_POP_PAPARIMO );
|
||||||
auto pPlayer = instance.getPlayerPtr();
|
auto pPlayer = instance.getPlayerPtr();
|
||||||
|
|
||||||
|
uint32_t bossHpPercent = 0;
|
||||||
|
if( boss )
|
||||||
|
bossHpPercent = boss->getHpPercent();
|
||||||
|
|
||||||
if( pPlayer && !pPlayer->isAlive() )
|
if( pPlayer && !pPlayer->isAlive() )
|
||||||
{
|
{
|
||||||
instance.fail();
|
instance.fail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( instance.getCountEnemyBNpc() == 0 && successCalled == 0 )
|
if( !ida || !papa )
|
||||||
{
|
|
||||||
instance.setCustomVar( SUCCESS_CALLED, 1 );
|
|
||||||
instance.success();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !boss || !ida || !papa )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( pair1Spawnd == 0 && boss->getHpPercent() <= 75 )
|
if( pair1Spawnd == 0 && bossHpPercent <= 75 )
|
||||||
{
|
{
|
||||||
instance.setCustomVar( SET_1_SPAWNED, 1 );
|
instance.setCustomVar( SET_1_SPAWNED, 1 );
|
||||||
auto a2 = instance.createBNpcFromLevelEntry( INIT_POP_ENEMY_B_03, 10, 0, 1440, 938,
|
auto a2 = instance.createBNpcFromLevelEntry( INIT_POP_ENEMY_B_03, 10, 0, 1440, 938,
|
||||||
|
@ -105,7 +102,7 @@ public:
|
||||||
a5->hateListAdd( pPlayer, 1 );
|
a5->hateListAdd( pPlayer, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pair2Spawnd == 0 && boss->getHpPercent() <= 50 )
|
if( pair2Spawnd == 0 && bossHpPercent <= 50 )
|
||||||
{
|
{
|
||||||
instance.setCustomVar( SET_2_SPAWNED, 1 );
|
instance.setCustomVar( SET_2_SPAWNED, 1 );
|
||||||
auto a2 = instance.createBNpcFromLevelEntry( INIT_POP_ENEMY_B_05, 10, 0, 1440, 938,
|
auto a2 = instance.createBNpcFromLevelEntry( INIT_POP_ENEMY_B_05, 10, 0, 1440, 938,
|
||||||
|
@ -133,7 +130,7 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pair3Spawnd == 0 && boss->getHpPercent() <= 25 )
|
if( pair3Spawnd == 0 && bossHpPercent <= 25 )
|
||||||
{
|
{
|
||||||
instance.setCustomVar( SET_3_SPAWNED, 1 );
|
instance.setCustomVar( SET_3_SPAWNED, 1 );
|
||||||
|
|
||||||
|
@ -148,6 +145,13 @@ public:
|
||||||
a4->hateListAdd( pPlayer, 1 );
|
a4->hateListAdd( pPlayer, 1 );
|
||||||
a5->hateListAdd( pPlayer, 1 );
|
a5->hateListAdd( pPlayer, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( instance.getCountEnemyBNpc() == 0 && successCalled == 0 )
|
||||||
|
{
|
||||||
|
instance.setCustomVar( SUCCESS_CALLED, 1 );
|
||||||
|
instance.success();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onEnterTerritory( QuestBattle& instance, Entity::Player& player, uint32_t eventId, uint16_t param1,
|
void onEnterTerritory( QuestBattle& instance, Entity::Player& player, uint32_t eventId, uint16_t param1,
|
||||||
|
|
Loading…
Add table
Reference in a new issue