Trade Windows

Archive of the older Feature Request Forum Posts

Moderator: POL Developer

Locked
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm

Trade Windows

Post by CWO »

I would like to see a feature to check if someone has a trade window open with another person at a given point in time like who.trade or GetTradeWindow(who). What I'm trying to do is, we have a tournament system where you come completely naked and get supplied with everything you need. We're having a problem though with people smuggling in items through opening a trade window with someone else, putting the items in, then accepting/rejecting the trade after all script checks for items.
if (GetEquipmentByLayer(who, LAYER_TRADE) )

doesnt catch anything in my tests where I was the person entering and I put items in the window to another person, went through the checks, then rejected the trade. I know this could be done by packethooks but the core does keep tabs on if you're involved in a trade already. Any way we could get read access to it?

I've also tried sending the cancel trade packet to the person but the trade window actually still stays open on the other person and the trade is still on. The only thing it does is close the trade window on the person I sent it to.
Marilla

Post by Marilla »

Good suggestion, yes. I like :)



Maybe a suggestion in the meantime for your situation, though? I assume you are using a dot-command to check their pack to make sure it's empty, or something similar? First, I have a question, and then maybe an idea for the meantime for you...



How would you prevent someone from being given items AFTER you have checked them? I'm just guessing maybe after they've been checked, they are sent off to an area where they could not get into another trade? I'm also guessing that having a script to "MoveCharacterToLocation" doesn't cancel the trade?



If the above are correct, how about this; When you run the test to make sure they are empty, have as part of the test being that they must also have a trade window up with you (or whoever the judge is)... this way, as far as I know, you will know they can't have a trade window up with anyone else... I think.



But obviously, it'd be easier to detect a trade window otherwise, and there could be some other uses for knowing if someone has a trade window up at any given moment, so I second this suggestion!
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

Could do something like

mobile.istrading - a boolean return value
and or
mobile.tradingwith - a mobile reference or error "mobile is not trading"
or possibly
mobile.tradecontainer - a reference to the container or "mobile is not trading"

uo.em a
CancelTrade(mobile)
Closes the trade window for the mobile, and for who ever it is trading with.

What options would be the best all-around? Most likely this would all have to be for 097.


I gotta admit, when I read that first post, I laughed..
Smuggling items with secure trading is clever and amusing.
User avatar
CWO
POL Expert
Posts: 1159
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

well, tradingwith would be nice because it covers istrading. Tradecontainer could also be useful for many things too. Since you can already initiate a trade window, why not add something to it in a certain instance.

Instance: House trading. Click the button on the sign, target the person, an ownership deed appears in a trade window. The buyer would then put what they'll give for it...

As for how this is done, you double click a stone and hit your fighting template. The stone then checks you and creates all the items you'll need while moving you to an enclosed area. I was also pondering disconnecting the char before checks (disconnecting cancels trades), doing the checks, then moving them but thats a bit of a pain being disconnected every time since you do the same thing to refresh your char.
Aeros
Journeyman Poster
Posts: 69
Joined: Mon Apr 24, 2006 10:56 am

Post by Aeros »

mobile.tradingwith - a mobile reference or error "mobile is not trading"
I like that one. Easier referencing for script use.
Locked