mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
Various quest script adjustments.
This commit is contained in:
parent
495a675f35
commit
532645fc88
4 changed files with 9 additions and 5 deletions
|
@ -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 )
|
switch( npcId )
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ namespace Sapphire::ScriptAPI
|
||||||
|
|
||||||
virtual void onEventItem( World::Quest& quest, Sapphire::Entity::Player& player, uint64_t actorId );
|
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 );
|
virtual void onEmote( World::Quest& quest, uint64_t actorId, uint32_t emoteId, Sapphire::Entity::Player& player );
|
||||||
|
|
||||||
|
|
|
@ -365,14 +365,18 @@ bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_
|
||||||
|
|
||||||
uint32_t questId = quest.getId() | Event::EventHandler::EventHandlerType::Quest << 16;
|
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 )
|
if( script )
|
||||||
{
|
{
|
||||||
std::string objName = eventMgr.getEventName( questId );
|
std::string objName = eventMgr.getEventName( questId );
|
||||||
|
|
||||||
PlayerMgr::sendDebug( player, "Calling: {0}.onBnpcKill nameId#{1}", objName, nameId );
|
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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue