What's new

Skrypty & Kody Pomocy Skrypt nie dziala 8.6 0.4

Status
Not open for further replies.

Renini

Active User
Joined
Nov 7, 2014
Messages
51
Reaction score
0
Witam , mam skrypt na otland i robilem wszystko jak tam pisalo czyli dodalem do action i creature skrypty otoz daje stone na item i pisze mi ze ma np blue robe + 30%magic lvla a jak zakladam nic nie dodaje prosze o pomoc z gory dziekuje
---- link na strone
 

Spellejk

Active User
Joined
Apr 3, 2016
Messages
83
Reaction score
2
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Poniewa? nie zadeklarowa?e? tego itema w movements.xml m.in o tak:
[XML]<movevent type="Equip" itemid="9932" slot="armor" level="130" event="function" value="onEquipItem"/>
<movevent type="DeEquip" itemid="9932" slot="armor" event="function" value="onDeEquipItem"/>[/XML]
 

Renini

Active User
Joined
Nov 7, 2014
Messages
51
Reaction score
0
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Poniewa? nie zadeklarowa?e? tego itema w movements.xml m.in o tak:
[XML]<movevent type="Equip" itemid="9932" slot="armor" level="130" event="function" value="onEquipItem"/>
<movevent type="DeEquip" itemid="9932" slot="armor" event="function" value="onDeEquipItem"/>[/XML]

Ale to jest cos w stylu ulepszania broni masz np mace dasz kamyk na nia 2x i masz 4% magic i np 4% hp i nic nie dodaje :/

---------- Tre?? dodana o 20:26 ----------

2ito278.png


Error
dxhdsj.png


[LUA]---Script by mock the bear!
local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,100 do ---Carrega as conditions
--- HP
conditionHP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionHP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionHP, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+i)
setConditionParam(conditionHP, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionHP, CONDITION_PARAM_SUBID, 50)
--MANA
conditionMP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionMP, CONDITION_PARAM_STAT_MAXMANAPERCENT, 100+i)
setConditionParam(conditionMP, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionMP, CONDITION_PARAM_SUBID, 51)
--Magic level
conditionML = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionML, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionML, CONDITION_PARAM_STAT_MAGICLEVELPERCENT, 100+i)
setConditionParam(conditionML, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionML, CONDITION_PARAM_SUBID, 52)
--club axe sword
conditionCLUB = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionCLUB, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_CLUBPERCENT, 100+i)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_SWORDPERCENT, 100+i)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_AXEPERCENT, 100+i)
setConditionParam(conditionCLUB, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionCLUB, CONDITION_PARAM_SUBID, 53)
--- shield
conditionSHI = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionSHI, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionSHI, CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i)
setConditionParam(conditionSHI, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionSHI, CONDITION_PARAM_SUBID, 54)
--- dist
conditionDIST = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDIST, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionDIST, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)
setConditionParam(conditionDIST, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionDIST, CONDITION_PARAM_SUBID, 55)
end
function getSlotType(n) --By mock the bear
if not n then
return false
end
if n:match('%[(.+)%]') then
n = n:match('%[(.+)%]')
if n == '?' then
return 0,n
else
return n:match('(.-)%.([+-])(%d+)%%')
end
else
return false
end

end
local function loadSet(cid)
local t = {}
for slot=1,9 do
t[slot] = ''

local s = getPlayerSlotItem(cid,slot).uid
if s ~= 0 then
t[slot] = getItemName(s)
end
end
return t
end
function isInArray2(arr,var) -- Because in some servers it return 1 and 0 and others true and false
for i,b in pairs(arr) do
if var == b then
return true
end
end
return false
end
function check2(cid,i)
if i == 5 or i == 6 then
if isInArray({'head','necklace','backpack','body','legs','feet','ring'},getItemValue(getPlayerSlotItem(cid,i).itemid,'slotType') or '') then
return false
end
end
return true
end
function chk(cid,f)
if not isPlayer(cid) then return end
local t = loadSet(cid)
for i=1,#f do
if f ~= t then
equip(cid,nil,slot)
break
end
end
addEvent(chk,2000,cid,t)
end
items = { ---- Only to get attr: slotType because getItemName dont return it -.-'
_VERSION='1.0 By mock',
XML_DIR='data/items/items.xml',
}
do
local ia = os.clock()
io.write('Loading items')
local i = io.open(items.XML_DIR,'r')
local u = i:read(-1)
i:close()
local u = u:match('<items>(.+)</items>')
for mi,id,mid,name,data,me in u:gmatch('<(%a-)%s*id%s*=%s*"(%d+)"%s*(.-)%s*name%s*=%s*"(.-)"%s*>(.-)</(%a*)>') do
if mi == 'item' and me == 'item' then
local td = {name=name,id=id,type=1}
for key,value in data:gmatch('<attribute key="(.-)" value="(.-)"/>') do
td[key] = value
end
for key,value in mid:gmatch('(.-)="(.-)"') do
td[key] = value
end
items[tonumber(id)] = td

items[name] = td
end
end
for mi,id,mid,name,data in u:gmatch('<(%a-)%s*id%s*=%s*"(%d*)"%s*(.-)%s*name%s*=%s*"(%a+)"%s*/>') do
if mi == 'item' then
local td = {name=name,id=id,type=2}
for key,value in mid:gmatch('(.-)="(.-)"') do
td[key] = value
end
items[tonumber(id)] = td
items[name] = td
end
end
io.write('[done '..os.clock()-ia..']\n')
end
function getItemValue(item,value)
return items[item] and items[item][value]
end
function equip(cid,item,slot) --By mock the bear
local HP = getCreatureHealth(cid)
local MP = getCreatureMana(cid)
local t = {}
if item then
local mm,sinal,qto = getSlotType(getItemName(item.uid))
t[mm] = tonumber(qto)
end
for i=1,9 do -- Not on slot 10 > arrow
if i ~= slot then
if getPlayerSlotItem(cid,i).itemid ~= 0 then
local aab = getPlayerSlotItem(cid,i).uid
if aab and check2(cid,i) then
for _ in getItemName(aab):gmatch('(%[.-%])') do
local mm,sinal,qto2 = getSlotType(_)
if mm then
if not t[mm] then
t[mm] = 0
end
t[mm] = t[mm]+tonumber(qto2)

t[mm] = t[mm] > 100 and 100 or t[mm]
end
end
end
end
end
end
local fu = 0
local ca = {}
local s = ''
for sl,n in pairs(t) do
fu = fu+1
s = s..''..n..'% more of '..sl..'\n'
if sl == 'hp' then
doAddCondition(cid,conditionHP[tonumber(n)])
doCreatureAddHealth(cid,HP-getCreatureHealth(cid))
ca[50] = 1
doPlayerSendTutorial(cid,19)
elseif sl == 'mp' then
doAddCondition(cid,conditionMP[tonumber(n)])
doCreatureAddMana(cid,HP-getCreatureMana(cid))
ca[51] = 1
doPlayerSendTutorial(cid,19)
elseif sl == 'ml' then
doAddCondition(cid,conditionML[tonumber(n)])
ca[52] = 1
elseif sl == 'cas' then
doAddCondition(cid,conditionCLUB[tonumber(n)])
ca[53] = 1
elseif sl == 'shield' then
doAddCondition(cid,conditionSHI[tonumber(n)])
ca[54] = 1
elseif sl == 'dist' then
doAddCondition(cid,conditionDIST[tonumber(n)])
ca[55] = 1
end
end
if fu > 0 then
addEvent(doPlayerSendTextMessage,100,cid,24,'You have:\n'..s)
for i=50,55 do
if not ca then
doRemoveCondition(cid,CONDITION_ATTRIBUTES,i)
end
end
else
for i=50,55 do
doRemoveCondition(cid,CONDITION_ATTRIBUTES,i)
end
end
return true
end
function onLogin(cid) ---Script by mock the bear!
equip(cid,nil,slot)
addEvent(chk,2000,cid,loadSet(cid)) -- Here we check!
return TRUE
end [/LUA]
 
Last edited:

Spellejk

Active User
Joined
Apr 3, 2016
Messages
83
Reaction score
2
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Ale cz?owieku jak nie masz zadeklarowane to chuja da. W movement armory, helmy itp, a w weapons bronie. Jak to nie dzia?a to w items.xml mo?e te atrybuty najpierw dodaj, bo jak ma dawa? magic level jak nie jest zadeklarowane w items wgl.
 

