Aller au contenu

Photo

Addxp or Setlevel script?


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
jsd313

jsd313
  • Members
  • 184 messages
I want an NPC to offer the option to lvl to 25. I can make a lvl 1 and use this cheat to add enough xp to make me lvl 25 but I don't know how I would set a number in here so when I trigger this from a convo the xp is granted automatically. Or would it be easier to have the NPs just SetLevel on the Hero to 25?

[dascript]
#include "sys_rewards_h"
void main()
{
    string sVar     =  GetLocalString(GetModule(),"RUNSCRIPT_VAR");
    int nFind       =  FindSubString(sVar," ");
    string sXp      =  SubString(sVar,0,nFind);
    int    nXp      =  StringToInt(sXp);

    DEBUG_PrintToScreen("Adding " + sXp  + " XP to " + ToString(OBJECT_SELF));
    RewardXPParty(nXp, 5, OBJECT_SELF, OBJECT_SELF);
}
[/dascript]

#2
Xetrill

Xetrill
  • Members
  • 28 messages
Untested:

#include "sys_rewards_h"

object oPC = GetHero();
   int nXP = RW_GetXPNeededForLevel(25) - GetExperience(oPC);

RewardXPParty(nXP, XP_TYPE_PLOT, oPC);


#3
jsd313

jsd313
  • Members
  • 184 messages
That works, thank you Xetrill.