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