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

Pomoc Upgarde System

bocz

New Member
Joined
Jun 1, 2011
Messages
14
Reaction score
0
Witam, mam taki probelm a mianowicie, mam dwa upgarde system na servie OTS, jeden dodaje do ataku itp, a drugi atrybuty takie jak mana + dis + itp. Gdy uzuje Tego ktory daje mi mane itp a potem tego drugiego, to wlasnie ten co dal mi mane sie resetuje. Wydaje mi sie ze one dzialaja na tym samym aid, ale nie potrafie tego zmienic, mecze sie z tym pare godzn, ale nic z tego nie wychodzi. Prosze o pomoc.

Skrypt Ktory Daj atrybuty

--[[
Slot system 100% by mock \o
]]
---Config
local conf = {
maxSlotCount=4,
ignoredIds={}
}
--End
function choose(...) --- Function by mock.
local arg = {...}
return arg[math.random(1,#arg)]
end
if not getItemAttack then
function getItemAttack(uid)
return getItemAttribute(uid,'attack')
end
function getItemDefense(uid)
return getItemAttribute(uid,'defense')
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 and not isItemStackable(uid) then
return true
end
return false
end
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Script by mock the bear (MTB)
if item.uid == 0 or item.itemid == 0 then return false end
toPosition.stackpos = 255
if item.uid == 0 or item.itemid == 0 then return false end
toPosition.stackpos = 255
if isInArray(conf.ignoredIds, itemEx.itemid)
or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then
doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
return TRUE
end
if isCreature(itemEx.uid) then
return FALSE
end
local nam = getItemName(itemEx.uid)
function getper()
local n = 1
for i=1,10 do
n = n+math.random(0,10)
if n < 20*i then
break
end
end
return n
end
function getSlotCount(nam)
local c = 0
for _ in nam:gmatch('%[(.-)%]') do
c = c+1
end
return c
end
if getSlotCount(nam) < conf.maxSlotCount then
local l = choose('hp','mp','ml','cas','dist')
local p = getper()

doSendMagicEffect(toPosition,30)
nam = nam..' ['..l..'.+'..p..'%]'
doSendAnimatedText(toPosition,l..' '..p..'%',120)
doItemSetAttribute(itemEx.uid,'name',nam)
doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
end
return true
end

A to ten co daje Arm itp



--- Perfect refine system by Mock the bear (MTB).
--- Email: [email protected]
local gain = {
gainArmor='&p+1',loseArmor='&p-1',
gainShield='&s+#',loseShield='&s-(#+1)',
gainAttack='&a+(1*(#))',loseAttack='&a-(1*(#+1))',
gainDefense='&d+(1*(#))',loseDefense='&d-(1*(#+1))',
chance='150/((#*(1/(@/0)))*(@/0))', -- Eu fiz essa equaç?o para variar de +0 a +7 o item
--- Essa equaç?o deve retornar em % a chance do item se refinar (0-100) 100 = sempre, 0 = nunca
maxlvl = 4,
blocked_ids = {2488,8881}
}
-- &a = weapon attack
-- &d = weapon defense
-- &s = shield defense
-- &p = armor defense
-- # = nivel do item
-- @ = max level
if not setItemName then
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
end
function isArmor(uid) -- Function by Mock the bear.
if (getItemArmor(uid) and getItemArmor(uid) ~= 0 and not getItemInfo(uid.itemid,'attack') and not getItemInfo(uid.itemid,'defense') and getItemWeaponType(uid.uid) == 500) then
return true
end
return false
end
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
function isShield(uid) -- Function by Mock the bear.
uid = uid or 500
if getItemWeaponType(uid) == 504 then
return TRUE
end
return FALSE
end

function getWeaponLevel(uid) -- Function by Mock the bear.
uid = uid or 0
local name = getItemName(uid)
local lvl = string.match(name,'+(%d)')
return tonumber(lvl) or 0
end
function doTransform(s,i) -- Function by Mock the bear.
local c = string.gsub(s,'@',gain.maxlvl)
local c = string.gsub(c,'&a',getItemAttack(i.uid) or getItemInfo(i.itemid).attack)
local c = string.gsub(c,'&d',getItemDefense(i.uid) or getItemInfo(i.itemid).defense)
local c = string.gsub(c,'&s',getItemDefense(i.uid) or getItemInfo(i.itemid).defense)
local c = string.gsub(c,'&p',getItemArmor(i.uid) or getItemInfo(i.itemid).armor)
local c = string.gsub(c,'#',getWeaponLevel(i.uid))
local q,err = loadstring('return '..c)
assert(q,err)
return assert(q())
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
toPosition.stackpos = 255
if isInArray(gain.blocked_ids, itemEx.itemid) == TRUE
or getItemWeaponType(itemEx.uid) > 4
or (getItemWeaponType(itemEx.uid) == 0
and isArmor(itemEx) == FALSE)
or itemEx.itemid == 0 then
doPlayerSendTextMessage(cid, 24,"Nie mozesz ulepszyc tego przedmiotu.")
return TRUE
end
if isCreature(itemEx.uid) == TRUE then
return FALSE
end
local level = getWeaponLevel(itemEx.uid)
local chance = doTransform(gain.chance,itemEx)
if chance >= math.random(0,100) or item.actionid >= 0 or (item.actionid == 0 and math.random(0,100) <= 25) then
if level+1 > gain.maxlvl then
doSendMagicEffect(toPosition, 2)
return doPlayerSendTextMessage(cid, 24,"Twoj przedmiot ma juz maksymalny poziom.")
else
setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level+1))
doPlayerSendTextMessage(cid, 24,"Ulepszyles przedmiot do +"..(level+1)..".")
doSendMagicEffect(toPosition, 12)
if isArmor(itemEx) == TRUE then
local get = doTransform(gain.gainArmor,itemEx)
setItemArmor(itemEx.uid,get)
elseif isWeapon(itemEx.uid) == TRUE then
setItemAttack(itemEx.uid, doTransform(gain.gainAttack,itemEx))
setItemDefense(itemEx.uid, doTransform(gain.gainDefense,itemEx))
elseif isShield(itemEx.uid) == TRUE then
setItemDefense(itemEx.uid, doTransform(gain.gainShield,itemEx))
end
end
else

