20 #include "../clib/clib_endian.h" 21 #include "../clib/rawtypes.h" 65 if ( client->
chr->has_gotten_item() )
77 bool inRemoteContainer =
false, isRemoteContainer =
false;
79 if ( item ==
nullptr || isRemoteContainer )
141 u16 orig_x = item->
x, orig_y = item->
y;
158 client->
chr->gotten_item( item );
160 item->gotten_by( client->
chr );
161 item->
x = item->
y = item->
z = 0;
163 if ( orig_container !=
nullptr )
185 if ( new_item !=
nullptr )
188 new_item->
x = orig_x;
189 new_item->
y = orig_y;
190 new_item->
z = orig_z;
191 if ( orig_container !=
nullptr )
198 new_item->
x = client->
chr->
x;
199 new_item->
y = client->
chr->
y;
200 new_item->
z = client->
chr->
z;
203 move_item( new_item, new_item->
x, new_item->
y, new_item->
z,
nullptr );
207 orig_container->
add( new_item );
268 item->gotten_by(
nullptr );
316 orig_container->
add( item );
341 if ( bp !=
nullptr && bp->
can_add( *item ) &&
virtual void on_insert_add_item(Mobile::Character *mob, MoveType move, Items::Item *new_item)
void on_remove(Mobile::Character *chr, Items::Item *item, MoveType move=MT_PLAYER)
void register_with_supporting_multi(Item *item)
bool can_add_to_slot(u8 &slotIndex)
bool can_moveanydist() const
bool is_legal_posn(const Items::Item *item, u16 x, u16 y) const
virtual bool can_add(const Items::Item &item) const
void add_item_to_world(Items::Item *item)
bool check_unequip_script()
virtual UObject * toplevel_owner() POL_OVERRIDE
bool check_unequiptest_scripts(Mobile::Character *chr)
Item * find_legal_item(const Character *chr, u32 serial, bool *additlegal, bool *isRemoteContainer)
enum Pol::Mobile::Character::GOTTEN_ITEM_TYPE gotten_item_source
#define MOVE_ITEM_FAILURE_ALREADY_HOLDING_AN_ITEM
void send_put_in_container_to_inrange(const Item *item)
virtual void add(Items::Item *item)
void remove_item_from_world(Items::Item *item)
void send_item_to_inrange(const Item *item)
#define MOVE_ITEM_FAILURE_TOO_FAR_AWAY
void get_item(Network::Client *client, PKTIN_07 *msg)
void send_item_move_failure(Network::Client *client, u8 reason)
void undo_get_item(Mobile::Character *chr, Items::Item *item)
bool check_equip_script(Mobile::Character *chr, bool startup)
void set_decay_after(unsigned int seconds)
bool has_los(const Core::ULWObject &att, const Core::ULWObject &tgt) const
void add_at_random_location(Items::Item *item)
Core::UContainer * container
void send_remove_object_to_inrange(const UObject *centerObject)
void send_full_statmsg(Network::Client *client, Mobile::Character *chr)
void equip(Items::Item *item)
void move_item(Item *item, UFACING facing)
ref_ptr< Items::Item > ItemRef
bool IsCharacter(u32 serial)
#define MOVE_ITEM_FAILURE_OUT_OF_SIGHT
Core::UContainer * backpack() const
void restart_decay_timer()
unsigned short pol_distance(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
bool check_can_remove_script(Mobile::Character *chr, Items::Item *item, MoveType move=MT_PLAYER)
bool isa(UOBJ_CLASS uobj_class) const
void send_wornitem_to_inrange(const Character *chr, const Item *item)
bool check_equiptest_scripts(Mobile::Character *chr, bool startup=false)
bool amount_to_remove_is_partial(u16 amount_to_remove) const
virtual void refresh_ar()
Item * slice_stacked_item(u16 this_item_new_amount)
bool can_move(const Items::Item *item) const
bool equippable(const Items::Item *item) const
#define MOVE_ITEM_FAILURE_CANNOT_PICK_THAT_UP
void send_sysmessage(Network::Client *client, const char *text, unsigned short font, unsigned short color)
void update_item_to_inrange(const Item *item)
bool can_insert_add_item(Mobile::Character *mob, MoveType move, Items::Item *new_item)