mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +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:
@@ -78,13 +78,9 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId,
|
||||
|
||||
SetSelectedMapId(originator->GetObjectID(), zone);
|
||||
|
||||
// Equipping the rocket (RocketEquip) sent ChangeObjectWorldState(ATTACHED); live sent it before this event
|
||||
GameMessages::FireEventClientSide(m_Parent->GetObjectID(), u"RocketEquipped", rocket->GetId(), originator->GetObjectID()).SendToClient(originator->GetSystemAddress());
|
||||
|
||||
GameMessages::ChangeObjectWorldState worldState;
|
||||
worldState.target = rocket->GetId();
|
||||
worldState.newState = eObjectWorldState::ATTACHED;
|
||||
worldState.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
Game::entityManager->SerializeEntity(originator);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user