FANDOM


A tree chopping script that works with RealmCrafter 1.26. The tree will need one bone and one frame of animation. A standard RCTree will work fine. Script was modified by original forum used rodneymillerpca.

Using "RC_Core.rcm" 
; COMPLETE Seeking SCRIPT
; Date/Time: 7:30:24 PM on 15/06/2009
; By User on OWNER-X1U5WSPT8

; Date/Time: 6:37:57 AM on 1/1/2006
; Date/Time: 12:21:13 PM on 23/6/2009

; By Venture
; Foremost


Function Main()


; Determines if the player is close enough to harvest.
Result = ActorDistance(Actor(), ContextActor())
If(Result < 8.0)
Else
Output(Actor(),"Get a little closer!", 152, 183, 254)
Return
EndIf

; Checks if the player has a mining tool
If(HasItem(Actor(),"hatchet",1))
Else
Output(Actor(),"Might be a good idea to go to the Chaos Tool Shed and buy a hatchet!", 253, 77, 112)
DoEvents(2000)
Return
EndIf

iWep% = ActorWeapon(Actor())
sWep$ = ItemName(iWep)
if (sWep = "hatchet")
Output(Actor(),"And a chopping we will go...", 128, 255, 128)
DoEvents(2000)
Else
Output(Actor(),"Might be a good idea to use your hatchet!", 245, 255, 245)
DoEvents(1000)
Return
EndIf

; This just sets your Seeking skill to 1 because the " >= 0 " does not work.
Seeking = Attribute(Actor(), "Seeking")
If(Seeking = 0)

SetAttribute(Actor(), "Seeking", Seeking +1)
Else
EndIf

; Let's make sure the Seeking item exist.
Toughness = Attribute(ContextActor(), "Health")

If(Toughness > 0)
Else
Output(Actor(),"?", 128, 255, 128)
DoEvents(3000)
Return
EndIf

; Check if player has enough skill to harvest this item.
Seeking = Attribute(Actor(), "Seeking")
If(Seeking > 0)
AnimateActor(Actor(),"seeker",0.5)
PlaySound(Actor(), 3, 1)
Doevents(1000)
Else
Output(Actor(),"??", 152, 183, 254)
Return
EndIf

; Grab a random number to see what the player harvested.
Harvest = Rand(1, 6)
If(Harvest = 1)
GiveItem(Actor(),"pine log",+1)
Output(Actor(),"You have 1 pine log!", 245, 255, 245)
SetAttribute(ContextActor(), "Toughness", Toughness -1)
ElseIf(Harvest = 2)
Output(Actor(),"Ouch! You have been hit by a splinter", 152, 183, 254)
Health = Attribute(Actor(), "Health")
SetAttribute(Actor(), "Health", Health -1)
Else
Output(Actor(),"Hit a little harder!", 253, 77, 112)
EndIf

; Grab a Random number to see if the player gains a skill.
SkillExp = Rand(1, 20)
If(SkillExp < 2)
SetAttribute(Actor(), "Seeking", Seeking +1)
Output(Actor(),"You gain 1 skill point!")
EndIf

Return
End Function