cant figure out how to make random loot table.
Posted: Sat Aug 06, 2011 12:33 am
On video 25 of the tutorial right now, trying to work off that to make my own changes... but I am having a hell of a time doing so. Currently I am trying to change the way looting works. Currently it works as it does in source:
if creature is killed, do a number 0-100, and if that number is less than "hasloot" (the chance number on the monster) then you get that item the monster is carrying because it takes all from store that are under 'name' (which the name is designated in the creature as well).
obviously this does not easily support a loot table.. And I am having one hell of a time trying to find out how to convert it.
my basic understanding is this:
if creature is killed
find out what its loot table is
then randomly pull out an item by random chance %.
my problem is I don't understand enough to know how to do this.. Atm I am trying to work it like this: (note nothing has been changed at all so far... and the following is all exact thought put in place to trying to figure it out.. Yes, unfortunately, this is how my mind works all the time.)
the hasloot for an orc is 50. So i figured I will just make this a pointer to the loot table. Thus, all orcs will have reward the player with loot from table 50 (my thoughts: How can I do this? obviously I have to make a new table in the database with multiple fields... Or maybe I have to make many tables in the database for the loot table... Or perhaps I can just make one new table, and put all items in there.. But then how would it call up different loot tables? Perhaps I can set a field in the 1 table that will be called Ltable and that will have the number on it.. But what if I wanted some mobs to have some of the same items but others to be different... then that wouldn't work....
Next I think about how to even script such a thing... How can I script it in to whats already there... As it is now it can only get the item because it was specifically named in the creature.. So I have to find out how to make it pull an item out of a list of items...
$critem="SELECT * from store where name='$creatureloot'"; ---ok... so its pulling it up from database store, but its pulling it by name from creatureloot... damn!!! Looking at where its pulling it from has shown me that it will only pull out an orc tooth, because it is only pulling it by name, and thus it would have to be named in the creature database..... So how do I make it pull out different things?.. nono, think... hmmm... if I had the loot table database, uhh... (5 mins later and several re-reading of the same things) ok.. creatureloot = value 'loot' in creatures database... but what can I do with this information? I still don't know how to make it pull out random loot from specific tables... I know it involves the random number isloot, but how can I do it...)
--------
and this is about as far as I could get in an hour... still stuck... still nothing done. any ideas?
if creature is killed, do a number 0-100, and if that number is less than "hasloot" (the chance number on the monster) then you get that item the monster is carrying because it takes all from store that are under 'name' (which the name is designated in the creature as well).
obviously this does not easily support a loot table.. And I am having one hell of a time trying to find out how to convert it.
my basic understanding is this:
if creature is killed
find out what its loot table is
then randomly pull out an item by random chance %.
my problem is I don't understand enough to know how to do this.. Atm I am trying to work it like this: (note nothing has been changed at all so far... and the following is all exact thought put in place to trying to figure it out.. Yes, unfortunately, this is how my mind works all the time.)
the hasloot for an orc is 50. So i figured I will just make this a pointer to the loot table. Thus, all orcs will have reward the player with loot from table 50 (my thoughts: How can I do this? obviously I have to make a new table in the database with multiple fields... Or maybe I have to make many tables in the database for the loot table... Or perhaps I can just make one new table, and put all items in there.. But then how would it call up different loot tables? Perhaps I can set a field in the 1 table that will be called Ltable and that will have the number on it.. But what if I wanted some mobs to have some of the same items but others to be different... then that wouldn't work....
Next I think about how to even script such a thing... How can I script it in to whats already there... As it is now it can only get the item because it was specifically named in the creature.. So I have to find out how to make it pull an item out of a list of items...
$critem="SELECT * from store where name='$creatureloot'"; ---ok... so its pulling it up from database store, but its pulling it by name from creatureloot... damn!!! Looking at where its pulling it from has shown me that it will only pull out an orc tooth, because it is only pulling it by name, and thus it would have to be named in the creature database..... So how do I make it pull out different things?.. nono, think... hmmm... if I had the loot table database, uhh... (5 mins later and several re-reading of the same things) ok.. creatureloot = value 'loot' in creatures database... but what can I do with this information? I still don't know how to make it pull out random loot from specific tables... I know it involves the random number isloot, but how can I do it...)
--------
and this is about as far as I could get in an hour... still stuck... still nothing done. any ideas?