Tudo que lazarus321 postou
- Item updade - Oen
-
TFS 1.2 Party
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?
-
TFS 1.2 Defesa dos itens
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; } } }
-
Script para aprender magia TFS 1.2
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
-
Script para aprender magia TFS 1.2
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
-
Script para aprender magia TFS 1.2
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
-
(Resolvido)Magia por Itens
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.
-
(Resolvido)Magia por Itens
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.
-
Outfit por Vocação
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?
-
Magia com resistência a fisico ou elementos
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.
-
Posição Diagonal da Criatura
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
-
Dano Elemental
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.
-
Dano Elemental
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.
-
(Resolvido)Magia por Itens
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
-
Decay Weapons
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...
-
Decay Weapons
Entao...da forma que está funciona direitinho ela transforma da fire para a normal. Porem o contrario já não consigo fazer.
-
Decay Weapons
Estou com uma dúvida ao colocar o atributo <attribute key="decayTo" value="xxxx" /> no item.xml. Não esta funcionando. Ex. fiery sword para blacksteel sword e vice versa. Utilizo TFS 1.2. -espada 1 <item id="7747" article="a" name="fiery blacksteel sword"> <attribute key="weight" value="5900" /> <attribute key="defense" value="22" /> <attribute key="attack" value="35" /> <attribute key="weaponType" value="sword" /> <attribute key="slotType" value="two-handed" /> <attribute key="elementFire" value="7" /> <attribute key="charges" value="1000" /> <attribute key="showcharges" value="1" /> <attribute key="decayTo" value="7406" /> </item> -espada 2 <item id="7406" article="a" name="blacksteel sword"> <attribute key="description" value="This sword is only granted to a greenhorn of the Svargrond arena." /> <attribute key="weight" value="5900" /> <attribute key="defense" value="22" /> <attribute key="attack" value="42" /> <attribute key="weaponType" value="sword" /> <attribute key="slotType" value="two-handed" /> <attribute key="charges" value="1000" /> <attribute key="showcharges" value="1" /> <attribute key="decayTo" value="7747" /> </item>
-
Compilando TFS 1.3
O arquivo veio assim ==> config.lua.dist Dentro do arquivo eu somente mudei mysqlHost = "127.0.0.1" mysqlUser = "xxxx" mysqlPass = "xxxxxx" mysqlDatabase = "xxxx" mysqlPort = 3306 mysqlSock = "" que utilizo aqui. Tirei o .dist do config.lua mais tbm nao deu nada.
-
Compilando TFS 1.3
Alguem sabe porque isto esta acontecendo? Compilei TFS 1.3 conforme os procedimentos https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows, porem, na hora que executo o arquivo do servidor ele fecha após 3-4 segundos sem da erro.
-
Dano Elemental
Gostaria de saber porque o dano do elemento so aparece se tiver algum dano fisico declarado nos itens.xml, (figura abaixo). Ele funciona dentro do jogo porem a representação do texto nao aparece.
-
Conversão de Script
Alguem consegue passar esses 2 scripts para versao tfs 1.x+? Achei interessante o script mais não funciona em verões mais atuais. link original > https://www.xtibia.com/forum/topic/203243-pullpush-spells/ Pull Spell local function doPullCreature(target, cid) if target > 0 then if not isNpc(target) then local position = getThingPosition(cid) local fromPosition = getThingPosition(target) local x = ((fromPosition.x - position.x) < 0 and 1 or ((fromPosition.x - position.x) == 0 and 0 or -1)) local y = ((fromPosition.y - position.y) < 0 and 1 or ((fromPosition.y - position.y) == 0 and 0 or -1)) local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z} if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then doTeleportThing(target, toPosition, true) end end end end local spell = {} spell.config = { [3] = { damageType = 1, areaEffect = 2, area = { {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 3, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0} } }, [2] = { damageType = 1, areaEffect = 2, area = { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 3, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0} } }, [1] = { damageType = 1, areaEffect = 2, area = { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 1, 3, 1, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} } } } spell.combats = {} for _, config in ipairs(spell.config) do local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType) setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect) function onTargetCreature(cid, target) doPullCreature(target, cid) end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") setCombatArea(combat, createCombatArea(config.area)) table.insert(spell.combats, combat) end function onCastSpell(cid, var) for n = 1, #spell.combats do addEvent(doCombat, (n * 150) - 150, cid, spell.combats[n], var) end return true end Push Spell local function doPushCreature(target, cid) if target > 0 then if not isNpc(target) then local position = getThingPosition(cid) local fromPosition = getThingPosition(target) local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1)) local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1)) local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z} if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then doTeleportThing(target, toPosition, true) end end end end local spell = {} spell.config = { [3] = { damageType = 1, areaEffect = 2, area = { {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 3, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0} } }, [2] = { damageType = 1, areaEffect = 2, area = { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 3, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0} } }, [1] = { damageType = 1, areaEffect = 2, area = { {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 1, 3, 1, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} } } } spell.combats = {} for _, config in ipairs(spell.config) do local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType) setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect) function onTargetCreature(cid, target) doPushCreature(target, cid) end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") setCombatArea(combat, createCombatArea(config.area)) table.insert(spell.combats, combat) end function onCastSpell(cid, var) for n = 1, #spell.combats do addEvent(doCombat, (n * 150) - 150, cid, spell.combats[n], var) end return true end
-
Magia com 2 target
Olá, Gostaria de um script que quando o player usasse a spell iria para 2 alvos mais proximos. Ex. Strong flame strike iria em 2 target ao mesmo tempo. Utilizo base tfs 1.3. Desde já agradeço.
-
Formulação (dano criatura / dano jogador)
Óla pessoal, Foi fazer um teste no dano das armas e percebi que quando ao atacar um player com uma espada ataque 5, o ataque errava sempre.... e quando atacava um mob dava dano normal. Tive que colocar uma espada com ataque 30 para dar 5-7 de dano no player. A comparação foi feita no lv 8 com skill 10 de player para player e player para mob foi num rato. Gostaria de saber como mudar essa formula de player para player ficar = a de player para creature. Uso tfs 1.3 base 10.98.
-
Script Forja Avançado
Avançando nesse conteúdo de forja , Gostaria se possível ao invés dos itens (matéria prima dos itens a ser criado) estarem na bp, estaria nessaS coord conforme (figura abaixo), e depois clicaria nessa bigorna para faze-los. Obs. O item criado iria direto para bp. Outra coisa tambem seria adicionar uma certa skill para o player executar o craft. Ex. teria q ter alem do lv skillsword 30. Seria mais um check se os itens estariam naquela posição da foto e executasse o comando quando clicasse na bigorna.
-
(Resolvido)Sistema Simples de Forja
Perfeito rep+.