mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 16:17:46 +00:00
Merge pull request #561 from NotAdam/develop
fix self target actions not targeting correctly, fix chasing shadows being uncompletable
This commit is contained in:
commit
ff34636777
3 changed files with 12 additions and 10 deletions
|
@ -61,16 +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( !boss || !ida || !papa )
|
if( !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,
|
||||||
|
@ -98,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,
|
||||||
|
@ -126,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,7 +152,6 @@ public:
|
||||||
instance.success();
|
instance.success();
|
||||||
return;
|
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,
|
||||||
|
|
|
@ -491,7 +491,7 @@ bool Sapphire::Action::Action::consumeResources()
|
||||||
|
|
||||||
bool Sapphire::Action::Action::snapshotAffectedActors( std::vector< Entity::CharaPtr >& actors )
|
bool Sapphire::Action::Action::snapshotAffectedActors( std::vector< Entity::CharaPtr >& actors )
|
||||||
{
|
{
|
||||||
for( const auto& actor : m_pSource->getInRangeActors() )
|
for( const auto& actor : m_pSource->getInRangeActors( true ) )
|
||||||
{
|
{
|
||||||
// check for initial target validity based on flags in action exd (pc/enemy/etc.)
|
// check for initial target validity based on flags in action exd (pc/enemy/etc.)
|
||||||
if( !preFilterActor( *actor ) )
|
if( !preFilterActor( *actor ) )
|
||||||
|
@ -515,9 +515,8 @@ bool Sapphire::Action::Action::snapshotAffectedActors( std::vector< Entity::Char
|
||||||
player->sendDebug( "hit actor#{}", actor->getId() );
|
player->sendDebug( "hit actor#{}", actor->getId() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( actors.empty() )
|
|
||||||
return false;
|
return !actors.empty();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sapphire::Action::Action::addActorFilter( World::Util::ActorFilterPtr filter )
|
void Sapphire::Action::Action::addActorFilter( World::Util::ActorFilterPtr filter )
|
||||||
|
|
|
@ -385,7 +385,7 @@ uint32_t Sapphire::QuestBattle::getQuestId() const
|
||||||
uint32_t Sapphire::QuestBattle::getCountEnemyBNpc()
|
uint32_t Sapphire::QuestBattle::getCountEnemyBNpc()
|
||||||
{
|
{
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
for( auto bnpcIt : m_bNpcMap )
|
for( const auto& bnpcIt : m_bNpcMap )
|
||||||
{
|
{
|
||||||
if( bnpcIt.second->getEnemyType() == 4 && bnpcIt.second->isAlive() )
|
if( bnpcIt.second->getEnemyType() == 4 && bnpcIt.second->isAlive() )
|
||||||
count++;
|
count++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue