Nome: Item Treiner
Autor: Shoguns
Tipo: Moveevents
Oque ele faz?
Quando o player equipar tal item,
esse item vai servir como um treiner e ficara upando o skill de acordo com o item que tiver no seu Sloot Esquerdo e direito,
que no caso é aonde se colocam a arma de atk e o shield
Oque mas tem?
O Player não poderá se mover enquanto estiver equipado com o item e ficara aparecendo uma mensagem "Treinando".
Va em data/movements/scripts e crie um arquivo com nome de itemtreiner.lua e coloque isso lá dentro
local porcent = 4 local tempo = 3 * 1000 local lock = 0 local Skills = { { 1, 2 }, { 2, 1 }, { 3, 3 }, { 5, 5 }, { 4, 4 } } function onEquip(cid, item, slot) local x = {cid = cid, item = item, slot = slot} setPlayerStorageValue(x.cid, 12345, 1) if isPlayer(x.cid) then doPlayerSendTextMessage(x.cid,25,"O Treino Começou") doPlayerSetNoMove(cid, true) addEvent(Shoguns, tempo, x) end return true end function onDeEquip(cid, item, slot) if getPlayerStorageValue(cid, 12345) == 2 then return false end setPlayerStorageValue(cid, 12345, 2) doPlayerSendTextMessage(cid,21,"O Treino acabou") doPlayerSetNoMove(cid, false) return true end function Shoguns(x) if isPlayer(x.cid) and getPlayerStorageValue(x.cid, 12345) == 1 then local weaponLeft = getPlayerSlotItem(x.cid, CONST_SLOT_LEFT) local weaponRight = getPlayerSlotItem(x.cid, CONST_SLOT_RIGHT) if weaponLeft.itemid ~= 0 then weaponLeft = getItemWeaponType(weaponLeft.uid) end if weaponRight.itemid ~= 0 then weaponRight = getItemWeaponType(weaponRight.uid) end for _, tempo in pairs(Skills) do if tempo[1] == weaponLeft or tempo[1] == weaponRight then doPlayerAddSkillTry(x.cid, tempo[2], porcent) end end magiclvl = getPlayerMana(x.cid) doPlayerAddSpentMana(x.cid, magiclvl, math.random(1,3)) doSendMagicEffect(getPlayerPosition(x.cid),30) doSendAnimatedText(getPlayerPosition(x.cid),"Treinando", math.random(3,255)) addEvent(Shoguns, tempo, x) end return true end
Agora em movements.lua cole essas 2 tags:
<movevent type="Equip" itemid="1234" slot="feet" event="script" value="itemtreiner.lua"/> <movevent type="DeEquip" itemid="1234" slot="feet" event="script" value="itemtreiner.lua"/>
Como configurar:
No itemtreiner.lua
local porcent = 4
Porcentagem que ira dar de skill
local tempo = 3 * 1000
Intervalos para subir o skill
local lock = 0
Se quiser colocar algo tipo um exausted antes de comecar
nas tags:
1234
Id do item que ao equipar vai upar skill
feet
Tipo do item (usei feet = boots ) como um exemplo
Alguma dúvida deixe um comentário que irei dar suporte.