SphereCommunity
Shop Sell packet - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Shop Sell packet (/Thread-Shop-Sell-packet--3566)

Pages: 1 2


RE: Shop Sell packet - Skul - 06-20-2014 03:19 AM

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.


RE: Shop Sell packet - mrkarlo - 06-21-2014 09:39 PM

And I have one more question. It's possible to summon target after saying word? For example: Hello! (with out dot before Hello!)


RE: Shop Sell packet - Skul - 06-22-2014 01:37 AM

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


RE: Shop Sell packet - Skul - 06-22-2014 02:50 AM

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/files/809/blizz%20-%20shop%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.


RE: Shop Sell packet - mrkarlo - 06-22-2014 03:14 AM

Skul, thank you very much! It's really helpful!!


RE: Shop Sell packet - Skul - 06-22-2014 03:16 AM

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.


RE: Shop Sell packet - XuN - 06-23-2014 04:03 AM

The limit is LONG actually (2.147.483.647), can't be more because of client's limitation.


RE: Shop Sell packet - Skul - 06-23-2014 04:18 AM

Question about that, how am I supposed to use that with this script, am I using the right packet (0x09e)?


RE: Shop Sell packet - Feeh - 06-23-2014 05:12 AM

(0x74) Shop List price is a DWORD
(0x9E) Shop Sell price is a WORD


RE: Shop Sell packet - Skul - 06-23-2014 05:28 AM

Thank you.