- Joined
- Jan 3, 2009
- Messages
- 17
- Reaction score
- 4
Introduction
Hey guys. So I've been working on an NPC script that acts as a shop in lieu of the usual SQL-based shop...I didn't want to have to update that god forsaken table and restart the server every time I wanted to make a shop, so with a little tweaking of the server files I've created a shop that's completely based within an NPC script.
Features
So far, this shop only deals with equippable items. All you have to do is fill an array with the item IDs (and another one with the respective prices) and the shop will be created for you, replete with buttons, sounds, and the like.
The script gets the item information from the equip ID such as reqLevel, reqStr, reqDex, weapon attack, and whatever else.
You can buy items, mesos is taken from you, you get the item, all of that stuff.
In addition to the array of items to be sold in the shop, all the UI elements, sound elements, and messages are stored in variables at the top of the script for easy editing while keeping the main framework of the shop.
To Do
So far, you can only buy equipped items. Can't sell your own items yet.
This NPC only sells equips, will have to let it sell other things as well! Will need to make an NPC command to get an equipment's type.
Demonstration
Enjoy! Thanks for taking a look .
Hey guys. So I've been working on an NPC script that acts as a shop in lieu of the usual SQL-based shop...I didn't want to have to update that god forsaken table and restart the server every time I wanted to make a shop, so with a little tweaking of the server files I've created a shop that's completely based within an NPC script.
Features
So far, this shop only deals with equippable items. All you have to do is fill an array with the item IDs (and another one with the respective prices) and the shop will be created for you, replete with buttons, sounds, and the like.
The script gets the item information from the equip ID such as reqLevel, reqStr, reqDex, weapon attack, and whatever else.
You can buy items, mesos is taken from you, you get the item, all of that stuff.
In addition to the array of items to be sold in the shop, all the UI elements, sound elements, and messages are stored in variables at the top of the script for easy editing while keeping the main framework of the shop.
To Do
So far, you can only buy equipped items. Can't sell your own items yet.
This NPC only sells equips, will have to let it sell other things as well! Will need to make an NPC command to get an equipment's type.
Demonstration
Enjoy! Thanks for taking a look .
Last edited: