Merchants have 2 primary commands

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Merchants have 2 primary commands

Post by John Adams » Wed Oct 08, 2008 10:39 pm

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?
Last edited by John Adams on Thu Oct 09, 2008 8:46 am, edited 1 time in total.

paulgh
Retired
Posts: 51
Joined: Sun Jul 27, 2008 8:48 pm

Post by paulgh » Thu Oct 09, 2008 7:55 am

Hailing a merchant on live does not cause your inventory to open.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Thu Oct 09, 2008 8:43 am

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.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Oct 11, 2008 6:30 am

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Oct 11, 2008 11:21 am

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.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Oct 11, 2008 11:54 am

Either way is easy for me. Just let me know which one you want :P

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Oct 11, 2008 12:32 pm

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?
You do not have the required permissions to view the files attached to this post.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Nov 22, 2008 10:09 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests