Page 1 of 1
Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 12:17 pm
by Gangrenous
I noticed that a few NPC's in Antonica show up as red portals on occasion we you do a respawn. Anyone else notice this? It is not every time either.
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 4:05 pm
by Jabantiz
This is part of the random code, some models have changed over time so an id that use to point to a playable race can now point to random objects/mobs. I thought I fixed most of them, if you see it again, or any other weird object that should be a playable race, can you do a /spawn details and post the model_type id?
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 5:43 pm
by Gangrenous
And it can change on respawn? That is what is baffling to me.
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 6:05 pm
by Gangrenous
Here you go...
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 6:08 pm
by Gangrenous
This guy too....
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 6:36 pm
by Gangrenous
And a Traitorous Farmer
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 6:44 pm
by Gangrenous
I am thinking it is randomize since it is actually random...very random. I notice randomize is on.
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 6:47 pm
by Jabantiz
Yea the random code is to change the appearance of the spawn, so we can have 1 spawn for guard and a bunch of different appearances instead of 1 spawn per appearance and then each location a combination of all those spawns. There is a way to alter what is random, even restrict it to good or evil races, or you can turn it off completely, this is something I haven't messed with to much so not sure what tables is related to this.
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 6:58 pm
by Jabantiz
15909 is ec/pc/human/human_male_normal_test in the appearance table, just checked the code and that should not be included, anything with test in the name should be excluded. In worlddatabase.cpp make sure you have this function with the updated sql.
Code: Select all
vector<int16>* WorldDatabase::GetAppearanceIDsLikeName(string name, bool filtered) {
vector<int16>* ids = 0;
Query query;
MYSQL_ROW row;
query.escaped_name = getEscapeString(name.c_str());
MYSQL_RES* result;
if (filtered)
result = query.RunQuery2(Q_SELECT, "SELECT `appearance_id` FROM `appearances` WHERE `name` RLIKE '%s' AND `name` NOT RLIKE 'ghost' AND `name` NOT RLIKE 'headless' AND `name` NOT RLIKE 'elemental' AND `name` NOT RLIKE 'test' AND `name` NOT RLIKE 'zombie' AND `name` NOT RLIKE 'vampire'", query.escaped_name);
else
result = query.RunQuery2(Q_SELECT, "SELECT `appearance_id` FROM `appearances` WHERE `name` RLIKE '%s' AND `name` NOT RLIKE 'ghost' AND `name`", query.escaped_name);
while (result && (row = mysql_fetch_row(result))) {
if (!ids)
ids = new vector<int16>;
ids->push_back(atoi(row[0]));
}
return ids;
}
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 7:08 pm
by Gangrenous
No, I have not merged in your updates to mine in a few months. I can certainly do that on Sunday or Monday. I see that change now on 9/16/2016. That is all it is I guess?
Re: Strange NPC appearance on new dump
Posted: Sat Dec 10, 2016 7:13 pm
by Jabantiz
yea, updating that first sql statement should solve most of the weird random models but it is possible there is more that I just haven't run across yet.
Re: Strange NPC appearance on new dump
Posted: Sun Dec 11, 2016 7:38 am
by Gangrenous
If there are I will post a diff
Re: Strange NPC appearance on new dump
Posted: Thu Feb 09, 2017 8:31 pm
by Gangrenous
FYI, finding when some of these randomize as Model Type 16011, they look like bumps on the terrain. Moving the model around, looks like a flag.
Re: Strange NPC appearance on new dump
Posted: Sun Apr 09, 2017 7:14 am
by Gangrenous
Here we go, ran into a few more today.