mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-03 09:17:47 +00:00
fix name inconsistency with bnpc kill script callbacks
This commit is contained in:
parent
252998c194
commit
9f2dee403c
6 changed files with 9 additions and 9 deletions
|
@ -68,7 +68,7 @@ public:
|
|||
Scene00001( player );
|
||||
}
|
||||
|
||||
void onNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
|
||||
{
|
||||
if( npcId != ENEMY0 )
|
||||
return;
|
||||
|
|
|
@ -1133,7 +1133,7 @@ void Sapphire::Entity::Player::update( int64_t currTime )
|
|||
void Sapphire::Entity::Player::onMobKill( uint16_t nameId )
|
||||
{
|
||||
auto pScriptMgr = m_pFw->get< Scripting::ScriptMgr >();
|
||||
pScriptMgr->onMobKill( *getAsPlayer(), nameId );
|
||||
pScriptMgr->onBNpcKill( *getAsPlayer(), nameId );
|
||||
}
|
||||
|
||||
void Sapphire::Entity::Player::freePlayerSpawnId( uint32_t actorId )
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace Sapphire::ScriptAPI
|
|||
{
|
||||
}
|
||||
|
||||
void EventScript::onNpcKill( uint32_t npcId, Entity::Player& player )
|
||||
void EventScript::onBNpcKill( uint32_t nameId, Entity::Player& player )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace Sapphire::ScriptAPI
|
|||
|
||||
virtual void onTalk( uint32_t eventId, Sapphire::Entity::Player& player, uint64_t actorId );
|
||||
|
||||
virtual void onNpcKill( uint32_t npcId, Sapphire::Entity::Player& player );
|
||||
virtual void onBNpcKill( uint32_t nameId, Sapphire::Entity::Player& player );
|
||||
|
||||
virtual void onEmote( uint64_t actorId, uint32_t eventId, uint32_t emoteId, Sapphire::Entity::Player& player );
|
||||
|
||||
|
|
|
@ -272,20 +272,20 @@ bool Sapphire::Scripting::ScriptMgr::onEventItem( Entity::Player& player, uint32
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Sapphire::Scripting::ScriptMgr::onMobKill( Entity::Player& player, uint16_t nameId )
|
||||
bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_t nameId )
|
||||
{
|
||||
auto pEventMgr = framework()->get< World::Manager::EventMgr >();
|
||||
|
||||
std::string eventName = "onBnpcKill_" + std::to_string( nameId );
|
||||
|
||||
// loop through all active quests and try to call available onMobKill callbacks
|
||||
// loop through all active quests and try to call available onBNpcKill callbacks
|
||||
for( size_t i = 0; i < 30; i++ )
|
||||
{
|
||||
auto activeQuests = player.getQuestActive( static_cast< uint16_t >( i ) );
|
||||
if( !activeQuests )
|
||||
continue;
|
||||
|
||||
uint32_t questId = activeQuests->c.questId | 0x00010000;
|
||||
uint32_t questId = activeQuests->c.questId | Event::EventHandler::EventHandlerType::Quest << 16;
|
||||
|
||||
auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::EventScript >( questId );
|
||||
if( script )
|
||||
|
@ -294,7 +294,7 @@ bool Sapphire::Scripting::ScriptMgr::onMobKill( Entity::Player& player, uint16_t
|
|||
|
||||
player.sendDebug( "Calling: {0}.{1}", objName, eventName );
|
||||
|
||||
script->onNpcKill( nameId, player );
|
||||
script->onBNpcKill( nameId, player );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace Sapphire::Scripting
|
|||
bool onEventItem( Entity::Player& player, uint32_t eventItemId, uint32_t eventId, uint32_t castTime,
|
||||
uint64_t targetId );
|
||||
|
||||
bool onMobKill( Entity::Player& player, uint16_t nameId );
|
||||
bool onBNpcKill( Entity::Player& player, uint16_t nameId );
|
||||
|
||||
bool onCastFinish( Entity::Player& pPlayer, Entity::CharaPtr pTarget, uint32_t actionId );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue