NPC Faction Colors
- John Adams
- Retired
- Posts: 4583
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: NPC Faction Colors
I just re-parsed everything and popped it into my world. I was surprised when I saw colored names and reticles.
They were both yellow, and when I clicked on them it turns green, with a familiar blue reticle. These are pets (minions), and this doesn't happen when I target NPCs (because of the faction packets we're not sending yet).
Question to be answered: are Pets (entity type 4096) just handled differently because they are never faction aware to players?
They were both yellow, and when I clicked on them it turns green, with a familiar blue reticle. These are pets (minions), and this doesn't happen when I target NPCs (because of the faction packets we're not sending yet).
Question to be answered: are Pets (entity type 4096) just handled differently because they are never faction aware to players?
You do not have the required permissions to view the files attached to this post.
Re: NPC Faction Colors
[quote]Question to be answered: are Pets (entity type 4096) just handled differently because they are never faction aware to players?[/quote]
If i had to guess yes kinda like how players show up correctly in the emu the color of them that is when you click on them.
If i had to guess yes kinda like how players show up correctly in the emu the color of them that is when you click on them.
- John Adams
- Retired
- Posts: 4583
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: NPC Faction Colors
Cool. If you haven't done so elsewhere, can you please do the packet layout/flow for Factions here? While it's not super urgent, if it's easy I'd like to bring the world to life with appropriate colorings like you did in your demo.
I can set up a temporary `character_factions` table along with our global `factions` and `faction_alliances` (if that's what we choose to call it).
I can set up a temporary `character_factions` table along with our global `factions` and `faction_alliances` (if that's what we choose to call it).
Re: NPC Faction Colors
Ok going to be doing some guessing on this and i'm not even sure i'm right but here it goes.
When the spawns are sent to the world they have a faction id attached to them and when the client see's that spawn packet i think it checks to see if if the player knows about that faction and then if so it uses the value the player has for that id. Now if the player doesn't then the client sends a request to the server asking for what the player has for a faction value.
OP_ClientNpcFaction
OP_ServerNpcFaction
When the spawns are sent to the world they have a faction id attached to them and when the client see's that spawn packet i think it checks to see if if the player knows about that faction and then if so it uses the value the player has for that id. Now if the player doesn't then the client sends a request to the server asking for what the player has for a faction value.
OP_ClientNpcFaction
Code: Select all
-- OP_Unknown_862 --
7/17/2014 17:31:01
192.168.1.168 -> 69.174.203.21
0000: 02 00 5E 03 00 00 0C 00 00 00 9E 03 00 00 00 00 ..^.............
0010: EC 04 9C 01 00 00 ......
Code: Select all
-- OP_ServerNpcFaction --
7/17/2014 17:31:02
69.174.203.21 -> 192.168.1.168
0000: 02 00 58 03 00 00 08 00 00 00 9C 01 00 00 00 00 ..X.............
0010: 00 00 ..
Re: NPC Faction Colors
Faction levels
Ally (8000)to(20000)
Good (6000)to(7999)
Sociable (2000)to(5999)
Neutral (1999)to(-1999)
Wary (-2000)to(-5999)
Untrustworthy (-6000)to(-7999) Will talk to you still, and allow you to parley and do quests.
Kill on Sight (-8000)to(-20000)
Ally (8000)to(20000)
Good (6000)to(7999)
Sociable (2000)to(5999)
Neutral (1999)to(-1999)
Wary (-2000)to(-5999)
Untrustworthy (-6000)to(-7999) Will talk to you still, and allow you to parley and do quests.
Kill on Sight (-8000)to(-20000)
- John Adams
- Retired
- Posts: 4583
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: NPC Faction Colors
[quote="zingtastic"]Faction levels
Ally (8000)to(20000)
Good (6000)to(7999)
Sociable (2000)to(5999)
Neutral (1999)to(-1999)
Wary (-2000)to(-5999)
Untrustworthy (-6000)to(-7999) Will talk to you still, and allow you to parley and do quests.
Kill on Sight (-8000)to(-20000)[/quote]
[quote="Xinux"]Found faction values in the client.
[/quote]
Ally (8000)to(20000)
Good (6000)to(7999)
Sociable (2000)to(5999)
Neutral (1999)to(-1999)
Wary (-2000)to(-5999)
Untrustworthy (-6000)to(-7999) Will talk to you still, and allow you to parley and do quests.
Kill on Sight (-8000)to(-20000)[/quote]
[quote="Xinux"]Found faction values in the client.
Code: Select all
_SGOUIString__SGOUIString(a1, &_gpEmptyWChar);
v6 = 0;
v5 = 1;
if ( a2 > -2000 )
{
if ( a2 < 2000 )
{
v4 = (int)L"FactionNeutral";
goto LABEL_17;
}
goto LABEL_5;
}
if ( a2 >= 2000 )
{
LABEL_5:
if ( a2 < 5000 )
{
v4 = (int)L"FactionSociable";
goto LABEL_17;
}
goto LABEL_8;
}
if ( a2 >= 5000 )
{
LABEL_8:
if ( a2 < 8000 )
{
v4 = (int)L"FactionGoodwill";
goto LABEL_17;
}
LABEL_11:
v4 = (int)L"FactionAlly";
goto LABEL_17;
}
if ( a2 >= 8000 )
goto LABEL_11;
if ( a2 <= -5000 )
{
if ( a2 <= -8000 )
v4 = (int)L"FactionKOS";
else
v4 = (int)L"FactionUntrustworthy";
}
else
{
v4 = (int)L"FactionWary";
}