• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

All items from items.xml parsed to lua table!

Qwe

Banned User
Joined
May 19, 2009
Messages
122
Reaction score
8
Location
$user->getLocation();
It lua items data table, if you want item values from XML - you can get it from table: )
All attributes etc. has been parsed and put into table. : )
It parsed from items.xml of TFS 0.3.6PL1. : )

If you want it download from sticked file (it's get ~700K CHars, post limit i 75K then i cannot put it into post : )

You must go to data/lib/ and put here file "101-itemstable.lua" when you download it.

and you can use for example:
PHP:
    doPlayerSendTextMessage(cid, 22, "Standard attack of magic sword: "..(item[2400].attack).." and defense:"..(item[2400].defense).."!")

(I know you can use for it getItemAttack, but if item attack has been set by command /attr you don't get from this function orginal attack, this returns orginal attributes.)

WARNING! IF OTS RUN[STARTS] AND SCRIPTS LOADING MORE SLOW BECAUSE SIZE OF THIS TABLE IS 0.7MB!

Thanks for using!
 

Attachments

  • 101-itemstable.zip
    77.8 KB · Views: 109 · VirusTotal
Last edited:
getItemInfo(itemid) returns a table with all attribtues.
 
#up
yes, but if my script change this value, getItemInfo() returns changed not default attributes.

Thanks man, i'm installed it to my server and works for me good! :)
 
Changed value definining style, removed quotes around numbers.
 

Attachments

  • 101-itemstable.rar
    43.7 KB · Views: 31 · VirusTotal
UPDATE
FILE UPDATED IN FIRST POST!

NEWS:
- Changed value definining style, removed quotes around numbers.[THANKS FOR Cykotitan]
- changed table name from "item" to "_ITEM", because colide with "item" param veriable in functions!

NOW EXAMPLE:
PHP:
doPlayerSendTextMessage(cid, 22, "Standard attack of magic sword: "..(_ITEM[2400].attack).." and defense:"..(_ITEM[2400].defense).."!")
 
Last edited:
@up: use 7zip xD
didnt tried parsing xml in lua, but writing to file can be done using php(I made a php array like this earlier xD)
and I dont know (yet) why it can be useful(the lua array), for sure there is some way to use it but...
 
#up
i don't seen this function in /doc/LUA_FUNCTIONS, because this function not added to this file... o ;;;
i don't have time to look how this function works...
 
this is pretty cool, we should use sql for all the other things like vocation and all such game info
 
lol yea but hey i didn't know jack anything from sql but reading some tut from here i learned it all you need is a well done tutorial and newbs will be able to understand, plus once they see how easy it actually is no one will want to change it for anything, but what i don't get is, that will it be able to change the attributes on items like weapons and armor if you use a weapon upgrade script, oh yea i know this isn't the right place but is there a way to do a getPlayerGender (getPlayerSex) function because the one in TFS 0.3.5 does not work and it does not give any errors either, so do you think you can brew up the function i think it should be simple but i don't know much about making custom functions.
 
Use .rar -.-
btw it's doPlayerSendTextMessage

o_O
Care to share what's the f***ing point of contention over archive format on a seventy kilobyte file?

Besides LMZA2 tarballs trump all: .tar.xz > .rar
 
Back
Top