mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-22 12:47:45 +00:00
107 lines
2.9 KiB
ChaiScript
107 lines
2.9 KiB
ChaiScript
// 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: SubFst002_00025
|
|
// Quest Name: Quarrels with Squirrels
|
|
// Quest ID: 65561
|
|
// Start NPC: 1000263
|
|
// End NPC: 1000263
|
|
|
|
class SubFst002Def
|
|
{
|
|
def SubFst002Def()
|
|
{
|
|
// Basic quest information
|
|
this.name = "Quarrels with Squirrels";
|
|
this.id = 65561;
|
|
|
|
// 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_FINISH = 255;
|
|
|
|
// Quest rewards
|
|
this.RewardExpFactor = 100;
|
|
this.RewardItemOptional = [3762, 3764, 5823];
|
|
this.RewardItemOptionalCount = [1, 1, 3];
|
|
|
|
// Entities found in the script data of the quest
|
|
this.ACTOR0 = 1000263;
|
|
this.ENEMY0 = 37;
|
|
this.SEQ_0_ACTOR0 = 0;
|
|
this.SEQ_2_ACTOR0 = 1;
|
|
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// 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( SubFst002.id, SubFst002.SEQ_1 );
|
|
}
|
|
} );
|
|
}
|
|
|
|
def Scene00001( player )
|
|
{
|
|
player.eventPlay( this.id, 1, NONE,
|
|
fun( player, eventId, param1, param2, param3 )
|
|
{
|
|
if( param2 == 1 ) // finish quest
|
|
{
|
|
if( player.giveQuestRewards( SubFst002.id, 0 ) )
|
|
{
|
|
player.questFinish( SubFst002.id );
|
|
}
|
|
}
|
|
} );
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Event Handlers
|
|
def onTalk( eventId, player, actorId )
|
|
{
|
|
var actor = mapActor( actorId );
|
|
|
|
if( !player.hasQuest( SubFst002.id ) )
|
|
{
|
|
SubFst002.Scene00000( player );
|
|
}
|
|
|
|
if( actor == SubFst002.ACTOR0 && player.questGetSeq( SubFst002.id ) == SubFst002.SEQ_FINISH )
|
|
{
|
|
SubFst002.Scene00001( player );
|
|
}
|
|
}
|
|
|
|
def onBnpcKill_37( player )
|
|
{
|
|
var currentKC = player.getQuestUI8AL(SubFst002.id);
|
|
currentKC = currentKC + 1;
|
|
|
|
player.questMessage( SubFst002.id, 0, 2, currentKC, 6 );
|
|
|
|
if( currentKC >= 6 )
|
|
{
|
|
player.questUpdate( SubFst002.id, SubFst002.SEQ_FINISH );
|
|
}
|
|
else
|
|
{
|
|
player.setQuestUI8AL( SubFst002.id, currentKC );
|
|
}
|
|
}
|
|
|
|
};
|
|
|
|
GLOBAL SubFst002 = SubFst002Def();
|