1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 22:37:45 +00:00

Various quest script adjustments.

This commit is contained in:
Mordred 2021-12-21 12:02:22 +01:00
parent 495a675f35
commit 532645fc88
4 changed files with 9 additions and 5 deletions

View file

@ -98,7 +98,7 @@ class SubFst033 : public Sapphire::ScriptAPI::QuestScript
}
void onBNpcKill( uint32_t npcId, Entity::Player& player ) override
void onBNpcKill( World::Quest& quest, uint32_t npcId, Entity::Player& player ) override
{
switch( npcId )
{

View file

@ -146,7 +146,7 @@ namespace Sapphire::ScriptAPI
{
}
void QuestScript::onBNpcKill( uint32_t nameId, Entity::Player& player )
void QuestScript::onBNpcKill( World::Quest& quest, uint32_t nameId, Entity::Player& player )
{
}

View file

@ -210,7 +210,7 @@ namespace Sapphire::ScriptAPI
virtual void onEventItem( World::Quest& quest, Sapphire::Entity::Player& player, uint64_t actorId );
virtual void onBNpcKill( uint32_t nameId, Sapphire::Entity::Player& player );
virtual void onBNpcKill( World::Quest& quest, uint32_t nameId, Sapphire::Entity::Player& player );
virtual void onEmote( World::Quest& quest, uint64_t actorId, uint32_t emoteId, Sapphire::Entity::Player& player );

View file

@ -365,14 +365,18 @@ bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_
uint32_t questId = quest.getId() | Event::EventHandler::EventHandlerType::Quest << 16;
auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::EventScript >( questId );
auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::QuestScript >( questId );
if( script )
{
std::string objName = eventMgr.getEventName( questId );
PlayerMgr::sendDebug( player, "Calling: {0}.onBnpcKill nameId#{1}", objName, nameId );
script->onBNpcKill( nameId, player );
World::Quest preQ = quest;
script->onBNpcKill( quest, nameId, player );
if( quest != preQ )
player.updateQuest( quest );
}
}