Class PlayerNPC
- All Implemented Interfaces:
MapleCharacterLook
以玩家外觀呈現的特殊 NPC,將角色的髮型、臉型、膚色、裝備與寵物鏡像到遊戲地圖上。
繼承 MapleNPC 並實作 MapleCharacterLook,
將 MapleCharacter 的外觀資料(髮型、臉型、性別、膚色、已裝備道具)
持久化至 playernpcs 與 playernpcs_equip 資料表,
並同步到所有 ChannelServer 頻道,
讓其他玩家可在地圖上看見該角色的複製外觀。
主要職責:
loadAll()— 伺服器啟動時從 DB 讀取全部 PlayerNPC 並廣播至各頻道。update(MapleCharacter)— 角色外觀變更後同步更新並存檔。destroy(boolean)— 刪除 DB 紀錄,可選擇同時從伺服器移除。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()voiddestroy(boolean remove) intintintgetElf()intgetFace()byteintgetHair()shortgetJob()intgetMapId()intgetPet(int i) bytestatic voidloadAll()voidvoidsaveToDB()voidsendSpawnData(MapleClient client) voidsetCoords(int x, int y, int f, int fh) voidsetFace(int f) voidsetGender(int g) voidsetHair(int h) voidvoidsetSkin(byte s) voidupdate(MapleCharacter chr) static voidMethods inherited from class MapleNPC
getName, getType, hasShop, isCustom, sendDestroyData, sendShop, setCustom, setNameMethods 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
-
PlayerNPC
-
PlayerNPC
-
-
Method Details
-
setCoords
public void setCoords(int x, int y, int f, int fh) -
loadAll
public static void loadAll() -
updateByCharId
-
addToServer
public void addToServer() -
removeFromServer
public void removeFromServer() -
update
-
destroy
public void destroy() -
destroy
public void destroy(boolean remove) -
saveToDB
public void saveToDB() -
getJob
public short getJob()- Specified by:
getJobin interfaceMapleCharacterLook
-
getDemonMarking
public int getDemonMarking()- Specified by:
getDemonMarkingin interfaceMapleCharacterLook
-
getEquips
- Specified by:
getEquipsin interfaceMapleCharacterLook
-
getSkinColor
public byte getSkinColor()- Specified by:
getSkinColorin interfaceMapleCharacterLook
-
getGender
public byte getGender()- Specified by:
getGenderin interfaceMapleCharacterLook
-
getFace
public int getFace()- Specified by:
getFacein interfaceMapleCharacterLook
-
getHair
public int getHair()- Specified by:
getHairin interfaceMapleCharacterLook
-
getCharId
public int getCharId() -
getMapId
public int getMapId() -
setSkin
public void setSkin(byte s) -
setFace
public void setFace(int f) -
setHair
public void setHair(int h) -
setGender
public void setGender(int g) -
getPet
public int getPet(int i) -
setPets
-
sendSpawnData
- Overrides:
sendSpawnDatain classMapleNPC
-
getNPCFromWZ
-
getTotems
- Specified by:
getTotemsin interfaceMapleCharacterLook
-
getElf
public int getElf()- Specified by:
getElfin interfaceMapleCharacterLook
-