• logo_cipsoft
    Nowe serwery zostały otwarte 27 Sie 2025:
    Escura (Retro Open PvP) Mystera (Retro Open PvP) us_logo Penumbra (Retro Open PvP)

Upgrade runa

Kopek14

Advanced User
Dołączył
Maj 19, 2008
Posty
226
Liczba reakcji
10
Witam... Chce zrobi? upgrade rune wzi??em scrypt Geio pod 8.54 TFS silnik... Oto on

Tu robie nowy plik lua...
Kod:
local znika = "tak"     -- Czy item ma znika? po upgrade (item upgraduj?cy)
local ileProcent = 7    -- O ile procent powi?ksza atrybuty czego?. Jak wyjdzie liczba rzeczywista to podnosi o tyle, ?eby by?a liczba ca?kowita.
local maksProcent = 6    -- Ile maksymalnie procent mo?e by? upgradowane. 0 - niesko?czono??
local antyUlepszenieProcent = 60     -- Ile procent szansy na anty-ulepszenie przedmiotu. 0 - 0% szans na anty upgrade, zawsze upgraduje
local antyUlepszenieZabieraProcent = 42   -- Ile procent ka?dego atrybutu zabiera je?eli nie uda si? upgreade
function onUse(cid, item, frompos, item2, topos)
if(item2.uid ~= 0) then
	local arm = getItemArmor(item2.uid)
	local def = getItemDefense(item2.uid)
	local atk = getItemAttack(item2.uid)
	local descr = ""
	local action = item2.actionid-100
	if(action < 0) then
		action = 0
	end
	if(maksProcent > 0 and action >= maksProcent) then
		doPlayerSendCancel(cid,"You can't upgrade it anymore.")
		return TRUE
	end
	if(arm ~= 0 or def ~= 0 or atk ~= 0) then
		if(znika == "tak") then
			if(item.type > 1) then
				doChangeTypeItem(item.uid, item.type-1)
			else
				doRemoveItem(item.uid,1)
			end
		end
		if(antyUlepszenieProcent > 0) then
			if(math.random(1,100) <= antyUlepszenieProcent) then
				descr = "Values: "
				if(arm ~= 0) then
					setItemArmor(item2.uid,math.floor(arm * (antyUlepszenieZabieraProcent/100)))
					descr = descr .."armor incrased by ".. action-antyUlepszenieZabieraProcent .." percents "
					doSetItemActionId(item2.uid,100+action-antyUlepszenieZabieraProcent)
				end
				if(def ~= 0) then
					setItemDefense(item2.uid,math.floor(def * (antyUlepszenieZabieraProcent/100)))
					descr = descr .."defense incrased by ".. action-antyUlepszenieZabieraProcent .." percents "
					doSetItemActionId(item2.uid,100+action-antyUlepszenieZabieraProcent)
				end
				if(atk ~= 0) then
					setItemAttack(item2.uid,math.floor(atk * (antyUlepszenieZabieraProcent/100)))
					descr = descr .."attack incrased by ".. action-antyUlepszenieZabieraProcent .." percents "
					doSetItemActionId(item2.uid,100+action-antyUlepszenieZabieraProcent)
				end
				doSetItemSpecialDescription(item2.uid,descr)
				doPlayerSendCancel(cid,"You have anty-upgraded this item.")
				return TRUE
			end
		end
		descr = "Values: "
		if(arm ~= 0) then
			descr = descr .."armor increased by ".. ileProcent+action .. " percents "
			local ilePowieksza = math.ceil(arm * (ileProcent/100))
			setItemArmor(item2.uid, arm+ilePowieksza)
			doSetItemActionId(item2.uid,100+action+ileProcent)
		end
		if(def ~= 0) then
			descr = descr .."defense increased by ".. ileProcent+action .." percents "
			local ilePowieksza = math.ceil(def * (ileProcent/100))
			setItemDefense(item2.uid, def+ilePowieksza)
			doSetItemActionId(item2.uid,100+action+ileProcent)
		end
		if(atk ~= 0) then
			descr = descr .."attack increased by ".. ileProcent+action .." percents "
			local ilePowieksza = math.ceil(atk * (ileProcent/100))
			setItemAttack(item2.uid, atk+ilePowieksza)
			doSetItemActionId(item2.uid,100+action+ileProcent)
		end
		doSetItemSpecialDescription(item2.uid,descr)
		doSendMagicEffect(topos,CONST_ME_MAGIC_GREEN)
	else
		doPlayerSendCancel(cid,"You can't upgrade this.")
	end
	return TRUE
end
return FALSE
end

I w actions wpisuje to:
Kod:
   <action itemid="2280" script="upgrade system.lua" />

I gdy wpisuje id 2280 to pojawia si? runa lecz nie mog? ni? ulepszy? nic... Kto pomo?e dam reputa!
 
Odp: Upgrade runa

A jak dajesz na runie ppm to da sie use with?!
Jesli nie musisz jakas inna rune co ma use with :P
Mysle ze pomoglem

Regards
Shadok
 
Odp: Upgrade runa

hmm.. sproboj zamienic

Kod:
local znika = "tak"

na

Kod:
local znika = "nie"


bo gdy przestawilem na tak w tym skrypcie rowniez to niedzialalo.. ale gdy ma nie znikac to powinna zadzialac. sproboj i podaj jeszcze nazwe TFSa .
 
Odp: Upgrade runa

TFS 0.3.6.pl1 Sprawdza?em i tak nie dzia?a a jak np. ustawi?em na id 2291 to zamiast upgrafe runa to si? pojawi?o hhmmm chameleon rune("adevo ina", Charges:98).mo?e usuni?cie tej runy z items.xml by pomog?o sprubuj? jak co? to napisz? tu

/edit: nie dzia?a
 
Ostatnia edycja:
Do góry