• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action [MODS] Weed Cuting System

mainly none of these scripts will work on TFS 0.4.0, unless people make a whole bunch of compats to it.
 
[07/06/2010 21:11:36] > Loading weedCuting.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/weedCuting.xml
[07/06/2010 21:11:36] Line: 1, Info: XML declaration allowed only at the start of the document
 
Let's all cut weed and get high.
Haha.
Nice script btw.
 
I'm not getting wood for cuting a tree, why? No errors

I change this :

Code:
doRemoveItem(itemEx.uid, 1)
			doCreateItem(8786, 1, toPosition)
			addEvent(function()

to this:
Code:
doRemoveItem(itemEx.uid, 1)
			doCreateItem(8786, 1, toPosition)
			doPlayerAddExperience(cid, 50)
			doPlayerAddItem(cid, wood.reward, 1) 
			addEvent(function()

Cuz u use local reward and u not using it later so there wont be a reward here.'


>> Work on 0.3.6 v4 8.6
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="WoodCuting System" version="1.0" author="Karpio" contact="http://tibia.net.pl/members/karpio.html" enabled="yes">
<config name="WoodCuting Lib"><![CDATA[
wood = {}
 
wood.reward = 5901
wood.trees = {2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708}
wood.maxLevel = 100
wood.stor = {876, 875}
wood.showLevel = true
 
function wood.getPlayerSkill(cid)
	return getPlayerStorageValue(cid, wood.stor[1])
end
 
function wood.addSkillTry(cid)
	if(getPlayerStorageValue(cid, wood.stor[1]) >= wood.maxLevel) then
		return true
	end
	local formula = getPlayerStorageValue(cid, wood.stor[1]) / 10
	if(math.random(1, formula) == 1) then
		if(getPlayerStorageValue(cid, wood.stor[2]) >= 99) then
			setPlayerStorageValue(cid, wood.stor[2], 0)
			setPlayerStorageValue(cid, wood.stor[1], getPlayerStorageValue(cid, wood.stor[1])+1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You advanced in WoodCuting. "..(wood.showLevel == true and "["..getPlayerStorageValue(cid, wood.stor[1]).."]" or "").."")
		else
			setPlayerStorageValue(cid, wood.stor[2], getPlayerStorageValue(cid, wood.stor[2])+1)
		end
	end
return true
end
]]></config>
 
<action itemid="2559" event="script"><![CDATA[
	domodlib("WoodCuting Lib")
	function onUse(cid, item, fromPosition, itemEx, toPosition)		
		if(isInArray(wood.trees, itemEx.itemid) == false) then
			return false
		end
 
		wood.addSkillTry(cid)
		doSendMagicEffect(toPosition, 16)		
		if(math.random(wood.getPlayerSkill(cid), wood.maxLevel) == wood.maxLevel) then
			local itemid = itemEx.itemid
			doRemoveItem(itemEx.uid, 1)
			doCreateItem(8786, 1, toPosition)
			doPlayerAddExperience(cid, 50)
			doPlayerAddItem(cid, wood.reward, 1) 
			addEvent(function()
				doRemoveItem(getThingFromPos(toPosition).uid)
				pien = doCreateItem(2768, 1, toPosition)
				addEvent(function()
					doRemoveItem(getThingFromPos(toPosition).uid)
					doCreateItem(itemid, 1, toPosition)
				end, 5 * 1000, {itemid = itemid, toPosition = toPosition})
			end, 5 * 1000, {itemid = itemid, toPosition = toPosition})
		end
	return true
	end]]></action>
 
<event type="login" name="WoodCuting Login" event="script"><![CDATA[
	domodlib("WoodCuting Lib")
	function onLogin(cid)
		if(getPlayerStorageValue(cid, wood.stor[1]) < 10) then
			setPlayerStorageValue(cid, wood.stor[1], 10)
		end
		if(getPlayerStorageValue(cid, wood.stor[2]) < 0) then
			setPlayerStorageValue(cid, wood.stor[2], 0)
		end
	return true
	end
]]></event>
</mod>

Rep ++ if u like this mod, to this mod :))
 
Last edited:
Back
Top