Problem with GetHarvestDifficulty & HarvestResource func

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.
Post Reply
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am

Problem with GetHarvestDifficulty & HarvestResource func

Post by Harley »

I want modiffy my script bladed.src. I have get thoose code from ZH 095:

Code: Select all

function CarveTree(who, blade, use_on)
  blade := blade;
  if(abs(who.x-use_on.x)>2 || abs(who.y-use_on.y)>2)
    SendSysMessage(who, "You are not close enough");
    return;
  endif
  PrintTextAbove(who, "*Trying to get some kindlings*",_DEFAULT_TEXT_FONT,52);
	if(GetStamina(who)<= 1)
            	       SetStamina(who, 0);
            	       SendSysMessage(who, "You have to rest a while!",3,33);
            	       return;
               else
            	       SetStamina(who, GetStamina(who) - 1);
      endif
  sleep(1);
        CheckToolWear (who, blade, SKILLID_LUMBERJACKING);
  var count := GetHarvestDifficulty("wood", use_on.x, use_on.y, use_on.objtype);
    if((count == error) or (!count))
      SendSysMessage(who, "There's not enough kindling here to chip.");
      return 1;
  endif
  var wood_amount := HarvestResource( "wood", use_on.x, use_on.y, 1, 5 );
  if((wood_amount == 0) or (!wood_amount))
        SendSysMessage(who, "There's not enough kindling here to chip.");
        return 1;
  endif
  CreateItemInBackpack(who, UOBJ_KINDLING, 1);
  DestroyItem(use_on);
  SendSysMessage(who, "You chip off some kindling and put it in your backpack");
endfunction
WHen I try chip some kindling, I always get thoose frase:
There's not enough kindling here to chip.
If I disable first function check GetHarvestDifficulty, I have problem with second function HarvestResource.

Please, if have some one thoose problem, or know how to enable thoose functions that they will working pretty, helpme.
Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Post by Pierce »

It sounds that there is no wood where you try to carve.

You have to take a look inside the wood.cfg in the regions folder.
You should put a few wood on every tree in the world. Something like:

Code: Select all

Region The Whole World
{
    UnitsPerArea        5
    SecondsPerRegrow    3600
    Capacity            200000
    Range               0 0 6143 4095
}
Post Reply