| 274 | } |
| 275 | |
| 276 | bool Sapphire::Scripting::ScriptMgr::onBNpcKill( Entity::Player& player, uint16_t nameId ) |
| 277 | { |
| 278 | auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref(); |
| 279 | |
| 280 | // loop through all active quests and try to call available onBNpcKill callbacks |
| 281 | for( size_t i = 0; i < 30; i++ ) |
| 282 | { |
| 283 | auto activeQuests = player.getQuestActive( static_cast< uint16_t >( i ) ); |
| 284 | if( !activeQuests ) |
| 285 | continue; |
| 286 | |
| 287 | uint32_t questId = activeQuests->c.questId | Event::EventHandler::EventHandlerType::Quest << 16; |
| 288 | |
| 289 | auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::EventScript >( questId ); |
| 290 | if( script ) |
| 291 | { |
| 292 | std::string objName = eventMgr.getEventName( questId ); |
| 293 | |
| 294 | player.sendDebug( "Calling: {0}.onBnpcKill nameId#{1}", objName, nameId ); |
| 295 | |
| 296 | script->onBNpcKill( nameId, player ); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | return true; |
| 301 | } |
| 302 | |
| 303 | bool Sapphire::Scripting::ScriptMgr::onEObjHit( Sapphire::Entity::Player& player, uint64_t actorId, uint32_t actionId ) |
| 304 | { |
no test coverage detected