Making Trades and Guild Warehouse secure:
Add an intermediate window when depositing items into guild warehouse. There should be two radio/check boxes labeled "Donate" and "Rental"
"Donate" should change the account ID attached to the item to the guild leader
"Rental" should have your account ID remain attached to the item.
Anyone who takes an item out of guild warehouse that doesn't belong to them will automatically be renting it for 24 hours(Could also implement fees to drain more zeny from the economy).
After the rental time has elapsed, the items should return to the guild warehouse automatically and that person should be forbidden to rent that item again for at least 1 hour to allow the owner of the item to get their item back from the warehouse.
Trade windows should have a rental checkbox, works the same way as the rental from guild warehouse. When the receiving party hits the first Accept button, the rental fee is automatically put in the window(replacing any zeny that was entered into the trade to avoid rental scams) and then locks in the trade items/zeny allowing the receiving party to review the trade.
After 24 hours, the items should return to the owner, fees for person to person rental should be more expensive than guild warehouse rentals.
Items being rented should be character bound, unable to trade, unable to put in personal storage, unable to sell, unable to drop; this makes the code to remove the item from the character and returning it to it's owner a lot simpler.
Receiving party should be able to see weather the items being traded are to keep or for rent when the box is ticked.
For the developers: GuildID/WarehouseID, OwnerID, RentalExpiry fields need to be added to each item record
When depositing items to guild warehouse, OwnerID and the associated fields should change to guild leader if the items are being donated, GuildID/WarehouseID should be populated with the appropriate information
When items are taken from guild warehouse, RentalExpiry field should be populated with a date/time stamp; a timer should be set to a call a function to return the item to the warehouse and remove it from the renter
When items are traded as rental, Rental Expiry field should be populated with a date/time stamp; a timer should be set to a call a function to return the item to the owner via RODEX and remove it from the renter
If GuildID/WarehouseID is populated at the time of the RentalExpiry, it will return to the guild warehouse it was taken from. If GuildID/WarehouseID is 0 or blank, it will return to the character that's pointed to by OwnerID via RODEX.
Consumable items should be excluded from being rented out of course.