Renini

Active User
Joined
Nov 7, 2014
Messages
51
Reaction score
0
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Ale cz?owieku jak nie masz zadeklarowane to chuja da. W movement armory, helmy itp, a w weapons bronie. Jak to nie dzia?a to w items.xml mo?e te atrybuty najpierw dodaj, bo jak ma dawa? magic level jak nie jest zadeklarowane w items wgl.

W movement "equip/deequip" jest zadeklarowany . . . . Nie wiem czy to nie chodzi o source czy czasmi to trzeba dodac , a tak po za tym patrzyles na otland na tego skrpyta ? i jak narazie blad mi wyskakuje w creature wiec hmn "setConditionParam(conditionCLUB, CONDITION_PARAM_BUFF, true)" . A to dziala na zasadzie upgrade wiec nie powinno byc w items a raczej kazdy silnik /gra rpg ma wbudowane ulepszanie rzeczy .

Ahh i jeszcze jedno za pomoca stona dodajesz sobie bonusy do itemu np + 30% magic lvla dodalem jak widzisz do helmetu i po zalozeniu mi nie przyja wartosci tylko ten blad w creature sie wyswietla a jak dodaje przez stone albo cos to nic
 

Spellejk

Active User
Joined
Apr 3, 2016
Messages
83
Reaction score
2
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Filmik obejrza?e?? bo on tam po tym ulepszeniu jeszcze k?adzie gdzie? i d?wignie ci?gnie. :D
 
Last edited:

Renini

Active User
Joined
Nov 7, 2014
Messages
51
Reaction score
0
Odp: Pomocy Skrypt nie dziala 8.6 0.4

ja mam tutaj ze nie wypala mi slota tylko odrazu dodaje do itemu przez stone atrybut, pomoze ktos i gdzie silnik widzi blad w linijce 28 to ze jest "buff"?
 
Last edited:

Spellejk

Active User
Joined
Apr 3, 2016
Messages
83
Reaction score
2
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Aj kolego przetestowa?em to na wersji 0.3.6 i dzia?a. Nie ma du?ej r??nicy mi?dzy 0.3.6 a 0.4, ale Mock napisa?, ?e to pod 0.3.6.

Tak?e na 0.4 to nie b?dzie dzia?a? :(
 

#Adaś

Senior User
Joined
Jan 22, 2011
Messages
780
Reaction score
23
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Co do tego czy dzia?a to na 0.4 czy nie, to si? z Wami nie zgodz?, ostatnio jak by?em jeszcze noobem jak Wy teraz, to te? wgra?em to TFS 0.4 i dzia?a?o niczym niemy w ch?rze, bez zarzutu.
Ma?a wiedza, ma?y rozum.
 

Renini

Active User
Joined
Nov 7, 2014
Messages
51
Reaction score
0
Odp: Pomocy Skrypt nie dziala 8.6 0.4

nic wam nie wyskakuje ? mi to tez wgrac wgralo ale nie dodawalo atrybutow . . . . co z tego ze pisalo np 20%+ mlvla jak i tak nic nie dodawalo + opinie sa ze na 0.4 nie dziala + tam jest ze trzeba miec zmodyfikowane source :/ a bez to nie wiem gdzie dodaje , moze jakis potrzebny skrypt zeby czytal te atrybuty ?
#Adas to musisz byc geniuszem jak na bez modyfikowania source na 0.4 wgrales ten skrypt xD

-----A co do bledu na silniku , wie ktos jak to zaradzic ? moze to przez to nie czyta tych atrybutow? w creature mi wykakuje blad :/ i to chyba najwazniejszy bo tam jest ze to ma sluzyc jako buff /
 
Last edited:

Spellejk

Active User
Joined
Apr 3, 2016
Messages
83
Reaction score
2
Odp: Pomocy Skrypt nie dziala 8.6 0.4

[MENTION=65415]Ada?[/MENTION] sam, ?e? kurwa noob i nie masz poj?cia. [MENTION=83060]ToP[/MENTION] tam na stronie jest nie kompletny skrypt ten do creaturescript tutaj ja poprawilem i zoabcz czy bd dzia?a?, powinno:
[LUA]---Script by mock the bear!
local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,100 do ---Carrega as conditions
--- HP
conditionHP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionHP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionHP, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+i)
setConditionParam(conditionHP, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionHP, CONDITION_PARAM_SUBID, 50)
--MANA
conditionMP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionMP, CONDITION_PARAM_STAT_MAXMANAPERCENT, 100+i)
setConditionParam(conditionMP, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionMP, CONDITION_PARAM_SUBID, 51)
--Magic level
conditionML = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionML, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionML, CONDITION_PARAM_STAT_MAGICLEVEL, 100+i)
setConditionParam(conditionML, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionML, CONDITION_PARAM_SUBID, 52)
--club axe sword
conditionCLUB = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionCLUB, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_CLUB, 100+i)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_SWORD, 100+i)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_AXE, 100+i)
setConditionParam(conditionCLUB, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionCLUB, CONDITION_PARAM_SUBID, 53)
--- shield
conditionSHI = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionSHI, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionSHI, CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i)
setConditionParam(conditionSHI, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionSHI, CONDITION_PARAM_SUBID, 54)
--- dist
conditionDIST = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDIST, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionDIST, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)
setConditionParam(conditionDIST, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionDIST, CONDITION_PARAM_SUBID, 55)
end
function getSlotType(n) --By mock the bear
if not n then
return false
end
if n:match('%[(.+)%]') then
n = n:match('%[(.+)%]')
if n == '?' then
return 0,n
else
return n:match('(.-)%.([+-])(%d+)%%')
end
else
return false
end

