Ir para conteúdo

lazarus321

Membro
  • Registro em

  • Última visita

  1. lazarus321 postou uma resposta no tópico em Suporte Tibia OTServer
    Ola pessoal, Alguem utiliza este o cod. do Oen [TFS 1.3 / 1.4] Upgrade System no servidor canary? eu tentei coloca-lo porem na parte 17 a 20 (figura abaixo), não tem esses arquivos no servidor Canary. Como poderia faze-lo?
  2. Pessoal, estou com um problema no meu servidor, seguinte; As magias de adiciona condição em party não estão funcionando. Ex. Se eu uso enchant party, ele me retorna "No party members in range." já testei a magia um do lado do outro não tinha pq fazer isso. local combat = Combat() combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false) combat:setArea(createCombatArea(AREA_CIRCLE3X3)) local condition = Condition(CONDITION_ATTRIBUTES) condition:setParameter(CONDITION_PARAM_TICKS, 2 * 60 * 1000) condition:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 1) condition:setParameter(CONDITION_PARAM_BUFF_SPELL, true) function onCastSpell(creature, variant) return creature:addPartyCondition(combat, variant, condition, 120) end acredito que seja algum problema dentro da source não reconhecer que estão em party. Bem, no meu spell.lua tenho esse cod. tbm. function Player:addPartyCondition(combat, variant, condition, baseMana) local party = self:getParty() if not party then self:sendCancelMessage(RETURNVALUE_NOPARTYMEMBERSINRANGE) self:getPosition():sendMagicEffect(CONST_ME_POFF) return false end local members = party:getMembers() members[#members + 1] = party:getLeader() local position = self:getPosition() local affectedMembers = {} for _, member in ipairs(members) do if member:getPosition():getDistance(position) <= 36 then affectedMembers[#affectedMembers + 1] = member end end if #affectedMembers <= 1 then self:sendCancelMessage(RETURNVALUE_NOPARTYMEMBERSINRANGE) position:sendMagicEffect(CONST_ME_POFF) return false end local mana = math.ceil(math.pow(0.9, #affectedMembers - 1) * baseMana * #affectedMembers) if self:getMana() < mana then self:sendCancelMessage(RETURNVALUE_NOTENOUGHMANA) position:sendMagicEffect(CONST_ME_POFF) return false end if not combat:execute(self, variant) then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) position:sendMagicEffect(CONST_ME_POFF) return false end self:addMana(baseMana - mana, false) self:addManaSpent(mana - baseMana) for _, member in ipairs(affectedMembers) do member:addCondition(condition) end return true end Alguem pode me ajudar?
  3. Alguem sabe como mostrar a defesa dos itens dentro do jogo? Ex. Dragon Shield tem defesa 31 mais não mostra quando da look. <item id="2516" article="a" name="dragon shield"> <attribute key="weight" value="6000" /> <attribute key="defense" value="31" /> <attribute key="weaponType" value="shield" /> <attribute key="showattributes" value="1" /> </item> acredito que seja em algum lugar da source. talvez aqui no item.cpp, mais não sei como fazer. else if (it.weaponType != WEAPON_AMMO) { int32_t defense, extraDefense; if (item) { defense = item->getDefense(); extraDefense = item->getExtraDefense(); } else { defense = it.defense; extraDefense = it.extraDefense; } if (defense != 0 || extraDefense != 0) { begin = false; s << "\n Defesa: " << defense << std::showpos; // s << " \nDefesa: " << defense; if (extraDefense != 0) { s << ' ' << "+ " << extraDefense << std::noshowpos; } } }
  4. Yes, same error. (vou colocar em Inglês não sei se os gringos vão reclamar). I put this full script above test your self (need make one action with one item). thanks
  5. Deu o mesmo erro .Smile, será que é algum problema no compact.lua? ta assim no compact, function canPlayerLearnInstantSpell(cid, name) local p = Player(cid) return p ~= nil and p:canLearnSpell(name) or false end function getPlayerLearnedInstantSpell(cid, name) local p = Player(cid) return p ~= nil and p:hasLearnedSpell(name) or false end function playerLearnInstantSpell(cid, name) local p = Player(cid) return p ~= nil and p:learnSpell(name) or false end
  6. Pessoal alguém sabe o que esta de errado nessa magia. Era para o player aprender a magia e esta dando esse erro abaixo. Lua Script Error: [Spell Interface] data/spells/scripts/attack/teste.lua:onCastSpell LuaScriptInterface::luaPlayerCanLearnSpell(). Spell "" not found stack traceback: [C]: in function 'canLearnSpell' data/spells/scripts/attack/teste.lua:35: in function <data/spells/scripts/attack/teste.lua:1> Segue as configurações da magia. no arquivo spell.xml, <instant group="support" spellid="289" name="Assassin" words="assassin" lvl="1" maglv="0" mana="20" prem="1" selftarget="1" aggressive="0" cooldown="1000" groupcooldown="1000" needlearn="1" script="support/assassin.lua"> <vocation name="Ass" /> </instant> no arquivo assassin.lua, function onCastSpell(creature, variant) local player = Player(creature) player:canLearnSpell(Assassin) end
  7. Perfeito Joaovettor, Muito obrigado pela ajuda, deu certinho aqui. Rep+ Só nao sei pq itens com dano elemental não funciona. Utilizando espada com dano físico funciona normal.
  8. lazarus321 reagiu a uma resposta no tópico: (Resolvido)Magia por Itens
  9. Tentei fazer como runa mais não deu certo. tipo, quando registra como runa nos "items.xml" dentro do jogo a espada perde os atributos (ataque, defesa etc..) na verdade só a descrição do texto mais a espada funciona normal.
  10. Alguém sabe como colocar outfit por vocação para tfs 1.0+? estava olhando esse tópico mais ngm respondeu...alguém consegue ajudar?
  11. Olá pessoal, não estou conseguindo fazer uma spell que forneça resistencia a danos físicos e elemental por alguns segundos. Alguém poderia ajudar, uso tfs 1.2.
  12. Esse script abaixo "solta" uma spell em diagonal, mas não estão funcionado adequadamente. Alguém consegue verificar pq? TFS1.2 function Creature.IsInCornerToCreature(self, creature) local i = 0 local spos = self:getPosition() local cpos = creature:getPosition() local relativepos = { Position(-1, -1, 0), Position(1, -1, 0), Position(-1, 1, 0), Position(1, 1, 0) } for _, rpos in pairs(relativepos) do local pos = spos+rpos if pos == cpos then return 4 - i end i = i + 1 end return 4 - i end -- [DIRECTION_NORTH] = {x = 0, y = -1}, -- [DIRECTION_EAST] = {x = 1, y = 0}, -- [DIRECTION_SOUTH] = {x = 0, y = 1}, -- [DIRECTION_WEST] = {x = -1, y = 0}, -- [DIRECTION_SOUTHWEST] = {x = -1, y = 1}, -- [DIRECTION_SOUTHEAST] = {x = 1, y = 1}, -- [DIRECTION_NORTHWEST] = {x = -1, y = -1}, -- [DIRECTION_NORTHEAST] = {x = 1, y = -1} function Creature.IsInCornerToCreature(self, creature) local i = 0 local spos = self:getPosition() local cpos = creature:getPosition() local relativepos = { Position(-1, -1, 0), Position(1, -1, 0), Position(-1, 1, 0), Position(1, 1, 0) } for _, rpos in pairs(relativepos) do local pos2 = spos+rpos if pos2 == cpos then return 4 - i end i = i + 1 end return 4 - i end local combat1 = Combat() combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) combat1:setParameter(COMBAT_PARAM_BLOCKARMOR, true) combat1:setParameter(COMBAT_PARAM_BLOCKSHIELD, true) combat1:setFormula(COMBAT_FORMULA_SKILL, 1, 0, 1, 0) local combat2 = Combat() combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) combat2:setParameter(COMBAT_PARAM_BLOCKARMOR, true) combat2:setParameter(COMBAT_PARAM_BLOCKSHIELD, true) combat2:setFormula(COMBAT_FORMULA_SKILL, 1, 0, 1, 0) local combat3 = Combat() combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) combat3:setParameter(COMBAT_PARAM_BLOCKARMOR, true) combat3:setParameter(COMBAT_PARAM_BLOCKSHIELD, true) combat3:setFormula(COMBAT_FORMULA_SKILL, 1, 0, 1, 0) local area = createCombatArea( { {1, 0, 1,}, {0, 1, 0,}, {0, 1, 0,}, {0, 3, 0,}, {0, 0, 0,} } ) local area1 = createCombatArea( { {0,0,1,0}, {0,0,1,1}, {0,1,0,0}, {3,0,0,0} }) local area2 = createCombatArea( { {0,1,0,0}, {1,1,0,0}, {0,0,1,0}, {0,0,0,3} }) combat1:setArea(area) combat2:setArea(area1) combat3:setArea(area2) function onUseWeapon(player, variant) local target = player:getTarget() local result = Creature.IsInCornerToCreature(player,target) if result == 0 then combat1:execute(player, variant) elseif pos == 1 or 4 then combat3:execute(player,variant) elseif pos2 == 2 or 3 then combat2:execute(player,variant) end return true end
  13. Brunds, Fiz umas verificações... vamo la, Ex de uma espada. Atk 150 físico + 50 energia +50 fogo. No jogo deveria me retornar 3 tipos de dano, não esta acontecendo. Ele retorna dano fisíco e dano de fogo. Por algum motivo ele não pega o dano de energia.
  14. Bem... eu consegui resolver isso mudando algumas coisas na source... nem lembro o que eu fiz mais foi por lá. O problema que vejo agora é que tiver 2 atributos de dano elemental (elementenergy e um outro elementfire) so funciona o que foi declarado por último. Queria que funcionasse os 2.
  15. Alguém sabe como posso fazer um item lançar magia. Ex. uma sword quando clicada para usar, lançaria uma spell death_strike no alvo alem do dano normal de ataque. Lembrando que não é para ser automático é só quando clicar na espada. Ela tbm teria range 4 e gastaria 150 de mana. Utilizo TFS 1.2. Coloquei uma action para usar a spell, porem deu esse erro ai em cima alguem sabe pq? Segue a spell abaixo. local primeiroCombat = Combat() primeiroCombat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) primeiroCombat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONHIT) primeiroCombat:setParameter(COMBAT_PARAM_BLOCKARMOR, true) primeiroCombat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true) local segundoCombat = Combat() segundoCombat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) segundoCombat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) segundoCombat:setParameter(COMBAT_PARAM_BLOCKARMOR, true) segundoCombat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true) local area = createCombatArea( { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 1, 1, 3, 1, 1, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} } ) local area2 = createCombatArea( { {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 0, 1, 1, 0}, {1, 0, 0, 3, 0, 0, 1}, {0, 1, 1, 0, 1, 1, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0} } ) primeiroCombat:setArea (area) segundoCombat:setArea (area2) function onGetFormulaValues(player, skill, attack, factor) local min = (player:getLevel() / 1) + (skill * attack * 0.03) + 50 local max = (player:getLevel() / 1) + (skill * attack * 0.08) + 50 return -min, -max end primeiroCombat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onGetFormulaValues(player, skill, attack, factor) local min = (player:getLevel() / 1) + (skill * attack * 0.01) + 50 local max = (player:getLevel() / 1) + (skill * attack * 0.02) + 50 return -min, -max end segundoCombat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onUse(player, item, fromPosition, itemEx, toPosition) primeiroCombat:execute(player, variant) segundoCombat:execute(player, variant) return true end
  16. Funcionou não. acredito q seja so um atributo com duração, nao irá interferir no decay. Talvez se tivesse uma função ao atacar ele fizesse o decay poderia funcionar...

Informação Importante

Confirmação de Termo