Class PortalPlayerInteraction

java.lang.Object
scripting.AbstractPlayerInteraction
scripting.PortalPlayerInteraction

public class PortalPlayerInteraction extends AbstractPlayerInteraction
傳送門腳本的玩家互動 API,將 AbstractPlayerInteraction 綁定至特定 MaplePortal

PortalScriptManager 在執行 scripts/portal/<名稱>.js 時建立, 並以 PortalScript.enter(PortalPlayerInteraction) 傳入腳本。本類別以傳送門的位置為預設坐標, 提供自由市場(inFreeMarket)、梅斯特鎮(inArdentmill)等常用傳送捷徑, 以及以傳送門位置為基準的怪物召喚重載(spawnMonster)。

關鍵協作者:

  • AbstractPlayerInteraction:提供傳送、道具操作、任務查詢等完整腳本 API。
  • MaplePortal:保存傳送門 ID、位置及 scriptName,供腳本讀取。
  • MapleClient:持有當前玩家連線,透過 getPlayer() 存取角色。
  • Constructor Details

  • Method Details

    • getPortal

      public final MaplePortal getPortal()
    • inFreeMarket

      public final void inFreeMarket()
    • inArdentmill

      public final void inArdentmill()
    • spawnMonster

      public void spawnMonster(int id)
      Overrides:
      spawnMonster in class AbstractPlayerInteraction
    • spawnMonster

      public void spawnMonster(int id, int qty)
      Overrides:
      spawnMonster in class AbstractPlayerInteraction
    • spawnMonster

      public void spawnMonster(int id, long hp, int mp, int qty, int exp)