AdamsiQ
New Member
Hello!
Im from poland and my english is not good.
I write this post becouse this forum is the best forum about ot.
I need 1 script the script to create diablo II rune words. I build the server diablo 2, im a good scripter but this too hard ;/.
My example script:
Please help me. ;p
Im from poland and my english is not good.
I write this post becouse this forum is the best forum about ot.
I need 1 script the script to create diablo II rune words. I build the server diablo 2, im a good scripter but this too hard ;/.
My example script:
--------------------------------------------
function onUse(cid, item, frompos, item2, topos)
--------------------------------------------
local runewords = {
["KoKoMal"] = { -- Runes Ko Ko Mal
armor = math.random(10,30), -- Armor Add
armorpercent = math.random(0,0), -- Armor % add
def = math.random(10,30), -- Def Add
defpercent = math.random(0,0), -- Def % Add
atack = math.random(0,0), -- Attack add
atackpercent = math.random(10,100), -- Attack % add
hitchace = math.random(1,15), -- Hit chace % add
speed = math.random(1,5), -- Attack speed add
newname = "Smialosc", -- New item nafe if is rune word
range = math.random(1,3), -- Range Add if is bow
extradef = math.random(1,50), -- Extra def
extraatk = math.random(1,50), -- Extra atack
extras = "" -- Extra description to item
},
}
}
for i = 1, #runewords do
local name = getItemName(item2.uid)
local load = runewords[name]
if name == load then
setItemName(item2.uid,load.newname)
if load.atack > 0 then
setItemAttack(item2.uid,load.atack)
local atkops = "Atak + "..load.atack..""
elseif load.atackpercent > 0 then
local atk = getItemAttack(item2.uid)
local licznik = (load.atackpercent * atk) / (atackpercent * 100)
setItemAttack(item2.uid,atk + licznik)
local lol = atk + licznik
local atkops = "Atak +"..lol.."%"
else
local atkops = ""
end
if load.def > 0 then
setItemDefense(item2.uid,load.def)
local defops = "Obrona +"..load.def..""
elseif load.defpercent > 0 then
local atk = getItemDefense(item2.uid)
local licznik = (load.defpercent * atk) / (defpercent * 100)
setItemDefense(item2.uid,atk + licznik)
local lol = atk + licznik
local defops = "Obrona +"..lol.."%"
else
local defops = ""
end
if load.arm > 0 then
setItemArmor(item2.uid,load.armor)
local armops = "Obrona +"..load.armor..""
elseif load.armpercent > 0 then
local atk = getItemArmor(item2.uid)
local licznik = (load.armpercent * atk) / (armpercent * 100)
setItemArmor(item2.uid,atk + licznik)
local lol = atk + licznik
local armops = "Obrona +"..lol.."%"
else
local armops = ""
end
if hitchace > 0 then
setItemHitChance(item2.uid,load.hitchace)
local hitchaceops = "Szansa Ataku +"..load.hitchace.."%"
else
local hitchaceops = ""
end
if speed > 0 then
setItemAttackSpeed(item2.uid,load.speed)
local speedops = "Szybkosc Ataku +"..load.speed..""
else
local speedops = ""
end
if range > 0 then
setItemShootRange(item2.uid,load.range)
local rangeops = "Zasieg +"..load.range..""
else
local rangeops = ""
end
if extras == true then
local ka = extras
else
local ka = ""
end
if extradef > 0 then
setItemExtraDefense(item2.uid, load.extradef)
end
if extraatk > 0 then
setItemExtraAttack(item2.uid, load.extraatk)
end
local build = ""..atkops.."\n"..defops.."\n"..armops.."\n"..hitchaceops.."\n"..speedops.."\n"..rangeops.."\n"..ka..""
doSetItemSpecialDescription(item2.uid, build)
end
elseif name == getItemNameById(item2.uid) then
local nm = getItemName(item.uid)
setItemName(item2.uid,nm)
else
local nm = getItemName(item.uid)
setItemName(item2.uid,""..getItemName(item2.uid)..""..nm.."")
end
return true
end
Please help me. ;p