Welcome to Yserbius.Org! Join our Ultima Online Private Server and have some old school fun.

Decoding yserbius map functions - NPC interaction

patchx

Message for Upgrade
#1
~/ Hi All ~/

In the second map ("The Mines") the following function is triggered when stepping on one of the squares (this is a standard NPC interaction function, i.e. when you step on the specific square, an NPC picture is shown, and he/she tells you something):

Code:
Function NpcOrcRanger

  Print( "You encounter an Orc Ranger." )

  SetNpcPortrait( NPC_ORC_RANGER )

  [COLOR="Navy"]result[/COLOR] = [COLOR="Red"][B]UnknownFunction[/B]( 15 )[/COLOR]

  If( [COLOR="navy"]result[/COLOR] > 9 )
    Print( [COLOR="DarkGreen"]"The Orc Ranger ignores you and wanders off."[/COLOR] )
  Else
    Print( [COLOR="darkgreen"]"King Cleowyn had a special lockpick which opened a set of doors "
      "in the Vestibule, leading to his Palace. He was the king of thieves,"
      "or so my father told me."[/COLOR] )
  End If

End Function
What I'm trying to figure out is the "UnknownFunction". It takes a parameter (in this case 15) and returns a value. In this particular case, if the value returned is greater than 9, the Orc Ranger NPC will ignore us instead of telling us about Cleowyn's lockpick.

My "theory" on this was that it checks character's level, but it doesn't seem to be the case, at least in the offline version of Yserbius.

Does anybody know/remember what triggers an NPC to "ignore" you instead of giving you information? :confused:

Best regards,
-PaTchX
 

patchx

Message for Upgrade
#3
If you already have the pick? Would be my guess..
Not sure what you mean by "have the pick". This is something I see in the yserbius executable files, I've not been able to get an NPC to "ignore" me. Also, I'd preffer to figure this out with at least some amount of certainty, and not just guess... =)
 

Tiger

Active Members
#4
Meaning, if you already have the lock pick.... Is what I ment... Does the UnknownFunction appear anwhere else?
 

patchx

Message for Upgrade
#5
Meaning, if you already have the lock pick.... Is what I ment... Does the UnknownFunction appear anwhere else?
The UnknownFunction appears for all NPC interactions, and the parameter is always 15, while the return check is not always 9.

I don't think that's it a check for the lock pick. The function always takes "15" as parameter in NPC interaction and is being checked for returning a value (that is either "less than or equal to" or "greater than" X).

The code for Cleowyn's Lockpick is 210.

Best regards,
-p
 

Tiger

Active Members
#6
Interesting.... What abbout a Allignment check? or even a level check...? Or.... Ya know, it may be even an event flag check.. I seem to remember Spell talking about the flags and that's how the game ran alot of checks...
 

patchx

Message for Upgrade
#7
Interesting.... What abbout a Allignment check? or even a level check...? Or.... Ya know, it may be even an event flag check.. I seem to remember Spell talking about the flags and that's how the game ran alot of checks...
That's the thing - we've decoded the alignment / level / etc check functions. This function is something else.That's why I'd like to see if anybody remembers ever being "ignored" by an NPC, and the criteria for being "ignored".

Spell is correct - "flags" is what is used to mark quest completion. For example, when opening top-left door in Dungeon Entrance using Thieves Key, a quest flag is set marking the fact that you've already used the key to open that door.

I've double-checked and the function is definitely not used for anything else but NPC interaction.

Best regards,
-p
 

Tarquin

Active Members
#8
The only thing that comes to mind is a check to see how far in the main quest the PC has progressed. I don't have a character with which I've bested the volcano, but perhaps if the main quest has been completed, the orc ranger simply ignores you.

That could mean, then, that 15 is an enumerated value for MAIN_QUEST_STAGE (or something along those lines) and that the unknown function returns an integer value for how far along the PC has progressed in the quest. Perhaps beating the volcano sets the value of the variable accessed via unknownFunction(15) to 10, at which point all NPCs with story-centric hints simply ignore you.

Just a thought.
 

patchx

Message for Upgrade
#9
The only thing that comes to mind is a check to see how far in the main quest the PC has progressed. I don't have a character with which I've bested the volcano, but perhaps if the main quest has been completed, the orc ranger simply ignores you.

That could mean, then, that 15 is an enumerated value for MAIN_QUEST_STAGE (or something along those lines) and that the unknown function returns an integer value for how far along the PC has progressed in the quest. Perhaps beating the volcano sets the value of the variable accessed via unknownFunction(15) to 10, at which point all NPCs with story-centric hints simply ignore you.

Just a thought.
Hi Tarquin,

Thanks for the reply. I don't believe there is such a thing as "main quest stage" in yserbius. I'm getting to be more and more convinced that this function is not used at all.

Best regards,
-ptx
 
Top