PDA

View Full Version : Database/Perl Faction System


RichardoX
12-22-2004, 01:20 PM
DATABASE VALUES AND DEFINITIONS
(note: I'm no master at this so I may be wrong on a few things)

Faction_List: (This Holds the names of the factions and ID Numbers along with the faction everyone STARTS with on that faction)

Http://www.worldofalkora.com/tutorial/faction_list.bmp

Faction_Values: (This holds the values of how NPC's respond to each other as you see in the picture.)

Http://www.worldofalkora.com/tutorial/faction_values.bmp

Npc_Faction: (This is where the server checks the names of the faction for whenever you slay a NPC with a certain faction and gives you the... You have gained faction with Qeynos!....Also When creating these, make sure they are same ID on both sides, on ID and Primary Faction.)

Http://www.worldofalkora.com/tutorial/npc_faction.bmp

Npc_Faction_Entries: (Npc_Faction_Entries is what the server checks to see how much faction you gain or lose when you slay a NPC with a set faction. NOTE, if you set these factions too high you can allow people to get ally faction or KoS faction very quickly. Also, - behind a number means lose faction, no negetive sign means gain faction.)

Http://www.worldofalkora.com/tutorial/npc_faction_entries.bmp

Notice in this picture I have qeynos twice, I did that so that if you kill a freeport NPC, you gain faction with Qeynos along with negetive faction with freeport.

FACTION VALUE LIST: (There are few because I have'nt tested all factions yet)
-1500: Scowl Ready to Attack
-1000: Threateningly
-200: Dubiously
0: Indifferently
1500: Ally

PERL

When writing a quest, you sometimes want people to earn their rights to be able to do such a quest and you see quest::faction there but have no idea how to use it, here ya go...

$faction - Returns the faction level number of the user with the mob.
1: Ally
2: Kindly
3: Warmly
4: Amiably
5: Indifferent
6: Apprehensive

< less than
> greater than
>= greater or equal than
<= less or equal than
== equal
!= Not equal

------------------------------------------------------------------------------------

Example
sub EVENT_SAY
{
if($faction == 1)
{
if($text=~/hail/i)
{
quest::say("hi");
}
}
elsif($faction != 1)
{
quest::say("umm dont talk to me?");
}
}
-------------------------------------------------------------------------------------

Also to give/take away faction


sub EVENT_SAY
{
if ($text =~/Hail/i)
{
quest::say("Do you want faction with Qeynos?");
}
if ($text =~/yes/i)
{
quest::faction(7,5);)
}
}

quest::faction(7(factionID), 5(how much faction it gives you, -5 would give negetive faction)
------------------------------------------------------------------------------------

I hope this helps, I do not take credit for Perl Section since its already explained somewhere else. :)

Cisyouc
12-22-2004, 04:23 PM
Nice way to ask me about half of the stuff in irc and then take credit :P

lol no but really, most of this looks good.. but you may want to compress the screenines out of bmp.. ick.

fathernitwit
12-22-2004, 06:03 PM
not trying to be a dick or anything, but this is missing like 80% of the information about factions... its a good start, but really contains little information that somebody could use to work on factions in the database.

faction_value has nothing to do with npcs really... notice the char_id column...
explanations of the mods is pretty important (hint: diety and race)
you dont explain what primary faction does, and why its important
you dont explain when you use the id from faction_list and when you use the id from npc_faction
your screen shot for faction entry dosent have npc_value in it
you dont explain anything about how mobs consider eachother using npc_value

also, concrete examples with explanations are almost manditory for explaining something like this. Also, the images are almost worthless not inlined.

RichardoX
12-22-2004, 06:15 PM
feel free to edit it, im just posting all I know, and yea cisyouc, which is why I say I dont take credit for it...

Farther, I only posted because I saw no one else posting.. so please edit it accordingly to what you know.. I really dont care who credit of writing it goes to...

I would just like to see a good tutorial on this

Muuss
12-22-2004, 08:10 PM
This is a good start, if you complete it, i m sure it could be validated and become an 'official' guide :)
Thank you.