mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-22 12:47:45 +00:00
70 lines
No EOL
2.6 KiB
ChaiScript
70 lines
No EOL
2.6 KiB
ChaiScript
//Aethernet - Aetheryte
|
|
|
|
class AetheryteDef
|
|
{
|
|
|
|
def AetheryteDef()
|
|
{
|
|
this.AetheryteBaseId = 0x50000;
|
|
this.AETHERYTE_MENU_AETHERNET = 1;
|
|
this.AETHERYTE_MENU_HOUSING = 2;
|
|
this.AETHERYTE_MENU_HOME_POINT = 3;
|
|
this.AETHERYTE_MENU_FAVORITE_POINT = 4;
|
|
this.AETHERYTE_MENU_FAVORITE_POINT_SECURITY_TOKEN = 5;
|
|
}
|
|
|
|
def onTalk( eventId, player, actorId )
|
|
{
|
|
if( player.isAetheryteRegistered( eventId & 0xFFFF ) )
|
|
{
|
|
player.eventPlay( eventId, 0, 1,
|
|
fun ( player, eventId, param1, param2, param3 )
|
|
{
|
|
var aetherId = eventId & 0xFFFF;
|
|
|
|
if ( param1 == 256 ) // set homepoint
|
|
{
|
|
player.setHomepoint( aetherId );
|
|
player.questMessage( eventId, 2, 0xEA, 0, 0);
|
|
}
|
|
else if ( param1 == 512 && param2 == 4 ) // aethernet
|
|
{
|
|
player.teleport( param3, 2 );
|
|
}
|
|
|
|
} );
|
|
}
|
|
else
|
|
{
|
|
var ACTION_ATTUNE = 0x13;
|
|
player.eventActionStart(eventId,
|
|
ACTION_ATTUNE,
|
|
// callback function for finished casting
|
|
fun ( player, eventId, additional )
|
|
{
|
|
var aetherId = eventId & 0xFFFF;
|
|
player.aetheryteRegister(aetherId);
|
|
|
|
// check if teleport is already unlocked
|
|
if( player.isActionLearned( 4 ) )
|
|
{
|
|
player.questMessage( eventId, 0, 2, 0, 0);
|
|
}
|
|
else
|
|
{
|
|
player.questMessage( eventId, 0, 1, 1, 0);
|
|
player.learnAction( 4 );
|
|
}
|
|
},
|
|
// callback for interrupted action.
|
|
fun ( player, eventId, additional )
|
|
{
|
|
},
|
|
0);
|
|
player.unlock();
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
GLOBAL Aetheryte = AetheryteDef(); |