!shop command help

Post Reply
NekoNinja
Posts: 30
Joined: Thu Jun 01, 2017 10:20 am

!shop command help

Post by NekoNinja » Tue Jul 03, 2018 8:58 am

***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
Last edited by NekoNinja on Sat Jul 07, 2018 9:20 pm, edited 1 time in total.

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: !shop command help

Post by Delaide » Tue Jul 03, 2018 9:43 am

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.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: !shop command help

Post by TeoTwawki » Sat Jul 21, 2018 12:11 am

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
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Post Reply