Thread Rating:
- 0 Votes - 0 Average
- 1
- 2
- 3
- 4
- 5
Shop Sell packet
|
Author |
Message |
Skul 
Master
 
Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9
![]()
|
RE: Shop Sell packet
Well, what are you trying to do? Are you trying to summon a pet from an animal trainer?
"If" you're looking to add the npc directly from the stablemaster/animaltrainer, here's some code to replace the existing code you have.
Replace this part:
Code:
for x 1 <local.x>
uid.<local.item<dlocal.x>>.amount -= <local.item<dlocal.x>.amount>
if (<uid.<local.item<dlocal.x>>.amount> < 1)
uid.<local.item<dlocal.x>>.remove
endif
if ( <uid.<local.item<dlocal.x>>.can> & 0100 )
serv.newitem=<uid.<local.item<dlocal.x>>.baseid>
new.amount=<local.item<dlocal.x>.amount>
new.cont=<ref1.findlayer.21>
else
for <local.item<dlocal.x>.amount>
serv.newitem=<uid.<local.item<dlocal.x>>.baseid>
new.cont=<ref1.findlayer.21>
endfor
endif
if (strmatch(<local.items>,0))
local.items=<uid.<local.item<dlocal.x>>.name>
else
if !(<local.item<eval <local.x> +1>>)
local.items=<local.items>, and <uid.<local.item<dlocal.x>>.name>
else
local.items=<local.items>, <uid.<local.item<dlocal.x>>.name>
endif
endif
endfor
with this:
Code:
for x 1 <local.x>
if (<uid.<local.item<dlocal.x>>.type>==t_figurine)
for 1 <local.item<dlocal.x>.amount>
serv.newnpc=<uid.<local.item<dlocal.x>>.tdata3>
local.uid=<new.uid>
serv.newitem=i_memory
new.color=memory_ipet
new.link=<ref1.uid>
new.cont=<local.uid>
uid.<local.uid>.p=<ref2.p>
uid.<local.uid>.go=<uid.<local.uid>.p>
endfor
elseif ( <uid.<local.item<dlocal.x>>.can> & 0100 )
serv.newitem=<uid.<local.item<dlocal.x>>.baseid>
new.amount=<local.item<dlocal.x>.amount>
new.cont=<ref1.findlayer.21>
else
for <local.item<dlocal.x>.amount>
serv.newitem=<uid.<local.item<dlocal.x>>.baseid>
new.cont=<ref1.findlayer.21>
endfor
endif
if (strmatch(<local.items>,0))
local.items=<uid.<local.item<dlocal.x>>.name>
else
if !(<local.item<eval <local.x> +1>>)
local.items=<local.items>, and <uid.<local.item<dlocal.x>>.name>
else
local.items=<local.items>, <uid.<local.item<dlocal.x>>.name>
endif
endif
uid.<local.item<dlocal.x>>.amount -= <local.item<dlocal.x>.amount>
if (<uid.<local.item<dlocal.x>>.amount> < 1)
uid.<local.item<dlocal.x>>.remove
endif
endfor
I hope that answers your question
"I ask a question to the answer I already know."
Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 06-22-2014 02:21 AM by Skul.)
|
|
06-22-2014 01:37 AM |
|
|
Skul 
Master
 
Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9
![]()
|
RE: Shop Sell packet
Here, nevermind about the above code. I updated the script to allow shrunk or unshrunk pets to be sold on NPC vendors. Here's the link: http://forum.spherecommunity.net/sshare/...20sell.scp
You will notice I added:
Code:
vendor_sell_pets_shrunk 1 //Sell pets shrunk? 1 = Yes, 0 = No
Set this value to 0 to sell unshrunk pets on vendors.
"I ask a question to the answer I already know."
Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 06-22-2014 03:14 AM by Skul.)
|
|
06-22-2014 02:50 AM |
|
The following 1 user Likes Skul's post:1 user Likes Skul's post
mrkarlo (06-22-2014)
|
Feeh 
Sphere Developer
    
Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4
![]()
|
|
06-23-2014 05:12 AM |
|
|
User(s) browsing this thread: 1 Guest(s)