Custom Loot Script

*Created by Taz.*

```
Using "RC_Core.rcm"
; testingrc1 1.26
; Date/Time: 12:07:15 AM on 8/14/2011
; By Naddaz on NADCO

    ;-------------------Custom loot system--------------------------------
    ;NOTE LIST NEW ACTOR NAMES IN THIS LIST THAT SHOULD HAVE LOOTS ASSINED TO.

;Will run when target dies to give the proper loot to player.

;When done an execute will need to be placed in each spell as well as the atttack script.
Function Main()
  Player = Actor()
  PName$ = Name(Player)
  HumanPlayer% = ActorIsHuman(Player)
  ActorName$ = Parameter(1) ;get Name of the target. ContextActor()
  PlayerLevel% = ActorLevel(Player)

 ScriptLog("Custom loot script running by " + Pname)

    ;______________________________________________________________________________________________________________________________
 ;______________________________________________________________________________________________________________________________
  ;  Check sent from attacking ability/spell script to see if player is in a form so they can get xp for the form level.
;______________________________________________________________________________________________________________________________
        ; SaberToothXp% = 0
       ; SaberCatXp% = 0
       ; VampXp% = 0
       ; VampFlyXp% = 0
       ; PandoraXp% = 0
       ; Xp2% = 0

        ;--------------------------------------------------------------------------------------------------------------------
  ;set xp if in any form
   ;---------------------CUSTOM XP---------------------------------
         ;give custom xp

           XpCalc% =  PlayerLevel * 3  ;xp formula
          ExtraXp% = Rnd(17, 25) + PlayerLevel + XpCalc

         ;End Custom xp

         SaberToothXp% = Split(ActorGlobal(Player, 4), 1, "|")
        SaberCatXp% = Split(ActorGlobal(Player, 4), 2, "|")
        VampXp% = Split(ActorGlobal(Player, 4), 3, "|")
        VampFlyXp1% = Split(ActorGlobal(Player, 4), 4, "|")
        PandoraXp% = Split(ActorGlobal(Player, 4), 5, "|")
        PandoraRageBuld% = Split(ActorGlobal(Player, 4), 6, "|")

         ;get player race

                 PRace$ = Race(Player)
                PClass$ = Class(Player)
                PlayerID% =ActorID(PRace, PClass)

             IsSaber% = ActorId("Saber Tooth", "Form")
            IsSAberCat% = ActorId("Saber Cat", "Form")
		    VampCheck% = ActorId("Vampire", "Form")
            IsVampfly% = ActorId("Vampire Flying", "Form")
            IsPandora% = ActorId("Pandora", "Form")

             If (PlayerID = IsPandora)

                 PandoraLevel% = AbilityLevel(Player, "Pandora Form")
                PandoraXp% = PandoraLevel * 2 + PandoraXp + ExtraXp + Rand(15, 35)

                  ;In pandora form give rage bonus and some rage back, when getting a kill.
                  AmountRage% = 100 ;set number to the amount of rage that will start bonuses.
                  CurrRage% = Attribute(Player, "Rage")
                  MaxRage% = MaxAttribute(Player, "Rage")
                  BunRagtoadd% = PandoraLevel + Rand(5, 10) + PlayerLevel
                  TotBonRage% = MaxRage + BunRagtoadd

                  If (MaxRage > AmountRage) ; if rage is less then bonus amount then dont let it stack the bonus
                      SetMaxAttribute(Player, "Rage", TotBonRage)
                      SetAttribute(Player, "Rage", TotBonRage)
                   Else ;stack bonus
                      TotBonRage% = 100 + BunRagtoadd
                      SetMaxAttribute(Player, "Rage", TotBonRage)
                      SetAttribute(Player, "Rage", TotBonRage)
                   EndIf

                 ;when a pandora form player kills something they will get a Rage Bulider buff, which will incress there speed abit.
                    If (ActorHasEffect(Player, "Rage Builder"))
                       AddActorEffect(Player, "Rage Builder", "Speed", + 7, 25, 243) ;give Rage Builder bonus
                    Else
                       AddActorEffect(Player, "Rage Builder", "Speed", + 7, 255, 243) ;give Rage Builder bonus
                    EndIf

               ;Send to levelup if Saber level should be given.
              If (PandoraXp >= PandoraLevel * 1000) ;if player has amount of xp need to level send them to level up
                ThreadExecute("LevelUp", "Main", Player, Target, 18) ;parameter for Herbing = 8
                PandoraXp% = 0 ;give 0 xp after level up
              EndIf
              IsPandora% = 1

             EndIf  ;end pandora check

          If (PlayerID = IsSaber) ;Give saber tooth xp
                SaberLevel% = AbilityLevel(Player, "Saber Tooth Form")
                SaberToothXp% = SaberLevel * 2 + SaberToothXp + ExtraXp + Rand(15, 35)

              ;Send to levelup if Saber level should be given.
              If (SaberToothXp >= SaberLevel * 1000) ;if player has amount of xp need to level send them to level up

                ThreadExecute("LevelUp", "Main", Player, Target, 14) ;parameter for Herbing = 8
                SaberToothXp% = 0 ;give 0 xp after level up
              EndIf
                IsSaber% = 1
            EndIf

             If (PlayerID = IsSaberCat)
                SaberCatLevel% = AbilityLevel(Player, "Saber Tooth Cat Form")
                SaberCatXp% = SaberCatLevel * 2 + SaberCatXp + ExtraXp + Rand(15, 35)

               If (SaberCatXp >= SaberCatLevel * 1000) ;if player has amount of xp need to level send them to level up
                ThreadExecute("LevelUp", "Main", Player, Target, 15) ;parameter for Herbing = 8
                SaberCatXp% = 0 ;give 0 xp after level up
              EndIf
                IsSaberCat% = 1
            EndIf

             If (PlayerID = VampCheck) ;if vamp
                VampLevel% = AbilityLevel(Player, "Vamp Form")
                VampXp% = VampLevel * 2 + VampXp + ExtraXp + Rand(15, 35)

                 If (VampXp >= VampLevel * 1000) ;if player has amount of xp need to level send them to level up

                    ThreadExecute("LevelUp", "Main", Player, Target, 16) ;parameter for Herbing = 8
                    VampXp% = 0 ;give 0 xp after level up

                EndIf
                VampCheck% = 1

            EndIf

            If (PlayerID = IsVampfly)
                VampFlyLevel% = AbilityLevel(Player, "Vamp Fly")
                VampFlyXp% = VampFlyLevel * 2 + VampFlyXp + ExtraXp + Rand(15, 35)

              If (VampFlyXp >= VampFlyLevel * 1000) ;if player has amount of xp need to level send them to level up

                ThreadExecute("LevelUp", "Main", Player, Target, 17) ;parameter for Herbing = 8
                VampFlyXp% = 0 ;give 0 xp after level up

               EndIf
              IsVampfly% = 1
            EndIf

       If (IsSaber = 1) or (IsSAberCat = 1) or (VampCheck = 1) or (IsVampfly = 1)  or (IsPandora = 1)

         SkillBar1% = Split(ActorGlobal(Player, 4), 7, "|")
        SkillBar2% = Split(ActorGlobal(Player, 4), 8, "|")
        SkillBar3% = Split(ActorGlobal(Player, 4), 9, "|")
        SkillBar4% = Split(ActorGlobal(Player, 4), 10, "|")
        Extra1% = Split(ActorGlobal(Player, 4), 11, "|")
        Extra2% = Split(ActorGlobal(Player, 4), 12, "|")
        Extra3% = Split(ActorGlobal(Player, 4), 13, "|")
        Extra4% = Split(ActorGlobal(Player, 4), 14, "|")
        Extra5% = Split(ActorGlobal(Player, 4), 15, "|")
        Extra6% = Split(ActorGlobal(Player, 4), 16, "|")
        Extra7% = Split(ActorGlobal(Player, 4), 17, "|")
        Extra8% = Split(ActorGlobal(Player, 4), 18, "|")
        Extra9% = Split(ActorGlobal(Player, 4), 19, "|")

          SetActorGlobal(Player, 4, SkillXPToStore3) ;set dilimiter to actor global 2 with new melee xp amount
       EndIf

 ;______________________________________________________________________________________________________________________________

    If (HumanPlayer = 1) ;Human target check
   ;if target is an npc then continue with picking the right loot.

    ;LIST OF ACTOR NAMES MAKE SURE THEY MATCH WITH NAMES IN THE GUE
   DoEvents(500)
   GiveItem(Player, "Bones") ;give 1 bones for now till we have other things for bones as drops

      ;==================================================================================================

   ;------Ramoria Field Mob list---------
    TrollLoot$ = "Troll"
    BabyLarLoot$ = "Baby Larvae"
    LarvaeLoot$ = "Larvae"
    KrysLoot$ = "Krystalics"
    FatRedLar$ = "Fat Larvae"

         If (ActorName = FatRedLar)
            ThreadExecute("Loot_Fat Larvae", "Main", Player, 0)
            Return
        EndIf

         If (ActorName = TrollLoot) ;troll loot
           ; ThreadExecute("Loot_Boss Spider", "Main", Player, 0) ;Execute to the proper loot script
            Return
        EndIf

             If (ActorName = BabyLarLoot) ;Baby Larvae
             ThreadExecute("Loot_Baby Larvae", "Main", Player, 0) ;Execute to the proper loot script

              Return
            EndIf

               If (ActorName = LarvaeLoot) ;Larvae
               ThreadExecute("Loot_Larvae", "Main", Player, 0) ;Execute to the proper loot script

               Return
              EndIf

                 If (ActorName = KrysLoot) ;Krystalics
                 ThreadExecute("Loot_Krystalics", "Main", Player, 0) ;Execute to the proper loot script
                 Return
                EndIf

   ;-----End Ramoria Field Mob list----------

   ;==================================================================================================

  ;------Damoria Mob List---------

  WSpiderLoot$ = "Wild Spider"
 SnapLoot$ = "Snappler"
 SpeSpiderLoot$ = "Spectal Spider"
 KryLoot$ = "Krystalics"
 RelicLoot$ = "Relica"

         If (ActorName = WSpiderLoot) ;Wild Spider
            ThreadExecute("Loot_Spider", "Main", Player, 0) ;Execute to the proper loot script
            Return
        EndIf

         If (ActorName = SnapLoot) ;Snappler
           ;ThreadExecute("Loot_Bear", "Main", Player, 0) ;Execute to the proper loot script
            Return
        EndIf

         If (ActorName = SpeSpiderLoot) ;Spectal Spider
            ThreadExecute("Loot_Spider", "Main", Player, 0) ;Execute to the proper loot script
            Return
        EndIf

          If (ActorName = KryLoot) ;Krystalics
            ThreadExecute("Loot_Krystalics", "Main", Player, 0) ;Execute to the proper loot script
            Return
        EndIf

         If (ActorName = RelicLoot) ;Relica
            ;ThreadExecute("Loot_Spider", "Main", Player, 0) ;Execute to the proper loot script
            Return
        EndIf

  ;-----End Alanon Mob List---------

 ;------------Misc Mobs-----------------
;    RareBearLoot$ = "Rare Bear"

;        If (ActorName = RareBearLoot)
;            ThreadExecute("Loot_rare bear", "Main", Player, 0) ;Execute to the proper loot script
;            Return
;        EndIf

 ;-----------End Misc Mobs--------------

;----------Other mobs-----------------

;bushaka
 bushakaLoot$ = "bushaka"
         If (ActorName = bushakaLoot) ;bushaka plant like mob give herb drops
            ;ThreadExecute("Loot_Misc", "Main", Player, 0) ;Execute to the proper loot script
            Return
        EndIf

 ;----------End other mobs--------------
     EndIf  ;End human check

     ;------------------End Custom loot system-------------------------------

 End Function

```