Pluck/pick prog

For builders to discuss and ask building questions.
Post Reply
User avatar
Algon
Sword Grand Master
Sword Grand Master
Posts: 1070
Joined: Thu Aug 14, 2003 12:44 am
Location: Waterdeep

Pluck/pick prog

Post by Algon » Mon Dec 30, 2013 5:02 pm

I am working on something now that has a few things that can be plucked/picked. I know were have the plants in game that already do this. Can I get a copy of the code for those? No reason to reinvent the wheel.
Thanks!
Counting bodies like sheep...to the rhythm of the war drums. ~~~ Maynard
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: Pluck/pick prog

Post by Harroghty » Mon Dec 30, 2013 5:37 pm

I just tinkered with one of the existing progs from forage.are. Try that. It is checking for proper months, then for the amount of apples pulled from the tree since the last copyover, and then random chances of finding one.

Code: Select all

>intercept_prog pick~
if month() == 5
or month() == 6
or month() == 7
or month() == 8
or month() == 9
or month() == 10
  if objval5($o) < 50
    if rand(50)
      mpechoat $n You hunt through $O for fruit.
      mpechoat $n You find a ripe apple!
      mpechoaround $n @N hunts through $O for fruit and finds a ripe apple.
      if rand(33)
        mpoload 2276
        mpgive i2276 $n
      else
        if rand(50)
          mpoload 6439
          mpgive i6439 $n
        else
          mpoload 4102
          mpgive i4102 $n
        endif
      endif
      mpoadd $o value5 1
    else
      mpechoat $n You look for fresh fruit, but cannot seem to find any right now.
      mpechoaround $n @N looks for fruit in the tree but does not seem to find any.
    endif
  else
    mpechoat $n You hunt around the tree for fruit.
    mpechoat $n The tree appears to have been picked clean.
    mpechoaround $n @N hunts around the tree for fruit but finds none.      
  endif
else
  mpechoat $n You hunt around the tree for fruit.
  mpechoat $n It does not seem to be the season to find fruit on this tree.
  mpechoaround $n @N hunts around the tree for fruit but finds none.
endif
~
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Post Reply