RealmCrafter Wiki
Register
Advertisement

Created by Taz.

Using "RC_Core.rcm"
; testingrc1 1.26
; Date/Time: 12:56:06 AM on 7/4/2010
; By Naddaz on TAZCO
;Mana Water 
 Function Main()
 Player = Actor()
 PlayerMaxHP% = MaxAttribute(Player, "Mana")
 PlayerHP% = Attribute(Player, "Mana")
 
  CurrPHunger% = Attribute(Player, "Hunger")
 CurrMaxPHunger% = MaxAttribute(Player, "Hunger")

    
 
 If (PlayerHP >= PlayerMaxHP) And (CurrPHunger >= CurrMaxPHunger) 
  
      OutPut(Player, "You dont need that right now", 200, 45, 32)
    Return
 
 EndIf
 
         If (PlayerHP >= PlayerMaxHP) And (CurrPHunger <= CurrMaxPHunger) 
        ;Give player hunger incress.
        ;CHANGE THIS LATER FOR WATER SYSTEM
        CurrPHunger% = Attribute(Player, "Hunger")
        TotHungerToGive% = CurrPHunger + 25
        SetAttribute(Player, "Hunger", TotHungerToGive)
        GiveItem(Player, "Mana Water", - 1)
        Return
         EndIf
         
         
 If (PlayerHP <= PlayerMaxHP) And (CurrPHunger >= CurrMaxPHunger) 
 
 OutPut(Player, "You sit and drink", 0, 200, 40)
 GiveItem(Player, "Mana Water", - 1)
 
 AnimateActor(Player, "Sit Down", 1.7)
 
 
 Ticks% = 6 ;total ticks of Mana
 
 Repeat
 
 Tothealth% = Attribute(Player, "Mana")
 totPlayerMaxHP% = MaxAttribute(Player, "Mana")
 DoEvents(1)
 
 NewHp% = Attribute(Player, "Mana") + 65 ;tick Mana amount
 
 AnimateActor(Player, "Sit idle", .05, 1)
 
 If (Tothealth >= totPlayermaxhp)
     AnimateActor(Player, "Standup", 1)
    Ticks% = 0
     Return
 EndIf    
 
 TickChance% = Rnd(1, 32)
 
 If (TickChance = 1)
 NewHp% = Attribute(Player, "Mana") + Rnd(3, 5) ;tick Mana amount
 TotalHp% = NewHp
 SetAttribute(Player, "Mana", TotalHp) ;give player Mana per tick
 EndIf
 
 Until (Tothealth = totPlayermaxhp)
 
 
 EndIf
 
 End Function
Advertisement