diff --git a/scripts/native/aetheryte/Aetheryte.cpp b/scripts/native/aetheryte/Aetheryte.cpp index 1b37c221..15a23759 100644 --- a/scripts/native/aetheryte/Aetheryte.cpp +++ b/scripts/native/aetheryte/Aetheryte.cpp @@ -29,18 +29,19 @@ public: } else if( param1 == 512 ) // aethernet access { - if( param2 == 2 ) // register favored destination - { - - } - else if( param2 == 0xC3E1 ) // register free destination - { - - } - else if( param2 == 4 ) + if( param2 == 4 ) { player.teleport( param3, 2 ); } + else if( param2 == 2 ) // register favored destination + { + + } +// else if( param2 == 0xC3E1 ) // register free destination +// { +// +// } + } } ); } @@ -60,7 +61,7 @@ public: player.learnAction( ACTION_TELEPORT ); } }, - [] ( Entity::Player& ply, uint32_t evntId, uint64_t additional ) + [] ( Entity::Player& player, uint32_t eventId, uint64_t additional ) {}, 0 ); } } diff --git a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp index 9dc2bcab..3325b985 100644 --- a/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp +++ b/src/servers/Server_Zone/DebugCommand/DebugCommandHandler.cpp @@ -36,8 +36,6 @@ #include -using DebugCommandPtr = boost::shared_ptr< DebugCommand >; - extern Core::Scripting::ScriptManager g_scriptMgr; extern Core::Data::ExdData g_exdData; extern Core::Logger g_log; @@ -121,7 +119,7 @@ void Core::DebugCommandHandler::execCommand( char * data, Entity::Player& player // Definition of the commands /////////////////////////////////////////////////////////////////////////////////////// -void Core::DebugCommandHandler::help( char* data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::help( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { player.sendDebug( "Registered debug commands:" ); for ( auto cmd : m_commandMap ) @@ -133,7 +131,7 @@ void Core::DebugCommandHandler::help( char* data, Entity::Player& player, DebugC } } -void Core::DebugCommandHandler::set( char * data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::set( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand = ""; std::string params = ""; @@ -285,7 +283,7 @@ void Core::DebugCommandHandler::set( char * data, Entity::Player& player, DebugC } -void Core::DebugCommandHandler::add( char * data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::add( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand; std::string params = ""; @@ -402,7 +400,7 @@ void Core::DebugCommandHandler::add( char * data, Entity::Player& player, DebugC } -void Core::DebugCommandHandler::get( char * data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::get( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand; std::string params = ""; @@ -446,21 +444,21 @@ void Core::DebugCommandHandler::get( char * data, Entity::Player& player, DebugC } -void Core::DebugCommandHandler::injectPacket( char * data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::injectPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { auto pSession = g_serverZone.getSession( player.getId() ); if( pSession ) pSession->getZoneConnection()->injectPacket( data + 7, player ); } -void Core::DebugCommandHandler::injectChatPacket( char * data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::injectChatPacket( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { auto pSession = g_serverZone.getSession( player.getId() ); if( pSession ) pSession->getChatConnection()->injectPacket( data + 8, player ); } -void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand; @@ -507,19 +505,19 @@ void Core::DebugCommandHandler::nudge( char * data, Entity::Player& player, Debu } } -void Core::DebugCommandHandler::serverInfo( char * data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::serverInfo( char * data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { player.sendDebug( "SapphireServer " + Version::VERSION + "\nRev: " + Version::GIT_HASH ); player.sendDebug( "Compiled: " __DATE__ " " __TIME__ ); player.sendDebug( "Sessions: " + std::to_string( g_serverZone.getSessionCount() ) ); } -void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, DebugCommandPtr command ) +void Core::DebugCommandHandler::unlockCharacter( char* data, Entity::Player& player, boost::shared_ptr< DebugCommand > command ) { player.unlock(); } -void Core::DebugCommandHandler::script( char* data, Entity::Player &player, DebugCommandPtr command ) +void Core::DebugCommandHandler::script( char* data, Entity::Player &player, boost::shared_ptr< DebugCommand > command ) { std::string subCommand; std::string params = ""; diff --git a/src/servers/Server_Zone/Script/ScriptManager.cpp b/src/servers/Server_Zone/Script/ScriptManager.cpp index 328932ba..d8ddef03 100644 --- a/src/servers/Server_Zone/Script/ScriptManager.cpp +++ b/src/servers/Server_Zone/Script/ScriptManager.cpp @@ -113,19 +113,21 @@ bool Core::Scripting::ScriptManager::onTalk( Entity::Player& player, uint64_t ac % static_cast< uint64_t >( eventId & 0xFFFFFFF ) ) + ")" ); uint16_t eventType = eventId >> 16; + uint32_t scriptId = eventId; // aethernet/aetherytes need to be handled separately - // todo: probably a nicer way to do this would be to switch the param for getQuestScript if( eventType == Common::EventType::Aetheryte ) { auto aetherInfo = g_exdData.getAetheryteInfo( eventId & 0xFFFF ); - auto scriptId = 0x50000; + scriptId = 0x50000; if( !aetherInfo->isAetheryte ) scriptId = 0x50001; + } - auto script = m_nativeScriptHandler->getQuestScript( scriptId ); - if( !script ) - return false; + auto script = m_nativeScriptHandler->getQuestScript( scriptId ); + if( script ) + { + player.sendDebug( "Calling: " + objName + "." + eventName ); player.eventStart( actorId, eventId, Event::Event::Talk, 0, 0 ); @@ -135,31 +137,17 @@ bool Core::Scripting::ScriptManager::onTalk( Entity::Player& player, uint64_t ac } else { - auto script = m_nativeScriptHandler->getQuestScript( eventId ); - if( script ) + if ( eventType == Common::EventType::Quest ) { - player.sendDebug( "Calling: " + objName + "." + eventName ); - - player.eventStart( actorId, eventId, Event::Event::Talk, 0, 0 ); - - script->onTalk( eventId, player, actorId ); - - player.checkEvent( eventId ); - } - else - { - if ( eventType == Common::EventType::Quest ) + auto questInfo = g_exdData.getQuestInfo( eventId ); + if ( questInfo ) { - auto questInfo = g_exdData.getQuestInfo( eventId ); - if ( questInfo ) - { - player.sendUrgent( "Quest not implemented: " + questInfo->name ); + player.sendUrgent( "Quest not implemented: " + questInfo->name ); - } } - - return false; } + + return false; } return true;