mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-07 11:17:46 +00:00
Fixing trigger ownder script and small clang tidy stuff
This commit is contained in:
parent
33533421b7
commit
dfac661763
4 changed files with 8 additions and 14 deletions
|
@ -578,8 +578,8 @@ void Sapphire::Entity::BNpc::deaggro( const Sapphire::Entity::CharaPtr& pChara )
|
|||
|
||||
if( getTriggerOwnerId() == pChara->getId() )
|
||||
{
|
||||
auto pScript = std::make_shared< Scripting::ScriptMgr >();
|
||||
pScript->onTriggerOwnerDeaggro( *pChara->getAsPlayer(), *getAsBNpc() );
|
||||
auto& scriptMgr = Common::Service< Scripting::ScriptMgr >::ref();
|
||||
scriptMgr.onTriggerOwnerDeaggro( *pChara->getAsPlayer(), *getAsBNpc() );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -421,8 +421,7 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
|
|||
|
||||
sscanf( params.c_str(), "%d %d %hu", &id, &duration, ¶m );
|
||||
|
||||
auto effect = StatusEffect::make_StatusEffect( id, player.getAsPlayer(), player.getAsPlayer(),
|
||||
duration, 3000 );
|
||||
auto effect = StatusEffect::make_StatusEffect( id, player.getAsPlayer(), player.getAsPlayer(), duration, 3000 );
|
||||
effect->setParam( param );
|
||||
|
||||
player.addStatusEffect( effect );
|
||||
|
@ -538,7 +537,7 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
|
|||
|
||||
auto effectPacket = std::make_shared< EffectPacket >( player.getId(), param1 );
|
||||
effectPacket->setRotation( Common::Util::floatToUInt16Rot( player.getRot() ) );
|
||||
effectPacket->setTargetActor( player.getTargetId() );
|
||||
effectPacket->setTargetActor( static_cast< uint32_t >( player.getTargetId() ) );
|
||||
|
||||
Common::CalcResultParam entry{};
|
||||
entry.Value = static_cast< int16_t >( param1 );
|
||||
|
@ -563,8 +562,7 @@ void Sapphire::World::Manager::DebugCommandMgr::add( char* data, Entity::Player&
|
|||
|
||||
}
|
||||
|
||||
void Sapphire::World::Manager::DebugCommandMgr::get( char* data, Entity::Player& player,
|
||||
std::shared_ptr< DebugCommand > command )
|
||||
void Sapphire::World::Manager::DebugCommandMgr::get( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
|
||||
{
|
||||
auto& exdData = Common::Service< Data::ExdData >::ref();
|
||||
std::string subCommand;
|
||||
|
@ -604,8 +602,7 @@ void Sapphire::World::Manager::DebugCommandMgr::get( char* data, Entity::Player&
|
|||
}
|
||||
|
||||
void
|
||||
Sapphire::World::Manager::DebugCommandMgr::injectPacket( char* data, Entity::Player& player,
|
||||
std::shared_ptr< DebugCommand > command )
|
||||
Sapphire::World::Manager::DebugCommandMgr::injectPacket( char* data, Entity::Player& player, std::shared_ptr< DebugCommand > command )
|
||||
{
|
||||
auto& server = Common::Service< World::WorldServer >::ref();
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ bool Sapphire::Scripting::ScriptMgr::onEventItem( Entity::Player& player, uint32
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Sapphire::Scripting::ScriptMgr::onTriggerOwnerDeaggro( Entity::Player& player, Entity::BNpc& bnpc )
|
||||
void Sapphire::Scripting::ScriptMgr::onTriggerOwnerDeaggro( Entity::Player& player, Entity::BNpc& bnpc )
|
||||
{
|
||||
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
|
||||
|
||||
|
@ -431,15 +431,12 @@ bool Sapphire::Scripting::ScriptMgr::onTriggerOwnerDeaggro( Entity::Player& play
|
|||
|
||||
PlayerMgr::sendDebug( player, "Calling: {0}.onTriggerOwnerDeaggro layoutId#{1}", objName, bnpc.getLayoutId() );
|
||||
|
||||
|
||||
World::Quest preQ = quest;
|
||||
script->onTriggerOwnerDeaggro( quest, bnpc, player );
|
||||
if( quest != preQ )
|
||||
player.updateQuest( quest );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_t nameId, uint32_t layoutId )
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace Sapphire::Scripting
|
|||
|
||||
bool onBNpcKill( Entity::Player& player, uint16_t nameId, uint32_t layoutId );
|
||||
|
||||
bool onTriggerOwnerDeaggro( Entity::Player& player, Entity::BNpc& bnpc );
|
||||
void onTriggerOwnerDeaggro( Entity::Player& player, Entity::BNpc& bnpc );
|
||||
|
||||
bool onEObjHit( Entity::Player& player, uint64_t actorId, uint32_t actionId );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue