mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-17 10:12:50 +00:00
feat(inventory): equip and unequip like live
Live, on every equip and unequip (captures: 22,422 ChangeObjectWorldState, 4,269 equip effects, 245 UncastSkill): - ChangeObjectWorldState on the item to everyone: ATTACHED when equipped, INVENTORY when unequipped, proxies (sub-items) included. - The equip-<slot> / unequip-<slot> effect on the wearer to everyone (effect -1, priority 1.07), the slot picked from the item's equip location as the client's ItemComponent does (0x00cdafb0): special_l left, special_r right, hair head, clavicle, chest, legs; none for others (e.g. a rocket's Extra_1); the item's equipEffects with "equip"/"unequip" when it has one; no equip effect for noEquipAnimation items, no unequip effect for proxies. - Order when an item replaces another: the new item's state and effect, then the old item's, then the old item's proxies taken away (RemoveItemFromInventory, UnEquipInventory with ignoreCooldown, ChangeObjectWorldState INVENTORY, to the player), then UncastSkill for the old item's equip skills (castOnType 1, not its proxies'), then its skill removed and the new one added, then the new item's proxies. - An equipped item taken out of the inventory is followed by UnEquipInventory (ignoreCooldown) to the player. DLU sent none of these (only the rocket's ChangeObjectWorldState, which now comes from equipping it, before RocketEquipped as live). Check in game (with a second player watching): equip and unequip a hat, a sword, a shield, a shirt, pants and a backpack; both players see the equip animation/effect. Put a ninja hood on, then another hat over it: the hood's back piece disappears and its passive effects end (no lingering aura or stat). Launch a rocket: it is still shown during the launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -579,6 +579,17 @@ private:
|
||||
*/
|
||||
void PurgeProxies(Item* item);
|
||||
|
||||
/**
|
||||
* Tells everyone an item was equipped or unequipped: ChangeObjectWorldState (ATTACHED / INVENTORY) on the item and
|
||||
* the equip-<slot> / unequip-<slot> effect on the wearer, as live did
|
||||
*/
|
||||
void SendEquipState(const Item& item, bool equipped) const;
|
||||
|
||||
/**
|
||||
* Tells the player the item's equip skills (castOnType 1) ended: UncastSkill for each, as live did on unequip
|
||||
*/
|
||||
void SendUncastEquipSkills(const Item& item) const;
|
||||
|
||||
/**
|
||||
* Saves all the pet information stored in inventory items to the database
|
||||
* @param document the xml doc to save to
|
||||
|
||||
Reference in New Issue
Block a user