Autor: Trajer
Licencja Brak opisu na stronie autora
Opracowanie: Moqill
Testowane: TFS 0.4_

Do data/actions/scripts/tools/ dodajemy:

rustyremover.lua
-------------------------------------------------
-------------------CONFIGURE-----------------------
-------------------------------------------------
 
	local config = {
 			rustyarmorid = 9808,
			rustylegsid = 9813,
			rustyremoveid = 9930
			}
---------------------CHANCES------------------------
	local prizes = { 
			armors = {
				{5,2472},-- mpa
				{10,2466},-- golden armor
				{50,2487},-- crown armor
				{100,8891}, --paladin armor
				{500,2463}, --plate armor
				{800,2465}, --brass
				{850,2464}, --chain arm
				{900,2483} --studded armor
 
 
				},
 
			 legs ={
				 {5,2470},--golden legs	
				 {30,2488},--crown legs
				 {400,2477},--knight legs
				 {600,2647},--plate legs
				 {750,2478},--brass legs
				 {800,2648},--chainlegs
				 {900,2468}--studded legs
 
				}
			}
----------------------------------------------------------
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
	if item.itemid == config.rustyremoveid then
		if itemEx.itemid == config.rustyarmorid then
           	 local prize1 = {}
           	 local reward1 = 0 
			for i = 1, #prizes.armors do
				prize1 = prizes.armors[i]
				rand = math.random(0,999)
			 	if  rand < prize1[1] then
                   			 reward1 = prize1[2] 
					doTransformItem(itemEx.uid, reward1)
					doSendMagicEffect(toPosition,CONST_ME_BLOCKHIT)
					doPlayerRemoveItem(cid, 9930, 1)
				break 
				elseif rand > 900 then
					doRemoveItem(itemEx.uid)
					doPlayerRemoveItem(cid, 9930, 1)
					doSendMagicEffect(toPosition,CONST_ME_POFF)
 
				break
				 end
			end
 
		elseif itemEx.itemid == config.rustylegsid then
           	 local prize = {}
           	 local reward = 0 
			for i = 1, #prizes.legs do
				prize = prizes.legs[i]
				rand = math.random(0,999)
			 	if rand < prize[1] then
                   			 reward = prize[2] 
					doTransformItem(itemEx.uid, reward)
					doSendMagicEffect(toPosition,CONST_ME_BLOCKHIT)
					doPlayerRemoveItem(cid, 9930, 1)
				break 
				elseif rand > 900 then
					doRemoveItem(itemEx.uid)
					doPlayerRemoveItem(cid, 9930, 1)
					doSendMagicEffect(toPosition,CONST_ME_POFF)
				break
 
 
				 end
			end
 
		else
			return FALSE
 
		end
 
 
	end
return TRUE
end

Do action.xml dodajemy linijke

<action itemid="9930" event="script" value="tools/rustyremover.lua" />

Gotowe :)

otspub/rusty_remover_by_tarjei_lua.txt · Last modified: 2010/04/27 18:30 by moqill
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki