inicia um evento??
kk
Por drakylucas, 03 de mai. de 2013 em Actions e Talkactions
info
Grupo: Infante
Registrado: 25/01/12
Posts: 1.6k
Reputação: +330

inicia um evento??
kk
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

muito bom
aqui funciono de boa =)
+rep
edit: só tenho uma pergunta
por acaso pra colocar isso no otclient junto com a parte das skills
ia precisar usar ExtendedOpcode?
Editado Maio 4 por rohfagundes
info
Grupo: Visconde
Registrado: 12/09/10
Posts: 416
Reputação: +160
Char no Tibia: Draky Lucas

como assim?
pa aparecer a Arm, Def, etc, junto com os skills no otclient?
bom, eu não sei se no OTClient tem uma função para verificar atributos (attack, def, armor, etc) dos itens..
caso tenha, nao precisará de opcode, é só fazer dentro do skills.lua, adicionando o evento onInventoryChange ..porem, como ja disse eu nao sei se o otclient tem a função pra verificar atributos do item, caso não tenha, até da pra fazer por opcode, fazendo sempre que o item for trocado, enviar um opcode pro servidor, servidor enviar o retorno dessas funções em uma tabela, e o client receber a tabela e setar os valores no skills ...
info
Grupo: Visconde
Registrado: 10/02/11
Posts: 377
Reputação: +78

é isso mesmo eu vou dar uma olhada aqui e ver se consigo arrumar vlw =)
info
Grupo: Visconde
Registrado: 12/09/10
Posts: 416
Reputação: +160
Char no Tibia: Draky Lucas
Bem, acho que é bem simples de entender, então nem vou explicar muito
em data/talkactions/scripts crie uma pasta chamada drakylucas
nessa pasta, crie o arquivo stats.lua
no arquivo stats.lua coloque isso:
--[[ Stats System by Draky Lucas V: 1.0 Contact: XTibia Don't remove credits. --]] function getSetArmor(cid) -- by Draky Lucas local arm = 0 for i = 1,9 do if getPlayerSlotItem(cid, i).itemid ~= 0 then arm = arm + getItemInfo(getPlayerSlotItem(cid, i).itemid).armor end end return arm end function getDefense(cid) -- by Draky Lucas local def,extradef = 0,0 for i = 1,9 do if getPlayerSlotItem(cid, i).itemid ~= 0 then def = def + getItemInfo(getPlayerSlotItem(cid, i).itemid).defense extradef = extradef + getItemInfo(getPlayerSlotItem(cid, i).itemid).extraDefense end end local str = def .. " (+ " .. extradef ..")" return str end function returnMoney(cid) local money = getPlayerMoney(cid) if money > 1000000 then return money/1000000 .. " kk" elseif money > 1000 then return money/1000 .. " k" else return money .. " gps" end end function getAtk(cid) if getPlayerWeapon(cid).itemid <= 0 or getPlayerWeapon(cid).itemid == nil or getPlayerWeapon(cid).itemid == false then return "0 (+ 0)" end return getItemInfo(getPlayerWeapon(cid).itemid).attack .. " (+ ".. getItemInfo(getPlayerWeapon(cid).itemid).extraAttack .. ")" end function onSay(cid,words,param) local worlds = { [WORLDTYPE_OPTIONAL] = "Optional PvP", [WORLDTYPE_OPEN] = "Open PvP", [WORLDTYPE_HARDCORE] = "Hardcore PvP" } local msg = "Name: " .. getCreatureName(cid) .. "\nLevel: " .. getPlayerLevel(cid) .. "\n" .. "Vocation: " .. getVocationInfo(getPlayerVocation(cid)).name .. "\n\nStatus:" .. "\nHealth - " .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. ", Mana - " .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "\nMagic Level - " .. getPlayerMagLevel(cid) .. ", Speed - " .. getCreatureSpeed(cid) .. "\n\nSkills:" .. "\nFist - " .. getPlayerSkillLevel(cid, SKILL_FIST) .. ", Club - " .. getPlayerSkillLevel(cid, SKILL_CLUB) .. ", Sword - " .. getPlayerSkillLevel(cid, SKILL_SWORD) .. ", Axe - " .. getPlayerSkillLevel(cid, SKILL_AXE) .. "\nDistance - " .. getPlayerSkillLevel(cid, SKILL_DISTANCE) .. ", Shielding - " .. getPlayerSkillLevel(cid, SKILL_SHIELD) .. ", Fishing - " .. getPlayerSkillLevel(cid, SKILL_FISHING) .. "\n\nSet: \n" .. "Protecao (Arm): " .. getSetArmor(cid) .. "\n" .. "Defense (Def): " .. getDefense(cid) .. "\n" .. "Weapon Attack: " .. getAtk(cid) .."\n\n" .. "Bank Money: " .. getPlayerBalance(cid) .. "\n" .. "Player Money: " .. returnMoney(cid) .. "\n" .. "World Type: " .. worlds[getWorldType()] doPlayerPopupFYI(cid, msg) return true endagora em data/talkactions abra o talkactions.xml e coloque isso:
Dê /reload talkactions
digite /stats
edit2: Erro concertado
Editado Maio 3 por DrakyLucas