1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-23 21:27:45 +00:00
sapphire/scripts/chai/quest/SubFst004.chai

151 lines
3.9 KiB
ChaiScript
Raw Normal View History

2017-08-08 13:53:47 +02:00
// 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();