Skul
Master
Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9
|
RE: Vendor Shop HELP
Well this code sort of works, it's an item list? I don't know, maybe you can find it useful:
Code:
[function testbuy2]
sysmessage Buy from who?
targetf f_testbuy2
[function f_testbuy2]
if (<argo.ischar>)
if (<argo.npc>==brain_vendor)
if (<argo.findlayer.26.rescount>)
forcont <argo.findlayer.26>
if (<tag0.override.value>) || (<value>)
local.x += 1
local.uid<dlocal.x>=<uid>
endif
endfor
if (<local.x>)
for x 1 <local.x>
if (strmatch(<local.packet>,0))
local.packet=w<uid.<local.uid<dlocal.x>>.baseid> w<uid.<local.uid<dlocal.x>>.color> <eval strlen(<uid.<local.uid<dlocal.x>>.name>)> <asc <uid.<local.uid<dlocal.x>>.name>>
else
local.packet=<local.packet> w<uid.<local.uid<dlocal.x>>.baseid> w<uid.<local.uid<dlocal.x>>.color> <eval strlen(<uid.<local.uid<dlocal.x>>.name>)> <asc <uid.<local.uid<dlocal.x>>.name>>
endif
local.packetlength += <eval <eval strlen(<uid.<local.uid<dlocal.x>>.name>)> +5>
endfor
local.title=<argo.title> Shoppe
local.packetlength += <eval strlen(<local.title>)>
sendpacket 07c w<eval <local.packetlength> +11> d<argo.uid> w0870 <eval strlen(<local.title>)> <asc <local.title>> <local.x> <local.packet>
endif
else
argo.speak I have nothing to sell.
endif
endif
endif
Here, this is the code you want, it's unfinished but at least you can view the shop list and use <tag.override.value> on any item.
Code:
[function testbuy3]
sysmessage Buy from who?
targetf f_testbuy3
[function f_testbuy3]
if (<argo.ischar>)
if (<argo.npc>==brain_vendor)
if (<argo.findlayer.26.rescount>)
forcont <argo.findlayer.26>
if (<tag0.override.value>) || (<value>)
local.x += 1
local.uid<dlocal.x>=<uid>
if (<tag0.override.value>)
local.uid<dlocal.x>.value=<tag0.override.value>
else
local.uid<dlocal.x>.value=<value>
endif
endif
endfor
if (<local.x>)
for x 1 <local.x>
if (strmatch(<local.packet>,0))
local.packet=d<local.uid<dlocal.x>> w<uid.<local.uid<dlocal.x>>.baseid> w<uid.<local.uid<dlocal.x>>.color> w<uid.<local.uid<dlocal.x>>.amount> w<uid.<local.uid<dlocal.x>>.value> w<eval strlen(<uid.<local.uid<dlocal.x>>.name>)> <asc <uid.<local.uid<dlocal.x>>.name>>
else
local.packet=<local.packet> d<local.uid<dlocal.x>> w<uid.<local.uid<dlocal.x>>.baseid> w<uid.<local.uid<dlocal.x>>.color> w<uid.<local.uid<dlocal.x>>.amount> w<uid.<local.uid<dlocal.x>>.value> w<eval strlen(<uid.<local.uid<dlocal.x>>.name>)> <asc <uid.<local.uid<dlocal.x>>.name>>
endif
local.packetlength += <eval <eval strlen(<uid.<local.uid<dlocal.x>>.name>)> +14>
endfor
serv.log <local.packet>
sendpacket 09e w<eval <local.packetlength> +9> d<argo.uid> w<local.x> <local.packet>
return 1
endif
endif
argo.speak I have nothing to sell.
endif
endif
"I ask a question to the answer I already know."
Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 09-26-2012 02:39 PM by Skul.)
|
|
09-26-2012 02:13 PM |
|
|