import L2Buff from "../entities/L2Buff" ; import L2Character from "../entities/L2Character" ; import L2Creature from "../entities/L2Creature" ; import L2Item from "../entities/L2Item" ; import L2Object from "../entities/L2Object" ; import { RestartPoint } from "../enums/RestartPoint" ; import { ShotsType } from "../enums/ShotsType" ; import MMOConfig from "../mmocore/MMOConfig" ; import GameClient from "../network/GameClient" ; import LoginClient from "../network/LoginClient" ; import AbstractGameCommand from "./AbstractGameCommand" ; import ICommand from "./ICommand" ; import commands from "./index" ; export default interface ClientCommands { param config enter ( config ? ) : Promise < { login : LoginClient ; game : GameClient ; } > ; param text say ( text ) : void ; param text shout ( text ) : void ; param text param target tell ( text , target ) : void ; param text sayToParty ( text ) : void ; param text sayToClan ( text ) : void ; param text sayToTrade ( text ) : void ; param text sayToAlly ( text ) : void ; param x param y param z moveTo ( x , y , z ) : void ; param ItemObjectId param ItemsCount param x param y param z dropItem ( objectId , count , x ? , y ? , z ? ) : void ; param object param shift hit ( object , shift ? ) : void ; param object param shift attack ( object , shift ? ) : void ; /**
     * Cancel the active target
     */ cancelTarget ( ) : void ; /**
     * Accepts the requested party invite
     */ acceptJoinParty ( ) : void ; /**
     * Declines the requested party invite
     */ declineJoinParty ( ) : void ; /**
     * Select next/closest attackable target
     */ nextTarget ( ) : L2Creature | undefined ; /**
     * Request for inventory item list
     */ inventory ( ) : void ; param item useItem ( item ) : void ; param char requestDuel ( char ? ) : void ; param item param enable autoShots ( item , enable ) : void ; param object param buff param level cancelBuff ( object , buff , level ? ) : void ; /**
     * Sit or stand
     */ sitOrStand ( ) : void ; /**
     * Sync position with server
     */ validatePosition ( ) : void ; param magicId param ctrl param shift cast ( magicSkillId , ctrl ? , shift ? ) : void ; /**
     * Open dwarven craft recipe book
     */ dwarvenCraftRecipes ( ) : void ; param recipeId craft ( recipeId ) : void ; param where revive ( where ) : void ; /**
     * Accept resurrect request
     */ acceptResurrect ( ) : void ; /**
     * Decline resurrect request
     */ declineResurrect ( ) : void ; /**
     * Send Party Request
     */ partyInvite ( charOrCharName ? ) : void ; /**
     * Send bypass to server. (dialog)
     */ dialog ( text ) : void ; } export default abstract class ClientCommands { LoginClient = new LoginClient ( ) ; GameClient = new GameClient ( ) ; protected commands : Record < string , ICommand > = commands ; constructor ( ) { return new Proxy < ClientCommands > ( this , { get ( target , propertyKey , receiver ) { if ( propertyKey in target ) { return Reflect . get ( target , propertyKey , receiver ) ; } if ( propertyKey in commands ) { const cmd = Object . create ( ( commands as any ) [ propertyKey ] as AbstractGameCommand , { LoginClient : { value : ( target as any ) . LoginClient } , GameClient : { value : ( target as any ) . GameClient } , } ) ; return ( ... args ) => cmd . execute ( ... args ) ; } } , } ) ; } registerCommand ( commandName , commandHandler ) { if ( commandName in this . commands ) { throw new Error ( `Command ${ commandName } is already registered.` ) ; } this . commands [ commandName ] = commandHandler ; return this ; } }