Page 1 of 1

Factions

Posted: Sat Aug 09, 2008 5:00 pm
by LethalEncounter
OK Factions are working. Here is a brief explanation on how to use them.

Starting factions: The factions in starting_factions are given to a player when they are created. If they choose qeynos as they starting city the values that are inserted into character_factions are all that match a starting_city (field in starting_factions) value of 1. Freeport is 2, Gfaydark is 4, Neriak is 8 and Kunark is 16.

Factions table: This is where you create new factions or modify existing ones. Note that factions 1 through 9 are reserved and will be discussed further down. Most fields in this table are self explanatory. Default_value is the value given to a player if the player didn't have the faction yet. Negative change is the amount their faction level is reduced by when they take a faction hit (ie they kill a spawn of the faction). Positive change is the amount their faction level is raised when they receive a faction boost (ie they kill a spawn that is an enemy of another faction). Type is whatever category you want to display in the players drop down list.

Reserved Factions: They are in the table for reference only. These range from 1 to 9 (Scowls to Ally) and are the values you should use in faction_id of a spawn for which you wish to adjust the default con. The default con is indifferent. So if you wish to make something KOS, but you don't want to create a specific faction you would give it a faction_id of 1.

Faction_alliances table: This table is used to let the system know which factions like and dislike each other. The input for all 3 fields are faction ids. For example if you kill a qeynos guard you would receive a negative hit with qeynos and a positive boost with freeport if they are set up to hate each other. If you kill a spawn that another faction likes then you will also lose value with that faction.

Example :
  • "id","faction_id","friend_faction","hostile_faction"
    "1","11","0","12"
    "2","12","0","11"
This will set Qeynos and Freeport as enemies since Qeynos (faction id of 11) has faction id 12 (Freeport) as a hostile faction. Freeport (12) then has Qeynos (11) as a hostile faction. See screenshot7 for the result of giving a spawn a faction_id of 12 and then killing it.

Note: A particular faction is not given to the player until they receive a negative hit or positive boost from that faction (or they are given it via the starting_factions table).

Some screenshots:
http://www.eq2emulator.net/ScreenShots/Factions1.jpg
http://www.eq2emulator.net/ScreenShots/Factions2.jpg
http://www.eq2emulator.net/ScreenShots/Factions3.jpg
http://www.eq2emulator.net/ScreenShots/Factions4.jpg
http://www.eq2emulator.net/ScreenShots/Factions5.jpg
http://www.eq2emulator.net/ScreenShots/Factions6.jpg
http://www.eq2emulator.net/ScreenShots/Factions7.jpg
I'm sure all this is clear as mud but hopefully someone understands it :P

Posted: Sat Aug 09, 2008 5:40 pm
by John Adams
Try not to faint, but I actually get this part. :)
Nice work, mate. I am loading it up now.

Posted: Sat Aug 09, 2008 6:46 pm
by LethalEncounter
Doesn't look like you are using the right version.

Posted: Sat Aug 09, 2008 6:49 pm
by John Adams
I just discovered a very important fact about testing new code on this project. Be sure you actually retrieve the latest code from SVN before "updating" your server to the latest. :)
Ok, now I really am going to test it out.

Posted: Sat Aug 09, 2008 6:49 pm
by John Adams
Indeed. I thought I'd ninja out my dumbass post before you saw it. Damnit! lol

Posted: Sat Aug 09, 2008 7:58 pm
by paulgh
Here's a question for you.
If I set some spawn's faction_ids to 1 KOS, say the giants in Thundering Steppes, and later gryphon flight is added to the emulator, wouldn't they try to bat me out of the air? Although that might be very amusing.
On live, it appears that your faction_id is temporarily changed while in flight/transit because nothing is KOS. Is this something that needs to be considered, or would it be a small tweak when/if the time comes?

Re: Factions

Posted: Mon Oct 12, 2009 10:30 am
by bolly
So just to get this straight

What would I set the default_level to in factions if i wanted to be Scowling

-40000?

Also /spawn set faction Number then /reload spawns crashes my eq2world (rev 335) - the number also doesn't update in the table. I think maybe it's the faction set that kills it to be honest?

Re: Factions

Posted: Mon Oct 12, 2009 1:22 pm
by John Adams
"Who Hates Who" is dependent on the configuration in the faction_alliances table.

Example: Qeynos hates Freeport

So in faction_alliances, set one record where Qeynos Faction (11) hates Freeport Faction (12) -- or whatever
Then set a Freeport (12) hates Qeynos (11)

Then in starting_factions, set the player class/race combo to get 50,000 for Qeynos, and -50,000 (or whatever) for Freeport.

Finally, set your NPCs to faction_id 12 and when your Qeynos player comes near, they should be KOS/Scowled/Hated.


I am not sure default_faction plays a role at this time.

Re: Factions

Posted: Mon Oct 12, 2009 3:22 pm
by bolly
No it's the default_value I was after and it does seem that it's * 10000

For anyone else who searches the forums:

-4 = scowls
-3 = threatening
-2 = dubiously
-1 = apprehensively
0 = indifferent
1 = amiably
2 = kindly
3 = warmly
4 = ally

(found in comments in the zoneserver.cpp)