1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-02 00:47:45 +00:00
sapphire/src/world/Encounter/InstanceContent/IfritNormal.h

53 lines
1.2 KiB
C
Raw Normal View History

#include <Encounter/EncounterFight.h>
#include <Encounter/EncounterTimeline.h>
namespace Sapphire
{
2023-03-24 11:21:09 -03:00
class IfritEncounterFight : public EncounterFight
{
2023-03-24 11:21:09 -03:00
private:
static constexpr int NPC_IFRIT = 4126276;
static constexpr int VAL_IFRIT_HP = 13884;
static constexpr int ACT_HELLFIRE = 0;
2023-03-08 14:36:53 -03:00
public:
2023-03-24 11:21:09 -03:00
IfritEncounterFight( InstanceContentPtr pInstance ) : EncounterFight( pInstance )
{
pInstance->setEncounterTimeline( "IfritNormal" );
2023-03-24 11:21:09 -03:00
};
2023-03-24 11:21:09 -03:00
void init() override
{
2023-03-24 11:21:09 -03:00
m_startTime = 0;
2023-03-08 14:36:53 -03:00
2023-03-24 11:21:09 -03:00
// todo: i don't like this
auto boss = m_pInstance->createBNpcFromLayoutId( NPC_IFRIT, VAL_IFRIT_HP, Common::BNpcType::Enemy );
2023-03-24 12:00:42 -03:00
boss->init();
2023-03-24 11:21:09 -03:00
addBNpc( boss );
}
2023-03-24 11:21:09 -03:00
void start() override
{
2023-03-08 14:36:53 -03:00
}
2023-03-24 11:21:09 -03:00
void reset() override
{
2023-03-24 11:21:09 -03:00
if( auto boss = m_pInstance->getActiveBNpcByLayoutId( NPC_IFRIT ); boss )
2023-03-08 14:36:53 -03:00
{
2023-03-24 11:21:09 -03:00
removeBNpc( NPC_IFRIT );
m_pInstance->removeActor( boss );
2023-03-08 14:36:53 -03:00
}
m_pInstance->getEncounterTimeline().reset( getInstance() );
2023-03-08 14:36:53 -03:00
2023-03-24 11:21:09 -03:00
init();
}
2023-03-08 14:36:53 -03:00
void update( uint64_t deltaTime ) override
{
m_pInstance->getEncounterTimeline().update( getInstance(), deltaTime );
}
};
2025-01-04 12:28:50 -03:00
}// namespace Sapphire