Class MapleNPC
- Direct Known Subclasses:
PlayerNPC
地圖上的 NPC 實體,繼承
AbstractLoadedMapleLife 並實作地圖物件生命週期介面。
主要職責:
- 持有 NPC 名稱(預設
"MISSINGNO")與自訂旗標custom。 sendSpawnData(MapleClient)— 向進入視野的客戶端發送NPCPacket.spawnNPC(MapleNPC, boolean)及spawnNPCRequestController封包(ID 小於 9901000 才傳送)。sendDestroyData(MapleClient)— 移除 NPC 控制器與 NPC 本體封包。hasShop()/sendShop(MapleClient)— 透過MapleShopFactory判斷並開啟 NPC 商店,供handling.channel.handler.NPCHandler呼叫。
MapleLifeFactory.getNPC(int) 建立,並由
server.maps.MapleMap 在地圖載入時放置;
玩家點擊後由 scripting.NPCScriptManager 驅動對話腳本。-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetName()final MapleMapObjectTypegetType()final booleanhasShop()final booleanisCustom()final voidsendDestroyData(MapleClient client) final voidvoidsendSpawnData(MapleClient client) final voidsetCustom(boolean custom) voidMethods inherited from class AbstractLoadedMapleLife
getCType, getCy, getF, getFh, getId, getMTime, getRx0, getRx1, isHidden, originFh, setCType, setCy, setF, setFh, setHide, setMTime, setRx0, setRx1Methods inherited from class AnimatedMapleMapObject
getFacingDirection, getStance, isFacingLeft, setStanceMethods inherited from class MapleMapObject
getObjectId, getPosition, getRange, getTruePosition, setObjectId, setPosition
-
Constructor Details
-
MapleNPC
-
-
Method Details
-
hasShop
public final boolean hasShop() -
sendShop
-
sendSpawnData
- Specified by:
sendSpawnDatain classMapleMapObject
-
sendDestroyData
- Specified by:
sendDestroyDatain classMapleMapObject
-
getType
- Specified by:
getTypein classMapleMapObject
-
getName
-
setName
-
isCustom
public final boolean isCustom() -
setCustom
public final void setCustom(boolean custom)
-