Class MapleMapItem
java.lang.Object
server.maps.MapleMapObject
server.maps.MapleMapItem
地圖上的掉落物(道具或楓幣),實作為
MapleMapObject 子類別。
每個掉落物持有以下資訊:
Item實體(楓幣掉落時為null,改以meso欄位記錄金額)- 掉落者
dropper(可能是怪物、NPC 或玩家對應的MapleMapObject) - 最初擁有者
character_ownerid(保護期間僅限該角色撿取) - 專屬擁有者
exclusiveOwner(「獨立掉寶」:> 0 時僅該角色可見、可撿取,連同隊都不行) - 掉落類型
type、是否為玩家主動丟棄playerDrop、任務限定questid - 自由撿取時間戳
nextFFA與過期時間戳nextExpiry
由 MapleMonsterKillManager 的掉落邏輯生成,並透過 MapleMap 的
spawnItemDrop/spawnMesoDrop 系列方法放置到地圖;
封包組裝依賴 CField。
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected MapleMapObjectprotected intprotected Itemprotected intprotected longprotected longprotected booleanprotected booleanprotected intprotected booleanprotected byte -
Constructor Summary
ConstructorsConstructorDescriptionMapleMapItem(int meso, Point position, MapleMapObject dropper, MapleCharacter owner, byte type, boolean playerDrop) MapleMapItem(Item item, Point position, MapleMapObject dropper, MapleCharacter owner, byte type, boolean playerDrop) MapleMapItem(Item item, Point position, MapleMapObject dropper, MapleCharacter owner, byte type, boolean playerDrop, int questid) MapleMapItem(Point position, Item item) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean判斷指定角色是否能「看見」此掉落物——生成瞬間與離開地圖後重新進入視野皆共用此判斷。voidfinal MapleMapObjectbytefinal int取得此掉落物的專屬擁有者角色 ID(「獨立掉寶」)。final ItemgetItem()final intgetLock()final intgetMeso()final intgetOwner()final intgetQuest()final MapleMapObjectTypegetType()booleanhasFFA()final boolean判斷此掉落物是否因「獨立掉寶」專屬限制而對指定角色封鎖(不可見/不可撿取)。final booleanfinal booleanfinal booleanvoidregisterExpire(long time) voidregisterFFA(long time) voidsendDestroyData(MapleClient client) voidsendSpawnData(MapleClient client) voidsetDropType(byte z) final voidsetExclusiveOwner(int charId) 設定此掉落物為「獨立掉寶」,僅指定角色可見、可撿取(連同隊玩家都不行)。voidvoidsetPickedUp(boolean pickedUp) booleanshouldExpire(long now) booleanshouldFFA(long now) Methods inherited from class MapleMapObject
getObjectId, getPosition, getRange, getTruePosition, setObjectId, setPosition
-
Field Details
-
item
-
dropper
-
character_ownerid
protected int character_ownerid -
meso
protected int meso -
questid
protected int questid -
exclusiveOwner
protected int exclusiveOwner -
type
protected byte type -
pickedUp
protected boolean pickedUp -
playerDrop
protected boolean playerDrop -
randDrop
protected boolean randDrop -
nextExpiry
protected long nextExpiry -
nextFFA
protected long nextFFA
-
-
Constructor Details
-
MapleMapItem
public MapleMapItem(Item item, Point position, MapleMapObject dropper, MapleCharacter owner, byte type, boolean playerDrop) -
MapleMapItem
public MapleMapItem(Item item, Point position, MapleMapObject dropper, MapleCharacter owner, byte type, boolean playerDrop, int questid) -
MapleMapItem
public MapleMapItem(int meso, Point position, MapleMapObject dropper, MapleCharacter owner, byte type, boolean playerDrop) -
MapleMapItem
-
-
Method Details
-
getItem
-
setItem
-
getQuest
public final int getQuest() -
getItemId
public final int getItemId() -
getDropper
-
getOwner
public final int getOwner() -
getExclusiveOwner
public final int getExclusiveOwner()取得此掉落物的專屬擁有者角色 ID(「獨立掉寶」)。- Returns:
- 專屬擁有者角色 ID;
0表示無專屬限制(一般掉落物)
-
setExclusiveOwner
public final void setExclusiveOwner(int charId) 設定此掉落物為「獨立掉寶」,僅指定角色可見、可撿取(連同隊玩家都不行)。- Parameters:
charId- 專屬擁有者角色 ID;0解除專屬限制
-
canBeSeenBy
判斷指定角色是否能「看見」此掉落物——生成瞬間與離開地圖後重新進入視野皆共用此判斷。依序檢查:角色非
null、未受獨立掉寶專屬限制 (isExclusiveBlockedFor(MapleCharacter))、且任務限定(questid)成立。 對一般掉落物(無專屬擁有者且無任務限定)恆為true。- Parameters:
chr- 目標角色- Returns:
- 可見則
true
-
isExclusiveBlockedFor
判斷此掉落物是否因「獨立掉寶」專屬限制而對指定角色封鎖(不可見/不可撿取)。當
exclusiveOwner大於 0 且該角色並非專屬擁有者時回傳true; 一般掉落物(exclusiveOwner == 0)恆回傳false。撿取端 (Pickup_Player/Pickup_Pet/寵物自動撿取/GM 吸物)皆以此擋下非擁有者。- Parameters:
chr- 目標角色(null視為非擁有者)- Returns:
- 受專屬限制封鎖則
true
-
getMeso
public final int getMeso() -
isPlayerDrop
public final boolean isPlayerDrop() -
isPickedUp
public final boolean isPickedUp() -
setPickedUp
public void setPickedUp(boolean pickedUp) -
getDropType
public byte getDropType() -
setDropType
public void setDropType(byte z) -
isRandDrop
public final boolean isRandDrop() -
getType
- Specified by:
getTypein classMapleMapObject
-
sendSpawnData
- Specified by:
sendSpawnDatain classMapleMapObject
-
sendDestroyData
- Specified by:
sendDestroyDatain classMapleMapObject
-
getLock
-
registerExpire
public void registerExpire(long time) -
registerFFA
public void registerFFA(long time) -
shouldExpire
public boolean shouldExpire(long now) -
shouldFFA
public boolean shouldFFA(long now) -
hasFFA
public boolean hasFFA() -
expire
-