if level == 500 then
doPlayerSendTextMessage(cid, 24,"No effect.")
doSendMagicEffect(toPosition, 2)
elseif level == gain.maxlvl then
doSendMagicEffect(toPosition, 5)
return doPlayerSendTextMessage(cid, 24,"Twoj przedmiot ma juz maksymalny poziom.")
elseif level > 0 then
if level == 1 then
setItemName(itemEx.uid, getItemNameById(itemEx.itemid))
doPlayerSendTextMessage(cid, 24,"Your item back to normal.")
else
setItemName(itemEx.uid, getItemNameById(itemEx.itemid)..' +'..(level-1))
doPlayerSendTextMessage(cid, 24,"Your item back to +"..(level-1)..".")
end
if isArmor(itemEx) == TRUE then
setItemArmor(itemEx.uid,doTransform(gain.loseArmor ,itemEx))
elseif isWeapon(itemEx.uid) == TRUE then
setItemAttack(itemEx.uid, doTransform(gain.loseAttack,itemEx))
setItemDefense(itemEx.uid, doTransform(gain.loseDefense,itemEx))
elseif isShield(itemEx.uid) == TRUE then
setItemDefense(itemEx.uid, doTransform(gain.loseShield,itemEx))
end
end
doSendMagicEffect(toPosition, 9)
end
doRemoveItem(item.uid,1)
return TRUE
end
 
A moze ktos wie co Tu jest nie tak?. Ale ten mocek to chbya anglik to sie z nim nie dogadam bo kiepsko umime ang. :/. Chodzi mi o to ze te skypty dzialaja, ale jak sa razem wgrane na server to cos sie psuje.
 
Last edited:
Back
Top