Jump to content
  • 0

How to create npc script with shop function as an option?


nunesb

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  11/30/12
  • Last Seen:  

I do not know if I asked right, but I meant:

I want to know how to create a npc which you click it, talk to him, and according to the option you choose it opens a shop.

It would something like this:

mes "I can get to you red and blue potions.";
next;
mes "What will you want?";
next;
switch(select("Red Potions:Blue potions")) {
case 1: <OPEN A SHOP THAT SELLS RED POTIONS>
case 2: <OPEN A SHOP THAT SELLS BLUE POTIONS>
}

Many thanks to anyone who can help.

Edited by nunesb
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

You have to make a standard shop NPC (it can be invisible), then call it from a script:

*callshop "<name>",<option>;

These are a series of commands used to create dynamic shops.

The callshop function calls a invisible shop (view -1) as if the player clicked on it.

For the options on callShop:

0 = The normal window (buy, sell and cancel)

1 = The buy window

2 = The sell window

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  11/30/12
  • Last Seen:  

only would work doing callshop ?

could I embed shop in one script npc ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

No, shop data can't be read off anything defined as a "script".

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  11/30/12
  • Last Seen:  

thank you

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...