PDA

View Full Version : Quest Giver Faction Issue if($faction >=1000)


litlamzetiv
07-08-2009, 12:27 PM
I want players to have to kill nagafen before they can go to Karnor. The method I've chosen to do this with is faction. The steps I've taken are as follows:


[TABLE: Faction List] Created a new faction (ID: 19938) called RED DRAGON SLAYERS.
[TABLE: npc_faction_entries] Modified npc_faction_id 23 (nagafen) to also have a faction ID 19938 value of 1500 and npc_value of 0.
[TABLE: npc_types] I created an NPC in soltemple and modified his npc_faction_id in this table to be 19938.
Modified the quest for this mob to the following:

sub EVENT_SAY
{
if($text=~/slain/i) {
$npc->SetAppearance(0);
if($faction >=1000) {
quest::say("Yes, Chronicler Crinklespark told me all about your feat in conquering the great lord Nagafen. I hear that the first to try were a bunch of crazy gnomish wizards, though I hope you managed to complete the task without quite as much bloodshed. Have you [performed the other tasks] as instructed?");
}
}
}

I'm sort of at a loss as to why that doesn't work. I've confirmed the following:

Killing Nagafen properly gives a message that my faction 19938 has increased.
My character has the proper value for the faction [Table: faction_values].


Do I also need to somehow add an entry for the quest NPC in [Table: npc_faction] in order to set his primary faction to 19938? I wouldn't figure this was necessary, because when I use the NPC and Loot Editor, it shows the npc_faction_id properly; however, when I con the mob (even after killing nagafen). If this is what I need to do, what does the value mean? Is that just an arbitrary unique number I can assign? Does it use "name" as a lockup in some other table?

While I'm at it, is there a way for a quest to check more than one faction, or can it really only compare the faction against the primary faction of the quest giver? I'm under the assumption that it can only do one, but if it could do several, that'd be downright handy.

Thanks in advance.

-Rob

Shendare
07-08-2009, 12:40 PM
The $faction variable does not give the quest NPC the actual faction points, it gives a number from 1-9, representing the faction message the user would get when conning the NPC.

However, for some reason, the current numbers are out of whack once you get below indifferent:

File: faction.h

enum FACTION_VALUE {
FACTION_ALLY = 1,
FACTION_WARMLY = 2,
FACTION_KINDLY = 3,
FACTION_AMIABLE = 4,

FACTION_INDIFFERENT = 5,

FACTION_APPREHENSIVE = 9,
FACTION_DUBIOUS = 8,
FACTION_THREATENLY = 7,
FACTION_SCOWLS = 6
};


File: faction.cpp

if(character_value >= 1101) return FACTION_ALLY;
if(character_value >= 701 && character_value <= 1100) return FACTION_WARMLY;
if(character_value >= 401 && character_value <= 700) return FACTION_KINDLY;
if(character_value >= 101 && character_value <= 400) return FACTION_AMIABLE;
if(character_value >= 0 && character_value <= 100) return FACTION_INDIFFERENT;
if(character_value >= -100 && character_value <= -1) return FACTION_APPREHENSIVE;
if(character_value >= -700 && character_value <= -101) return FACTION_DUBIOUS;
if(character_value >= -999 && character_value <= -701) return FACTION_THREATENLY;
if(character_value <= -1000) return FACTION_SCOWLS;
return FACTION_INDIFFERENT;


I'm not aware of a way for a quest script to check faction against a different NPC.

gaeorn
07-08-2009, 12:43 PM
However, for some reason, the current numbers are out of whack once you get below indifferent:

That's the way it is on live, unfortunately.

Congdar
07-08-2009, 12:45 PM
http://www.eqemulator.net/wiki/wikka.php?wakka=QuestTutorial

$faction values are only 1 through 9, so you need to set the primary faction on your zoner(i assume this is how you are keeping people out of karnors?) to the one you are using for Nagafen (Ring of Scale?)

Shendare
07-08-2009, 12:48 PM
That's the way it is on live, unfortunately.

What?? Verant defying logic? You're kidding! :D

litlamzetiv
07-08-2009, 01:46 PM
Thanks for the insight. The faction levels thing is good to know, but that isn't what's stopping the quest from working. Though I've taken the faction hit from killing naggy now, the mob still cons me as dubious (although the table shows me at 1500 with the faction which should be max ally). That's where the problem lies for me--though I appreciate you nipping my next question in the bud where it comes to faction levels.

So, why does the mob not con as ally to me if I have it done that way? Congdar seems to be pointing me in the right direction, but I thought I'd already done that. I don't want the "zoner" mob to be on ring of scale faction, but on the new faction I created (19938) and I thought I'd done that, but it doesn't seem to have taken. Could you elaborate as to how to properly perform this step?

Shendare
07-08-2009, 02:10 PM
Perhaps you're not utilizing the faction tables correctly.

npc_types.npc_faction_id corresponds to npc_faction.id

npc_faction.primaryfaction corresponds to faction_list.id

faction_list.id corresponds to faction_values.faction_id

So, when character # 1 cons Nagafen (npc_types.id 32040), the server sees that Nagafen has a npc_faction_id of 23.

The server checks the npc_faction record for id 23 and sees that the primary faction for this entry is 226.

The server checks the faction_list table for id 226 and builds a starting faction value from the base, race, class, and deity modifiers in the record.

The server then checks the faction_values table record matching character id #1 and faction_id # 226, adding the user-accomplished current_value number to the starting faction value from faction_list.

The server then adds in any further modifiers such as worn item faction adjustments and spell-related faction adjustments.

The final modified number determines the individual character's standing with the NPC being conned.

litlamzetiv
07-08-2009, 02:38 PM
Yeah, that's gotta be the breakdown. I was omitting an entry in faction_values for the factions I'd created.

I really appreciate you guys taking the time to break this all down in detail to a n00b.

<3