Index · Preferences · Help
Announcements · BYOND Features · Bug Reports · Fixes and Features · Developer How-To · Code Problems · Design Philosophy · Creations · Classified Ads · Gaming · Computers & Technology · Community
Forum Search:

[Advanced Search]

[Messages in this Thread] [Show All (4)] [Return to Code Problems]

Author:Onolt [Posts]
Date:11/7/09 10:16 pm
Topic:Randomized Gained Experience
Post ID:726243
Next ID:726253
Code: Mob/DeathCheck proc
////////////////////////////////////////////
///////////// DeathCheck Proc /////////////
//////////////////////////////////////////


    proc/DeathCheck(mob/M)
        if(src.Hp <= 0)
            if(!Npc)
                src.dead = 1
                M<<"<b><font color = blue>You watch as [src.name] collapses hitting the ground.</font></b>"
                src<<"<b><font color = blue>You have been killed by [M.name].</font></b>"
                view(M)<<"<b><font color = blue>[src.name] has been killed by [M.name]!</font></b>"
                src.loc = locate(1,1,1)
                src.dead = 0
                src.Restore()
                return
            else
                M<<"<b><font color = blue>You watch as [src.name] collapses hitting the ground.</font></b>"
                view(M)<<"<b><font color = blue>[src.name] has been killed by [M.name]!</font></b>"
                M.Ryo += src.Ryo
                src.dead = 1
                M.Exp += src.Exp
                del(src)
        else
            return



Problem description: Whenever I kill an NPC the exp added to my character is random instead of being 1 like I set the NPC's exp to.

Messages in this Thread: [Show All (4)]

  Randomized Gained Experience Onolt (11/7/09 10:16 pm)
      Re: Randomized Gained Experience Garthor (11/8/09 4:32 am)
          Re: Randomized Gained Experience Onolt (11/8/09 1:43 pm)
      Re: Randomized Gained Experience Howey (11/8/09 2:51 am)