mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-24 13:47:46 +00:00
235 lines
6.3 KiB
ChaiScript
235 lines
6.3 KiB
ChaiScript
// 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();
|