Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-03-2010, 04:25 AM
Black_knights55 Black_knights55 is offline
Registered User
Join Date: Jan 2008
Posts: 24
Black_knights55 is on a distinguished road
So, if I understand everything. If I want to add an item I would do something like this:

clientr.item.ore.iron += 1

Type = Ore
Itemname = Iron

So it's as simple as that? I was sure it would be more complicated lol. Thanks for your help!
Reply With Quote
  #2  
Old 04-04-2010, 01:29 PM
firefighter firefighter is offline
Registered User
Join Date: Jan 2009
Location: Germany
Posts: 70
firefighter is on a distinguished road
We on Zenox are storing the items in a SQLite database

PHP Code:
public function IncPlayerItemCount(placcitemcount) {
  if (
ItemExists(item)) {
    
temp.ct int(count);
    if (
temp.ct 0) {
      
CreatePlayerItemIfNotExists(placcitem);
      
temp.req GetSQL("UPDATE ItemDB_PlayerItems SET count=count+"@temp.ct@" WHERE player=(SELECT ID FROM Players WHERE Account='"@SQLEscape(placc)@"') AND item=(SELECT ID FROM ItemDB_Items WHERE name='"@SQLEscape(item)@"')",false);
      if (
temp.req!=null && temp.req.error=="")
        return 
true;
      else {
        echo(
"ItemDB: Inc item count '"@item@"' of player "@placc@" failed - SQL query error");
        return 
false;
      }
    } else {
      echo(
"ItemDB: Inc item count '"@item@"' of player "@placc@" failed - count smaller than 0 or 0");
      return 
false;
    }
  } else {
    echo(
"ItemDB: Inc item count '"@item@"' of player "@placc@" failed - item doesnt exist");
    return 
false;
  }

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:10 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.