end
local function loadSet(cid)
local t = {}
for slot=1,9 do
t[slot] = ''

local s = getPlayerSlotItem(cid,slot).uid
if s ~= 0 then
t[slot] = getItemName(s)
end
end
return t
end
function isInArray2(arr,var) -- Because in some servers it return 1 and 0 and others true and false
for i,b in pairs(arr) do
if var == b then
return true
end
end
return false
end
function check2(cid,i)
if i == 5 or i == 6 then
if isInArray({'head','necklace','backpack','body','legs','feet','ring'},getItemValue(getPlayerSlotItem(cid,i).itemid,'slotType') or '') then
return false
end
end
return true
end
function chk(cid,f)
if not isPlayer(cid) then return end
local t = loadSet(cid)
for i=1,#f do
if f ~= t then
equip(cid,nil,slot)
break
end
end
addEvent(chk,2000,cid,t)
end
items = { ---- Only to get attr: slotType because getItemName dont return it -.-'
_VERSION='1.0 By mock',
XML_DIR='data/items/items.xml',
}
do
local ia = os.clock()
io.write('Loading items')
local i = io.open(items.XML_DIR,'r')
local u = i:read(-1)
i:close()
local u = u:match('<items>(.+)</items>')
for mi,id,mid,name,data,me in u:gmatch('<(%a-)%s*id%s*=%s*"(%d+)"%s*(.-)%s*name%s*=%s*"(.-)"%s*>(.-)</(%a*)>') do
if mi == 'item' and me == 'item' then
local td = {name=name,id=id,type=1}
for key,value in data:gmatch('<attribute key="(.-)" value="(.-)"/>') do
td[key] = value
end
for key,value in mid:gmatch('(.-)="(.-)"') do
td[key] = value
end
items[tonumber(id)] = td

items[name] = td
end
end
for mi,id,mid,name,data in u:gmatch('<(%a-)%s*id%s*=%s*"(%d*)"%s*(.-)%s*name%s*=%s*"(%a+)"%s*/>') do
if mi == 'item' then
local td = {name=name,id=id,type=2}
for key,value in mid:gmatch('(.-)="(.-)"') do
td[key] = value
end
items[tonumber(id)] = td
items[name] = td
end
end
io.write('[done '..os.clock()-ia..']\n')
end
function getItemValue(item,value)
return items[item] and items[item][value]
end
function equip(cid,item,slot) --By mock the bear
local HP = getCreatureHealth(cid)
local MP = getCreatureMana(cid)
local t = {}
if item then
local mm,sinal,qto = getSlotType(getItemName(item.uid))
t[mm] = tonumber(qto)
end
for i=1,9 do -- Not on slot 10 > arrow
if i ~= slot then
if getPlayerSlotItem(cid,i).itemid ~= 0 then
local aab = getPlayerSlotItem(cid,i).uid
if aab and check2(cid,i) then
for _ in getItemName(aab):gmatch('(%[.-%])') do
local mm,sinal,qto2 = getSlotType(_)
if mm then
if not t[mm] then
t[mm] = 0
end
t[mm] = t[mm]+tonumber(qto2)

t[mm] = t[mm] > 100 and 100 or t[mm]
end
end
end
end
end
end
local fu = 0
local ca = {}
local s = ''
for sl,n in pairs(t) do
fu = fu+1
s = s..''..n..'% more of '..sl..'\n'
if sl == 'hp' then
doAddCondition(cid,conditionHP[tonumber(n)])
doCreatureAddHealth(cid,HP-getCreatureHealth(cid))
ca[50] = 1
doPlayerSendTutorial(cid,19)
elseif sl == 'mp' then
doAddCondition(cid,conditionMP[tonumber(n)])
doCreatureAddMana(cid,HP-getCreatureMana(cid))
ca[51] = 1
doPlayerSendTutorial(cid,19)
elseif sl == 'ml' then
doAddCondition(cid,conditionML[tonumber(n)])
ca[52] = 1
elseif sl == 'cas' then
doAddCondition(cid,conditionCLUB[tonumber(n)])
ca[53] = 1
elseif sl == 'shield' then
doAddCondition(cid,conditionSHI[tonumber(n)])
ca[54] = 1
elseif sl == 'dist' then
doAddCondition(cid,conditionDIST[tonumber(n)])
ca[55] = 1
end
end
if fu > 0 then
addEvent(doPlayerSendTextMessage,100,cid,24,'You have:\n'..s)
for i=50,55 do
if not ca then
doRemoveCondition(cid,CONDITION_ATTRIBUTES,i)
end
end
else
for i=50,55 do
doRemoveCondition(cid,CONDITION_ATTRIBUTES,i)
end
end
return true
end
function onLogin(cid) ---Script by mock the bear!
equip(cid,nil,slot)
addEvent(chk,2000,cid,loadSet(cid)) -- Here we check!
return TRUE
end [/LUA]
 

Renini

Active User
Joined
Nov 7, 2014
Messages
51
Reaction score
0
Odp: Pomocy Skrypt nie dziala 8.6 0.4

33m77du.png


No kurde ma byc jak upgrade system poprzez kamien daje mi losowe atrybuty do broni ale dalej mi nie dodaje ich :/ [MENTION=83060]ToP[/MENTION] zrobiles cos w stylu jak bym wlaczal utito tempo xD ale chodzio normalny upg system :/

---->>>>>> Edytowalem troszke skrypt i pisze mi jak daje na item "15:21 You can't open a slot on this item." <------------ nic w konsoli

Teraz patrze na armor np plate armor i daje tylko hp i mp . . . a reszte nic
 
Last edited:

Saiyans King

Forum friend
Joined
Feb 6, 2009
Messages
97
Reaction score
18
Odp: Pomocy Skrypt nie dziala 8.6 0.4

