View Single Post
  #62  
Old 02-11-2014, 11:42 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
I can't help much with this, but I can give you an example in relation to the shop stuff you were working on previously.

full script: http://forums.graalonline.com/forums...highlight=shop

In a Database NPC, such as: DB_Prices, put the following:
PHP Code:
function onCreated() 

  
// Format: 
  // this.item_id = price 
   
  
this.item_100 3// 3 gralats in this case 
  
this.item_200 5// 5 gralats in this case, etc...

You can access it in other scripts such as this:

PHP Code:
  this.price DB_Prices.("item_" this.item); //could also be temp.price if you just wanted to store it temporarily 
It adds a bit more security behind transactions as the prices between certain items (ex: this.item_100) cannot be manipulated when purchasing an item in a client menu, as it gathers the price data on the serverside from the Database (DB_Prices).

That is just one example. I do hope someone else can chime in because I would like to learn a bit more when a Database NPC might be more plausible than just a regular level NPC, etc...
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote