GiveKillXP
Usage:
GiveKillXP(Actor, TargetActor)
Description:
The GiveKillXP command gives experience points to actor. It works on both player characters and NPCs. The actor will increase in level if you give them enough points.
The difference between this command and GiveXP is that instead of specifying an exact number of XP points, you specify a target actor. The number of XP points assigned will be the number that would be assigned if the actor killed the target actor. This is convenient to let the RC engine automatically calculate XP points as it normally does, without having to use KillActor (e.g. in a custom combat script).
The target actor is not affected by the use of this command.
Example:
Function Main()
// Give the player the XP points for killing the NPC, and kill the NPC
NPC = ContextActor()
GiveKillXP(Actor(), NPC)
SetAttribute(NPC, "Health", 0)
Return()
End Function
Comments (0)
You don't have permission to comment on this page.