[LUA]---Script by mock the bear!
local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,100 do ---Carrega as conditions
--- HP
conditionHP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionHP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionHP, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+i)
setConditionParam(conditionHP, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionHP, CONDITION_PARAM_SUBID, 50)
--MANA
conditionMP = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionMP, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionMP, CONDITION_PARAM_STAT_MAXMANAPERCENT, 100+i)
setConditionParam(conditionMP, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionMP, CONDITION_PARAM_SUBID, 51)
--Magic level
conditionML = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionML, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionML, CONDITION_PARAM_STAT_MAGICLEVELPERCENT, 100+i)
setConditionParam(conditionML, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionML, CONDITION_PARAM_SUBID, 52)
--club axe sword
conditionCLUB = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionCLUB, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionCLUB, CONDITION_PARAM_SKILL_MELEEPERCENT, 100+i)
setConditionParam(conditionCLUB, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionCLUB, CONDITION_PARAM_SUBID, 53)
--- shield
conditionSHI = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionSHI, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionSHI, CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i)
setConditionParam(conditionSHI, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionSHI, CONDITION_PARAM_SUBID, 54)
--- dist
conditionDIST = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(conditionDIST, CONDITION_PARAM_TICKS, -1)
setConditionParam(conditionDIST, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)
setConditionParam(conditionDIST, CONDITION_PARAM_BUFF, true)
setConditionParam(conditionDIST, CONDITION_PARAM_SUBID, 55)
end
function getSlotType(n) --By mock the bear
if not n then
return false
end
if n:match('%[(.+)%]') then
n = n:match('%[(.+)%]')
if n == '?' then
return 0,n
else
return n:match('(.-)%.([+-])(%d+)%%')
end
else
return false
end
end
local function loadSet(cid)
local t = {}
for slot=1,9 do
t[slot] = ''
local s = getPlayerSlotItem(cid,slot).uid
if s ~= 0 then
t[slot] = getItemName(s)
end
end
return t
end
function check2(cid,i)
if i == 5 or i == 6 then
local wpos = getItemInfo(getPlayerSlotItem(cid,i).itemid).wieldPosition
if wpos == 10 or wpos == 11 or wpos == 12 then
return false
end
end
return true
end
function chk(cid,f)
if not isPlayer(cid) then return end
local t = loadSet(cid)
for i=1,#f do
if f ~= t then
equip(cid,nil,slot)
break
end
end
addEvent(chk,2000,cid,t)
end
function equip(cid,item,slot) --By mock the bear
local HP = getCreatureHealth(cid)
local MP = getCreatureMana(cid)
local t = {}
if item then
local mm,sinal,qto = getSlotType(getItemName(item.uid))
t[mm] = tonumber(qto)
end
for i=1,9 do -- Not on slot 10 > arrow
if i ~= slot then
if getPlayerSlotItem(cid,i).itemid ~= 0 then
local aab = getPlayerSlotItem(cid,i).uid
if aab and check2(cid,i) then
for _ in getItemName(aab):gmatch('(%[.-%])') do
local mm,sinal,qto2 = getSlotType(_)
if mm then
if not t[mm] then
t[mm] = 0
end
t[mm] = t[mm]+tonumber(qto2)
t[mm] = t[mm] > 100 and 100 or t[mm]
end
end
end
end
end
end
local fu = 0
local ca = {}
local s = ''
for sl,n in pairs(t) do
fu = fu+1
s = s..''..n..'% more of '..sl..'\n'
if sl == 'hp' then
doAddCondition(cid,conditionHP[tonumber(n)])
doCreatureAddHealth(cid,HP-getCreatureHealth(cid))
ca[50] = 1
elseif sl == 'mp' then
doAddCondition(cid,conditionMP[tonumber(n)])
doCreatureAddMana(cid,MP-getCreatureMana(cid))
ca[51] = 1
elseif sl == 'ml' then
doAddCondition(cid,conditionML[tonumber(n)])
ca[52] = 1
elseif sl == 'cas' then
doAddCondition(cid,conditionCLUB[tonumber(n)])
ca[53] = 1
elseif sl == 'shield' then
doAddCondition(cid,conditionSHI[tonumber(n)])
ca[54] = 1
elseif sl == 'dist' then
doAddCondition(cid,conditionDIST[tonumber(n)])
ca[55] = 1
end
end
if fu > 0 then
addEvent(doPlayerSendTextMessage,100,cid,24,'You have:\n'..s)
for i=50,55 do
if not ca then
doRemoveCondition(cid,CONDITION_ATTRIBUTES,i)
end
end
else
for i=50,55 do
doRemoveCondition(cid,CONDITION_ATTRIBUTES,i)
end
end
return true
end
function onLogin(cid) ---Script by mock the bear!
equip(cid,nil,slot)
addEvent(chk,2000,cid,loadSet(cid)) -- Here we check!
return TRUE
end [/LUA]
powinno dzia?a?
 

Spellejk

Active User
Joined
Apr 3, 2016
Messages
83
Reaction score
2
Odp: Pomocy Skrypt nie dziala 8.6 0.4

Poniewa? dany item mo?esz ulepszy? tylko 2 razy i na dodatek losowo nadaje atrybuty. Mimo tego, ?e napisane by?o po angielsku trzeba by?o przeczyta? na czym to dok?adnie polega...
 
Status
Not open for further replies.
Top