• 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!

[Request] Diablo II runeword system

AdamsiQ

New Member
Joined
Mar 25, 2009
Messages
24
Reaction score
0
Location
Poland/Polska
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:
--------------------------------------------
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
 
you have to store which runes and in what order are already in item,
its not hard script(just you need working getItemAttribute and setItemAttribute)but really annoying and can be quite long

it will be like: first add rune and set attributes, then check if word is correct and no slots left, if so change attributes

I can try later, but I have tons of own work
 
If you need id's of runes i give you...

local norm_runes = {2231,2262,2264,2265,2266,2267,2268}
local high_runes = {2293,2294,2295,2296,2297,2298,2299,2300,2278}

But i wery need script witch multiple config:

Simple:
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
},

}

I wery need this...

Thanks for help
 
Id rather use rune names(and you should use for that runes names only sylabe that it contains[for example Ko, NOT Ko rune])

like: on adding rune setItemSpecialDescription(itemEx, getItemSpecialDescription(itemEx)..getItemAttribute(item, name))(example if you use rune on item to put it into it[hard to say xD])
and then check special description if it is equal to one of rune words(and check slots if needed)
I'll try it in few days, not now.
In the meantime try it yourself
 
@Thread
Hey!, How would you expect this to work if it had a '}' closing the
'function onUse' anyways try it and see if it works, also next time
use [.CODE][./CODE] with out the dots '.' or when in advanced click
on this icon
code.gif
, it will add the tags, anyways here try it:
Code:
--------------------------------------------
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"..hitc haceops.."\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
I did not change anything only tabbed it and removed the '}'
probably it might give you an error, if it does then post the
error so people can help you and they don't have had to do
guess work on your script.
 
This code doesnt work....
I edit this and console print no errors and script dont work ;/;/
PLEASE HELP
Code:
    function setItemName(uid,name)
                return doItemSetAttribute(uid,'name',name)
    end

    function setItemArmor(uid,name)
                return doItemSetAttribute(uid,'armor',name)
    end

        function setItemDefense(uid,name)
                return doItemSetAttribute(uid,'defense',name)
        end

        function setItemAttack(uid,name)
                return doItemSetAttribute(uid,'attack',name)
        end

        function getItemAttack(uid)
                return getItemAttribute(uid,'attack')
        end

        function getItemDefense(uid)
                return getItemAttribute(uid,'defense')
        end


function getItemArmor(uid)
   if type(uid) == 'number' then
      return getItemAttribute(uid,'armor')
   else
      return getItemInfo(uid.itemid).armor
   end
end

local function isArmor(uid) -- Function by Mock the bear.
    if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
                return true
        end
        return false
end

local function isWeapon(uid) -- Function by Mock the bear.
        uid = uid or 0
        local f = getItemWeaponType(uid)
        if f == 1 or f == 2 or f == 3 then
                return true
        end
        return false
end
local function isShield(uid) -- Function by Mock the bear.
        uid = uid or 0
        if getItemWeaponType(uid) == 4 then
                return true
        end
        return false
end
local function isBow(uid) -- Function by Mock the bear.
        uid = uid or 0
        if getItemWeaponType(uid) == 5 then
                return true
        end
        return false
end

--------------------------------------------
function onUse(cid, item, frompos, item2, topos)
--------------------------------------------
local runewords = {
	["ZodZod"] = { -- 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
		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)

doItemSetAttribute(item2.uid,'name',load.newname)

			if load.atack > 0 then
				--setItemAttack(item2.uid,load.atack)

doItemSetAttribute(item2.uid,'attack',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)

doItemSetAttribute(item2.uid,'attack',atk + licznik)

				local lol = atk + licznik
				local atkops = "Atak +"..lol.."%"
			else
				local atkops = ""
			end
			if load.def > 0 then

				--setItemDefense(item2.uid,load.def)

doItemSetAttribute(item2.uid,'defense',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)

doItemSetAttribute(item2.uid,'defense',atk + licznik)


				local lol = atk + licznik
				local defops = "Obrona +"..lol.."%"
			else
				local defops = ""
			end
			if load.arm > 0 then
				--setItemArmor(item2.uid,load.armor)

doItemSetAttribute(item2.uid,'armor',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)

doItemSetAttribute(item2.uid,'armor',atk + licznik)

				local lol = atk + licznik
				local armops = "Obrona +"..lol.."%"
			else
				local armops = ""
			end
			if hitchace > 0 then
				--setItemHitChance(item2.uid,load.hitchace)

doItemSetAttribute(item2.uid,'hitchance',load.hitchace)


				local hitchaceops = "Szansa Ataku +"..load.hitchace.."%"
			else
				local hitchaceops = ""
			end
			if speed > 0 then
				--setItemAttackSpeed(item2.uid,load.speed)

doItemSetAttribute(item2.uid,'attackspeed',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
			local build = ""..atkops.."\n"..defops.."\n"..armops.."\n"..hitchaceops.."\n"..speedops.."\n"..rangeops.."\n"..ka.."."
			doSetItemSpecialDescription(item2.uid, build)

			doRemoveItem(item.uid)

		end

	if name == getItemNameById(item2.uid) then
		local nm = getItemName(item.uid)
		--setItemName(item2.uid,nm)

doItemSetAttribute(item2.uid,'name',nm)

		doRemoveItem(item.uid)
	else
		local nm = getItemName(item.uid)
		--setItemName(item2.uid,""..getItemName(item2.uid).. ""..nm.."")

doItemSetAttribute(item2.uid,'name',""..getItemName(item2.uid).. ""..nm.."")

		doRemoveItem(item.uid)
	end
end
return true
end
 
Back
Top