mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-23 21:27:45 +00:00
177 lines
4.4 KiB
ChaiScript
177 lines
4.4 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: SubFst000_00020
|
||
|
// Quest Name: Incense and Sensibility
|
||
|
// Quest ID: 65556
|
||
|
// Start NPC: 1000786
|
||
|
// End NPC: 1000705
|
||
|
|
||
|
class SubFst000Def
|
||
|
{
|
||
|
def SubFst000Def()
|
||
|
{
|
||
|
// Basic quest information
|
||
|
this.name = "Incense and Sensibility";
|
||
|
this.id = 65556;
|
||
|
|
||
|
// Quest vars / flags used
|
||
|
// GetQuestBitFlag8
|
||
|
// 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_2 = 2;
|
||
|
this.SEQ_FINISH = 255;
|
||
|
|
||
|
// Quest rewards
|
||
|
this.RewardExpFactor = 50;
|
||
|
this.RewardItemOptional = [4551, 4555];
|
||
|
this.RewardItemOptionalCount = [3, 3];
|
||
|
|
||
|
// Entities found in the script data of the quest
|
||
|
this.ACTOR0 = 1000786;
|
||
|
this.ACTOR1 = 1000705;
|
||
|
this.EOBJECT0 = 2000070;
|
||
|
this.EOBJECT1 = 2000071;
|
||
|
this.ITEM0 = 2000101;
|
||
|
this.SEQ_0_ACTOR0 = 0;
|
||
|
this.SEQ_1_ACTOR1 = 1;
|
||
|
this.SEQ_2_EOBJECT0 = 2;
|
||
|
this.SEQ_2_EOBJECT0_USEITEMNO = 99;
|
||
|
this.SEQ_2_EOBJECT0_USEITEMOK = 100;
|
||
|
this.SEQ_2_EOBJECT1 = 3;
|
||
|
this.SEQ_2_EOBJECT1_USEITEMNO = 97;
|
||
|
this.SEQ_2_EOBJECT1_USEITEMOK = 98;
|
||
|
this.SEQ_3_ACTOR1 = 4;
|
||
|
|
||
|
}
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////
|
||
|
// 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( SubFst000.id, 1 );
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
def Scene00001( player )
|
||
|
{
|
||
|
player.eventPlay( this.id, 1, NONE, 0, 0,
|
||
|
fun( player, eventId, param1, param2, param3 )
|
||
|
{
|
||
|
player.setQuestUI8BH( SubFst000.id, 2 );
|
||
|
player.questUpdate( SubFst000.id, SubFst000.SEQ_2 );// add quest to player.
|
||
|
});
|
||
|
}
|
||
|
|
||
|
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 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 )
|
||
|
{
|
||
|
this.Scene00000( player );
|
||
|
break;
|
||
|
}
|
||
|
case( this.ACTOR1 )
|
||
|
{
|
||
|
this.Scene00001( player );
|
||
|
break;
|
||
|
}
|
||
|
default
|
||
|
{
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
def onEventItem( eventId, player, eventItemId, castTime, targetId )
|
||
|
{
|
||
|
if( eventItemId == this.ITEM0 )
|
||
|
{
|
||
|
player.eventItemActionStart( this.id, eventItemId,
|
||
|
// callback function for finished action
|
||
|
fun ( player, eventId, additional )
|
||
|
{
|
||
|
var actor = mapActor( additional );
|
||
|
|
||
|
var censers = player.getQuestUI8AL( eventId );
|
||
|
|
||
|
player.questMessage( eventId, 1, 2, censers + 1, 2 );
|
||
|
|
||
|
if ( censers == 2 )
|
||
|
{
|
||
|
player.questUpdate( eventId, SubFst000.SEQ_FINISH );
|
||
|
}
|
||
|
else if( actor == SubFst000.EOBJECT0 )
|
||
|
{
|
||
|
player.setQuestUI8AL(eventId, 4 );
|
||
|
}
|
||
|
else if( actor == SubFst000.EOBJECT1 )
|
||
|
{
|
||
|
player.setQuestUI8AL(eventId, 8 );
|
||
|
}
|
||
|
SubFst000.Scene00100( player );
|
||
|
|
||
|
player.setQuestUI8AL( eventId, 0, censers + 1 );
|
||
|
|
||
|
},
|
||
|
// callback for interrupted action.
|
||
|
fun ( player, eventId, additional ) {},
|
||
|
targetId );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
GLOBAL SubFst000 = SubFst000Def();
|