Jump to content

Determining how much XP an NPC will reward when killed?


Asterra

Recommended Posts

Looking for the means (via scripting) to determine this. I do gather that there are a lot of variables to tap, like difficulty level, level of the NPC, etc. I don't know how all of that figures into the XP reward, and reckon there could be a straightforward function that calculates all this automatically (since, you know, the game does in fact do this when the player kills something).

 

Alternately, looking for a way to ensure that when an NPC dies, the player is assumed to be their killer, and so the reward is applied accordingly. The game does keep some sort of tabs on this -- like if the player doesn't do enough damage personally, they get no reward. I am not seeing that there are any script functions that can tap into the variables controlling such reckoning. But I could be mistaken.

Link to comment
Share on other sites

This is horrible and as above no native function. With access to hostile/opponent actor OnDeath() through managed combat quest aliases, the best I could cook up is this mess:

Event OnDeath(ObjectReference akVictimRef, Actor akKiller)

Self.RemoveRef(akVictimRef)

If akKiller == pPlayerActor
   ; calculate kill XP to aggregate for iQuestXPValue bonus 
   Int iPlayerXPNow = pPlayerActor.GetValue(pExperience) as Int
   Int iThisXPDelta = (iPlayerXPNow - iPlayerXPLast)
   iPlayerKillsXPValue +=iThisXPDelta 
   iPlayerXPLast = iPlayerXPNow
   Actor akVictimActor = akVictimRef as Actor
   Debug.Trace( "SKK_IB,ONKILL," + akVictimRef + "," + akVictimActor.GetActorBase() + ",killer," + akKiller + ",Level," + akVictimActor.GetLevel() + ",XP," + iThisXPDelta )
Endif

EndEvent

The biggest issue is that if the player buggers off and earns other XP between these kills, that will be included in the next XP delta, so it's not reliably accurate.

 

Also ... this only works where the player is the "last shot" final killer to avoid hoovering-up npc:npc kills, but the game engine awards XP for player assisted kills using fXPDeathRewardHealthThreshold (default 25%).

Edited by SKK50
Link to comment
Share on other sites

This is horrible and as above no native function. With access to hostile/opponent actor OnDeath() through managed combat quest aliases, the best I could cook up is this mess:

 

My testing revealed that rewarded exp ranged between 3x and 5x the level of the NPC, on a bell curve that was lowest at level 30 and highest at levels 1 and 60. I've decided that a system that mimics these results is "good enough" since it's been more or less agreed on from everyone who's looked into this that accuracy cannot be attained.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...