• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Loading things from database and applying to items

Status
Not open for further replies.

Mathias

Exalted Member
Hai guys! I have been working on this system that allows me to add stats requirements to items, i got all that working but there is a little probleme when it comes to loading the stat requirements from database

currently i have a table in my database called items_StatRequirement and i load that inside ObjectMgr.cpp in the function LoadItemTemplates();

but the way i do to load is extremly slow and does not work properly here is the part of the function i edited my code starts at line 165

http://pastebin.com/DmQ0ec7i

so to explain what happens ingame. it loads all the items and the requirements or atleast thats what the console says. but when i get ingame it seems like it really only loaded the last one. anyone got a clue why also if you can make it more optimized i would love that too
 

Tommy

Founder
Assuming that "required stat" is a specific stat requirement before you can equip the item, why not just add those columns to item_template table and add the new variables? Would be better and cleaner than how you have it.
 

yvoms

Exalted Member
Yes, Just get the data from the database, i think it'll look cleaner in the code, and probably works a bit smoother.
 

Mathias

Exalted Member
If I add it to item_template all sql generator will be corrupted

you may mark this as solved
 
Last edited:

Mathias

Exalted Member
Well after trying i see that i will not break the sql queries that diffrent sites create it dont care if i dont have all the rows :p
 
Status
Not open for further replies.
Top