Page 1 of 2

how add a command is @shop?

Posted: Sat Nov 23, 2013 11:39 pm
by movisew
how add a command is @shop? and can in where open shop and buy/sell item.

Re: how add a command is @shop?

Posted: Mon Nov 25, 2013 3:57 am
by TeoTwawki
Place attached file into your \scripts\commands folder.
Updated, see new post below.

You can edit the file to change the shop contents. I may later try to create a version that calls existing NPC shops. This version was thrown together just to see if this would work without an actual NPC. Its a quick and messy copy pasta job.

Re: how add a command is @shop?

Posted: Wed Nov 27, 2013 4:10 am
by movisew
Thank you very much

Re: how add a command is @shop?

Posted: Tue Aug 05, 2014 11:44 am
by TeoTwawki
Updated.

I had originally left a lot of unneeded junk in the script because I intended to try and call existing NPC shop scripts, but I decided that is unnecessarily complicated for what it would accomplish and wouldn't really be a popular feature, so instead I've given the command a page parameter and included a heavily edited example called @mogshop with conditional branches. The examples are based on mission status.

You'll see near the bottom some commented out code. This was from my experimenting with a spoofed chat packet to actually make it appear as if a Moogle NPC shop were speaking. This worked but was capable of crashing the server if the command were called in the mog house, so I replaced it with system messages via PrintToPlayer.

Re: how add a command is @shop?

Posted: Thu Aug 07, 2014 9:22 pm
by Scriptic
I've been trying to find the @ah command to add to my server. The shop command is nice, I at least understand how to customize it. Thanks.

Re: how add a command is @shop?

Posted: Thu Aug 07, 2014 9:57 pm
by TeoTwawki
Scriptic wrote:I've been trying to find the @ah command to add to my server. The shop command is nice, I at least understand how to customize it. Thanks.

Code: Select all

---------------------------------------------------------------------------------------------------
-- func: @ah
-- auth: forgottenandlost
-- desc: opens the Auction House menu anywhere in the world just to see if we can
---------------------------------------------------------------------------------------------------

cmdprops =
{
    permission = 1,
    parameters = ""
};

function onTrigger(player,npc)
    player:sendMenu(3);
end;
AH literally nothing but a menu value. Slap that SendMenu into any onTrigger and poof you have an AH counter/NPC like the ones in Jeuno.

Re: how add a command is @shop?

Posted: Thu Aug 07, 2014 9:59 pm
by TeoTwawki
P.s.

Kj recently updated the packet so a single shop page can now hold up to 50 entries, rather than maxing out at 16 (the client caps it at 50, server side is technically not capped at all).

Re: how add a command is @shop?

Posted: Fri Aug 08, 2014 5:01 pm
by Scriptic
Nice. Forgive me if this should be self explanatory but I saved the @ah info as a .lua file and put it in my commands folder like the shop. Tried it and it didn't work, am I supposed to populate the file with items or is it supposed to open the AH menu as if I was standing there? Still learning to script in my spare time, just figured I'd ask.

Edit: By the way, this isn't something I absolutely need to have but it is a clever idea. :)

Re: how add a command is @shop?

Posted: Fri Aug 08, 2014 5:45 pm
by TeoTwawki
Scriptic wrote:Nice. Forgive me if this should be self explanatory but I saved the @ah info as a .lua file and put it in my commands folder like the shop. Tried it and it didn't work, am I supposed to populate the file with items or is it supposed to open the AH menu as if I was standing there? Still learning to script in my spare time, just figured I'd ask.

Edit: By the way, this isn't something I absolutely need to have but it is a clever idea. :)
Need more info than "didn't work". Look at your server console log while trying to use it. Works as is on my server right now, it just pulls up the AH menu as if I went into town and clicked the AH counter.

Re: how add a command is @shop?

Posted: Fri Aug 08, 2014 5:51 pm
by Shadowmh
Your probably not a GM, make sure your least a GM level 1 in Navicat. Can find this in the "chars" table at the very end. Will require a server restart and then do "@ah"