| 301 | } |
| 302 | |
| 303 | bool Sapphire::Scripting::ScriptMgr::onEObjHit( Sapphire::Entity::Player& player, uint64_t actorId, uint32_t actionId ) |
| 304 | { |
| 305 | auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref(); |
| 306 | bool didCallScript = false; |
| 307 | |
| 308 | for( size_t i = 0; i < 30; i++ ) |
| 309 | { |
| 310 | auto activeQuests = player.getQuestActive( static_cast< uint16_t >( i ) ); |
| 311 | if( !activeQuests ) |
| 312 | continue; |
| 313 | |
| 314 | uint32_t questId = activeQuests->c.questId | Event::EventHandler::EventHandlerType::Quest << 16; |
| 315 | |
| 316 | auto script = m_nativeScriptMgr->getScript< Sapphire::ScriptAPI::EventScript >( questId ); |
| 317 | if( script ) |
| 318 | { |
| 319 | didCallScript = true; |
| 320 | std::string objName = eventMgr.getEventName( questId ); |
| 321 | |
| 322 | player.sendDebug( "Calling: {0}.onEObjHit actorId#{1}", objName, actorId ); |
| 323 | |
| 324 | script->onEObjHit( player, actorId, actionId ); |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | return didCallScript; |
| 329 | } |
| 330 | |
| 331 | bool Sapphire::Scripting::ScriptMgr::onExecute( World::Action::Action& action ) |
| 332 | { |
no test coverage detected