diff --git a/.appveyor.yml b/.appveyor.yml index fb30afe4..6bbe22d5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,8 +9,8 @@ platform: environment: MSVC_DEFAULT_OPTIONS: ON - BOOST_ROOT_DIR: "C:\\Libraries\\boost_1_60_0" - BOOST_LIB_DIR: "C:\\Libraries\\boost_1_60_0\\lib32-msvc-14.0" + BOOST_ROOT_DIR: "C:\\Libraries\\boost_1_63_0" + BOOST_LIB_DIR: "C:\\Libraries\\boost_1_63_0\\lib32-msvc-14.0" MYSQL_PWD: "Password12!" services: diff --git a/.gitignore b/.gitignore index 0747ffb3..c931620b 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ build/ *.la *.a *.lib +*.exp # Executables *.exe @@ -103,10 +104,13 @@ src/libraries/external/boost_* *.idb # sapphire version -src/servers/Server_Common/Version\.cpp +src/common/Version\.cpp # edit and continue files /enc_temp_folder # travis-ci build mtime cache .mtime_cache + +# generated script loader files +scripts/native/*/ScriptLoader.cpp \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 21eb7833..99dc3656 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,10 @@ cache: before_install: - eval "${MATRIX_EVAL}" - gem install --no-ri --no-rdoc mtime_cache + - sudo add-apt-repository -y ppa:rexut/recoil - sudo apt-get update - - sudo apt-get install -y libboost-dev libboost-all-dev - - sudo apt-get install -y libmysqlclient-dev libmysqlcppconn-dev + - sudo apt-get install -y libboost1.63-dev libboost1.63-all-dev + - sudo apt-get install -y libmysqlclient-dev # Build steps script: @@ -39,6 +40,6 @@ script: - mtime_cache src/**/*.{%{cpp}} -c .mtime_cache/cache.json - mkdir -p build - cd build - - cmake .. -DSAPPHIRE_BOOST_VER="1.54.0" && make -j 3 + - cmake .. -DSAPPHIRE_BOOST_VER="1.63.0" && make -j 3 - cd .. - bash sql_import.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 997abb3d..8fe6f474 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,9 @@ project (Sapphire) set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin) -set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) -set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) +set(EXECUTABLE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) set(PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) @@ -22,7 +23,7 @@ set(SAPPHIRE_BOOST_FOLDER_NAME boost_1_60_0) ########################################################################## # Common and library path -set(SERVER_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/servers/Server_Common") +set(SERVER_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/common") set(LIBRARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/libraries") ########################################################################## @@ -36,13 +37,12 @@ include( "cmake/compiler.cmake" ) ############################## include(GetGitRevisionDescription) get_git_head_revision(GIT_REFSPEC GIT_SHA1) -git_describe(VERSION --tags --dirty=-d) -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/servers/Server_Common/Version.cpp.in" - "${CMAKE_CURRENT_SOURCE_DIR}/src/servers/Server_Common/Version.cpp" @ONLY) +git_describe(VERSION --all --dirty=-d) +configure_file("${SERVER_COMMON_DIR}/Version.cpp.in" + "${SERVER_COMMON_DIR}/Version.cpp" @ONLY) ########################################################################## # Common include folders -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/external/ChaiScript-6.0.0/include/") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/sapphire/datReader/") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/libraries/sapphire/mysqlConnector/") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src") @@ -61,8 +61,12 @@ add_subdirectory("src/servers") add_subdirectory("src/libraries/sapphire/datReader") add_subdirectory("src/libraries/sapphire/mysqlConnector") +add_subdirectory("src/common") + add_subdirectory("src/tools/exd_common_gen") add_subdirectory("src/tools/exd_struct_gen") add_subdirectory("src/tools/exd_struct_test") add_subdirectory("src/tools/quest_parser") -add_subdirectory("src/tools/pcb_reader") +#add_subdirectory("src/tools/pcb_reader") + +add_subdirectory("scripts/native") diff --git a/bin/config/settings_zone.xml b/bin/config/settings_zone.xml index 18d33bf6..f50c18ce 100644 --- a/bin/config/settings_zone.xml +++ b/bin/config/settings_zone.xml @@ -1,5 +1,4 @@ - 54992 @@ -7,8 +6,22 @@ 127.0.0.1 C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack\\ffxiv + + + + ./compiledscripts/ + ./cache/ + + + 1 + ../scripts/native/ + ../cmake-build-debug/ + cmake --build %1% --target %2% + + + - ../scripts/chai + ./compiledscripts/ 127.0.0.1 @@ -16,13 +29,13 @@ root sapphire - 2 - 2 + 2 + 2 - + <<<Welcome to Sapphire>>> This is a very good server diff --git a/cmake/mysql.cmake b/cmake/mysql.cmake index 7e3ceccf..77106bc9 100644 --- a/cmake/mysql.cmake +++ b/cmake/mysql.cmake @@ -11,6 +11,7 @@ if(UNIX) /usr/local/mysql/include/mysql $ENV{ProgramFiles}/MySQL/*/include $ENV{SystemDrive}/MySQL/*/include + ${LIBRARY_DIR}/external/MySQL/ ) if(MYSQL_INCLUDE_DIR) diff --git a/scripts/chai/CmnDef/CmnDefCutSceneReplay.chai b/scripts/chai/CmnDef/CmnDefCutSceneReplay.chai deleted file mode 100644 index 6f390751..00000000 --- a/scripts/chai/CmnDef/CmnDefCutSceneReplay.chai +++ /dev/null @@ -1,38 +0,0 @@ - -class CmnDefCutSceneReplayDef -{ - - def CmnDefCutSceneReplayDef() - { - this.id = 721028; - } - - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000/*flags*/, 0/*unk*/, 1/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 != 0 ) - { - CmnDefCutSceneReplay.Scene00001( player, param2 ); - } - }); - } - - def Scene00001( player, returnScene ) - { - player.eventPlay( this.id, 1, 0xFB2EC8F8/*flags*/, 0/*unk*/, 1, returnScene, - fun( player, eventId, param1, param2, param3 ) - { - - }); - } - - def onTalk( eventId, player, actorId ) - { - this.Scene00000( player ); - } - -}; - -GLOBAL CmnDefCutSceneReplay = CmnDefCutSceneReplayDef(); \ No newline at end of file diff --git a/scripts/chai/CmnDef/CmnDefCutSceneReplay.chai_outdated b/scripts/chai/CmnDef/CmnDefCutSceneReplay.chai_outdated deleted file mode 100644 index 4bddaa63..00000000 --- a/scripts/chai/CmnDef/CmnDefCutSceneReplay.chai_outdated +++ /dev/null @@ -1,61 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai - - -// Quest Script: SubFst004_00027 -// Quest Name: Preserving the Past -// Quest ID: 65563 -// Start NPC: 1000194 -// End NPC: 1000789 - -class CmnDefCutSceneReplayDef -{ - // Basic quest information - var quest_name - var quest_id - - // These are the quest vars / flags used in this quest - // GetQuestUI8AL - // GetQuestUI8BH - - // Available Scenes in this quest, not necessarly all are used - attr onScene00000; - - // Quest rewards - var RewardExpFactor; - var RewardItem; - var RewardItemCount; - - // Entities found in the script data of the quest - // some of these may be useful - var ACTOR0; - var ACTOR1; - var ACTOR2; - var ITEM0; - - def CmnDefCutSceneReplayDef() - { - - } - - def Scene00000( player, eventId, flags, unk, unk1 ) - { - player.eventPlay(eventId, 0, 0x2000, unk, 1, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - player.eventFinish(eventId, 1); - } ); - } - -}; - - -def CmnDefCutSceneReplay_START(player, actorId, eventId) -{ - var quest = CmnDefCutSceneReplay(); - var actor = mapActor( actorId ); - - player.eventStart( actorId, eventId, 1, 0, 0 ); - CmnDefCutSceneReplay.Scene00000( player, eventId, 0, 0, 0 ); -} diff --git a/scripts/chai/CmnDef/CmnDefInnBed.chai b/scripts/chai/CmnDef/CmnDefInnBed.chai deleted file mode 100644 index 64b72573..00000000 --- a/scripts/chai/CmnDef/CmnDefInnBed.chai +++ /dev/null @@ -1,62 +0,0 @@ - -class CmnDefInnBedDef -{ - - def CmnDefInnBedDef() - { - this.id = 720916; - } - - def Scene00000( player ) //Menu - { - player.eventPlay( this.id, 0, 0x2000/*flags*/, 0/*unk*/, 1/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 > 1 ) - { - CmnDefInnBed.Scene00001( player, param2 ); - } - - }); - } - - def Scene00001( player, what ) //Lay down - { - player.eventPlay( this.id, 1, 0xF32E48F8/*flags*/, 0/*unk*/, 1/*unk*/, what, - fun( player, eventId, param1, param2, param3 ) - { - CmnDefInnBed.Scene00002( player, param2 ); - }); - } - - def Scene00002( player, what ) //Log out - { - player.eventPlay( this.id, 2, 0xF32E48F8/*flags*/, 0/*unk*/, 1/*unk*/, what, - fun( player, eventId, param1, param2, param3 ) - { - - }); - } - - def Scene00100( player ) //Wake up - { - player.eventPlay( this.id, 100, 0x800/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - - }); - } - - def onTalk( eventId, player, actorId ) - { - this.Scene00000( player ); - } - - def onEnterTerritory( eventId, player, param1, param2 ) - { - this.Scene00100( player ); - } - -}; - -GLOBAL CmnDefInnBed = CmnDefInnBedDef(); diff --git a/scripts/chai/CmnDef/CmnDefLinkShell.chai b/scripts/chai/CmnDef/CmnDefLinkShell.chai deleted file mode 100644 index 5d2cacd0..00000000 --- a/scripts/chai/CmnDef/CmnDefLinkShell.chai +++ /dev/null @@ -1,75 +0,0 @@ - -class CmnDefLinkShellDef -{ - - def CmnDefLinkShellDef() - { - this.ACTION_CREATE = 2; - this.ACTION_RENAME = 3; - this.ACTION_REMOVE = 4; - this.id = 0xB0006; - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - switch( param2 ) - { - case( CmnDefLinkShell.ACTION_CREATE ) - { - CmnDefLinkShell.Scene00002( player ); - break; - } - case( CmnDefLinkShell.ACTION_RENAME ) - { - CmnDefLinkShell.Scene00003( player ); - break; - } - case( CmnDefLinkShell.ACTION_REMOVE ) - { - CmnDefLinkShell.Scene00004( player ); - break; - } - } - - }); - } - - def Scene00002( player ) // Create Linkshell - { - player.eventPlay( this.id, 2, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - - }); - } - - def Scene00003( player ) // Rename Linkshell - { - player.eventPlay( this.id, 3, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - - }); - } - - def Scene00004( player ) // Delete Linkshell - { - player.eventPlay( this.id, 4, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - - }); - } - - def onTalk( eventId, player, actorId ) - { - this.Scene00001( player ); - } - - -}; - -global CmnDefLinkShell = CmnDefLinkShellDef(); \ No newline at end of file diff --git a/scripts/chai/CmnDef/HouFurOrchestrion.chai b/scripts/chai/CmnDef/HouFurOrchestrion.chai deleted file mode 100644 index adc60f55..00000000 --- a/scripts/chai/CmnDef/HouFurOrchestrion.chai +++ /dev/null @@ -1,26 +0,0 @@ - -class HouFurOrchestrionDef -{ - - def HouFurOrchestrionDef() - { - this.id = 721226; - } - - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000/*flags*/, 0/*unk*/, 1/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - - }); - } - - def onTalk( eventId, player, actorId ) - { - this.Scene00000( player ); - } - -}; - -GLOBAL HouFurOrchestrion = HouFurOrchestrionDef(); \ No newline at end of file diff --git a/scripts/chai/aetheryte/Aethernet.chai b/scripts/chai/aetheryte/Aethernet.chai deleted file mode 100644 index db86ed39..00000000 --- a/scripts/chai/aetheryte/Aethernet.chai +++ /dev/null @@ -1,57 +0,0 @@ -//Aethernet - Aetheryte - -class AethernetDef -{ - - def AethernetDef() - { - this.AetheryteBaseId = 0x50000; - this.AETHERYTE_MENU_AETHERNET = 1; - this.AETHERYTE_MENU_HOUSING = 2; - this.AETHERYTE_MENU_HOME_POINT = 3; - this.AETHERYTE_MENU_FAVORITE_POINT = 4; - this.AETHERYTE_MENU_FAVORITE_POINT_SECURITY_TOKEN = 5; - } - - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( player.isAetheryteRegistered( eventId & 0xFFFF ) ) - { - player.eventPlay( eventId, 2, NONE, - fun ( player, eventId, param1, param2, param3 ) - { - var aetherId = eventId & 0xFFFF; - - if ( param1 == 256 ) // aethernet - { - //player.setTeleporting( true ); - player.teleport( param2, 2 ); - } - } ); - } - else - { - var ACTION_ATTUNE = 0x13; - player.eventActionStart( eventId, - ACTION_ATTUNE, - // callback function for finished casting - fun ( player, eventId, additional ) - { - - var aetherId = eventId & 0xFFFF; - player.aetheryteRegister( aetherId ); - player.eventPlay( eventId, 3, 0, 0, 0); - - }, - // callback for interrupted action. - fun ( player, eventId, additional ){}, - 0); - player.unlock(); - - } - - } -} -GLOBAL Aethernet = AethernetDef(); \ No newline at end of file diff --git a/scripts/chai/aetheryte/Aetheryte.chai b/scripts/chai/aetheryte/Aetheryte.chai deleted file mode 100644 index ac92f7c0..00000000 --- a/scripts/chai/aetheryte/Aetheryte.chai +++ /dev/null @@ -1,70 +0,0 @@ -//Aethernet - Aetheryte - -class AetheryteDef -{ - - def AetheryteDef() - { - this.AetheryteBaseId = 0x50000; - this.AETHERYTE_MENU_AETHERNET = 1; - this.AETHERYTE_MENU_HOUSING = 2; - this.AETHERYTE_MENU_HOME_POINT = 3; - this.AETHERYTE_MENU_FAVORITE_POINT = 4; - this.AETHERYTE_MENU_FAVORITE_POINT_SECURITY_TOKEN = 5; - } - - def onTalk( eventId, player, actorId ) - { - if( player.isAetheryteRegistered( eventId & 0xFFFF ) ) - { - player.eventPlay( eventId, 0, 1, - fun ( player, eventId, param1, param2, param3 ) - { - var aetherId = eventId & 0xFFFF; - - if ( param1 == 256 ) // set homepoint - { - player.setHomepoint( aetherId ); - player.questMessage( eventId, 2, 0xEA, 0, 0); - } - else if ( param1 == 512 && param2 == 4 ) // aethernet - { - player.teleport( param3, 2 ); - } - - } ); - } - else - { - var ACTION_ATTUNE = 0x13; - player.eventActionStart(eventId, - ACTION_ATTUNE, - // callback function for finished casting - fun ( player, eventId, additional ) - { - var aetherId = eventId & 0xFFFF; - player.aetheryteRegister(aetherId); - - // check if teleport is already unlocked - if( player.isActionLearned( 4 ) ) - { - player.questMessage( eventId, 0, 2, 0, 0); - } - else - { - player.questMessage( eventId, 0, 1, 1, 0); - player.learnAction( 4 ); - } - }, - // callback for interrupted action. - fun ( player, eventId, additional ) - { - }, - 0); - player.unlock(); - } - - } -} - -GLOBAL Aetheryte = AetheryteDef(); \ No newline at end of file diff --git a/scripts/chai/global.inc b/scripts/chai/global.inc deleted file mode 100644 index 906a3a0b..00000000 --- a/scripts/chai/global.inc +++ /dev/null @@ -1,236 +0,0 @@ -///////////////////////////////////////////////////////////////////// -// Quest sequence -///////////////////////////////////////////////////////////////////// -global SEQ_COMPLETE = 0xFF - -///////////////////////////////////////////////////////////////////// -// SCENE_FLAGS -///////////////////////////////////////////////////////////////////// -global SET_EOBJ_BASE = 0xF8400EF3 -global SET_INVIS_BASE = 0xF8400FFF -global SET_BASE = 0xF8400EFB -global INVIS_COMPANION = 0x80000000 -global INVIS_ALLIANCE_BUDDY = 0x40000000 -global INVIS_ALLIANCE_PC = 0x20000000 -global INVIS_AOE = 0x08000000 -global DISABLE_CANCEL_EMOTE = 0x04000000 -global LOCK_HOTBAR = 0x02000000 -global LOCK_HUD = 0x01000000 -global ROLLBACK_HIDE_UI = 0x00800000 -global DISABLE_STEALTH = 0x00400000 -global HIDE_FESTIVAL = 0x00200000 -global DISABLE_SKIP = 0x00080000 -global SILENT_ENTER_TERRI_ALL = 0x00038000 -global SILENT_ENTER_TERRI_SE = 0x00020000 -global SILENT_ENTER_TERRI_BGM = 0x00010000 -global SILENT_ENTER_TERRI_ENV = 0x00008000 -global INVINCIBLE = 0x00004000 -global HIDE_HOTBAR = 0x00002000 -global AUTO_LOC_CAMERA = 0x00001000 -global INVIS_ALL = 0xF80003FC -global HIDE_UI = 0x00000800 -global CONDITION_CUTSCENE = 0x00000400 -global INVIS_TREASURE = 0x00000200 -global INVIS_AETHERYTE = 0x00000100 -global INVIS_GATHERING_POINT = 0x00000080 -global INVIS_PARTY_BUDDY = 0x10000000 -global INVIS_PARTY_PC = 0x00000040 -global INVIS_OTHER_PC = 0x00000020 -global INVIS_BNPC = 0x00000010 -global INVIS_EOBJ = 0x00000008 -global INVIS_ENPC = 0x00000004 -global FADE_OUT = 0x00000002 -global NO_DEFAULT_CAMERA = 0x00000001 -global NONE = 0x00000000 - -///////////////////////////////////////////////////////////////////// -// Event Types -///////////////////////////////////////////////////////////////////// -global EVENT_TALK = 1 -global EVENT_EMOTE = 2 -global EVENT_DISTANCE_BELOW = 3 -global EVENT_DISTANCE_OVER = 4 -global EVENT_BATTLE_REWARD = 5 -global EVENT_CRAFT = 6 -global EVENT_NEST = 7 -global EVENT_EVENT_ITEM = 8 -global EVENT_DROP = 9 -global EVENT_WITHIN_RANGE = 10 -global EVENT_OUTSIDE_RANGE = 11 -global EVENT_GAME_START = 12 -global EVENT_GAME_PROGRESS = 13 -global EVENT_ENTER_TERRITORY = 15 -global EVENT_GAME_COME_BACK = 17 -global EVENT_ACTION_RESULT = 18 -global EVENT_MATERIA_CRAFT = 19 -global EVENT_FISHING = 20 -global EVENT_UI = 21 -global EVENT_HOUSING = 22 -global EVENT_SAY = 23 -global EVENT_TABLE_GAME = 24 - -///////////////////////////////////////////////////////////////////// -// Event finish states -///////////////////////////////////////////////////////////////////// -global UNLOCK = 1 -global KEEPLOCK = 0 - -///////////////////////////////////////////////////////////////////// -// Possible Event Types -///////////////////////////////////////////////////////////////////// - -global ACTOR_EVENT_ON_CREATE = 1 -global ACTOR_EVENT_ON_SPAWN = 2 -global ACTOR_EVENT_ON_DESPAWN = 3 -global ACTOR_EVENT_ON_AI_TICK = 4 -global ACTOR_EVENT_ON_TALK_DEFAULT = 5 - -global MOB_EVENT_ON_DEATH = 1 - -global REGION_EVENT_ON_CREATE= 1 -global REGION_EVENT_ON_ENTER = 2 -global REGION_EVENT_ON_LEAVE = 3 - -global PLAYER_EVENT_ON_FIRST_ENTER_WORLD = 1 -global PLAYER_EVENT_ON_ENTER_WORLD = 2 -global PLAYER_EVENT_ON_DEATH = 3 -global PLAYER_EVENT_ON_LOGIN = 4 -global PLAYER_EVENT_ON_LOGOUT = 5 - -// End Event Types - -global SLOT_MAINH = 0 -global SLOT_OFFH = 1 -global SLOT_HEAD = 2 -global SLOT_BODY = 3 -global SLOT_GLOVES = 4 -global SLOT_WAIST = 5 -global SLOT_LEGS = 6 -global SLOT_FEET = 7 - -global GENDER_MALE = 0 -global GENDER_FEMALE = 1 - -global ACTION_EVENT_START = 1 -global ACTION_EVENT_RETURN = 2 -global ACTION_EVENT_TRADE_RETURN = 3 -global ACTION_ERANGE_EVENT_START = 4 -global ACTION_EVENT_EMOTE = 5 - -global ACTION_RETURN = 0x26 -global ACTION_TELEPORT = 0x29 - -global EVENTACTION_ATTUNE = 0x13 - -global CLASS_GLA = 1 -global CLASS_PUG = 2 -global CLASS_MRD = 3 -global CLASS_LNC = 4 -global CLASS_ARC = 5 -global CLASS_CON = 6 -global CLASS_THM = 7 -global CLASS_CRP = 8 -global CLASS_BSM = 9 -global CLASS_ARM = 10 -global CLASS_GLD = 11 -global CLASS_TAN = 12 -global CLASS_WVR = 13 -global CLASS_ALC = 14 -global CLASS_CUL = 15 -global CLASS_MIN = 16 -global CLASS_BOT = 17 -global CLASS_FSH = 18 -global CLASS_PLD = 19 -global CLASS_MNK = 20 -global CLASS_WAR = 21 -global CLASS_DRG = 22 -global CLASS_BRD = 23 -global CLASS_WHM = 24 -global CLASS_BLM = 25 -global CLASS_ACN = 26 -global CLASS_SMN = 27 -global CLASS_SCH = 28 -global CLASS_ROG = 29 -global CLASS_NIN = 30 -global CLASS_MCH = 31 -global CLASS_DRK = 32 -global CLASS_AST = 33 - -/////////////////////////////////////////////////////////////// -// Inventory Enums -/////////////////////////////////////////////////////////////// -global INVENTORY_BAG0 = 0 -global INVENTORY_BAG1 = 1 -global INVENTORY_BAG2 = 2 -global INVENTORY_BAG3 = 3 - -global INVENTORY_GEARSET0 = 1000 -global INVENTORY_GEARSET1 = 1001 - -global INVENTORY_CURRENCY = 2000 -global INVENTORY_CRYSTAL = 2001 -//global INVENTORY_UNKNOWN_0 = 2003 -global INVENTORY_KEYITEM = 2004 -global INVENTORY_DAMAGEDGEAR = 2007 -//global INVENTORY_UNKNOWN_1 = 2008 - -global INVENTORY_ARMORYOFF = 3200 -global INVENTORY_ARMORYHEAD = 3201 -global INVENTORY_ARMORYBODY = 3202 -global INVENTORY_ARMORYHAND = 3203 -global INVENTORY_ARMORYWAIST = 3204 -global INVENTORY_ARMORYLEGS = 3205 -global INVENTORY_ARMORYFEET = 3206 -global INVENTORY_ARMOTYNECK = 3207 -global INVENTORY_ARMORYEAR = 3208 -global INVENTORY_ARMORYWRIST = 3209 -global INVENTORY_ARMORYRING = 3300 - -global INVENTORY_ARMORYSOULCRYSTAL = 3400 -global INVENTORY_ARMORYMAIN = 3500 - -global INVENTORY_RETAINERBAG0 = 10000 -global INVENTORY_RETAINERBAG1 = 10001 -global INVENTORY_RETAINERBAG2 = 10002 -global INVENTORY_RETAINERBAG3 = 10003 -global INVENTORY_RETAINERBAG4 = 10004 -global INVENTORY_RETAINERBAG5 = 10005 -global INVENTORY_RETAINERBAG6 = 10006 -global INVENTORY_RETAINEREQUIPPEDGEAR = 11000 -global INVENTORY_RETAINERGIL = 12000 -global INVENTORY_RETAINERCRYSTAL = 12001 -global INVENTORY_RETAINERMARKET = 12002 - -global INVENTORY_FREECOMPANYBAG0 = 20000 -global INVENTORY_FREECOMPANYBAG1 = 20001 -global INVENTORY_FREECOMPANYBAG2 = 20002 -global INVENTORY_FREECOMPANYGIL = 22000 -global INVENTORY_FREECOMPANYCRYSTAL = 22001 - -//////////////////////////////////////////////////////////// -// Currency types -//////////////////////////////////////////////////////////// -global CURRENCY_GIL = 0X01 -global CURRENCY_STORMSEAL = 0X02 -global CURRENCY_SERPENTSEAL = 0X03 -global CURRENCY_FLAMESEAL = 0X04 -global CURRENCY_TOMESTONEPHILO = 0X05 -global CURRENCY_TOMESTONEMYTHO = 0X06 -global CURRENCY_WOLFMARK = 0X07 -global CURRENCY_TOMESTONESOLD = 0X08 -global CURRENCY_ALLIEDSEAL = 0X09 -global CURRENCY_TOMESTONEPOET = 0X0A -global CURRENCY_MGP = 0X0B -global CURRENCY_TOMESTONELAW = 0X0C -global CURRENCY_TOMESTONEESO = 0X0D -global CURRENCY_TOMESTONELORE = 0X0E - -//////////////////////////////////////////////////////////// -// Skill handle types -//////////////////////////////////////////////////////////// -global STD_DAMAGE = 0X03 -global STD_HEAL = 0X04 -global STD_MP_LOSS = 0X0A -global STD_MP_GAIN = 0X0B -global STD_TP_LOSS = 0X0C -global STD_TP_GAIN = 0X0D \ No newline at end of file diff --git a/scripts/chai/opening/OpeningGridania.chai b/scripts/chai/opening/OpeningGridania.chai deleted file mode 100644 index 207cf8fe..00000000 --- a/scripts/chai/opening/OpeningGridania.chai +++ /dev/null @@ -1,97 +0,0 @@ -// Opening Script: OpeningGridania -// Quest Name: OpeningGridania -// Quest ID: 1245186 - -class OpeningGridaniaDef -{ - - def OpeningGridaniaDef() - { - this.id = 1245186; - this.name = "OpeningGridania"; - - this.ERANGE_HOWTO_ANN_AND_QUEST = 2117539; - this.ERANGE_HOWTO_QUEST_REWARD = 2366417; - this.ERANGE_SEQ_1_CLOSED_1 = 2351918; - this.POS_SEQ_1_CLOSED_RETURN_1 = 2351921; - this.ERANGE_SEQ_1_CLOSED_2 = 2351919; - this.POS_SEQ_1_CLOSED_RETURN_2 = 2351921; - this.ERANGE_ALWAYS_CLOSED_1 = 2280846; - this.POS_ALWAYS_CLOSED_RETURN_1 = 2320804; - this.ENPC_ALWAYS_CLOSED_1 = 2367988; - this.ERANGE_ALWAYS_CLOSED_3 = 2280851; - this.POS_ALWAYS_CLOSED_RETURN_3 = 2320811; - this.ENPC_ALWAYS_CLOSED_3 = 2563491; - this.BGM_MUSIC_ZONE_FST_TWN = 1003; - this.NCUT_FST_1 = 3; - this.NCUT_FST_2 = 53; - this.NCUT_FST_3 = 226; - this.ENPC_QUEST_OFFER = 1985150; - this.NCUT_LIGHT_ALL = 2; - this.NCUT_LIGHT_FST_1 = 147; - this.NCUT_LIGHT_FST_2 = 146; - } - - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x04AC05, 0, 1, - fun( player, eventId, param1, param2, param3 ) - { - player.setOpeningSequence( 1 ); - OpeningGridania.Scene00001( player ); - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0x2001, 1, 0x32 ); - } - - def Scene00020( player ) - { - player.eventPlay( this.id, 20, 0x2001, 0, 1 ); - } - - def Scene00030( player ) - { - player.eventPlay( this.id, 30, 0x2001, 0, 0 ); - } - - def Scene00040( player ) - { - player.eventPlay( this.id, 40, 1, 2, 1, - fun( player, eventId, param1, param2, param3 ) - { - if( player.getOpeningSequence() == 2 ) - { - // update the instance boundaries - OpeningGridania.Scene00030( player ); - } - } ); - } - - ////////////////////////////// EVENT HANDLERS ////////////////////////////////// - - def onEnterTerritory( eventId, player, param1, param2) - { - if( player.getOpeningSequence() == 0 ) - { - this.Scene00000( player ); - } - else - { - this.Scene00040( player ); - } - } - - def onWithinRange( eventId, player, param1, x, y, z) - { - if( this.ERANGE_ALWAYS_CLOSED_3 == param1 ) - { - this.Scene00020( player ); - } - } - -}; - -GLOBAL OpeningGridania = OpeningGridaniaDef(); diff --git a/scripts/chai/opening/OpeningLimsa.chai b/scripts/chai/opening/OpeningLimsa.chai deleted file mode 100644 index f7ab44c7..00000000 --- a/scripts/chai/opening/OpeningLimsa.chai +++ /dev/null @@ -1,107 +0,0 @@ -// Opening Script: OpeningLimsaLominsa -// Quest Name: OpeningLimsaLominsa -// Quest ID: 1245185 - -class OpeningLimsaLominsaDef -{ - - def OpeningLimsaLominsaDef() - { - this.id = 1245185; - this.name = "OpeningLimsaLominsa"; - - this.ERANGE_HOWTO_ANN_AND_QUEST = 4101831 - this.ERANGE_HOWTO_QUEST_REWARD = 4102066 - this.ERANGE_SEQ_1_CLOSED_1 = 4101785 - this.POS_SEQ_1_CLOSED_RETURN_1 = 4101797 - this.ERANGE_ALWAYS_CLOSED_1 = 4101744 - this.POS_ALWAYS_CLOSED_RETURN_1 = 4101761 - this.ENPC_ALWAYS_CLOSED_1 = 4102038 - this.ERANGE_ALWAYS_CLOSED_2 = 4101746 - this.POS_ALWAYS_CLOSED_RETURN_2 = 4101763 - this.ENPC_ALWAYS_CLOSED_2 = 4102036 - this.ERANGE_ALWAYS_CLOSED_3 = 4101967 - this.POS_ALWAYS_CLOSED_RETURN_3 = 4101982 - this.ENPC_ALWAYS_CLOSED_3 = 4102033 - this.ERANGE_ALWAYS_CLOSED_4 = 4101970 - this.POS_ALWAYS_CLOSED_RETURN_4 = 4101984 - this.ENPC_ALWAYS_CLOSED_4 = 4102031 - this.ERANGE_ALWAYS_CLOSED_5 = 4101973 - this.POS_ALWAYS_CLOSED_RETURN_5 = 4101985 - this.ENPC_ALWAYS_CLOSED_5 = 4102007 - this.ERANGE_ALWAYS_CLOSED_6 = 4101979 - this.POS_ALWAYS_CLOSED_RETURN_6 = 4101988 - this.ENPC_ALWAYS_CLOSED_6 = 2367400 - this.BGM_MUSIC_ZONE_SEA_TWN = 1020 - this.NCUT_SEA_1 = 200 - this.NCUT_SEA_2 = 132 - this.NCUT_SEA_3 = 201 - this.ENPC_QUEST_OFFER = 4102039 - this.NCUT_LIGHT_ALL = 2 - this.NCUT_LIGHT_SEA_1 = 147 - this.NCUT_LIGHT_SEA_2 = 138 - } - - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x04AC05, 0, 1, - fun( player, eventId, param1, param2, param3 ) - { - player.setOpeningSequence( 1 ); - OpeningLimsaLominsa.Scene00001( player ); - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0x2001, 1, 0x32 ); - } - - def Scene00020( player ) - { - player.eventPlay( this.id, 20, 0x2001, 0, 1 ); - } - - def Scene00030( player ) - { - player.eventPlay( this.id, 30, 0x2001, 0, 0 ); - } - - def Scene00040( player ) - { - player.eventPlay( this.id, 40, 1, 2, 1, - fun( player, eventId, param1, param2, param3 ) - { - if( player.getOpeningSequence() == 2 ) - { - // update the instance boundaries - OpeningLimsaLominsa.Scene00030( player ); - } - } ); - } - - ////////////////////////////// EVENT HANDLERS ////////////////////////////////// - - def onEnterTerritory( eventId, player, param1, param2) - { - if( player.getOpeningSequence() == 0 ) - { - this.Scene00000( player ); - } - else - { - this.Scene00040( player ); - } - } - - def onWithinRange( eventId, player, param1, x, y, z) - { - if( this.ERANGE_SEQ_1_CLOSED_1 == param1 ) - { - this.Scene00020( player ); - } - } - -}; - -GLOBAL OpeningLimsaLominsa = OpeningLimsaLominsaDef(); diff --git a/scripts/chai/opening/OpeningUldah.chai b/scripts/chai/opening/OpeningUldah.chai deleted file mode 100644 index 829bab1b..00000000 --- a/scripts/chai/opening/OpeningUldah.chai +++ /dev/null @@ -1,98 +0,0 @@ -// Opening Script: OpeningUldah -// Quest Name: OpeningUldah -// Quest ID: 1245187 - -class OpeningUldahDef -{ - - def OpeningUldahDef() - { - this.id = 1245187; - this.name = "OpeningUldah"; - - this.ERANGE_HOWTO_ANN_AND_QUEST = 4101650; - this.ERANGE_HOWTO_QUEST_REWARD = 4102883; - this.ERANGE_SEQ_1_CLOSED_1 = 4101587; - this.POS_SEQ_1_CLOSED_RETURN_1 = 4101691; - this.ERANGE_ALWAYS_CLOSED_1 = 4101537; - this.POS_ALWAYS_CLOSED_RETURN_1 = 4101685; - this.ENPC_ALWAYS_CLOSED_1 = 4101796; - this.ERANGE_ALWAYS_CLOSED_2 = 4101525; - this.POS_ALWAYS_CLOSED_RETURN_2 = 4101680; - this.ENPC_ALWAYS_CLOSED_2 = 4101789; - this.ERANGE_ALWAYS_CLOSED_3 = 4101535; - this.POS_ALWAYS_CLOSED_RETURN_3 = 4101681; - this.ENPC_ALWAYS_CLOSED_3 = 4101787; - this.BGM_MUSIC_ZONE_WIL_TWN = 1035; - this.NCUT_WIL_1 = 186; - this.NCUT_WIL_2 = 139; - this.NCUT_WIL_3 = 187; - this.ENPC_QUEST_OFFER = 3969639; - this.NCUT_LIGHT_ALL = 2; - this.NCUT_LIGHT_WIL_1 = 147; - this.NCUT_LIGHT_WIL_2 = 145; - } - - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x04AC05, 0, 1, - fun( player, eventId, param1, param2, param3 ) - { - player.setOpeningSequence( 1 ); - OpeningUldah.Scene00001( player ); - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0x2001, 1, 0x32 ); - } - - def Scene00020( player ) - { - player.eventPlay( this.id, 20, 0x2001, 0, 1 ); - } - - def Scene00030( player ) - { - player.eventPlay( this.id, 30, 0x2001, 0, 0 ); - } - - def Scene00040( player ) - { - player.eventPlay( this.id, 40, 1, 2, 1, - fun( player, eventId, param1, param2, param3 ) - { - if( player.getOpeningSequence() == 2 ) - { - // update the instance boundaries - OpeningUldah.Scene00030( player ); - } - } ); - } - - ////////////////////////////// EVENT HANDLERS ////////////////////////////////// - - def onEnterTerritory( eventId, player, param1, param2) - { - if( player.getOpeningSequence() == 0 ) - { - this.Scene00000( player ); - } - else - { - this.Scene00040( player ); - } - } - - def onOutsideRange( eventId, player, param1, x, y, z) - { - if( this.ERANGE_SEQ_1_CLOSED_1 == param1 ) - { - this.Scene00020( player ); - } - } - -}; - -GLOBAL OpeningUldah = OpeningUldahDef(); diff --git a/scripts/chai/player_events.chai b/scripts/chai/player_events.chai deleted file mode 100644 index 8fc12d7f..00000000 --- a/scripts/chai/player_events.chai +++ /dev/null @@ -1,11 +0,0 @@ - -def onFirstEnterWorld(player) -{ - var name = player.getName(); - var race = player.getRace(); - var gender = player.getGender(); - //var class = player.getClass(); - - - return name; -} diff --git a/scripts/chai/quest/ManFst001.chai b/scripts/chai/quest/ManFst001.chai deleted file mode 100644 index 29d9f0e7..00000000 --- a/scripts/chai/quest/ManFst001.chai +++ /dev/null @@ -1,124 +0,0 @@ -// Quest Script: ManFst001_00039 -// Quest Name: Coming to Gridania -// Quest ID: 65575 -// Start NPC: 1001148 -// End NPC: 1001140 - -class ManFst001Def -{ - ////////////////////////////////////////////////////////////////////// - // default ctor - def ManFst001Def() - { - // Basic quest information - this.name = "Coming to Gridania"; - this.id = 65575; - // These are the quest vars / flags used in this quest - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 103; - - // Entities found in the script data of the quest - // some of these may be useful - this.ACTOR0 = 1001148; - this.ACTOR1 = 1001140; - this.CUT_EVENT = 29; - this.EOBJECT0 = 2001659; - this.EOBJECT1 = 2001660; - this.EOBJECT7 = 2616477; - this.EVENT_ACTION_SEARCH = 1; - this.HOWTO_QUEST_ACCEPT = 12; - this.HOWTO_QUEST_ANNOUNCE = 2; - this.HOWTO_REWARD = 11; - this.HOWTO_TODO = 3; - this.OPENING_EVENT_HANDLER = 1245186; - this.SEQ_2_ACTOR1 = 2; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.setOpeningSequence( 2 ); - ManFst001.Scene00001( player ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0xF8482EFB/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - ManFst001.Scene00002( player ); - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, NONE, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( ManFst001.id, ManFst001.SEQ_FINISH );// add quest to player. - - // this is an external event, so we do need to start it here - //player.eventStart( player.getId(), ManFst001.OPENING_EVENT_HANDLER, 7, 0, 0 ); // update the instance boundaries, call to the opening event - player.eventPlay( ManFst001.OPENING_EVENT_HANDLER, 0x1E, 0x2001, 0, 0 ); - }); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, 0x2c02, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManFst001.Scene00005( player ); - }); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, 0x20/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // clicked finish button - { - player.gainExp( 50 ); - player.addCurrency( 1, ManFst001.RewardGil ); - player.questFinish( ManFst001.id ); - } - }); - } - - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == this.ACTOR0 ) - { - this.Scene00000( player ); - } - else if( actor == this.ACTOR1 ) - { - this.Scene00004( player ); - } - - } -}; - -GLOBAL ManFst001 = ManFst001Def(); - - diff --git a/scripts/chai/quest/ManFst002.chai b/scripts/chai/quest/ManFst002.chai deleted file mode 100644 index d73e5b92..00000000 --- a/scripts/chai/quest/ManFst002.chai +++ /dev/null @@ -1,258 +0,0 @@ -// Quest Script: ManFst002_00124 -// Quest Name: Close to Home -// Quest ID: 65660 -// Start NPC: 1001140 -// End NPC: 1000100 - -class ManFst002Def -{ - - ////////////////////////////////////////////////////////////////////// - // default ctor - def ManFst002Def() - { - // Basic quest information - this.name = "Close to Home"; - this.id = 65621; - - // These are the quest vars / flags used in this quest - // GetQuestBitFlag8 - // GetQuestUI8AL -- attube to Aetheryte - // GetQuestUI8BH -- visit class guild - // GetQuestUI8BL -- Listen to Parsement in the market check mark - // GetQuestUI8CH -- recieve Key item - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - //this.SEQ_OFFER = ?; - - // Quest rewards - this.RewardExpFactor = 100; - this.RewardGil = 107; - - // Entities found in the script data of the quest - // some of these may be useful - this.ACTOR0 = 1001140; - this.ACTOR1 = 2; - this.ACTOR2 = 1000251; - this.ACTOR20 = 1000159; - this.ACTOR3 = 1000768; - this.ACTOR4 = 1000100; - this.BIND_ACTOR0 = 6229224; - this.HOW_TO_DESION = 13; - this.HOW_TO_MAP_AND_NAVI = 4; - this.ITEM0 = 2000074; - this.LOC_ACTOR0 = 1003159; - this.LOC_MARKER_01 = 2153091; - this.LOC_MARKER_02 = 2153104; - this.LOC_MARKER_03 = 2153111; - this.LOC_MARKER_04 = 2154539; - this.LOC_MARKER_05 = 2154540; - this.LOC_MARKER_06 = 2154541; - this.LOC_MARKER_07 = 2210446; - this.LOC_MARKER_08 = 2210454; - this.LOC_MARKER_09 = 2210461; - this.LOC_MOTION0 = 799; - this.POPRANGE0 = 2280858; - this.REWARD_DESION = 1; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_0_ACTOR0_LQ = 50; - this.SEQ_1_ACTOR0 = 4; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_1_ACTOR1_WAIT = 51; - this.SEQ_1_ACTOR2 = 2; - this.SEQ_1_ACTOR3 = 3; - this.SEQ_1_ACTOR3_NPCTRADENO = 99; - this.SEQ_1_ACTOR3_NPCTRADEOK = 100; - this.SEQ_2_ACTOR4 = 5; - this.TERRITORYTYPE0 = 132; - this.UNLOCK_DESION = 14; - - } - - def checkQuestCompletion( player, varIdx ) - { - - if (varIdx == 3) - { - player.questMessage(this.id, 1, 0, 0, 0 ); - } - else if (varIdx == 2) - { - player.questMessage(this.id, 2, 0, 0, 0 ); - } - else - { - player.questMessage(this.id, 0, 0, 0, 0 ); - } - - var QUEST_VAR_ATTUNE = player.getQuestUI8AL( this.id ); - var QUEST_VAR_CLASS = player.getQuestUI8BH( this.id ); - var QUEST_VAR_TRADE = player.getQuestUI8BL( this.id ); - - if ( QUEST_VAR_ATTUNE == 1 && QUEST_VAR_CLASS == 1 && QUEST_VAR_TRADE == 1 ) - { - player.questUpdate( this.id, this.SEQ_FINISH ); - } - } - - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - ManFst002.Scene00050( player ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0x0EFB/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8AL( ManFst002.id, 1 ); - ManFst002.checkQuestCompletion( player, 0 ); - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8BH( ManFst002.id, 1 ); - ManFst002.checkQuestCompletion( player, 3 ); - }); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, NONE/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if ( param2 == 1 ) - { - ManFst002.Scene00100( player ); - } - else - { - ManFst002.Scene00099( player ); - } - }); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, 0, 0, 0 ); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( ManFst002.id, 0 ) ) - { - player.questFinish( ManFst002.id ); - } - } - }); - } - - def Scene00050( player ) - { - player.eventPlay( this.id, 50, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - // accepting quest "close to home" - player.questUpdate( ManFst002.id, 1 ); - player.setQuestUI8CH( ManFst002.id, 1 ); // receive key item - // event is done, need to teleport to real zone. - player.setZone( 132 ); - //player.setZone(183); back to starting griania for debug purpose - }); - } - - def Scene00051( player ) - { - player.eventPlay( this.id, 51, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManFst002.Scene00001( player ); - }); - } - - def Scene00099( player ) - { - player.eventPlay( this.id, 99, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManFst002.Scene00004( player ); - }); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, 0x0EFB, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8CH( ManFst002.id, 0 ); // remove key item, since we have just traded it - player.setQuestUI8BL( ManFst002.id, 1 ); - ManFst002.checkQuestCompletion(player, 2 ); - }); - } - - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == this.ACTOR0 ) - { - this.Scene00000( player ); - } - else if( actor == this.ACTOR1 ) - { - - // starting the eventaction 0x13 ( attuning ) - player.eventActionStart( 0x050002, 0x13, - fun( player, eventId, additional ) - { - player.questMessage( 0x050002, 0, 1, 0, 0 ); - player.aetheryteRegister( 2 ); - player.learnAction( 1 ); - ManFst002.Scene00051( player ); - }, - fun( player, eventId, additional ) {}, - 0x050002 ); - player.unlock(); - } - else if( actor == this.ACTOR2 ) - { - this.Scene00002( player ); - } - else if( actor == this.ACTOR3 ) - { - this.Scene00003( player ); - } - else if( actor == this.ACTOR4 ) - { - this.Scene00005( player ); - } - - } - -}; - -GLOBAL ManFst002 = ManFst002Def(); - diff --git a/scripts/chai/quest/ManFst003.chai b/scripts/chai/quest/ManFst003.chai deleted file mode 100644 index 403d18d3..00000000 --- a/scripts/chai/quest/ManFst003.chai +++ /dev/null @@ -1,257 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: ManFst003_00123 -// Quest Name: Close to Home -// Quest ID: 65659 -// Start NPC: 1001140 -// End NPC: 1000100 - -class ManFst003Def -{ - def ManFst003Def() - { - // Basic quest information - this.name = "Close to Home"; - this.id = 65659; - - // Quest vars / flags used - // GetQuestBitFlag8 - // GetQuestUI8AL - // GetQuestUI8BH - // GetQuestUI8BL - // GetQuestUI8CH - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 100; - this.RewardGil = 107; - - // Entities found in the script data of the quest - this.ACTOR0 = 1001140; - this.ACTOR1 = 2; - this.ACTOR2 = 1000197; - this.ACTOR20 = 1000159; - this.ACTOR3 = 1000768; - this.ACTOR4 = 1000100; - this.BIND_ACTOR0 = 6229224; - this.ITEM0 = 2000119; - this.LOC_ACTOR0 = 1003159; - this.LOC_MARKER_01 = 2153091; - this.LOC_MARKER_02 = 2153104; - this.LOC_MARKER_03 = 2153111; - this.LOC_MARKER_04 = 2154539; - this.LOC_MARKER_05 = 2154540; - this.LOC_MARKER_06 = 2154541; - this.LOC_MARKER_07 = 2210446; - this.LOC_MARKER_08 = 2210454; - this.LOC_MARKER_09 = 2210461; - this.LOC_MOTION0 = 799; - this.POPRANGE0 = 2280858; - this.REWARD_DESION = 1; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_0_ACTOR0_LQ = 50; - this.SEQ_1_ACTOR0 = 4; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_1_ACTOR1_WAIT = 51; - this.SEQ_1_ACTOR2 = 2; - this.SEQ_1_ACTOR3 = 3; - this.SEQ_1_ACTOR3_NPCTRADENO = 99; - this.SEQ_1_ACTOR3_NPCTRADEOK = 100; - this.SEQ_2_ACTOR4 = 5; - this.TERRITORYTYPE0 = 132; - this.UNLOCK_DESION = 14; - - } - - def checkQuestCompletion( player, varIdx ) - { - - if (varIdx == 3) - { - player.questMessage(this.id, 1, 0, 0, 0 ); - } - else if (varIdx == 2) - { - player.questMessage(this.id, 2, 0, 0, 0 ); - } - else - { - player.questMessage(this.id, 0, 0, 0, 0 ); - } - - var QUEST_VAR_ATTUNE = player.getQuestUI8AL( this.id ); - var QUEST_VAR_CLASS = player.getQuestUI8BH( this.id ); - var QUEST_VAR_TRADE = player.getQuestUI8BL( this.id ); - - if ( QUEST_VAR_ATTUNE == 1 && QUEST_VAR_CLASS == 1 && QUEST_VAR_TRADE == 1 ) - { - player.questUpdate( this.id, this.SEQ_FINISH ); - } - } - - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - ManFst003.Scene00050( player ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0x0EFB/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8AL( ManFst003.id, 1 ); - ManFst003.checkQuestCompletion( player, 0 ); - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8BH( ManFst003.id, 1 ); - ManFst003.checkQuestCompletion( player, 3 ); - }); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, NONE/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if ( param2 == 1 ) - { - ManFst003.Scene00100( player ); - } - else - { - ManFst003.Scene00099( player ); - } - }); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, 0, 0, 0 ); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( ManFst003.id, 0 ) ) - { - player.questFinish( ManFst003.id ); - } - } - - }); - } - - def Scene00050( player ) - { - player.eventPlay( this.id, 50, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - // accepting quest "close to home" - player.questUpdate( ManFst003.id, 1 ); - player.setQuestUI8CH( ManFst003.id, 1 ); // receive key item - // event is done, need to teleport to real zone. - player.setZone( 132 ); - //player.setZone(183); back to starting griania for debug purpose - }); - } - - def Scene00051( player ) - { - player.eventPlay( this.id, 51, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManFst003.Scene00001( player ); - }); - } - - def Scene00099( player ) - { - player.eventPlay( this.id, 99, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManFst003.Scene00004( player ); - }); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, 0x0EFB, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8CH( ManFst003.id, 0 ); // remove key item, since we have just traded it - player.setQuestUI8BL( ManFst003.id, 1 ); - ManFst003.checkQuestCompletion(player, 2 ); - }); - } - - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == this.ACTOR0 ) - { - this.Scene00000( player ); - } - else if( actor == this.ACTOR1 ) - { - // starting the Aetheryte eventaction - // player.eventStart( actorId, 0x050002, 7, 0, 0); - // starting the eventaction 0x13 ( attuning ) - player.eventActionStart( 0x050002, 0x13, - fun( player, eventId, additional ) - { - - player.questMessage( 0x050002, 0, 1, 0, 0 ); - player.aetheryteRegister( 2 ); - player.learnAction( 1 ); - ManFst003.Scene00051( player ); - }, - fun( player, eventId, additional ) {}, - eventId ); - } - else if( actor == this.ACTOR2 ) - { - this.Scene00002( player ); - } - else if( actor == this.ACTOR3 ) - { - this.Scene00003( player ); - } - else if( actor == this.ACTOR4 ) - { - this.Scene00005( player ); - } - - } - -}; - -GLOBAL ManFst003 = ManFst003Def(); diff --git a/scripts/chai/quest/ManFst003.chai_generated b/scripts/chai/quest/ManFst003.chai_generated deleted file mode 100644 index e893e598..00000000 --- a/scripts/chai/quest/ManFst003.chai_generated +++ /dev/null @@ -1,246 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai - - -// Quest Script: ManFst003_00123 -// Quest Name: Close to Home -// Quest ID: 65659 -// Start NPC: 1001140 -// End NPC: 1000100 - -class ManFst003 -{ - var name; - var id; - var SEQ_0; - var SEQ_1; - var SEQ_FINISH; - var SEQ_OFFER; - var RewardExpFactor; - var RewardGil; - var ACTOR0; - var SEQ_0_ACTOR0; - var ITEM0; - var ACTOR1; - var SEQ_1_ACTOR1; - var ACTOR2; - var SEQ_1_ACTOR2; - var ACTOR3; - var SEQ_1_ACTOR3; - var SEQ_1_ACTOR3_NPCTRADEOK; - var SEQ_1_ACTOR3_NPCTRADENO; - var SEQ_1_ACTOR0; - var ACTOR4; - var SEQ_2_ACTOR4; - var TERRITORYTYPE0; - var POPRANGE0; - var LOC_MARKER_01; - var LOC_MARKER_02; - var LOC_MARKER_03; - var LOC_MARKER_04; - var LOC_MARKER_05; - var LOC_MARKER_06; - var LOC_MARKER_07; - var LOC_MARKER_08; - var LOC_MARKER_09; - var SEQ_0_ACTOR0_LQ; - var UNLOCK_DESION; - var REWARD_DESION; - var HOW_TO_MAP_AND_NAVI; - var HOW_TO_DESION; - var ACTOR20; - var SEQ_1_ACTOR1_WAIT; - var LOC_ACTOR0; - var BIND_ACTOR0; - var LOC_MOTION0; - - ////////////////////////////////////////////////////////////////////// - // default ctor - def ManFst003() - { - // Basic quest information - this.name = "Close to Home"; - this.id = 65659; - // These are the quest vars / flags used in this quest - // GetQuestBitFlag8 - // GetQuestUI8AL - // GetQuestUI8BH - // GetQuestUI8BL - // GetQuestUI8CH - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - //this.SEQ_OFFER = ?; - - // Quest rewards - this.RewardExpFactor = 100; - this.RewardGil = 107; - - // Entities found in the script data of the quest - // some of these may be useful - this.ACTOR0 = 1001140; - this.ACTOR1 = 2; - this.ACTOR2 = 1000197; - this.ACTOR20 = 1000159; - this.ACTOR3 = 1000768; - this.ACTOR4 = 1000100; - this.BIND_ACTOR0 = 6229224; - this.HOW_TO_DESION = 13; - this.HOW_TO_MAP_AND_NAVI = 4; - this.ITEM0 = 2000119; - this.LOC_ACTOR0 = 1003159; - this.LOC_MARKER_01 = 2153091; - this.LOC_MARKER_02 = 2153104; - this.LOC_MARKER_03 = 2153111; - this.LOC_MARKER_04 = 2154539; - this.LOC_MARKER_05 = 2154540; - this.LOC_MARKER_06 = 2154541; - this.LOC_MARKER_07 = 2210446; - this.LOC_MARKER_08 = 2210454; - this.LOC_MARKER_09 = 2210461; - this.LOC_MOTION0 = 799; - this.POPRANGE0 = 2280858; - this.REWARD_DESION = 1; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_0_ACTOR0_LQ = 50; - this.SEQ_1_ACTOR0 = 4; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_1_ACTOR1_WAIT = 51; - this.SEQ_1_ACTOR2 = 2; - this.SEQ_1_ACTOR3 = 3; - this.SEQ_1_ACTOR3_NPCTRADENO = 99; - this.SEQ_1_ACTOR3_NPCTRADEOK = 100; - this.SEQ_2_ACTOR4 = 5; - this.TERRITORYTYPE0 = 132; - this.UNLOCK_DESION = 14; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player, eventId ) - { - player.eventPlay( eventId, 0, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00001( player, eventId ) - { - player.eventPlay( eventId, 1, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00002( player, eventId ) - { - player.eventPlay( eventId, 2, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00003( player, eventId ) - { - player.eventPlay( eventId, 3, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00004( player, eventId ) - { - player.eventPlay( eventId, 4, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00005( player, eventId ) - { - player.eventPlay( eventId, 5, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00050( player, eventId ) - { - player.eventPlay( eventId, 50, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00051( player, eventId ) - { - player.eventPlay( eventId, 51, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00099( player, eventId ) - { - player.eventPlay( eventId, 99, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00100( player, eventId ) - { - player.eventPlay( eventId, 100, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest = ManFst003(); - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - -}; - -////////////////////////////////////////////////////////////////////// -// Entry function for this quest -def ManFst003_START(player, actorId, eventId) -{ - var quest = ManFst003(); - var actor = mapActor( actorId ); - - // Script content to be added here.... -} - diff --git a/scripts/chai/quest/ManFst004.chai b/scripts/chai/quest/ManFst004.chai deleted file mode 100644 index a36effde..00000000 --- a/scripts/chai/quest/ManFst004.chai +++ /dev/null @@ -1,258 +0,0 @@ -// Quest Script: ManFst004_00124 -// Quest Name: Close to Home -// Quest ID: 65660 -// Start NPC: 1001140 -// End NPC: 1000100 - -class ManFst004Def -{ - - ////////////////////////////////////////////////////////////////////// - // default ctor - def ManFst004Def() - { - // Basic quest information - this.name = "Close to Home"; - this.id = 65660; - - // These are the quest vars / flags used in this quest - // GetQuestBitFlag8 - // GetQuestUI8AL -- attube to Aetheryte - // GetQuestUI8BH -- visit class guild - // GetQuestUI8BL -- Listen to Parsement in the market check mark - // GetQuestUI8CH -- recieve Key item - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - //this.SEQ_OFFER = ?; - - // Quest rewards - this.RewardExpFactor = 100; - this.RewardGil = 107; - - // Entities found in the script data of the quest - // some of these may be useful - this.ACTOR0 = 1001140; - this.ACTOR1 = 2; - this.ACTOR2 = 1000323; - this.ACTOR20 = 1000159; - this.ACTOR3 = 1000768; - this.ACTOR4 = 1000100; - this.BIND_ACTOR0 = 6229224; - this.ITEM0 = 2000120; - this.LOC_ACTOR0 = 1003159; - this.LOC_MARKER_01 = 2153091; - this.LOC_MARKER_02 = 2153104; - this.LOC_MARKER_03 = 2153111; - this.LOC_MARKER_04 = 2154539; - this.LOC_MARKER_05 = 2154540; - this.LOC_MARKER_06 = 2154541; - this.LOC_MARKER_07 = 2210446; - this.LOC_MARKER_08 = 2210454; - this.LOC_MARKER_09 = 2210461; - this.LOC_MOTION0 = 799; - this.POPRANGE0 = 2280858; - this.REWARD_DESION = 1; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_0_ACTOR0_LQ = 50; - this.SEQ_1_ACTOR0 = 4; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_1_ACTOR1_WAIT = 51; - this.SEQ_1_ACTOR2 = 2; - this.SEQ_1_ACTOR3 = 3; - this.SEQ_1_ACTOR3_NPCTRADENO = 99; - this.SEQ_1_ACTOR3_NPCTRADEOK = 100; - this.SEQ_2_ACTOR4 = 5; - this.TERRITORYTYPE0 = 132; - this.UNLOCK_DESION = 14; - - } - - def checkQuestCompletion( player, varIdx ) - { - - if (varIdx == 3) - { - player.questMessage(this.id, 1, 0, 0, 0 ); - } - else if (varIdx == 2) - { - player.questMessage(this.id, 2, 0, 0, 0 ); - } - else - { - player.questMessage(this.id, 0, 0, 0, 0 ); - } - - var QUEST_VAR_ATTUNE = player.getQuestUI8AL( this.id ); - var QUEST_VAR_CLASS = player.getQuestUI8BH( this.id ); - var QUEST_VAR_TRADE = player.getQuestUI8BL( this.id ); - - if ( QUEST_VAR_ATTUNE == 1 && QUEST_VAR_CLASS == 1 && QUEST_VAR_TRADE == 1 ) - { - player.questUpdate( this.id, this.SEQ_FINISH ); - } - } - - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - ManFst004.Scene00050( player ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0x0EFB/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8AL( ManFst004.id, 1 ); - ManFst004.checkQuestCompletion( player, 0 ); - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8BH( ManFst004.id, 1 ); - ManFst004.checkQuestCompletion( player, 3 ); - }); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, NONE/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if ( param2 == 1 ) - { - ManFst004.Scene00100( player ); - } - else - { - ManFst004.Scene00099( player ); - } - }); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, 0, 0, 0 ); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( ManFst004.id, 0 ) ) - { - player.questFinish( ManFst004.id ); - } - } - - }); - } - - def Scene00050( player ) - { - player.eventPlay( this.id, 50, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - // accepting quest "close to home" - player.questUpdate( ManFst004.id, 1 ); - player.setQuestUI8CH( ManFst004.id, 1 ); // receive key item - // event is done, need to teleport to real zone. - player.setZone( 132 ); - //player.setZone(183); back to starting griania for debug purpose - }); - } - - def Scene00051( player ) - { - player.eventPlay( this.id, 51, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManFst004.Scene00001( player ); - }); - } - - def Scene00099( player ) - { - player.eventPlay( this.id, 99, 0, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManFst004.Scene00004( player ); - }); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, 0x0EFB, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8CH( ManFst004.id, 0 ); // remove key item, since we have just traded it - player.setQuestUI8BL( ManFst004.id, 1 ); - ManFst004.checkQuestCompletion(player, 2 ); - }); - } - - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == this.ACTOR0 ) - { - this.Scene00000( player ); - } - else if( actor == this.ACTOR1 ) - { - // starting the Aetheryte eventaction - // player.eventStart( actorId, 0x050002, 7, 0, 0); - // starting the eventaction 0x13 ( attuning ) - player.eventActionStart( 0x050002, 0x13, - fun( player, eventId, additional ) - { - - player.questMessage( 0x050002, 0, 1, 0, 0 ); - player.aetheryteRegister( 2 ); - player.learnAction( 1 ); - ManFst004.Scene00051( player ); - }, - fun( player, eventId, additional ) {}, - eventId ); - } - else if( actor == this.ACTOR2 ) - { - this.Scene00002( player ); - } - else if( actor == this.ACTOR3 ) - { - this.Scene00003( player ); - } - else if( actor == this.ACTOR4 ) - { - this.Scene00005( player ); - } - - } - -}; - -GLOBAL ManFst004 = ManFst004Def(); - diff --git a/scripts/chai/quest/ManSea001.chai b/scripts/chai/quest/ManSea001.chai deleted file mode 100644 index 8c060bf2..00000000 --- a/scripts/chai/quest/ManSea001.chai +++ /dev/null @@ -1,202 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: ManSea001_00107 -// Quest Name: Coming to Limsa Lominsa -// Quest ID: 65643 -// Start NPC: 1001028 -// End NPC: 1002697 - -class ManSea001Def -{ - def ManSea001Def() - { - // Basic quest information - this.name = "Coming to Limsa Lominsa"; - this.id = 65643; - - // Quest vars / flags used - // GetQuestBitFlag8 - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 103; - - // Entities found in the script data of the quest - this.ACTOR0 = 1001028; - this.ACTOR1 = 1002732; - this.ACTOR2 = 1002697; - this.CUT_EVENT = 202; - this.EOBJECT0 = 2001679; - this.EOBJECT1 = 2001680; - this.EVENT_ACTION_SEARCH = 1; - this.LOC_ACTOR0 = 1002732; - this.LOC_POS_ACTOR0 = 4107186; - this.OPENING_EVENT_HANDLER = 1245185; - this.POPRANGE0 = 4127803; - this.TERRITORYTYPE0 = 181; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - player.setOpeningSequence( 2 ); - ManSea001.Scene00001( player ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0xF8482EFB, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManSea001.Scene00002( player ); - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, HIDE_HOTBAR, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - ManSea001.Scene00003( player ); - }); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, NONE, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( ManSea001.id, 0x01 ); // add quest to player. - - // update the instance boundaries, call to the opening event - player.eventPlay( ManSea001.OPENING_EVENT_HANDLER, 0x1E, 0x2001, 1, 0); - }); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, NONE, 0, 0 ); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, HIDE_HOTBAR, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - ManSea001.Scene00006( player ); - }); - } - - def Scene00006( player ) - { - player.eventPlay( this.id, 6, 0x20, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - player.questUpdate( ManSea001.id, ManSea001.SEQ_FINISH ); - player.prepareZoning( player.getZoneId(), true, 1, 0 ); - player.changePos( 9, 40, 14, 2 ); - } - }); - } - - def Scene00007( player ) - { - player.eventPlay( this.id, 7, NONE, 0, 0 ); - } - - def Scene00008( player ) - { - player.eventPlay( this.id, 8, NONE, 0, 0 ); - } - - def Scene00009( player ) - { - player.eventPlay( this.id, 9, NONE, 0, 0 ); - } - - def Scene00010( player ) - { - player.eventPlay( this.id, 10, NONE, 0, 0 ); - } - - def Scene00011( player ) - { - player.eventPlay( this.id, 11, 0x2c02, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManSea001.Scene00012( player ); - }); - } - - def Scene00012( player ) - { - player.eventPlay( this.id, 12, 0x20, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - if( player.giveQuestRewards( ManSea001.id, 0 ) ) - { - player.questFinish( ManSea001.id ); - } - } - }); - } - - def Scene00013( player ) - { - player.eventPlay( this.id, 13, NONE, 0, 0 ); - } - - ////////////////////////////////////////////////////////////////////// - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - switch( actor ) - { - case( this.ACTOR0 ) - { - this.Scene00000( player ); - break; - } - case( this.ACTOR1 ) - { - this.Scene00005( player ); - break; - } - case( this.ACTOR2 ) - { - this.Scene00011( player ); - break; - } - default - { - - } - } - } - -}; - -GLOBAL ManSea001 = ManSea001Def(); diff --git a/scripts/chai/quest/ManWil001.chai b/scripts/chai/quest/ManWil001.chai deleted file mode 100644 index da55f8c1..00000000 --- a/scripts/chai/quest/ManWil001.chai +++ /dev/null @@ -1,168 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: ManWil001_00594 -// Quest Name: Coming to Ul'dah -// Quest ID: 66130 -// Start NPC: 1003987 -// End NPC: 1003988 - -class ManWil001Def -{ - ////////////////////////////////////////////////////////////////////// - // default ctor - def ManWil001Def() - { - // Basic quest information - this.name = "Coming to Ul'dah"; - this.id = 66130; - - // Quest vars / flags used - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 103; - - // Entities found in the script data of the quest - this.ACTOR0 = 1003987; - this.ACTOR1 = 1003988; - this.ACTOR20 = 1001285; - this.CUT_EVENT = 188; - this.EOBJECT0 = 2001681; - this.EOBJECT1 = 2001682; - this.EOBJECT2 = 2001683; - this.EOBJECT3 = 2001706; - this.EVENT_ACTION_SEARCH = 1; - this.OPENING_EVENT_HANDLER = 1245187; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0x2000, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.setOpeningSequence( 2 ); - ManWil001.Scene00001( player ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0xF8482EFB, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManWil001.Scene00002( player ); - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, NONE, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( ManWil001.id, ManWil001.SEQ_FINISH );// add quest to player. - player.eventPlay( ManWil001.OPENING_EVENT_HANDLER, 0x1E, 0x2001, 0, 0 ); - }); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, 0, 0, 0 ); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, 0x2c02, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - ManWil001.Scene00005( player ); - }); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, 0x20/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // clicked finish button - { - player.gainExp( 50 ); - player.addCurrency( 1, ManWil001.RewardGil ); - player.questFinish( ManWil001.id ); - } - }); - } - - def Scene00006( player ) - { - player.eventPlay( this.id, 6, 0, 0, 0 ); - } - - def Scene00007( player ) - { - player.eventPlay( this.id, 7, 0, 0, 0 ); - } - - def Scene00008( player ) - { - player.eventPlay( this.id, 8, 0, 0, 0 ); - } - - def Scene00009( player ) - { - player.eventPlay( this.id, 9, 0, 0, 0 ); - } - - def Scene00010( player ) - { - player.eventPlay( this.id, 10, 0, 0, 0 ); - } - - def Scene00011( player ) - { - player.eventPlay( this.id, 11, 0, 0, 0 ); - } - - def Scene00012( player ) - { - player.eventPlay( this.id, 12, 0, 0, 0 ); - } - - def Scene00013( player ) - { - player.eventPlay( this.id, 13, 0, 0, 0 ); - } - - ////////////////////////////////////////////////////////////////////// - // Entry function for this quest - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == this.ACTOR0 ) - { - this.Scene00000( player ); - } - else if( actor == this.ACTOR1 ) - { - this.Scene00004( player ); - } - } - -}; - -GLOBAL ManWil001 = ManWil001Def(); diff --git a/scripts/chai/quest/ManWil001.chai_generated b/scripts/chai/quest/ManWil001.chai_generated deleted file mode 100644 index 2c101bd5..00000000 --- a/scripts/chai/quest/ManWil001.chai_generated +++ /dev/null @@ -1,214 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: ManWil001_00594 -// Quest Name: Coming to Ul'dah -// Quest ID: 66130 -// Start NPC: 1003987 -// End NPC: 1003988 - -class ManWil001 -{ - ////////////////////////////////////////////////////////////////////// - // default ctor - def ManWil001() - { - // Basic quest information - this.name = "Coming to Ul'dah"; - this.id = 66130; - - // Quest vars / flags used - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 103; - - // Entities found in the script data of the quest - this.ACTOR0 = 1003987; - this.ACTOR1 = 1003988; - this.ACTOR20 = 1001285; - this.CUT_EVENT = 188; - this.EOBJECT0 = 2001681; - this.EOBJECT1 = 2001682; - this.EOBJECT2 = 2001683; - this.EOBJECT3 = 2001706; - this.EVENT_ACTION_SEARCH = 1; - this.OPENING_EVENT_HANDLER = 1245187; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00006( player ) - { - player.eventPlay( this.id, 6, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00007( player ) - { - player.eventPlay( this.id, 7, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00008( player ) - { - player.eventPlay( this.id, 8, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00009( player ) - { - player.eventPlay( this.id, 9, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00010( player ) - { - player.eventPlay( this.id, 10, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00011( player ) - { - player.eventPlay( this.id, 11, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00012( player ) - { - player.eventPlay( this.id, 12, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - def Scene00013( player ) - { - player.eventPlay( this.id, 13, 0/*flags*/, 0/*unk*/, 0/*unk*/, - fun( player, eventId, subEvent, param1, param2, param3 ) - { - var quest := ManWil001Obj; - // Callback area for this scene, called when the scene finishes - // Add logic here!!! - }); - } - - ////////////////////////////////////////////////////////////////////// - // Entry function for this quest - def eventHandlerNpc( player, actorId, eventId ) - { - var actor = mapActor( actorId ); - // Script content to be added here.... - } - -}; - -GLOBAL ManWil001Obj = ManWil001(); diff --git a/scripts/chai/quest/SubFst000.chai b/scripts/chai/quest/SubFst000.chai deleted file mode 100644 index 07f42a89..00000000 --- a/scripts/chai/quest/SubFst000.chai +++ /dev/null @@ -1,176 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: SubFst000_00020 -// Quest Name: Incense and Sensibility -// Quest ID: 65556 -// Start NPC: 1000786 -// End NPC: 1000705 - -class SubFst000Def -{ - def SubFst000Def() - { - // Basic quest information - this.name = "Incense and Sensibility"; - this.id = 65556; - - // Quest vars / flags used - // GetQuestBitFlag8 - // GetQuestUI8AL - // GetQuestUI8BH - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_2 = 2; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardItemOptional = [4551, 4555]; - this.RewardItemOptionalCount = [3, 3]; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000786; - this.ACTOR1 = 1000705; - this.EOBJECT0 = 2000070; - this.EOBJECT1 = 2000071; - this.ITEM0 = 2000101; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_2_EOBJECT0 = 2; - this.SEQ_2_EOBJECT0_USEITEMNO = 99; - this.SEQ_2_EOBJECT0_USEITEMOK = 100; - this.SEQ_2_EOBJECT1 = 3; - this.SEQ_2_EOBJECT1_USEITEMNO = 97; - this.SEQ_2_EOBJECT1_USEITEMOK = 98; - this.SEQ_3_ACTOR1 = 4; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - player.questUpdate( SubFst000.id, 1 ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8BH( SubFst000.id, 2 ); - player.questUpdate( SubFst000.id, SubFst000.SEQ_2 );// add quest to player. - }); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, NONE, 0, 0 ); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, NONE, 0, 0 ); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, NONE, 0, 0 ); - } - - def Scene00097( player ) - { - player.eventPlay( this.id, 97, NONE, 0, 0 ); - } - - def Scene00098( player ) - { - player.eventPlay( this.id, 98, NONE, 0, 0 ); - } - - def Scene00099( player ) - { - player.eventPlay( this.id, 99, NONE, 0, 0 ); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, NONE, 0, 0 ); - } - - ////////////////////////////////////////////////////////////////////// - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - switch( actor ) - { - case( this.ACTOR0 ) - { - this.Scene00000( player ); - break; - } - case( this.ACTOR1 ) - { - this.Scene00001( player ); - break; - } - default - { - } - } - } - - def onEventItem( eventId, player, eventItemId, castTime, targetId ) - { - if( eventItemId == this.ITEM0 ) - { - player.eventItemActionStart( this.id, eventItemId, - // callback function for finished action - fun ( player, eventId, additional ) - { - var actor = mapActor( additional ); - - var censers = player.getQuestUI8AL( eventId ); - - player.questMessage( eventId, 1, 2, censers + 1, 2 ); - - if ( censers == 2 ) - { - player.questUpdate( eventId, SubFst000.SEQ_FINISH ); - } - else if( actor == SubFst000.EOBJECT0 ) - { - player.setQuestUI8AL(eventId, 4 ); - } - else if( actor == SubFst000.EOBJECT1 ) - { - player.setQuestUI8AL(eventId, 8 ); - } - SubFst000.Scene00100( player ); - - player.setQuestUI8AL( eventId, 0, censers + 1 ); - - }, - // callback for interrupted action. - fun ( player, eventId, additional ) {}, - targetId ); - } - } - -}; - -GLOBAL SubFst000 = SubFst000Def(); diff --git a/scripts/chai/quest/SubFst001.chai b/scripts/chai/quest/SubFst001.chai deleted file mode 100644 index b75364d6..00000000 --- a/scripts/chai/quest/SubFst001.chai +++ /dev/null @@ -1,125 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: SubFst001_00024 -// Quest Name: Coarse Correspondence -// Quest ID: 65560 -// Start NPC: 1000206 -// End NPC: 1000233 - -class SubFst001Def -{ - def SubFst001Def() - { - // Basic quest information - this.name = "Coarse Correspondence"; - this.id = 65560; - - // Quest vars / flags used - // GetQuestUI8AL - // GetQuestUI8BH - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 103; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000206; - this.ACTOR1 = 1000233; - this.ITEM0 = 2000079; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_1_ACTOR1_NPCTRADENO = 99; - this.SEQ_1_ACTOR1_NPCTRADEOK = 100; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( SubFst001.id, 0, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - player.setQuestUI8AL( SubFst001.id, 1 ); - player.setQuestUI8BH( SubFst001.id, 1 ); - player.questUpdate( SubFst001.id, SubFst001.SEQ_FINISH ); - } - } ); - } - - def Scene00001( player ) - { - player.eventPlay( SubFst001.id, 1, NONE, - fun( player, eventId, param1, param2, param3 ) - { - } ); - } - - def Scene00099( player ) - { - player.eventPlay( SubFst001.id, 99, NONE, - fun( player, eventId, param1, param2, param3 ) - { - - } ); - } - - def Scene00100( player ) - { - player.eventPlay( SubFst001.id, 100, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - if( player.giveQuestRewards( SubFst001.id, 0 ) ) - { - player.questFinish( SubFst001.id ); - } - } - } ); - } - - ////////////////////////////////////////////////////////////////////// - // Event Handlers - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == SubFst001.ACTOR0 ) - { - if( !player.hasQuest( SubFst001.id ) ) - { - SubFst001.Scene00000( player ); - } - else - { - SubFst001.Scene00001( player ); - } - } - else if( actor == SubFst001.ACTOR1 ) - { - if( !player.hasQuest( SubFst001.id ) ) - { - // todo: what should this event do? - SubFst001.Scene00099( player ); - } - else - { - SubFst001.Scene00100( player ); - } - } - } - -}; - -GLOBAL SubFst001 = SubFst001Def(); diff --git a/scripts/chai/quest/SubFst002.chai b/scripts/chai/quest/SubFst002.chai deleted file mode 100644 index ec14cda4..00000000 --- a/scripts/chai/quest/SubFst002.chai +++ /dev/null @@ -1,107 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: SubFst002_00025 -// Quest Name: Quarrels with Squirrels -// Quest ID: 65561 -// Start NPC: 1000263 -// End NPC: 1000263 - -class SubFst002Def -{ - def SubFst002Def() - { - // Basic quest information - this.name = "Quarrels with Squirrels"; - this.id = 65561; - - // Quest vars / flags used - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 100; - this.RewardItemOptional = [3762, 3764, 5823]; - this.RewardItemOptionalCount = [1, 1, 3]; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000263; - this.ENEMY0 = 37; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_2_ACTOR0 = 1; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.questUpdate( SubFst002.id, SubFst002.SEQ_1 ); - } - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( SubFst002.id, 0 ) ) - { - player.questFinish( SubFst002.id ); - } - } - } ); - } - - ////////////////////////////////////////////////////////////////////// - // Event Handlers - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( !player.hasQuest( SubFst002.id ) ) - { - SubFst002.Scene00000( player ); - } - - if( actor == SubFst002.ACTOR0 && player.questGetSeq( SubFst002.id ) == SubFst002.SEQ_FINISH ) - { - SubFst002.Scene00001( player ); - } - } - - def onBnpcKill_37( player ) - { - var currentKC = player.getQuestUI8AL(SubFst002.id); - currentKC = currentKC + 1; - - player.questMessage( SubFst002.id, 0, 2, currentKC, 6 ); - - if( currentKC >= 6 ) - { - player.questUpdate( SubFst002.id, SubFst002.SEQ_FINISH ); - } - else - { - player.setQuestUI8AL( SubFst002.id, currentKC ); - } - } - -}; - -GLOBAL SubFst002 = SubFst002Def(); diff --git a/scripts/chai/quest/SubFst003.chai b/scripts/chai/quest/SubFst003.chai deleted file mode 100644 index 88a133c5..00000000 --- a/scripts/chai/quest/SubFst003.chai +++ /dev/null @@ -1,114 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: SubFst003_00026 -// Quest Name: Once Bitten, Twice Shy -// Quest ID: 65562 -// Start NPC: 1000297 -// End NPC: 1000315 - -class SubFst003Def -{ - def SubFst003Def() - { - // Basic quest information - this.name = "Once Bitten, Twice Shy"; - this.id = 65562; - - // Quest vars / flags used - // GetQuestUI8AL - // GetQuestUI8BH - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 118; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000297; - this.ACTOR1 = 1000315; - this.ITEM0 = 2000028; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_1_ACTOR1_NPCTRADENO = 99; - this.SEQ_1_ACTOR1_NPCTRADEOK = 100; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.questUpdate( SubFst003.id, SubFst003.SEQ_FINISH ); - player.setQuestUI8AL( SubFst003.id, 1 ); - player.setQuestUI8BH( SubFst003.id, 1 ); - } - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // gave back items - { - SubFst003.Scene00100( player ); - } - } ); - } - - def Scene00099( player ) - { - player.eventPlay( this.id, 99, NONE, - fun( player, eventId, param1, param2, param3 ) - { - } ); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( SubFst003.id, 0 ) ) - { - player.questFinish( SubFst003.id ); - } - } - } ); - } - - ////////////////////////////////////////////////////////////////////// - // Event Handlers - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( !player.hasQuest( SubFst003.id ) ) - { - SubFst003.Scene00000( player ); - } - - if( actor == SubFst003.ACTOR1 && player.questGetSeq( SubFst003.id ) == SubFst003.SEQ_FINISH ) - { - SubFst003.Scene00001( player ); - } - } - -}; - -GLOBAL SubFst003 = SubFst003Def(); diff --git a/scripts/chai/quest/SubFst004.chai b/scripts/chai/quest/SubFst004.chai deleted file mode 100644 index 7dfdacd2..00000000 --- a/scripts/chai/quest/SubFst004.chai +++ /dev/null @@ -1,150 +0,0 @@ -// Quest Script: SubFst004_00027 -// Quest Name: Preserving the Past -// Quest ID: 65563 -// Start NPC: 1000194 -// End NPC: 1000789 - -class SubFst004Def -{ - def SubFst004Def() - { - // Basic quest information - this.name = "Preserving the Past"; - this.id = 65563; - - // Quest vars / flags used - // GetQuestUI8AL - // GetQuestUI8BH - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardItem = [5594]; - this.RewardItemCount = [10]; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000194; - this.ACTOR1 = 1000686; - this.ACTOR2 = 1000789; - this.ITEM0 = 2000024; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_2_ACTOR2 = 2; - this.SEQ_2_ACTOR2_NPCTRADENO = 99; - this.SEQ_2_ACTOR2_NPCTRADEOK = 100; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - - player.questUpdate( SubFst004.id, SubFst004.SEQ_1 ); - } - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventId, param1, param2, param3 ) - { - player.setQuestUI8AL( SubFst004.id, 1 ); - player.setQuestUI8BH( SubFst004.id, 1 ); - //player.questMessage( SubFst004.id, 0, 2, 1, 1 ); - player.questMessage( SubFst004.id, 0, 1, 21002, 0 ); - player.questUpdate( SubFst004.id, SubFst004.SEQ_FINISH ); - } ); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - SubFst004.Scene00100( player ); - } - } ); - } - - def Scene00099( player ) - { - player.eventPlay( this.id, 99, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - if( player.giveQuestRewards( SubFst004.id, 0 ) ) - { - player.questFinish( SubFst004.id ); - } - } - } ); - } - - ////////////////////////////////////////////////////////////////////// - // Event Handlers - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == SubFst004.ACTOR0 ) - { - if( !player.hasQuest( SubFst004.id ) ) - { - SubFst004.Scene00000( player ); - } - else - { - SubFst004.Scene00001( player ); - } - } - else if( actor == SubFst004.ACTOR1 ) - { - if( !player.hasQuest( SubFst004.id ) ) - { - // todo: what should this event do? - SubFst004.Scene00099( player ); - } - else - { - SubFst004.Scene00001( player ); - } - } - else if( actor == SubFst004.ACTOR2 ) - { - if( !player.hasQuest( SubFst004.id ) ) - { - // todo: what should this event do? - SubFst004.Scene00099( player ); - } - else - { - SubFst004.Scene00002( player ); - } - } - } - -}; - -GLOBAL SubFst004 = SubFst004Def(); diff --git a/scripts/chai/quest/SubFst007.chai b/scripts/chai/quest/SubFst007.chai deleted file mode 100644 index 3c336bcd..00000000 --- a/scripts/chai/quest/SubFst007.chai +++ /dev/null @@ -1,133 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: SubFst007_00031 -// Quest Name: Essential Oil -// Quest ID: 65567 -// Start NPC: 1000705 -// End NPC: 1000705 - -class SubFst007Def -{ - def SubFst007Def() - { - // Basic quest information - this.name = "Essential Oil"; - this.id = 65567; - - // Quest vars / flags used - // GetQuestUI8AL - // GetQuestUI8BH - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 100; - this.RewardItemOptional = [3530, 3531, 5823]; - this.RewardItemOptionalCount = [1, 1, 3]; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000705; - this.ENEMY0 = 49; - this.ITEM0 = 2000098; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_2_ACTOR0 = 1; - this.SEQ_2_ACTOR0_NPCTRADENO = 99; - this.SEQ_2_ACTOR0_NPCTRADEOK = 100; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.questUpdate( SubFst007.id, SubFst007.SEQ_1 ); - } - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // gave back items - { - SubFst007.Scene00100( player ); - } - } ); - } - - def Scene00099( player ) //unused - { - player.eventPlay( this.id, 99, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( SubFst007.id, 0 ) ) - { - player.questFinish( SubFst007.id ); - } - } - } ); - } - - ////////////////////////////////////////////////////////////////////// - // Event Handlers - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( !player.hasQuest( SubFst007.id ) ) - { - SubFst007.Scene00000( player ); - } - - if( player.questGetSeq( SubFst007.id ) == SubFst007.SEQ_FINISH ) - { - SubFst007.Scene00001( player ); - } - } - - def onBnpcKill_49( player ) - { - var currentKC = player.getQuestUI8AL(SubFst007.id); - currentKC = currentKC + 1; - - player.questMessage( SubFst007.id, 0, 2, currentKC, 6 ); - player.tryAddItem( 2000098, 1 ); - - if( currentKC >= 6 ) - { - player.questUpdate( SubFst007.id, SubFst007.SEQ_FINISH ); - player.setQuestUI8BH( SubFst007.id, currentKC ); - } - else - { - player.setQuestUI8AL( SubFst007.id, currentKC ); - player.setQuestUI8BH( SubFst007.id, currentKC ); - } - } - -}; - -GLOBAL SubFst007 = SubFst007Def(); diff --git a/scripts/chai/quest/SubFst010.chai b/scripts/chai/quest/SubFst010.chai deleted file mode 100644 index fb0f4758..00000000 --- a/scripts/chai/quest/SubFst010.chai +++ /dev/null @@ -1,82 +0,0 @@ -// Quest Script: SubFst010_00001 -// Quest Name: A Good Adventurer Is Hard to Find -// Quest ID: 65537 -// Start NPC: 1000146 -// End NPC: 1000195 - -class SubFst010Def -{ - def SubFst010Def() - { - // Basic quest information - this.name = "A Good Adventurer Is Hard to Find"; - this.id = 65537; - - // Quest vars / flags used - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardItem = [4551]; - this.RewardItemCount = [2]; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000146; - this.ACTOR1 = 1000195; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_1_ACTOR1 = 1; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventid, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.questUpdate( SubFst010.id, SubFst010.SEQ_FINISH ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventid, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( SubFst010.id, 0 ) ) - { - player.questFinish( SubFst010.id ); - } - } - }); - } - - ////////////////////////////////////////////////////////////////////// - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( actor == this.ACTOR0 ) - { - this.Scene00000( player ); - } - else if( actor == this.ACTOR1 ) - { - this.Scene00001( player ); - } - } - -}; - -GLOBAL SubFst010 = SubFst010Def(); diff --git a/scripts/chai/quest/SubFst011.chai b/scripts/chai/quest/SubFst011.chai deleted file mode 100644 index 56f616e4..00000000 --- a/scripts/chai/quest/SubFst011.chai +++ /dev/null @@ -1,100 +0,0 @@ -// Quest Script: SubFst011_00037 -// Quest Name: Population Control -// Quest ID: 65573 -// Start NPC: 1000195 -// End NPC: 1000195 - -class SubFst011Def -{ - def SubFst011Def() - { - // Basic quest information - this.name = "Population Control"; - this.id = 65573; - - // Quest vars / flags used - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 100; - this.RewardItemOptional = [2653, 2655, 5823]; - this.RewardItemOptionalCount = [1, 1, 3]; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000195; - this.ENEMY0 = 47; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_2_ACTOR0 = 1; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventid, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.questUpdate( SubFst011.id, SubFst011.SEQ_1 ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventid, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - if( player.giveQuestRewards( SubFst011.id, 0 ) ) - { - player.questFinish( SubFst011.id ); - } - } - }); - } - - ////////////////////////////////////////////////////////////////////// - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( player.hasQuest(SubFst011.id) ) - { - this.Scene00001( player ); - } - else - { - this.Scene00000( player ); - } - } - - def onBnpcKill_47( player ) - { - var currentKC = player.getQuestUI8AL(SubFst011.id); - currentKC = currentKC + 1; - - player.questMessage( SubFst011.id, 0, 2, currentKC, 6 ); - - if( currentKC >= 6 ) - { - player.questUpdate( SubFst011.id, SubFst011.SEQ_FINISH ); - } - else - { - player.setQuestUI8AL( SubFst011.id, currentKC ); - } - } - -}; - -GLOBAL SubFst011 = SubFst011Def(); \ No newline at end of file diff --git a/scripts/chai/quest/SubFst013.chai b/scripts/chai/quest/SubFst013.chai deleted file mode 100644 index 8f048451..00000000 --- a/scripts/chai/quest/SubFst013.chai +++ /dev/null @@ -1,235 +0,0 @@ -// Quest Script: SubFst013_00040 -// Quest Name: For Friendship -// Quest ID: 65576 -// Start NPC: 1000162 -// End NPC: 1000162 - -class SubFst013Def -{ - def SubFst013Def() - { - // Basic quest information - this.name = "For Friendship"; - this.id = 65576; - - // Quest vars / flags used - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_2 = 2; - this.SEQ_3 = 3; - this.SEQ_4 = 4; - this.SEQ_5 = 5; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 111; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000162; - this.ACTOR1 = 1000161; - this.FIRST_QUEST = 65575; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_1_ACTOR1 = 1; - this.SEQ_1_ACTOR1_EMOTENO = 99; - this.SEQ_1_ACTOR1_EMOTEOK = 100; - this.SEQ_2_ACTOR0 = 2; - this.SEQ_3_ACTOR1 = 3; - this.SEQ_3_ACTOR1_EMOTENO = 97; - this.SEQ_3_ACTOR1_EMOTEOK = 98; - this.SEQ_4_ACTOR0 = 4; - this.SEQ_5_ACTOR1 = 5; - this.SEQ_5_ACTOR1_EMOTENO = 95; - this.SEQ_5_ACTOR1_EMOTEOK = 96; - this.SEQ_6_ACTOR0 = 6; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.questUpdate( SubFst013.id, SubFst013.SEQ_1 ); - } - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, NONE, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( SubFst013.id, SubFst013.SEQ_3 ); - } ); - } - - def Scene00003( player ) //unused - { - player.eventPlay( this.id, 3, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, NONE, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( SubFst013.id, SubFst013.SEQ_5 ); - } ); - } - - def Scene00005( player ) //unused - { - player.eventPlay( this.id, 5, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00006( player ) - { - player.eventPlay( this.id, 6, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( SubFst013.id, 0 ) ) - { - player.questFinish( SubFst013.id ); - } - } - } ); - } - - def Scene00095( player ) //unused - { - player.eventPlay( this.id, 95, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00096( player ) - { - player.eventPlay( this.id, 96, NONE, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( SubFst013.id, SubFst013.SEQ_FINISH ); - player.questMessage( SubFst013.id, 4, 2, 0, 0 ); - } ); - } - - def Scene00097( player ) //unused - { - player.eventPlay( this.id, 97, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00098( player ) - { - player.eventPlay( this.id, 98, NONE, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( SubFst013.id, SubFst013.SEQ_4 ); - player.questMessage( SubFst013.id, 2, 2, 0, 0 ); - } ); - } - - def Scene00099( player ) //unused - { - player.eventPlay( this.id, 99, NONE, - fun( player, eventId, param1, param2, param3 ) - {} ); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, NONE, - fun( player, eventId, param1, param2, param3 ) - { - player.questUpdate( SubFst013.id, SubFst013.SEQ_2 ); - player.questMessage( SubFst013.id, 0, 2, 0, 0 ); - } ); - } - - ////////////////////////////////////////////////////////////////////// - // Event Handlers - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( !player.hasQuest( SubFst013.id ) ) - { - SubFst013.Scene00000( player ); - return; - } - - if( actor == SubFst013.ACTOR1 ) //talk to girl without emotes - { - SubFst013.Scene00001( player ); - return; - } - - if( actor == SubFst013.ACTOR0 && player.questGetSeq( SubFst013.id ) == SubFst013.SEQ_2 ) - { - SubFst013.Scene00002( player ); - return; - } - - if( actor == SubFst013.ACTOR0 && player.questGetSeq( SubFst013.id ) == SubFst013.SEQ_4 ) - { - SubFst013.Scene00004( player ); - return; - } - - if( actor == SubFst013.ACTOR0 && player.questGetSeq( SubFst013.id ) == SubFst013.SEQ_FINISH ) - { - SubFst013.Scene00006( player ); - return; - } - - } - - def onEmote( eventId, player, actorId, emoteId ) - { - var actor = mapActor( actorId ); - print( emoteId ); - - if( actor == SubFst013.ACTOR1 && emoteId == 5 && player.questGetSeq( SubFst013.id ) == SubFst013.SEQ_1 ) - { - SubFst013.Scene00100( player ); - return; - } - - if( actor == SubFst013.ACTOR1 && emoteId == 18 && player.questGetSeq( SubFst013.id ) == SubFst013.SEQ_3 ) - { - SubFst013.Scene00098( player ); - return; - } - - if( actor == SubFst013.ACTOR1 && emoteId == 11 && player.questGetSeq( SubFst013.id ) == SubFst013.SEQ_5 ) - { - SubFst013.Scene00096( player ); - return; - } - } - -}; - -GLOBAL SubFst013 = SubFst013Def(); diff --git a/scripts/chai/quest/SubFst015.chai b/scripts/chai/quest/SubFst015.chai deleted file mode 100644 index a8f89a2b..00000000 --- a/scripts/chai/quest/SubFst015.chai +++ /dev/null @@ -1,261 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: SubFst015_00042 -// Quest Name: Sylphic Gratitude -// Quest ID: 65578 -// Start NPC: 1000286 -// End NPC: 1000286 - -class SubFst015Def -{ - def SubFst015Def() - { - // Basic quest information - this.name = "Sylphic Gratitude"; - this.id = 65578; - - // Quest vars / flags used - // GetQuestBitFlag8 - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_1 = 1; - this.SEQ_FINISH = 255; - //this.SEQ_OFFER = ?; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardGil = 110; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000286; - this.EOBJECT0 = 2000020; - this.EOBJECT1 = 2000021; - this.EOBJECT2 = 2000022; - this.EOBJECT3 = 2000023; - this.EOBJECT4 = 2000024; - this.EOBJECT5 = 2000025; - this.EVENT_ACTION_SEARCH = 1; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - player.questUpdate( SubFst015.id, 1 ); - } - }); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, 0, 0 ); - } - - def Scene00002( player ) - { - player.eventPlay( this.id, 2, NONE, 0, 0 ); - } - - def Scene00003( player ) - { - player.eventPlay( this.id, 3, NONE, 0, 0 ); - } - - def Scene00004( player ) - { - player.eventPlay( this.id, 4, NONE, 0, 0 ); - } - - def Scene00005( player ) - { - player.eventPlay( this.id, 5, NONE, 0, 0 ); - } - - def Scene00006( player ) - { - player.eventPlay( this.id, 6, NONE, 0, 0 ); - } - - def Scene00007( player ) - { - player.eventPlay( this.id, 7, NONE, 0, 0, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) - { - if( player.giveQuestRewards( SubFst015.id, 0 ) ) - { - player.questFinish( SubFst015.id ); - } - } - }); - } - - def Scene00089( player ) - { - player.eventPlay( this.id, 89, NONE, 0, 0 ); - } - - def Scene00090( player ) - { - player.eventPlay( this.id, 90, NONE, 0, 0 ); - } - - def Scene00091( player ) - { - player.eventPlay( this.id, 91, NONE, 0, 0 ); - } - - def Scene00092( player ) - { - player.eventPlay( this.id, 92, NONE, 0, 0 ); - } - - def Scene00093( player ) - { - player.eventPlay( this.id, 93, NONE, 0, 0 ); - } - - def Scene00094( player ) - { - player.eventPlay( this.id, 94, NONE, 0, 0 ); - } - - def Scene00095( player ) - { - player.eventPlay( this.id, 95, NONE, 0, 0 ); - } - - def Scene00096( player ) - { - player.eventPlay( this.id, 96, NONE, 0, 0 ); - } - - def Scene00097( player ) - { - player.eventPlay( this.id, 97, NONE, 0, 0 ); - } - - def Scene00098( player ) - { - player.eventPlay( this.id, 98, NONE, 0, 0 ); - } - - def Scene00099( player ) - { - player.eventPlay( this.id, 99, NONE, 0, 0 ); - } - - def Scene00100( player ) - { - player.eventPlay( this.id, 100, NONE, 0, 0 ); - } - - ////////////////////////////////////////////////////////////////////// - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - switch( actor ) - { - case( this.ACTOR0 ) - { - if( player.hasQuest( this.id ) ) - { - this.Scene00007( player ); - } - else - { - this.Scene00000( player ); - } - break; - } - case ( this.EOBJECT0 ) {} - case ( this.EOBJECT1 ) {} - case ( this.EOBJECT2 ) {} - case ( this.EOBJECT3 ) {} - case ( this.EOBJECT4 ) {} - case ( this.EOBJECT5 ) - { - player.eventActionStart( this.id, 0x0F, - fun( player, eventId, additional ) - { - var actor = mapActor( additional ); - - var currVegetal = player.getQuestUI8AL( eventId ); - - var despawn1 = player.getQuestUI8FL( eventId ); - var despawn2 = player.getQuestUI8FH( eventId ); - - if( SubFst015.EOBJECT3 == actor ) - { - despawn2 = despawn2 | 1; - player.setQuestUI8FH( eventId, despawn2 ); - } - else if( SubFst015.EOBJECT2 == actor ) - { - despawn2 = despawn2 | 2; - player.setQuestUI8FH( eventId, despawn2 ); - } - else if( SubFst015.EOBJECT1 == actor ) - { - despawn2 = despawn2 | 4; - player.setQuestUI8FH( eventId, despawn2 ); - } - else if( SubFst015.EOBJECT0 == actor ) - { - despawn2 = despawn2 | 8; - player.setQuestUI8FH( eventId, despawn2 ); - } - else if( SubFst015.EOBJECT5 == actor ) - { - despawn2 = despawn1 | 4; - player.setQuestUI8FL( eventId, despawn2 ); - } - else if( SubFst015.EOBJECT4 == actor ) - { - despawn2 = despawn1 | 8; - player.setQuestUI8FL( eventId, despawn2 ); - } - - player.questMessage( eventId, 0, 2, currVegetal + 1, 6 ); - - if ( currVegetal + 1 == 6 ) - { - player.questUpdate( eventId, SubFst015.SEQ_FINISH ); - } - else - { - player.setQuestUI8AL( eventId, currVegetal + 1 ); - } - - SubFst015.Scene00096( player ); - }, - fun( player, eventId, additional ) - { - }, - actorId ); - player.unlock(); - break; - } - - default - { - } - } - } - -}; - -GLOBAL SubFst015 = SubFst015Def(); diff --git a/scripts/chai/quest/SubFst019.chai b/scripts/chai/quest/SubFst019.chai deleted file mode 100644 index 371a0096..00000000 --- a/scripts/chai/quest/SubFst019.chai +++ /dev/null @@ -1,89 +0,0 @@ -// This is an automatically generated chai script template -// Content needs to be added by hand to make it function -// In order for this script to be loaded, change its extension to .chai -// and move it to the correct folder in bin/scripts/chai/quest - -// Quest Script: SubFst019_00049 -// Quest Name: I Am Millicent, Hear Me Roar -// Quest ID: 65585 -// Start NPC: 1000788 -// End NPC: 1000429 - -class SubFst019Def -{ - def SubFst019Def() - { - // Basic quest information - this.name = "I Am Millicent, Hear Me Roar"; - this.id = 65585; - - // Quest vars / flags used - // GetQuestUI8AL - - // Steps in this quest ( 0 is before accepting, - // 1 is first, 255 means ready for turning it in - this.SEQ_0 = 0; - this.SEQ_FINISH = 255; - - // Quest rewards - this.RewardExpFactor = 50; - this.RewardItem = [4551]; - this.RewardItemCount = [5]; - - // Entities found in the script data of the quest - this.ACTOR0 = 1000788; - this.ACTOR1 = 1000429; - this.SEQ_0_ACTOR0 = 0; - this.SEQ_1_ACTOR1 = 1; - - } - - ////////////////////////////////////////////////////////////////////// - // Available Scenes in this quest, not necessarly all are used - def Scene00000( player ) - { - player.eventPlay( this.id, 0, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // accept quest - { - player.questUpdate( SubFst019.id, SubFst019.SEQ_FINISH ); - } - } ); - } - - def Scene00001( player ) - { - player.eventPlay( this.id, 1, NONE, - fun( player, eventId, param1, param2, param3 ) - { - if( param2 == 1 ) // finish quest - { - if( player.giveQuestRewards( SubFst019.id, 0 ) ) - { - player.questFinish( SubFst019.id ); - } - } - } ); - } - - ////////////////////////////////////////////////////////////////////// - // Event Handlers - def onTalk( eventId, player, actorId ) - { - var actor = mapActor( actorId ); - - if( !player.hasQuest( SubFst019.id ) ) - { - SubFst019.Scene00000( player ); - } - - if( actor == SubFst019.ACTOR1 && player.questGetSeq( SubFst019.id ) == SubFst019.SEQ_FINISH ) - { - SubFst019.Scene00001( player ); - } - } - -}; - -GLOBAL SubFst019 = SubFst019Def(); diff --git a/scripts/chai/skill/cnj/skillDef_119.chai b/scripts/chai/skill/cnj/skillDef_119.chai deleted file mode 100644 index 2c25a2df..00000000 --- a/scripts/chai/skill/cnj/skillDef_119.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Stone -// Skill ID: 119 - -class skillDef_119Def -{ - def skillDef_119Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_DAMAGE, 119, 140, 0, target ); - } - -}; - -GLOBAL skillDef_119 = skillDef_119Def(); diff --git a/scripts/chai/skill/cnj/skillDef_120.chai b/scripts/chai/skill/cnj/skillDef_120.chai deleted file mode 100644 index ec78e907..00000000 --- a/scripts/chai/skill/cnj/skillDef_120.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Cure -// Skill ID: 120 - -class skillDef_120Def -{ - def skillDef_120Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_HEAL, 120, 450, 0, target ); - } - -}; - -GLOBAL skillDef_120 = skillDef_120Def(); diff --git a/scripts/chai/skill/cnj/skillDef_121.chai b/scripts/chai/skill/cnj/skillDef_121.chai deleted file mode 100644 index 048ec609..00000000 --- a/scripts/chai/skill/cnj/skillDef_121.chai +++ /dev/null @@ -1,19 +0,0 @@ -// Skill Name: Aero -// Skill ID: 121 - -class skillDef_121Def -{ - def skillDef_121Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_DAMAGE, 121, 50, 0, target ); - target.addStatusEffectByIdIfNotExist(143, 20000, player, 0); - } - -}; - -GLOBAL skillDef_121 = skillDef_121Def(); diff --git a/scripts/chai/skill/cnj/skillDef_124.chai b/scripts/chai/skill/cnj/skillDef_124.chai deleted file mode 100644 index 325dd3d9..00000000 --- a/scripts/chai/skill/cnj/skillDef_124.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Medica -// Skill ID: 124 - -class skillDef_124Def -{ - def skillDef_124Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_HEAL, 124, 300, 0, player ); - } - -}; - -GLOBAL skillDef_124 = skillDef_124Def(); diff --git a/scripts/chai/skill/cnj/skillDef_125.chai b/scripts/chai/skill/cnj/skillDef_125.chai deleted file mode 100644 index 2795dc85..00000000 --- a/scripts/chai/skill/cnj/skillDef_125.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Raise -// Skill ID: 125 - -class skillDef_125Def -{ - def skillDef_125Def() - { - - } - - def onFinish( player, target ) - { - target.addStatusEffectByIdIfNotExist( 148, 60000, player, 0 ); - } - -}; - -GLOBAL skillDef_125 = skillDef_125Def(); diff --git a/scripts/chai/skill/cnj/skillDef_127.chai b/scripts/chai/skill/cnj/skillDef_127.chai deleted file mode 100644 index 88baf71d..00000000 --- a/scripts/chai/skill/cnj/skillDef_127.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Stone II -// Skill ID: 127 - -class skillDef_127Def -{ - def skillDef_127Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_DAMAGE, 127, 200, 0, target ); - } - -}; - -GLOBAL skillDef_127 = skillDef_127Def(); diff --git a/scripts/chai/skill/cnj/skillDef_128.chai b/scripts/chai/skill/cnj/skillDef_128.chai deleted file mode 100644 index 0d5aa11f..00000000 --- a/scripts/chai/skill/cnj/skillDef_128.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Repose -// Skill ID: 128 - -class skillDef_128Def -{ - def skillDef_128Def() - { - - } - - def onFinish( player, target ) - { - target.addStatusEffectByIdIfNotExist( 3, 30000, player, 0 ); - } - -}; - -GLOBAL skillDef_128 = skillDef_128Def(); diff --git a/scripts/chai/skill/cnj/skillDef_132.chai b/scripts/chai/skill/cnj/skillDef_132.chai deleted file mode 100644 index 3cca7909..00000000 --- a/scripts/chai/skill/cnj/skillDef_132.chai +++ /dev/null @@ -1,19 +0,0 @@ -// Skill Name: Aero II -// Skill ID: 132 - -class skillDef_132Def -{ - def skillDef_132Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_DAMAGE, 132, 50, 0, target ); - target.addStatusEffectByIdIfNotExist( 143, 20000, player, 0 ); - } - -}; - -GLOBAL skillDef_132 = skillDef_132Def(); diff --git a/scripts/chai/skill/cnj/skillDef_133.chai b/scripts/chai/skill/cnj/skillDef_133.chai deleted file mode 100644 index 9a279eaa..00000000 --- a/scripts/chai/skill/cnj/skillDef_133.chai +++ /dev/null @@ -1,19 +0,0 @@ -// Skill Name: Medica II -// Skill ID: 133 - -class skillDef_133Def -{ - def skillDef_133Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_HEAL, 133, 200, 0, player ); - target.addStatusEffectByIdIfNotExist( 150, 30000, player, 50 ); - } - -}; - -GLOBAL skillDef_133 = skillDef_133Def(); diff --git a/scripts/chai/skill/pgl/skillDef_53.chai b/scripts/chai/skill/pgl/skillDef_53.chai deleted file mode 100644 index 0ebbb980..00000000 --- a/scripts/chai/skill/pgl/skillDef_53.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Bootshine -// Skill ID: 53 - -class skillDef_53Def -{ - def skillDef_53Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_DAMAGE, 53, 140, 0, target ); - } - -}; - -GLOBAL skillDef_53 = skillDef_53Def(); diff --git a/scripts/chai/skill/skillDef_3.chai b/scripts/chai/skill/skillDef_3.chai deleted file mode 100644 index e888058a..00000000 --- a/scripts/chai/skill/skillDef_3.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Sprint -// Skill ID: 3 - -class skillDef_3Def -{ - def skillDef_3Def() - { - - } - - def onFinish( player, target ) - { - player.addStatusEffectById(50, 20000, player, 30); - } - -}; - -GLOBAL skillDef_3 = skillDef_3Def(); diff --git a/scripts/chai/skill/skillDef_6.chai b/scripts/chai/skill/skillDef_6.chai deleted file mode 100644 index 8c5c61a1..00000000 --- a/scripts/chai/skill/skillDef_6.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Return -// Skill ID: 6 - -class skillDef_6Def -{ - def skillDef_6Def() - { - - } - - def onFinish( player, target ) - { - player.returnToHomepoint(); - } - -}; - -GLOBAL skillDef_6 = skillDef_6Def(); diff --git a/scripts/chai/skill/thm/skillDef_147.chai b/scripts/chai/skill/thm/skillDef_147.chai deleted file mode 100644 index e36950a1..00000000 --- a/scripts/chai/skill/thm/skillDef_147.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Skill Name: Fire II -// Skill ID: 147 - -class skillDef_147Def -{ - def skillDef_147Def() - { - - } - - def onFinish( player, target ) - { - player.handleScriptSkill( STD_DAMAGE, 147, 80, 0, target ); - } - -}; - -GLOBAL skillDef_147 = skillDef_147Def(); \ No newline at end of file diff --git a/scripts/chai/status/statusDef_143.chai b/scripts/chai/status/statusDef_143.chai deleted file mode 100644 index 70a4d80a..00000000 --- a/scripts/chai/status/statusDef_143.chai +++ /dev/null @@ -1,19 +0,0 @@ -// Status Name: Aero -// Status ID: 143 - -class statusDef_143Def -{ - def statusDef_143Def() - { - - } - - def onTick( actor, effect ) - { - print("tick"); - effect.registerTickEffect( 1, 30 ); - } - -}; - -GLOBAL statusDef_143 = statusDef_143Def(); diff --git a/scripts/chai/status/statusDef_144.chai b/scripts/chai/status/statusDef_144.chai deleted file mode 100644 index 72159c8d..00000000 --- a/scripts/chai/status/statusDef_144.chai +++ /dev/null @@ -1,18 +0,0 @@ -// Status Name: Aero II -// Status ID: 144 - -class statusDef_144Def -{ - def statusDef_144Def() - { - - } - - def onTick( actor, effect ) - { - effect.registerTickEffect( 1, 50 ); - } - -}; - -GLOBAL statusDef_144 = statusDef_144Def(); diff --git a/scripts/native/CMakeLists.txt b/scripts/native/CMakeLists.txt new file mode 100644 index 00000000..aeaa0094 --- /dev/null +++ b/scripts/native/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 3.0) +project(Sapphire_Script) + +file(GLOB SCRIPT_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h") + +include_directories("${CMAKE_SOURCE_DIR}/src/servers/") +include_directories("${CMAKE_SOURCE_DIR}/src/servers/sapphire_zone/") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") + +message("exec: ${EXECUTABLE_OUTPUT_DIRECTORY}") + +set(SCRIPT_LIB_DIR "${EXECUTABLE_OUTPUT_DIRECTORY}/compiledscripts/" ) +set(EXECUTABLE_OUTPUT_PATH "${SCRIPT_LIB_DIR}") +set(LIBRARY_OUTPUT_PATH "${SCRIPT_LIB_DIR}") +set(RUNTIME_OUTPUT_DIRECTORY "${SCRIPT_LIB_DIR}") + + +file(GLOB children "${CMAKE_CURRENT_SOURCE_DIR}/*" ) +foreach(_scriptDir ${children}) + get_filename_component(_name "${_scriptDir}" NAME_WE) + if(IS_DIRECTORY ${_scriptDir} AND NOT ${_name} MATCHES "CMakeFiles") + message("discovered plugin lib: ${_scriptDir} (${_name})") + + file(GLOB_RECURSE SCRIPT_FILES "${_scriptDir}/*.cpp") + + # build file list + foreach(_script ${SCRIPT_FILES}) + get_filename_component( _scriptname "${_script}" NAME_WE) + + if(NOT ${_scriptname} MATCHES "ScriptLoader") + if(ScriptIncludes) + set(ScriptIncludes "${ScriptIncludes}\n#include \"${_script}\"") + else() + set(ScriptIncludes "#include \"${_script}\"") + endif() + + set(ScriptNames "${ScriptNames} static_cast< ScriptObject* >( new ${_scriptname} ),\n") + endif() + endforeach() + + add_library("script_${_name}" MODULE "${SCRIPT_FILES}" "${SCRIPT_INCLUDE_FILES}" "${_scriptDir}/ScriptLoader.cpp") + target_link_libraries("script_${_name}" sapphire_zone) + + if(MSVC) + set_target_properties("script_${_name}" PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS ON + LIBRARY_OUTPUT_DIRECTORY_DEBUG "${SCRIPT_LIB_DIR}" + LIBRARY_OUTPUT_DIRECTORY_RELEASE "${SCRIPT_LIB_DIR}" + LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${SCRIPT_LIB_DIR}" + LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${SCRIPT_LIB_DIR}" + ) + endif() + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ScriptLoader.cpp.in" "${_scriptDir}/ScriptLoader.cpp") + + add_custom_command(TARGET "script_${_name}" POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.exp" + COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.lib" + COMMAND ${CMAKE_COMMAND} -E remove "${SCRIPT_LIB_DIR}/script_${_name}.ilk" + ) + + unset(ScriptIncludes) + unset(ScriptNames) + endif() +endforeach() diff --git a/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp b/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp new file mode 100644 index 00000000..618c1610 --- /dev/null +++ b/scripts/native/CmnDef/CmnDefCutSceneReplay.cpp @@ -0,0 +1,36 @@ +#include "../ScriptObject.h" + +class CmnDefCutSceneReplay : public EventScript +{ +public: + CmnDefCutSceneReplay() : EventScript( "CmnDefCutSceneReplay", 721028 ) + {} + + void Scene00000( Entity::Player& player ) + { + auto callback = [ this ]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) + { + if( param2 != 0 ) + { + Scene00001( player, param2 ); + } + }; + + player.eventPlay( getId(), 0, 0x2000, 0, 1, callback ); + } + + void Scene00001( Entity::Player& player, uint16_t returnScene ) + { + auto callback = []( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) + { + // todo: this is fucked + }; + + player.eventPlay( getId(), 1, 0xFB2EC8F8, 0, 1, returnScene, callback ); + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + Scene00000( player ); + } +}; \ No newline at end of file diff --git a/scripts/native/CmnDef/CmnDefInnBed.cpp b/scripts/native/CmnDef/CmnDefInnBed.cpp new file mode 100644 index 00000000..5e675b88 --- /dev/null +++ b/scripts/native/CmnDef/CmnDefInnBed.cpp @@ -0,0 +1,56 @@ +#include "../ScriptObject.h" + +class CmnDefInnBed : public EventScript +{ +public: + CmnDefInnBed() : EventScript( "CmnDefInnBed", 720916 ) + {} + + // menu + void Scene00000( Entity::Player& player ) + { + auto callback = [ this ]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) + { + if( param2 > 0 ) + Scene00001( player, param2 ); + }; + + player.eventPlay( getId(), 0, 0x2000, 0, 1, callback ); + } + + // lay down + void Scene00001( Entity::Player& player, uint16_t param ) + { + auto callback = [ this ]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) + { + Scene00002( player, param2 ); + }; + + player.eventPlay( getId(), 1, 0xF32E48F8, 0, 1, param, callback ); + } + + // logout + void Scene00002( Entity::Player& player, uint16_t param ) + { + player.eventPlay( getId(), 2, 0xF32E48F8, 0, 1, param, nullptr ); + } + + // wake up + void Scene00100( Entity::Player& player ) + { + auto callback = []( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) + {}; + + player.eventPlay( getId(), 100, 0x800, 0, 0, callback ); + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + Scene00000( player ); + } + + void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override + { + Scene00100( player ); + } +}; \ No newline at end of file diff --git a/scripts/native/CmnDef/CmnDefLinkShell.cpp b/scripts/native/CmnDef/CmnDefLinkShell.cpp new file mode 100644 index 00000000..eb2a7b29 --- /dev/null +++ b/scripts/native/CmnDef/CmnDefLinkShell.cpp @@ -0,0 +1,58 @@ +#include "../ScriptObject.h" + +#define ACTION_CREATE 2 +#define ACTION_RENAME 3 +#define ACTION_REMOVE 4 + +class CmnDefLinkShell : public EventScript +{ +public: + CmnDefLinkShell() : EventScript( "CmnDefLinkShell", 0xB0006 ) + {} + + void Scene00001( Entity::Player& player ) + { + auto callback = [ this ]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) + { + switch( param2 ) + { + case ACTION_CREATE: + Scene00002( player ); + break; + + case ACTION_RENAME: + Scene00003( player ); + break; + + case ACTION_REMOVE: + Scene00004( player ); + break; + } + }; + + player.eventPlay( getId(), 1, 0, 0, 0, callback ); + } + + // create linkshell + void Scene00002( Entity::Player& player ) + { + player.eventPlay( getId(), 2, 0, 0, 0 ); + } + + // rename linkshell + void Scene00003( Entity::Player& player ) + { + player.eventPlay( getId(), 3, 0, 0, 0 ); + } + + // remove linkshell + void Scene00004( Entity::Player& player ) + { + player.eventPlay( getId(), 4, 0, 0, 0 ); + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + Scene00001( player ); + } +}; \ No newline at end of file diff --git a/scripts/native/CmnDef/HouFurOrchestrion.cpp b/scripts/native/CmnDef/HouFurOrchestrion.cpp new file mode 100644 index 00000000..bb370e24 --- /dev/null +++ b/scripts/native/CmnDef/HouFurOrchestrion.cpp @@ -0,0 +1,18 @@ +#include "../ScriptObject.h" + +class HouFurOrchestrion : public EventScript +{ +public: + HouFurOrchestrion() : EventScript( "HouFurOrchestrion", 721226 ) + {} + + void Scene00000( Entity::Player& player ) + { + player.eventPlay( getId(), 0, 0x2000, 0, 1 ); + } + + void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override + { + Scene00000( player ); + } +}; \ No newline at end of file diff --git a/scripts/native/ScriptLoader.cpp.in b/scripts/native/ScriptLoader.cpp.in new file mode 100644 index 00000000..633ca309 --- /dev/null +++ b/scripts/native/ScriptLoader.cpp.in @@ -0,0 +1,16 @@ +#include + +class ScriptObject; + +@ScriptIncludes@ + +const ScriptObject* ptrs[] = +{ +@ScriptNames@ + nullptr +}; + +extern "C" EXPORT const ScriptObject** getScripts() +{ + return ptrs; +} diff --git a/scripts/native/ScriptObject.h b/scripts/native/ScriptObject.h new file mode 100644 index 00000000..17da1520 --- /dev/null +++ b/scripts/native/ScriptObject.h @@ -0,0 +1,94 @@ +#ifndef SAPPHIRE_SCRIPTOBJECT_H +#define SAPPHIRE_SCRIPTOBJECT_H + +#include