FANDOM


Created by Taz.

Using "RC_Core.rcm"
; testingrc1 1.26
; Date/Time: 4:13:41 PM on 4/10/2010
; By Naddaz on TAZCO
;Life regen
 ;Heals life every 4 secs, for 78 ticks. About 5.2 mins
;last updated june 09 2010
Function Main()
Player% = Actor()
Target% = ContextActor()
Pname$ = Name(Player)
Prayerlvl% = Attribute(Player, "Prayer")
MaxPrayerlvl% = MaxAttribute(Player, "Prayer")
PlayerLevel% = ActorLevel(Player)
BuffLevel% = AbilityLevel(Player, "Life Regen")
Buffamount% = Prayerlvl * PlayerLevel / 8 + Bufflevel * 7 / 25 ; buff amount seems to work just needs some tweaking

ScriptLog("Life regen running by " + Pname)

If (Prayerlvl <= 6)
    OutPut(Player, "You need to recharge your prayer, to use this buff, you need 7 prayer points.", 245, 123, 123)
    Return
 EndIf 
 
 Buffcost% = Attribute(Player, "Prayer") - 7 ;amount of paryer cost
 SetAttribute(Player, "Prayer", Buffcost)  ; take 7 prayer from player for buff cost
 
 If (BuffAmount > 175) ;set max amount that buff can be
     Buffamount% = 175
EndIf   


Doevents(500)
If (MaxPrayerlvl >= 9) ; set prayer level required to use ability
 
     AddActorEffect(Player, "Buff Life Regen", "Health", Buffamount, 10400, 235) ; add buff icon should last 1 hour
    OutPut(Player, "You have buffed yourself with Life Regen ", 110, 54, 43)
    Ticks% = 78
     Repeat 
  
     PlayerHp% = Attribute(Player, "Health")
    healAmount% = Rand(62, 75) + PlayerLevel + MaxPrayerlvl
    Tothealamount% = PlayerHp + HealAmount 
    SetAttribute(Player, "Health", Tothealamount)
    Ticks% = Ticks - 1   
    DoEvents(4000) ;Every 2 sec give play health
    CreateFloatingNumber(Target, healAmount, 0, 255, 5) ;show blue for crit
                  
    ;Output(player, "Recived health" + healAmount, 125, 32, 43) ;Debug
            If (PlayerHp <= 0)
             Ticks% = 0
            EndIf  
    Until (Ticks = 0)
    
     DeleteActorEffect(Player, "Buff Life Regen") ;take regen buff away
Else
OutPut(Player, "You need a prayer level of 9 to use this Prayer ability", 125, 32, 43)
Return
EndIf



End Function