Page 1 of 1

Proposed RaceID changes

Posted: Wed May 01, 2019 5:59 am
by Ememjr
I know this has been brought up before but here I go again
we have a race in Spawn table, that so far i havenot been able to figure out what the #'s 1-20 used match up to yet
many things we need to do are by race, there are well of 100 race types in this game, when you look at Lore and Legend, beastord warders, familars etc
using the model id is not a great idea like we are using it now for global loot tables, since if i want an elemental global loot table there are 40-50 elemental model_id

here is what i am proposing

leave the race column alone in spawn, since i dont want to screw up what its purpose is, (that is sent to client) although i dont know if it affects the client

create a new column in spawn table called lua_race_id and and populate it based from a new race id reference list,with those id's starting at #101
it would include all L&L races, Warder races, and the Races of the old race list on wiki there is a reason to start the lua_race_list at 101 explained below

once we get the list populate and the i can script the population of the lua_race_id into the spawn_table.that should get every creature/NPC with a Lua_race_id

in lua functions we all ready have addspellbonus that supports specific classes, i can update that spell to support lua_race_id as well, and factions
classid's are 0-100 max race id's start at 101, and we just let devs know that if its a faction to add 1000 to the faction number

this way the current scripts dont need changed that use class, and you can the optional parameter
this is example not exact
1 fighter, 101 priest, 1001 qeynos faction
so when using addspellbonus(target,bonus catatory, bonumus amount,id's)
id's can contain any class,lua_race_id, or faction without issue

i would also add his support to damage , healing, lua functions as well and other lus functions that could be race/class /faction specific
some might say why not just use model_id instead of a new column
well for elememtal alone there are over 40 elemental model ids, and that would be a great pain to have to type in every model_id that is could apply to

also Model is not a Race
thats almost like saying i need all Ford Vehicles to stop , but instead of saying Ford as the common item, having to list all the vehicles ford makes instead

Re: Proposed RaceID changes

Posted: Wed May 01, 2019 1:56 pm
by Cynnar
You will have to talk with [mention]Jabantiz[/mention] about this because I don't know what the code does or doesn't do.

I do know that there is something with race as we have several Lua functions that use race like GetRace() or GetRaceType().

Honestly it sounds like you are proposing a different way to preform a check to see if race equals this then do this else do something different, and I think we can do it with the current Lua functions.

Now don't get me wrong I am all for a better way to make writing scripts easier, and better code in the source, but I think we need to make sure it's going to do at least one of those things before just jumping off into it, or any other code for that matter.

Re: Proposed RaceID changes

Posted: Wed May 01, 2019 5:14 pm
by Jabantiz
The race_type in the spawn DB goes with an element in spawn structs with the same name, I have no clue what that element actually effects though.

I implemented a race type system a while back but as far as I know it was never used and it looks like the limited data that it did have was lost. It is the `race_types` table and links a model id to a race type id. The code for it is in the "RaceTypes" folder and the id's are set up like classes with a base type and sub types, so for example a zombie type and vampire type would be an undead base type. Looking at the defines in RaceTypes.h I have 247 races defined.

For loot it should be using the race id from this system and not the model id.

There are also 3 LUA functions that go along with this system.

Re: Proposed RaceID changes

Posted: Wed May 01, 2019 5:51 pm
by Ememjr
i woill look at that
as for the lua functions i know there are functions that look at race type but when we are fighting a group of mobs ww do something like an AOE i dont think lua script is parsing the list of targets
also i wont commit anything till i /we know what ever i am doing is a better way

Re: Proposed RaceID changes

Posted: Wed May 01, 2019 5:57 pm
by Jabantiz
The way spells work with lua has turned out to be a pain and I was debating with Cynnar if we should change it or not. But basically in a spell script the target parameter that is passed is usually worthless and the lua functions meant for spells will overwrite whatever target parameter you pass to it with the spells targets.

Re: Proposed RaceID changes

Posted: Wed May 01, 2019 6:13 pm
by Ememjr
yes i have noticed some of that as well, but i think it just needs some tweaking, becuase there is some missing functionallit there as well,

like if you have a group member targeted and cast a damage spell it should detect that it is a group member and then use the group members target
if you target a enemy it stays that enemy but if its a green aoe it needs to change the target to multiple targets of the spawn group
if its a blue AOE then it should use the target as direct damage and then damage the closest enemies with in the limit of max targets

also if you have an enemy targeted and cast a heal it should use the enemies target

i have been going through each lua spell type along with the spells and confirming whether or not they are targeting correctly an noting exactly what they are doing wrong

also much of it will depend on having the target types like i listed in other post being correct, once i fixed that for the single target buffs and things like thorncoat and heals those seem to be working now before some of the single target buffs were applying to both the target and the caster so those settings are important

Re: Proposed RaceID changes

Posted: Wed May 01, 2019 6:54 pm
by Jabantiz
Yea all of that is determined in spell code and the list of targets gets saved to an array, spell LUA functions will use that array usually no matter what you pass as the target and that is the part I find problematic as usually if you specify a target that is the target you want it to effect and not be overwritten by the server.

Also we did have code for implied targets and it was mostly working, but then again I have fixed the issue of player pets being attackable by other players countless times, I don't know why some of these issues keep coming back.

But anyways this is off topic of races...