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