// 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();