1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-04 17:57:47 +00:00

Fix some compile errors

This commit is contained in:
dude22072 2022-02-23 02:14:33 -06:00
parent b57ea937ee
commit f37fb538d6
6 changed files with 29 additions and 23 deletions

View file

@ -4,6 +4,7 @@
#include "Manager/EventMgr.h" #include "Manager/EventMgr.h"
#include <Actor/Player.h> #include <Actor/Player.h>
#include <Actor/BNpc.h>
#include <ScriptObject.h> #include <ScriptObject.h>
#include <Service.h> #include <Service.h>
@ -122,9 +123,9 @@ public:
} }
} }
void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{ {
switch( entityId ) switch( bnpc.getLayoutId() )
{ {
case Enemy0: case Enemy0:
case Enemy1: case Enemy1:
@ -200,9 +201,9 @@ private:
if( !enemy0spawned && !enemy1spawned && !enemy2spawned && quest.getUI8BL() < 3 ) if( !enemy0spawned && !enemy1spawned && !enemy2spawned && quest.getUI8BL() < 3 )
{ {
auto enemy0 = instance->createBNpcFromInstanceId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy0 = instance->createBNpcFromLayoutId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
auto enemy1 = instance->createBNpcFromInstanceId( Enemy1, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy1 = instance->createBNpcFromLayoutId( Enemy1, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
auto enemy2 = instance->createBNpcFromInstanceId( Enemy2, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy2 = instance->createBNpcFromLayoutId( Enemy2, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
enemy0->hateListAddDelayed( player.getAsPlayer(), 1 ); enemy0->hateListAddDelayed( player.getAsPlayer(), 1 );
enemy1->hateListAddDelayed( player.getAsPlayer(), 1 ); enemy1->hateListAddDelayed( player.getAsPlayer(), 1 );

View file

@ -4,6 +4,7 @@
#include "Manager/EventMgr.h" #include "Manager/EventMgr.h"
#include <Actor/Player.h> #include <Actor/Player.h>
#include <Actor/BNpc.h>
#include <ScriptObject.h> #include <ScriptObject.h>
#include <Service.h> #include <Service.h>
@ -74,9 +75,9 @@ public:
} }
} }
void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{ {
switch( entityId ) switch( bnpc.getLayoutId() )
{ {
case Enemy0: case Enemy0:
case Enemy1: case Enemy1:
@ -143,9 +144,9 @@ private:
if( !enemy0spawned && !enemy1spawned && !enemy2spawned && quest.getUI8AL() < 3 ) if( !enemy0spawned && !enemy1spawned && !enemy2spawned && quest.getUI8AL() < 3 )
{ {
auto enemy0 = instance->createBNpcFromInstanceId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy0 = instance->createBNpcFromLayoutId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
auto enemy1 = instance->createBNpcFromInstanceId( Enemy1, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy1 = instance->createBNpcFromLayoutId( Enemy1, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
auto enemy2 = instance->createBNpcFromInstanceId( Enemy2, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy2 = instance->createBNpcFromLayoutId( Enemy2, 1220 /*Find the right value*/, Common::BNpcType::Enemy, player.getId() );
enemy0->hateListAdd( player.getAsPlayer(), 1 ); enemy0->hateListAdd( player.getAsPlayer(), 1 );
enemy1->hateListAdd( player.getAsPlayer(), 1 ); enemy1->hateListAdd( player.getAsPlayer(), 1 );

View file

@ -4,6 +4,7 @@
#include "Manager/EventMgr.h" #include "Manager/EventMgr.h"
#include <Actor/Player.h> #include <Actor/Player.h>
#include <Actor/BNpc.h>
#include <ScriptObject.h> #include <ScriptObject.h>
#include <Service.h> #include <Service.h>
@ -122,9 +123,9 @@ public:
} }
} }
void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{ {
switch( entityId ) switch( bnpc.getLayoutId() )
{ {
case Enemy0: case Enemy0:
{ {
@ -190,7 +191,7 @@ private:
if( !enemySpawned ) if( !enemySpawned )
{ {
auto enemy = instance->createBNpcFromInstanceId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy = instance->createBNpcFromLayoutId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() );
enemy->hateListAdd( player.getAsPlayer(), 1 ); enemy->hateListAdd( player.getAsPlayer(), 1 );
// quest.setBitFlag8( 1, true ); // quest.setBitFlag8( 1, true );
} }

View file

@ -4,6 +4,7 @@
#include "Manager/EventMgr.h" #include "Manager/EventMgr.h"
#include <Actor/Player.h> #include <Actor/Player.h>
#include <Actor/BNpc.h>
#include <ScriptObject.h> #include <ScriptObject.h>
#include <Service.h> #include <Service.h>
@ -63,9 +64,9 @@ public:
} }
} }
void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{ {
switch( nameId ) switch( bnpc.getBNpcNameId() )
{ {
case Enemy0: case Enemy0:
{ {

View file

@ -4,6 +4,7 @@
#include "Manager/EventMgr.h" #include "Manager/EventMgr.h"
#include <Actor/Player.h> #include <Actor/Player.h>
#include <Actor/BNpc.h>
#include <ScriptObject.h> #include <ScriptObject.h>
#include <Service.h> #include <Service.h>
@ -92,9 +93,9 @@ public:
} }
} }
void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{ {
switch( entityId ) switch( bnpc.getLayoutId() )
{ {
case Enemy0: case Enemy0:
case Enemy1: case Enemy1:
@ -157,8 +158,8 @@ private:
if( !enemy0Spawned && !enemy1Spawned && quest.getUI8AL() < 2) if( !enemy0Spawned && !enemy1Spawned && quest.getUI8AL() < 2)
{ {
auto enemy0 = instance->createBNpcFromInstanceId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy0 = instance->createBNpcFromLayoutId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() );
auto enemy1 = instance->createBNpcFromInstanceId( Enemy1, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy1 = instance->createBNpcFromLayoutId( Enemy1, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() );
enemy0->hateListAddDelayed( player.getAsPlayer(), 1 ); enemy0->hateListAddDelayed( player.getAsPlayer(), 1 );
enemy1->hateListAddDelayed( player.getAsPlayer(), 1 ); enemy1->hateListAddDelayed( player.getAsPlayer(), 1 );
} }

View file

@ -4,6 +4,7 @@
#include "Manager/EventMgr.h" #include "Manager/EventMgr.h"
#include <Actor/Player.h> #include <Actor/Player.h>
#include <Actor/BNpc.h>
#include <ScriptObject.h> #include <ScriptObject.h>
#include <Service.h> #include <Service.h>
@ -121,15 +122,15 @@ public:
} }
} }
void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override void onBNpcKill( World::Quest& quest, Entity::BNpc& bnpc, Entity::Player& player ) override
{ {
if( entityId == Enemy0 ) if( bnpc.getLayoutId() == Enemy0 )
{ {
eventMgr().sendEventNotice( player, getId(), 0, 0 ); eventMgr().sendEventNotice( player, getId(), 0, 0 );
quest.setSeq( Seq2 ); quest.setSeq( Seq2 );
quest.setUI8BH( 1 ); quest.setUI8BH( 1 );
} }
else if( nameId == Enemy1 ) else if( bnpc.getBNpcNameId() == Enemy1 )
{ {
} }
} }
@ -202,7 +203,7 @@ private:
if( !enemySpawned ) if( !enemySpawned )
{ {
auto enemy = instance->createBNpcFromInstanceId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() ); auto enemy = instance->createBNpcFromLayoutId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy, player.getId() );
enemy->hateListAdd( player.getAsPlayer(), 1 ); enemy->hateListAdd( player.getAsPlayer(), 1 );
} }
} }