Author Topic: Need to get EXP on kill  (Read 370 times)

Legacy_Asmius

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Need to get EXP on kill
« on: July 01, 2011, 03:38:14 am »


               I need the command to give experience on death. Anyone know what it is?
               
               

               
            

Legacy_mwplayer

  • Newbie
  • *
  • Posts: 38
  • Karma: +0/-0
Need to get EXP on kill
« Reply #1 on: July 01, 2011, 04:08:29 am »


               The command (function) is RewardPartyXP (#include "nw_i0_tool") and GiveXPToCreature.

That's what you were looking for, right? Or did you want to give xp on the OnDeath of some creature?
               
               

               
            

Legacy_Asmius

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Need to get EXP on kill
« Reply #2 on: July 01, 2011, 04:24:19 am »


               hrm..

I was using RewardPartyXP(1, oPC, TRUE); but it siad that 'RewardPartyXP' was invalid.
               
               

               
            

Legacy_Asmius

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
Need to get EXP on kill
« Reply #3 on: July 01, 2011, 04:28:05 am »


               I want the experience to go to the kilelr, btw.
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Need to get EXP on kill
« Reply #4 on: July 01, 2011, 10:18:57 am »


               RewardPartyXP is not a default function, and as mwplayer said, you must include a script so you can use it.
( #include "nw_i0_tool" )
Put that before void main()
This command gives XP to a whole party.

GiveXPToCreature is a default function, and thus you need not include anything. It only gives XP to a single creature at a time though.
               
               

               


                     Modifié par Xardex, 01 juillet 2011 - 09:20 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Need to get EXP on kill
« Reply #5 on: July 01, 2011, 09:43:03 pm »


               Something like this in the creatures OnDeath:

void main()
{
    object oPC = GetLastKiller();
    if (GetIsObjectValid(GetMaster(oPC)))
    {
        oPC = GetMaster(oPC);
    }
    GiveXPToCreature(oPC, 100);
}
               
               

               
            

Legacy_La Rose Noire

  • Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
Need to get EXP on kill
« Reply #6 on: July 04, 2011, 05:16:15 pm »


               But take care, if your xp rate is not at 0, it will give extra xp to the killer and normal xp to the group.