how add a command is @shop?

movisew
Posts: 12
Joined: Fri Nov 15, 2013 11:12 pm

how add a command is @shop?

Post by movisew » Sat Nov 23, 2013 11:39 pm

how add a command is @shop? and can in where open shop and buy/sell item.

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

Re: how add a command is @shop?

Post by TeoTwawki » Mon Nov 25, 2013 3:57 am

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.
Last edited by TeoTwawki on Tue Aug 05, 2014 11:45 am, edited 2 times in total.
Hi, I run The Demiurge server.

Code: Select all

PLS USE [code]CODE TAGS[/code] WHEN POSTING CODE
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
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

movisew
Posts: 12
Joined: Fri Nov 15, 2013 11:12 pm

Re: how add a command is @shop?

Post by movisew » Wed Nov 27, 2013 4:10 am

Thank you very much

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

Re: how add a command is @shop?

Post by TeoTwawki » Tue Aug 05, 2014 11:44 am

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.
Attachments
GM command shops.7z
(2.11 KiB) Downloaded 259 times
Hi, I run The Demiurge server.

Code: Select all

PLS USE [code]CODE TAGS[/code] WHEN POSTING CODE
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
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

User avatar
Scriptic
Posts: 27
Joined: Wed Jul 23, 2014 7:54 pm

Re: how add a command is @shop?

Post by Scriptic » Thu Aug 07, 2014 9:22 pm

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.

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

Re: how add a command is @shop?

Post by TeoTwawki » Thu Aug 07, 2014 9:57 pm

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

Code: Select all

PLS USE [code]CODE TAGS[/code] WHEN POSTING CODE
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
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

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

Re: how add a command is @shop?

Post by TeoTwawki » Thu Aug 07, 2014 9:59 pm

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

Code: Select all

PLS USE [code]CODE TAGS[/code] WHEN POSTING CODE
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
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

User avatar
Scriptic
Posts: 27
Joined: Wed Jul 23, 2014 7:54 pm

Re: how add a command is @shop?

Post by Scriptic » Fri Aug 08, 2014 5:01 pm

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. :)

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

Re: how add a command is @shop?

Post by TeoTwawki » Fri Aug 08, 2014 5:45 pm

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

Code: Select all

PLS USE [code]CODE TAGS[/code] WHEN POSTING CODE
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
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

User avatar
Shadowmh
Posts: 60
Joined: Fri Nov 29, 2013 1:26 am

Re: how add a command is @shop?

Post by Shadowmh » Fri Aug 08, 2014 5:51 pm

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"

Post Reply