Xeevis
Sorceror
[RunUO - SVN] DoubleClick Equip/Unequip/Swap (DeusX)
Doubleclick Equip/Unequip/Swap by Xeevis (DeusX) -- 2.01
I was thinking how to reduce hassle players face when it comes to management of equipment. Tedious tasks like to remove equipment from paperdoll, put it right into bag, then equip new one its a pain especially for new players. This system solves just that as it handles everything on simple doubleclick like all other modern games these days.
Tested against SVN (710) with .NET Framework (2.0/4.0)
Features
Do it in all 4 files, procedure is identical to example above.
4. Now its working!
Optionals: There are several distro edits you can make to enhance this system, this includes modifying of OnDoubleClick event for items which already implement their own but can still benefit from this system. These are mainly BaseSword, BaseKnife, BasePolearm and BaseAxe, but also miscs like GM suits (read Optionals.txt how to edit these)
Screenshot
Last Word
Please note that although safe to use, this system was tested only locally in all scenarios I could possibly think of. If you find any problem, please write in this topic, otherwise I'll be happy for any positive feedback.
Known Issues
Double-clicking items with translucent hue will cause client to crash, this is client related bug. If someone can give me all the translucent hue numbers I can add in handle for them to not work with this system.
Update 2.00
Doubleclick Equip/Unequip/Swap by Xeevis (DeusX) -- 2.01
I was thinking how to reduce hassle players face when it comes to management of equipment. Tedious tasks like to remove equipment from paperdoll, put it right into bag, then equip new one its a pain especially for new players. This system solves just that as it handles everything on simple doubleclick like all other modern games these days.
Tested against SVN (710) with .NET Framework (2.0/4.0)
Features
- 100% Working - No matter what combinations of equip you have, you always swap the right ones
- Works From Anywhere - Equip from backpack, sub-container, locker, bank, ground anywhere where player has normal access to
- Easy Integration - Change just 4 words and its already working for you.
- Operation Feedback - Messages will tell player what he equipped/unequipped and what he swapped for what (even 3 way if shield is present!). These messages also retain hue of item being equipped for easier readability.
- Smart Placement - When swapping items from container the equipped item will drop on the very same location as the one that swapped for it. No more hand moving if player has carefully placed equipment in bags.
- Safe Use - Won't equip items which are far (2 tiles by default), cannot be moved (locked containers, other player backpacks etc) or don't specify layer. Also no swapping from corpses to prevent accidental swaps.
- Download file corresponding to .NET Framework version your RunUO is using (its my personal survey .NET 2.0 will work for everyone )
- Put CS file WearableItem.cs anywhere into your scripts folder (I suggest Scripts/Items)
- In BaseArmor.cs, BaseWeapon.cs, BaseJewel.cs, BaseClothing.cs change inheritance from Item to WearableItem
topublic abstract class BaseArmor : Item, IScissorable, IFactionItem, ICraftable, IWearableDurability, ISetItem
public abstract class BaseArmor : WearableItem, IScissorable, IFactionItem, ICraftable, IWearableDurability, ISetItem
Do it in all 4 files, procedure is identical to example above.
4. Now its working!
Optionals: There are several distro edits you can make to enhance this system, this includes modifying of OnDoubleClick event for items which already implement their own but can still benefit from this system. These are mainly BaseSword, BaseKnife, BasePolearm and BaseAxe, but also miscs like GM suits (read Optionals.txt how to edit these)
Screenshot
Last Word
Please note that although safe to use, this system was tested only locally in all scenarios I could possibly think of. If you find any problem, please write in this topic, otherwise I'll be happy for any positive feedback.
Known Issues
Double-clicking items with translucent hue will cause client to crash, this is client related bug. If someone can give me all the translucent hue numbers I can add in handle for them to not work with this system.
Update 2.00
- Script rewrote from scratch (renamed file and class to WearableItem instead of BaseWearable)
- Cleaner code (updated to .NET 4.0, added comments, removed redundancies, removed duplicates, restyled code to match StyleCop guidelines)
- Better performance
- Better handling of items, no loner swaps items to ground, conflict will simply drop to backpack
- Smart messages to give this system a slight RP touch
- Added function WearableItem.EquipTo(Mobile) which allows you to easily equip any wearable item to any mobile and script will take care of swapping conflicts (by default for NPCs swapping will remove conflicting items, while for players it will drop them into their backpack ... this behavior is overrideable by passing optional parameter)
- Fixed range check (can now equip only from 2 tiles)
- If player doesn't meet stat requirement then conflicting item won't be unequipped (also will tell same message as with dragging)
- Doubleclicking won't work if dclicked or conflicting item is not movable (to prevent unequipping of GM-locked gear on players etc)
- Add sample EquipTo demonstration command [EquipTo that allows GM to select item and then mobile for which item is to be equipped. (When target item is container then it will dress mobile into everything inside, command will fail if container has 2 and more items that share same layer)