Page 1 of 1

Merchants have 2 primary commands

Posted: Wed Oct 08, 2008 10:39 pm
by John Adams
Merchants are Hailed upon clicking them, as they respond like all other NPCs with the default of Hail. However, Merchants also need to pop open their inventory upon clicking them - as their default action really is "frommerchant" or "Buy from merchant".
There is still debate on whether or not this also opens the player inventory (not bags, just nventory), so since I am right, I will just ask for it here, too.
1) NPC default Hail + From Merchant
2) Merchant click (Hail) simply Hails the NPC
3) Merchant click (Hail) opens player nventory - doesnotjohnadamsisabigfatliar
We can actually fake this with scripting by setting up a function targeted(), but perhaps it is better if it's just hardcoded.
Edit: Based on paulgh actually making me log in and see wth is going on, I think this can be handled with scripting (function targeted()) since most Merchant NPCs should have some form of scripting for their Hail/speech anyway?

Posted: Thu Oct 09, 2008 7:55 am
by paulgh
Hailing a merchant on live does not cause your inventory to open.

Posted: Thu Oct 09, 2008 8:43 am
by John Adams
k, so I am not right. what a surprise. Clicking a merchant opens the merchant inventory, performs a Hail command, and does NOT open your inventory. I must be hung up on Bankers, which work as expected currently.
I have adjusted my list of demands above.

Posted: Sat Oct 11, 2008 6:30 am
by LethalEncounter
Every merchant should have hail as a secondary command in the DB. If they don't then a simple update will take care of that as Parser probably doesnt do it. I'll change the code to call the hail LUA function when someone starts a merchant transaction.
Actually which would you rather me call the hailed(NPC, Spawn) function or a new merchant(NPC, Spawn) function? If you see no scenario where the action would be different depending on whether they start a merchant transaction I'll just call the hailed function. Otherwise I can call the new merchant(NPC, Spawn) function and you could add hailed(NPC, Spawn) inside that function if wanted.

Posted: Sat Oct 11, 2008 11:21 am
by John Adams
I believe every "targeted" merchant performs the same way; I hail, they respond, their inventory opens for transactions. Again, we could just build our merchant LUA scripts as "function targeted()" instead, and make that call function hailed(). I didn't think of calling hailed as a sub-function within targeted.
I like the idea of having a unique LUA though "function merchant()" which combos them up for us. Less scripting, but whatever is easiest on you and makes the most sense.

Posted: Sat Oct 11, 2008 11:54 am
by LethalEncounter
Either way is easy for me. Just let me know which one you want :P

Posted: Sat Oct 11, 2008 12:32 pm
by John Adams
Ok, I just re-ran some live tests on merchants and the broker. Here is my final analysis (for the moment anyway hah)
merchant1.wmv
Seems the player character does not perform a "Hail, so-and-so" command, but the NPC responds as if the player had targeted and pressed "H" for Hail.
merchant2.wmv
However, if you do target the NPC and use command "Hail" or press "H" to hail, the NPC does respond with the PlayFlavor, but does NOT open the transaction window.
broker.wmv
Note the first time I clicked him, he said nothing. We currently emulate this by using math.random() with a higher number than the possible options :)

This is what I want. So it looks like maybe a special merchant function is needed, so players are not sending their Hail?

Posted: Sat Nov 22, 2008 10:09 pm
by John Adams
Btw, I think I faked this by using the function targeted() which calls function hailed() to get me my mixture of click-hail-open or target-hail-only.

LE, if you still want to provide a Merchant() function, it would eliminate a little confusion on why we have targeted calling hail, but in the short term, this is fine for now.


Edit: Actually, I cannot use targeted() since the NPC starts squalking it's Hail block 1/2 way across the zone if you click it. Maybe a range is needed on response to Hail or Targeted.