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 05-13-2009, 10:11 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Here's how I'm doing it on Maloria.


Table creation...
NPC Code:
CREATE TABLE items (entry_index INTEGER PRIMARY KEY AUTOINCREMENT, account VARCHAR NOT NULL DEFAULT 'ACCOUNT_ERROR', item_id VARCHAR NOT NULL DEFAULT 'ID_ERROR', item_data VARCHAR NOT NULL DEFAULT 'DATA_ERROR')



Loading of items...
NPC Code:
SELECT * FROM items WHERE account = '" @ player.account @ "'"



Then I just loop through the query and add each item to player.items which is a TStaticVar that gets cleared everytime the player logs out.

I also automatically save all the players current items to the SQLite database upon onPlayerLogout().
__________________
Follow my work on social media post-Graal:Updated august 2025.
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 11:48 PM.


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