• 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 Cannibalism (Sucks out the blood of an dead human)

Guiaki

Member
Joined
Jan 3, 2011
Messages
137
Reaction score
8
Author: Guiaki
Server Tested: TFS 0.4dev

What it do?​
When using a item on a dead human corpse, it decayTo the second level of a dead human, and you get 5 times life added, 5hp per second.

SCRIPT:​
Create a file named cannibalism.lua in actions/scripts and add this into it:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.itemid == 3058) then
	doTransformItem(itemEx.uid, 3059)
	doDecayItem(itemEx.uid)
end
function doCannibalism() -- function by Guiaki
		doSendMagicEffect(getCreaturePosition(cid), 12, cid)
		doCreatureAddHealth(cid,[COLOR="red"]5[/COLOR])
	end
for i = 1,5 do
		addEvent(doCannibalism, i * 1000, 5)
end
	return true
end

Configuration: the "5" in RED is the amount of life that will be regenerated when cannibalized.

TAG:
add this to actions.xml
Code:
	<action itemid="[COLOR="red"]ITEMID[/COLOR]" event="script" value="cannibalism.lua"/>
Edit the ITEMID to the desired Item id


well hope it helped someone ^^, remember this is my first script so please don't swear me, and sorry for my english ;x
 
Good idea but bad execution.. :)

If you using this item on other items then get health..
This is good script:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.itemid == 3058) then
	doTransformItem(itemEx.uid, 3059)
	doDecayItem(itemEx.uid)
for i = 1,5 do
		addEvent(doCannibalism, i * 1000, 5)
end
end
function doCannibalism() -- function by Guiaki
		doSendMagicEffect(getCreaturePosition(cid), 12, cid)
		doCreatureAddHealth(cid,100)
	end

	return true
end
 
Good idea but bad execution.. :)

If you using this item on other items then get health..
This is good script:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.itemid == 3058) then
	doTransformItem(itemEx.uid, 3059)
	doDecayItem(itemEx.uid)
for i = 1,5 do
		addEvent(doCannibalism, i * 1000, 5)
end
end
function doCannibalism() -- function by Guiaki
		doSendMagicEffect(getCreaturePosition(cid), 12, cid)
		doCreatureAddHealth(cid,100)
	end

	return true
end

What is cid in doCannibalism?
Great scripts, for sure will work !
 
Would be nice if you added so the health removes when logout/login since the regain will be removed (i think).
(I haven't test the script)
 
@Kawon:
Code:
function onUse(cid, item, itemEx, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 3058 then
		doTransformItem(itemEx.uid, item.itemid + 1)
		doDecayItem(itemEx.uid)
		for i = 1, 5 do
			addEvent(function(p) if isPlayer(p) then doSendMagicEffect(getThingPosition(p), CONST_ME_MAGIC_BLUE, p) doCreatureAddHealth(p, 100) end end, i * 1000, cid)
		end
	end
	return true
end

u mad, bro?
 
@Kawon:
Code:
function onUse(cid, item, itemEx, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 3058 then
		doTransformItem(itemEx.uid, item.itemid + 1)
		doDecayItem(itemEx.uid)
		for i = 1, 5 do
			addEvent(function(p) if isPlayer(p) then doSendMagicEffect(getThingPosition(p), CONST_ME_MAGIC_BLUE, p) doCreatureAddHealth(p, 100) end end, i * 1000, cid)
		end
	end
	return true
end

u mad, bro?

Hehe thank ;D
 
Back
Top