Page 1 of 1

!shop command help

Posted: Tue Jul 03, 2018 8:58 am
by NekoNinja
***UPDATED*** 7/7/18
I figured most of this stuff out and have been getting more comfortable with using queries but I am still stuck on getting:

- A working Signet command

- A working Buff command

Thanks For any Help!




Hello,
I recently got back into the DIY thing and I wanted to ask since i know many of the OGs read all the posts lol

recently after updating and building a new server all of my !shop commands stopped working :( I still get the print to player messages but the shop doesn't open. It is probably something simple but i wanted to ask if anyone could share a few things with me. I really enjoy reverse engineering stuff and making it work for me so if anyone who reads could share any of the stuff im looking for that would be aweosme. but most importantly !shop that works I do realize im asking for a lot but im starting to understand this stuff a bit more so i am all dialed in

- a general !shop command with a few pages so I can seperate stuff like tools, ammo, crystals
- if anyone has a content restricted !shop there used to be one i used that was like u had to finish CoP or Nation ranks to use
- an NPC script that you trade X of this to get Y
- a custom BCNM that I can look at and try to adjust for me, i have been messing with already working BCNMs and changing the Mob ID but the BCNM is empty when i enter lol
- the old !regen or !signet command that i got off here awhile ago doesn't work anymore and crashes my server i really want one i can call !buffs and then go in and add the buffs i want to the script
- a Query i can use in navicat to easily change zone music
- honestly im finally figuring out queries and how easy they make things so any staple queries would be appreciated

Re: !shop command help

Posted: Tue Jul 03, 2018 9:43 am
by Delaide
Just check an existing shop: https://github.com/DarkstarProject/dark ... lflete.lua

Code: Select all

-----------------------------------
-- Area: Lower Jeuno
--  NPC: Adelflete
-- Standard Merchant NPC
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil
-----------------------------------
require("scripts/zones/Lower_Jeuno/TextIDs")
require("scripts/globals/shop")

function onTrade(player,npc,trade)
end

function onTrigger(player,npc)
    local stock =
    {
        806,   1863,    -- Tourmaline
        807,   1863,    -- Sardonyx
        800,   1863,    -- Amethyst
        814,   1863,    -- Amber
        795,   1863,    -- Lapis Lazuli
        809,   1863,    -- Clear Topaz
        799,   1863,    -- Onyx
        796,   1863,    -- Light Opal
        13327, 1250,    -- Silver Earring
        13456, 1250,    -- Silver Ring
    }

    player:showText(npc, ADELFLETE_SHOP_DIALOG)
    dsp.shop.general(player, stock)
end

function onEventUpdate(player,csid,option)
end

function onEventFinish(player,csid,option)
end
My bet is you need to add the tabled method, the "dsp.shop.general"

Example, my !nin shop:

Code: Select all

-----------------------------------
-- Auth: Me
-- desc: Some random shop items
---------------------------------------------------------------------------------------------------

cmdprops =
{
    permission = 0,
    parameters = "iiii"
};
function onTrigger(player,npc)
player:PrintToPlayer("Buy your nin shit here!")
stock = {
	5867, 15000,
    5868, 18000,
} 
dsp.shop.general(player, stock);
end
Sorry, the other stuff, I don't know.

Re: !shop command help

Posted: Sat Jul 21, 2018 12:11 am
by TeoTwawki
check the requirement you want met like:

Code: Select all

player:hasCompletedMission(logIdHere, missionIdHere)
and then use a different stock table if the condition is met. I wrote a large complex shop script like that for legion and then they never used it. /sadpanda