|
@ -1,5 +1,6 @@ |
|
|
use libpso::packet::messages::*;
|
|
|
use libpso::packet::messages::*;
|
|
|
use libpso::packet::ship::*;
|
|
|
use libpso::packet::ship::*;
|
|
|
|
|
|
use crate::entity::item;
|
|
|
use crate::common::leveltable::CharacterStats;
|
|
|
use crate::common::leveltable::CharacterStats;
|
|
|
use crate::ship::ship::{ShipError};
|
|
|
use crate::ship::ship::{ShipError};
|
|
|
use crate::ship::items::{ClientItemId, InventoryItem, StackedFloorItem, FloorItem, CharacterBank};
|
|
|
use crate::ship::items::{ClientItemId, InventoryItem, StackedFloorItem, FloorItem, CharacterBank};
|
|
@ -26,13 +27,13 @@ pub fn item_drop(client: u8, target: u8, item_drop: &FloorItem) -> Result<ItemDr |
|
|
})
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
pub fn create_item(area_client: AreaClient, item: &FloorItem) -> Result<CreateItem, ShipError> {
|
|
|
|
|
|
|
|
|
pub fn create_item(area_client: AreaClient, item_id: ClientItemId, item: &item::ItemDetail) -> Result<CreateItem, ShipError> {
|
|
|
let bytes = item.as_client_bytes();
|
|
|
let bytes = item.as_client_bytes();
|
|
|
Ok(CreateItem {
|
|
|
Ok(CreateItem {
|
|
|
client: area_client.local_client.id(),
|
|
|
client: area_client.local_client.id(),
|
|
|
target: 0,
|
|
|
target: 0,
|
|
|
item_data: bytes[0..12].try_into()?,
|
|
|
item_data: bytes[0..12].try_into()?,
|
|
|
item_id: item.item_id().0,
|
|
|
|
|
|
|
|
|
item_id: item_id.0,
|
|
|
item_data2: bytes[12..16].try_into()?,
|
|
|
item_data2: bytes[12..16].try_into()?,
|
|
|
unknown: 0,
|
|
|
unknown: 0,
|
|
|
})
|
|
|
})
|
|
|