What's new

Obsidian Knife

Nikus12

Active User
Joined
Apr 25, 2009
Messages
67
Reaction score
3
Witam,

Zauwa?y?em ?e obsidianem nieumie wycina? z bonebeast?w. Bardzo bym prosi? o linijk? z kodem action's.
 

BoBBo Frucio

Active User
Joined
Aug 23, 2008
Messages
81
Reaction score
6
Age
31
Odp: Obsidian Knife

wstaw tutaj skrypt ob knife a ja ci to zrobie bo aktualnie nie mam silnika 8.5 na kompie
 

Nikus12

Active User
Joined
Apr 25, 2009
Messages
67
Reaction score
3
Odp: Obsidian Knife

Prosz? bardzo, ju? wstawiam.

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(itemEx.itemid == FALSE) then
return FALSE
end

if(getPlayerLevel(cid) >= 2) then
local found = FALSE
local skin = 0

if(isInArray({2830, 2871, 2866, 2876, 3090}, itemEx.itemid) == TRUE) then
found = TRUE
if(math.random(1,5) == 1) then
skin = 5878
end
elseif(isInArray({4259, 4262, 4256}, itemEx.itemid) == TRUE) then
found = TRUE
if(math.random(1,5) == 1) then
skin = 5876
end
elseif(isInArray({3104, 2844}, itemEx.itemid) == TRUE) then
found = TRUE
if(math.random(1,5) == 1) then
skin = 5877
end
elseif(isInArray({2881}, itemEx.itemid) == TRUE) then
found = TRUE
if(math.random(1,5) == 1) then
skin = 5948
end
elseif(isInArray({2931}, itemEx.itemid) == TRUE) then
found = TRUE
local rand = math.random(1,10)
if(rand > 8) then
skin = 5893
elseif(rand == 4) then
skin = 5930
end
elseif(isInArray({3031}, itemEx.itemid) == TRUE) then
found = TRUE
if(math.random(1,5) == 1) then
skin = 5925
end
end

if(found == TRUE) then
if(skin == 0) then
doSendMagicEffect(toPosition, CONST_ME_POFF)
else
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, skin, 1)
doSendAnimatedText(fromPosition, 'Success!', TEXTCOLOR_WHITE_EXP);
end
doTransformItem(itemEx.uid, itemEx.itemid + 1)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
else
doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
end

return TRUE
end
 

BoBBo Frucio

Active User
Joined
Aug 23, 2008
Messages
81
Reaction score
6
Age
31
Odp: Obsidian Knife

jak wroce to dam edita i zrobie narazie spadam nad jeziorko ;)

@edit

Code:
function skinMonster(cid,item,skin)
	local random = math.random(1,8)
	if(random == 1) then
		doPlayerAddItem(cid,skin,1)
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_RED)
	else
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_POFF)
	end
	doTransformItem(item.uid,item.itemid+1)
end

function onUse(cid, item, frompos, item2, topos)
	if isInArray({2830, 2871, 2866, 2876}, item2.itemid) then
		skinMonster(cid, item2, 5878)
	elseif isInArray({4259, 4262, 4251}, item2.itemid) then
		skinMonster(cid, item2, 5876)
	elseif isInArray({3104}, item2.itemid) then
		skinMonster(cid, item2, 5877)
	elseif isInArray({2881}, item2.itemid) then
		skinMonster(cid, item2, 5948)
	elseif isInArray({2931}, item2.itemid) then
		skinMonster(cid, item2, 5893)
	elseif isInArray({3031}, item2.itemid) then
		skinMonster(cid, item2, 5925)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
		return 0
	end
end
powinno byc dobrze wycielem z mojego silnika 8.5 u mnie dziala
 
Last edited:
Top