The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
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



Post: #11
RE: Shop Sell packet
well as long as you are using the new_buy and new_sell functions it should prompt a target. make sure you installed the script properly.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
06-20-2014 03:19 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
mrkarlo
Journeyman
*

Posts: 160
Likes Given: 3
Likes Received: 6 in 5 posts
Joined: Mar 2012
Reputation: 1



Post: #12
RE: Shop Sell packet
And I have one more question. It's possible to summon target after saying word? For example: Hello! (with out dot before Hello!)
06-21-2014 09:39 PM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #13
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 Smile

"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
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #14
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
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Skul's post
mrkarlo
Journeyman
*

Posts: 160
Likes Given: 3
Likes Received: 6 in 5 posts
Joined: Mar 2012
Reputation: 1



Post: #15
RE: Shop Sell packet
Skul, thank you very much! It's really helpful!!
06-22-2014 03:14 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #16
RE: Shop Sell packet
YW Smile I'm just having 1 problem with this script, and that is the fact that the value of items listed in the shop sell packet are limitted to WORD - 65536 bytes, I'm still wondering how sphere has this as a DWORD by default.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
06-22-2014 03:16 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #17
RE: Shop Sell packet
The limit is LONG actually (2.147.483.647), can't be more because of client's limitation.
06-23-2014 04:03 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #18
RE: Shop Sell packet
Question about that, how am I supposed to use that with this script, am I using the right packet (0x09e)?

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
06-23-2014 04:18 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Feeh
Sphere Developer
*****

Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4



Post: #19
RE: Shop Sell packet
(0x74) Shop List price is a DWORD
(0x9E) Shop Sell price is a WORD

Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
06-23-2014 05:12 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #20
RE: Shop Sell packet
Thank you.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
06-23-2014 05:28 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Skul's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)