Page 1 of 2

Non-Player Race Types

Posted: Sat Aug 10, 2013 8:07 am
by John Adams
Identifying Race Types in Server - We're going to need this functionality for a number of reasons:
  • Slayer Stats/Achievements
  • Abilities that only work on [race] NPCs
  • <more>
For years I've been dreading this conversation because I think it's going to be bigger than a breadbox... but here is my initial idea.

What if we made a cross-ref table of all the model_type values and associate them with our own list of race_id's (outside the normal playable races)? Ie., Goblin = 1, Gnoll = 2, etc. This way, the list is completely dynamic and can be customized per server.

The original thought was to add a field to the `spawn` table to set a value, but that is not as dynamic (imo) as the new concept.


Reason this is coming up now, I am working with the Master's Rage/Strike/etc spells, they have a condition in which they can be used:
If one of the following races:
And the list of races grows as the player completes Lore and Legends quests. So Player records will also need to track what races they have conquered - which I believe we can do via `character_quests` (you finish the Goblin Lore and Legend quest, you can use Master's Rage on gobbies). There may be a simpler flag we can set in `character_history` as well, depending on the implementation.


Give me your thoughts, if I've forgotten something, or how best you think this could be implemented. It's probably too big for 0.7.3, but we can at least plan ahead. For now, race-specific abilities will simply work on any target.

Thanks

Re: Non-Player Race Types

Posted: Sat Aug 10, 2013 10:23 am
by Zcoretri
John Adams wrote:Identifying Race Types in Server
What if we made a cross-ref table of all the model_type values and associate them with our own list of race_id's (outside the normal playable races)? Ie., Goblin = 1, Gnoll = 2, etc. This way, the list is completely dynamic and can be customized per server.
I like this idea.
And the list of races grows as the player completes Lore and Legends quests. So Player records will also need to track what races they have conquered - which I believe we can do via `character_quests` (you finish the Goblin Lore and Legend quest, you can use Master's Rage on gobbies). There may be a simpler flag we can set in `character_history` as well, depending on the implementation.
I'm thinking a simple flag in one of the character tables will suffice.

Re: Non-Player Race Types

Posted: Thu Aug 22, 2013 7:26 pm
by Jabantiz
In Substruct_SpawnInfoStruct there is a spawn_type element, also in WS_SpawnStruct_Footer there is a spawn_type element. Any chance one of these could be a race type?

Re: Non-Player Race Types

Posted: Sun Aug 25, 2013 11:02 am
by John Adams
That always confused me, the 2 "spawn_type" values. They must be called differently, because I am pretty sure 2 elements of the same name in the same struct would not work. Unless one is spawnInfo->spawn_type and the other spawnFooter->spawn_type? Though it is very likely ours are just mis-labeled.

Regardless, the one in the WS_SpawnStruct_Footer is the one I use in Parser to determine the "type", so I know what data to look for in parser:

Code: Select all

		/* Spawn Type ID's from version 1142+
			  0 = player
			  1 = bad spawn?
			  2 = normal/Crafting Table
			  3 = dead spawn
			  4 = Mercenary
			 10 = Pet
			 18 = Merchant
			 34 = Display Cases
			 66 = Banker
			130 = Broker
		*/

Re: Non-Player Race Types

Posted: Wed Sep 11, 2013 6:09 pm
by thefoof
In addition to these details I think it would be cool if we could save "race" spawnscripts to these new entries for race combat voiceovers and call them during combat. Maybe add a value to the spawn (or npc) field to disable these manually if you didn't want to use them for a certain spawn.

Re: Non-Player Race Types

Posted: Fri Sep 13, 2013 10:19 am
by John Adams
I mentioned to you previously about including common lua's with callouts. I believe there already are some generic ones that exist, if that's what you mean. If not, then never mind.

Re: Non-Player Race Types

Posted: Fri Sep 13, 2013 5:04 pm
by thefoof
Yeah I know about the includes from scripts and such, I just mean we assign a script to a race id in a map or something.

In the code, everytime an npc attacks call the script, add a chance to say something in the script for that race. And bam you get easy combat voiceovers without a ton of script work =p. That way we don't have to assign a spawnscript to every NPC we want to have combat voiceovers for. And if someone wanted to disable it server wide - you wouldn't have to remove the script or include from every single spawn.

We could just make one generic combat voiceover script with all the races in it too that wouldn't be a big deal, just figured it would be more modulized this way.

Re: Non-Player Race Types

Posted: Sun Sep 15, 2013 4:26 pm
by John Adams
Again, I may not be expressing my thoughts clearly. We already have racial and "task-oriented" generic scripts with various callouts in them.

Code: Select all

SpawnScript/Generic/GenericMerchantVoiceOvers.lua
SpawnScript/Generic/GenericVoiceOvers.lua
.
.
etc...
Have you opened these and looked at them, and will they do what you seek? Or are you considering making a ginormous LUA script that is hooked in at the server level (hard-coded) for ALL spawns, with no required spawn_scripts data entry? If the latter, then I agree :) as long as there is a RULE to shut it off.

If something else, then please look over the existing generics and see if they will serve a purpose.

Re: Non-Player Race Types

Posted: Sun Sep 15, 2013 5:16 pm
by thefoof
It's something similar to those scripts but nothing we have already. And yes I did plan on doing it this way to have it as a rule, so admins could shut it off :D.

The reason for it being separate to the spawnscripts we have now is if someone wanted to shut it off, it would be a HUGE undertaking to take all of the lines out of the spawnscripts. (Those scripts work just for different purposes, they are mostly for random NPC chatter in cities so should set those to the spawns manually anyway).


The only thing I'm talking about for these "race-script" calls would be for in-combat voices. For instance gnolls may say something everytime they kill something, or a chance when they attack, so call these scripts for this purpose rather than running it through the spawnscripts set to each NPC.


So in summary yes it wouldn't have to be assigned per spawn and would work with all spawns worldwide with a race set (unless otherwise specified for a particular spawn), we could do it separate per race on the DB level or one script, but the main idea is all of the calls to the script are hardcoded for every npc.

Re: Non-Player Race Types

Posted: Fri Dec 06, 2013 5:16 pm
by Jabantiz
Bumping this as I ran into spells that have bonus damage to undead, I am sure other classes will have something similar as well.
John Adams wrote:What if we made a cross-ref table of all the model_type values and associate them with our own list of race_id's (outside the normal playable races)? Ie., Goblin = 1, Gnoll = 2, etc. This way, the list is completely dynamic and can be customized per server.
From wikia: Monster Types

As you can see spawns can be of multiple types for example

Undead
  • Ghost‎
  • Ghoul‎
  • Gunthak (Group)
  • Horror‎
  • Mummy‎
  • Shin'Ree Orcs (Group)
  • Skeleton
  • Spectre‎
  • Vampire‎
  • Zombie‎
We could do a bitmask, however I think those tend to be confusing for non programmers. Another option would be like classes, a base type, followed by all its sub types before the next base type.

Re: Non-Player Race Types

Posted: Fri Dec 06, 2013 5:24 pm
by John Adams
Jabantiz wrote:Another option would be like classes, a base type, followed by all its sub types before the next base type.
I think this is a great idea.

Or, extending my original thought, we could build a table of classifications (Undead), with a FK of 1 (for example), then assign that ID in the spawn record - or the opening post idea of a xref table of model_types (less repeated data, more dynamic)

Either way, it's going to be a mess of data entry, unless we find something to parse.

Re: Non-Player Race Types

Posted: Tue Jan 14, 2014 8:46 pm
by Jabantiz
I made some defines from the list on wikia and came up with 247 types. However I did have to modify the list adding in 2 player races that were left out and removing a duplicate define. There are some categories I am not sure about, like feline and cat, do those really need to be different?

Current plan is to do the cross-ref table, model_id and race_id, and load it into a master list.

EDIT: Committed the initial files (source/RaceTypes/ ) haven't added them to the project yet as they are not used yet, mainly committed so other can look at the defines

Re: Non-Player Race Types

Posted: Mon Mar 31, 2014 3:27 pm
by Jabantiz
What kind of lua functions do we want for this, do we want just 1 that returns a bool for checking?

Code: Select all

CheckRaceType(spawn, race ID)
In this function we would pass the spawn we want to check and the race ID we want to check against, would return true if it is a match or the "base race" is a match, for example a skeleton spawn is passed and the id for undead is passed it would return true.

Or do we want to just manually check them in lua with 2 lua functions to get the race id

Code: Select all

GetRaceType(Spawn)
GetRaceBaseType(Spawn)
Or do we want all three functions?

Also I assume this table will be put on the DB patcher? I am going to start making a table and data, however the data won't be useful yet, just going to get a list of model id's.

Re: Non-Player Race Types

Posted: Mon Mar 31, 2014 4:28 pm
by John Adams
Whatever you think is easier. Seems like 1 call would be easiest, though the other 2 options offer specific lookups.

As for the Models table, hope you didn't already make one. I've had one in EQ2 schema since about 2008 :) just never pushed it to servers since it's reference only. Attached are the 5 tables I use in DB Editor or just for reference.
eq2reference.zip
Edit: Models are very old, as I stopped updating this table when ZexisStryfe stopped updating his.

Re: Non-Player Race Types

Posted: Mon Mar 31, 2014 4:42 pm
by Jabantiz
I just made a simple table

Code: Select all

CREATE TABLE `race_types` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`model_id` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`race_id` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
	PRIMARY KEY (`id`),
	UNIQUE INDEX `model_id` (`model_id`)
)
COLLATE='latin1_general_ci'
ENGINE=InnoDB;
also did some simple sql (complex for me, damn sql) to get model id's from the appearance table for what I assume is NPC's. The extra info in your table looks like it will make it easier to assign a race id though. It would be simple for me to change the code, really just point the sql to a different table, only change to the table I would need to make is adding a `race_id` field.

The more I think about it the more I like your table even if it is out of date, still probably more accurate then mine, so the question is keep the name you have or change it to something else?