diff --git a/src/scripts/quest/subquest/gridania/SubFst033.cpp b/src/scripts/quest/subquest/gridania/SubFst033.cpp index fc426f8d..d1ca8837 100644 --- a/src/scripts/quest/subquest/gridania/SubFst033.cpp +++ b/src/scripts/quest/subquest/gridania/SubFst033.cpp @@ -98,9 +98,9 @@ class SubFst033 : public Sapphire::ScriptAPI::QuestScript } - void onBNpcKill( World::Quest& quest, uint32_t npcId, Entity::Player& player ) override + void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override { - switch( npcId ) + switch( entityId ) { case Enemy0: { break; } case Enemy1: { break; } diff --git a/src/tools/quest_parser/main.cpp b/src/tools/quest_parser/main.cpp index cbdf1845..cbca4a16 100644 --- a/src/tools/quest_parser/main.cpp +++ b/src/tools/quest_parser/main.cpp @@ -390,9 +390,9 @@ createScript( std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel:: if( !enemy_ids.empty() ) scriptEntry += std::string( - " void onBNpcKill( uint32_t npcId, Entity::Player& player ) override\n" + " void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) override\n" " {\n" - " switch( npcId )\n" + " switch( entityId )\n" " {\n" ); for( auto enemy : enemy_strings ) @@ -406,7 +406,7 @@ createScript( std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel:: if( !action_ids.empty() ) actionEntry += std::string( - " void onEObjHit( uint32_t npcId, Entity::Player& player, uint32_t actionId )\n" + " void onEObjHit( World::Quest& quest, uint32_t npcId, Entity::Player& player, uint32_t actionId )\n" " {\n" " switch( actionId )\n" " {\n" ); diff --git a/src/world/Actor/BNpc.cpp b/src/world/Actor/BNpc.cpp index ffb493de..644f0d67 100644 --- a/src/world/Actor/BNpc.cpp +++ b/src/world/Actor/BNpc.cpp @@ -741,7 +741,7 @@ void Sapphire::Entity::BNpc::onDeath() if( pPlayer ) { auto& playerMgr = Common::Service< World::Manager::PlayerMgr >::ref(); - playerMgr.onMobKill( *pPlayer, static_cast< uint16_t >( m_bNpcNameId ) ); + playerMgr.onMobKill( *pPlayer, static_cast< uint16_t >( m_bNpcNameId ), m_id ); } } hateListClear(); diff --git a/src/world/Manager/PlayerMgr.cpp b/src/world/Manager/PlayerMgr.cpp index 746d82eb..e0d243a0 100644 --- a/src/world/Manager/PlayerMgr.cpp +++ b/src/world/Manager/PlayerMgr.cpp @@ -252,10 +252,10 @@ void PlayerMgr::onMountUpdate( Sapphire::Entity::Player& player, uint32_t mountI } } -void PlayerMgr::onMobKill( Sapphire::Entity::Player& player, uint16_t nameId ) +void PlayerMgr::onMobKill( Sapphire::Entity::Player& player, uint16_t nameId, uint32_t entityId ) { auto& scriptMgr = Common::Service< Scripting::ScriptMgr >::ref(); - scriptMgr.onBNpcKill( player, nameId ); + scriptMgr.onBNpcKill( player, nameId, entityId ); if( player.isActionLearned( Common::UnlockEntry::HuntingLog ) ) { diff --git a/src/world/Manager/PlayerMgr.h b/src/world/Manager/PlayerMgr.h index ebbdb53f..ba43c7af 100644 --- a/src/world/Manager/PlayerMgr.h +++ b/src/world/Manager/PlayerMgr.h @@ -40,7 +40,7 @@ class PlayerMgr void onMountUpdate( Sapphire::Entity::Player& player, uint32_t mountId ); - void onMobKill( Sapphire::Entity::Player& player, uint16_t nameId ); + void onMobKill( Sapphire::Entity::Player& player, uint16_t nameId, uint32_t entityId ); void onHateListChanged( Sapphire::Entity::Player& player ); diff --git a/src/world/Script/NativeScriptApi.cpp b/src/world/Script/NativeScriptApi.cpp index 83179c94..352f41d8 100644 --- a/src/world/Script/NativeScriptApi.cpp +++ b/src/world/Script/NativeScriptApi.cpp @@ -146,7 +146,7 @@ namespace Sapphire::ScriptAPI { } - void QuestScript::onBNpcKill( World::Quest& quest, uint32_t nameId, Entity::Player& player ) + void QuestScript::onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Entity::Player& player ) { } diff --git a/src/world/Script/NativeScriptApi.h b/src/world/Script/NativeScriptApi.h index 219aa0aa..6cf8a83a 100644 --- a/src/world/Script/NativeScriptApi.h +++ b/src/world/Script/NativeScriptApi.h @@ -210,7 +210,7 @@ namespace Sapphire::ScriptAPI virtual void onEventItem( World::Quest& quest, Sapphire::Entity::Player& player, uint64_t actorId ); - virtual void onBNpcKill( World::Quest& quest, uint32_t nameId, Sapphire::Entity::Player& player ); + virtual void onBNpcKill( World::Quest& quest, uint16_t nameId, uint32_t entityId, Sapphire::Entity::Player& player ); virtual void onEmote( World::Quest& quest, uint64_t actorId, uint32_t emoteId, Sapphire::Entity::Player& player ); diff --git a/src/world/Script/ScriptMgr.cpp b/src/world/Script/ScriptMgr.cpp index 2cc6a542..b2915b8f 100644 --- a/src/world/Script/ScriptMgr.cpp +++ b/src/world/Script/ScriptMgr.cpp @@ -352,7 +352,7 @@ bool Sapphire::Scripting::ScriptMgr::onEventItem( Entity::Player& player, uint32 return false; } -bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_t nameId ) +bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_t nameId, uint32_t entityId ) { auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref(); @@ -374,7 +374,7 @@ bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_ World::Quest preQ = quest; - script->onBNpcKill( quest, nameId, player ); + script->onBNpcKill( quest, nameId, entityId, player ); if( quest != preQ ) player.updateQuest( quest ); } diff --git a/src/world/Script/ScriptMgr.h b/src/world/Script/ScriptMgr.h index d9a14f27..04a62153 100644 --- a/src/world/Script/ScriptMgr.h +++ b/src/world/Script/ScriptMgr.h @@ -66,7 +66,7 @@ namespace Sapphire::Scripting bool onEventItem( Entity::Player& player, uint32_t eventItemId, uint32_t eventId, uint64_t targetId ); - bool onBNpcKill( Entity::Player& player, uint16_t nameId ); + bool onBNpcKill( Entity::Player& player, uint16_t nameId, uint32_t entityId ); bool onEObjHit( Entity::Player& player, uint64_t actorId, uint32_t actionId );