RealmCrafter Wiki
Advertisement

Created by Taz.

Using "RC_Core.rcm"
; testingrc1 1.26
; Date/Time: 4:33:33 PM on 1/29/2011
; By Naddaz on TAZCO
;Spider Stew
 Function Main()
 Player = Actor()
 PlayerMaxHP% = MaxAttribute(Player, "Health")
 PlayerHP% = Attribute(Player, "Health")
 
  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.
        CurrPHunger% = Attribute(Player, "Hunger")
        TotHungerToGive% = CurrPHunger + 550
        SetAttribute(Player, "Hunger", TotHungerToGive)
        GiveItem(Player, "Spider Stew", - 1)
        Return
         EndIf
         
         
 If (PlayerHP <= PlayerMaxHP) And (CurrPHunger >= CurrMaxPHunger) 
 
 OutPut(Player, "You sit and eat some spider stew", 0, 200, 40)
 GiveItem(Player, "Spider Stew", - 1)
 
 AnimateActor(Player, "Sit Down", 1.7)
 
 
 Ticks% = 6 ;total ticks of health
 
 Repeat
 
 Tothealth% = Attribute(Player, "Health")
 totPlayerMaxHP% = MaxAttribute(Player, "Health")
 DoEvents(1)
 
 NewHp% = Attribute(Player, "Health") + 75 ;tick health 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, "Health") + Rnd(3, 5) ;tick health amount
 TotalHp% = NewHp
 SetAttribute(Player, "Health", TotalHp) ;give player health per tick
 EndIf
 
 Until (Tothealth = totPlayermaxhp)
 
 AddActorEffect(Player, "Well Fed + 4 Defence", "Defence", 4, 2790, 254)
 
 
 
 Return
 EndIf
 
 End Function
Advertisement