Solutions
-
Mathias Kenfi's post in (Resolvido)Weapons com dano de acordo com skill+lvl+dano da arma equipada was marked as the answer--[[ Script By ~Mathias Kenfi]]-- local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 34) function onGetFormulaValues(cid, level) skill = getPlayerSkillLevel(cid, 4) -- 4 é sword attack = getItemInfo(getPlayerWeapon(cid).itemid).attack total = (level + skill) + attack return -total, -total end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
-
Mathias Kenfi's post in (Resolvido)Mudar posições declarada e verificar tile was marked as the answerpos = {x=160, y=54, z=7}
Como você pode ver, pos é uma tabela e os indexes são X, Y e Z.
Então para retornar o valor de X você deve utilizar pos.x, Y pos.y e Z pos.z
Neste caso para adicionar um valor a X você cria outra mini tabela.
pos2 = {x=pos.x+1, y=pos.y, z=pos.z} // Assim irá retornar os valores da tabela pos
Para verificar um piso você pode utilizar algumas funções.
getTileItemById(pos, ID).uid
doFindItemInPos({ID}, pos)[1]
-
Mathias Kenfi's post in (Resolvido)[Resolvido] NPC que Troca Itens por Quantidade was marked as the answerCrie um arquivo chamado golden.lua em data/npc/scripts e dentro coloque:
Agora crie um arquivo chamado golden.xml em data/npc e dentro coloque:
-
Mathias Kenfi's post in (Resolvido)Auxilio com scripts de spells was marked as the answer1º Magia
2º Magia
3º Magia: Acredito que esta magia seja apenas colocar isso
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN) 4º Magia
No script da magia Big Regeneration, abaixo de function onCastSpell(cid, var) coloque:
if getPlayerStorageValue(cid, 154343232) os.time() >= 1 then return doPlayerSendTextMessage(cid,22,"You are silence") end Agora o script da magia que causa o silenciamento
Observação: Estas spells podem ser tanto alvo único, como também podem ser em área
-
Mathias Kenfi's post in (Resolvido). was marked as the answerFiz aqui pra você, amigo
-
Mathias Kenfi's post in (Resolvido)Healando por segundo usando ML was marked as the answerOs valores fixos foram exemplos de como deve ser feito, afinal da maneira que você estava fazendo não ia funcionar
Para não ser valor fixo, basta você fazer da mesma forma que está escrito na função abaixo:
function onGetFormulaValues(cid, level, maglevel) local min = (((level/5)+(maglevel*1) +1)) local max = (((level/5)+(maglevel*2) +3)) return min, max end Neste caso é só você criar uma variável GLOBAL da mesma forma que está escrito acima
EXEMPLO:
local level = getPlayerLevel(cid) local maglevel = getPlayerMagLevel(cid) local min, max = (((level/5)+(maglevel*1) +1)), (((level/5)+(maglevel*2) +3)) Mas deve ser declarado com variável GLOBAL, neste caso você deve declarar ela fora de uma função
Porém você vai se deparar com outro problema, que é a variável "cid", porque você precisa de uma função padrão para declarar esta variável.
Então para TENTAR resolver este problema tente usar o script dessa forma
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) function onGetFormulaValues(cid, level, maglevel) local min = (((level/5)+(maglevel*1) +1)) local max = (((level/5)+(maglevel*2) +3)) -- Essas variáveis são validas apenas para esta função, pois você fechou o escopo return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") local condition = createConditionObject(CONDITION_REGENERATION) function onCastSpell(cid, var) -- Perceba que eu coloquei dentro desta função para definir a variável cid local level = getPlayerLevel(cid) local maglevel = getPlayerMagLevel(cid) local min, max = math.ceil((((level/5)+(maglevel*1) +1))), math.ceil((((level/5)+(maglevel*2) +3))) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 60 * 1000) setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, math.random(min, max)) -- Agora estão declaradas logo acima setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000) setCombatCondition(combat, condition) return doCombat(cid, combat, var) end É uma das possibilidades de resolver o problema (existe script melhor pra tal coisa, porém é a mesma coisa)
-
Mathias Kenfi's post in (Resolvido)[TFS1.2] Vortex Cults De Carlin was marked as the answerERROR na linha 27
portal2:remove(1) end, 1*60*1000, 26394, 1, posCorpo)
Está apenas faltando um ()
portal2:remove(1) end, (1*60*1000, 26394, 1, posCorpo)
-
Mathias Kenfi's post in (Resolvido)[TFS1.2] Novo exeta res was marked as the answerlocal combat = Combat() combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) combat:setArea(createCombatArea(AREA_SQUARE1X1)) function onTargetCreature(creature, target) if target:getMaxHealth() > ((30*target:getMaxHealth())/100) then --- Vai checar se a vida do monstro é maior que 30% return doChallengeCreature(creature, target) end end combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(creature, variant) return combat:execute(creature, variant) end Tente assim
-
Mathias Kenfi's post in (Resolvido)Diminuir o Exhaust das runas was marked as the answer-- Item usage timeBetweenActions = 100 timeBetweenExActions = 1000 -- Pra diminui exhausted só modificar aqui mesmo timeBetweenCustomActions = 500
-
Mathias Kenfi's post in (Resolvido)Editar o dano das magias was marked as the answersetCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, mglvl, min, lvl, max)
Para facilitar, se você colocar assim:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, mglvl, min, lvl, max)
Ele irá causar 100% do seu Level + uns quebrados do seu Magic Level. As outras fórmulas eu não sei como funciona, mas são valores muito quebrados e nunca são exatos, tanto que mesmo nessa formula, para checar o Level Atual de forma correta, teria que ser um numero tipo 4.2222123, então eu recomendo você usar o onGetFormulaValues(cid, level, maglevel)
function onGetFormulaValues(cid, level, maglevel)
return -(level + maglevel), -(level + maglevel)
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
Neste caso ele irá retornar seu Level+MagicLevel.
Você também pode com SKILL V
function onGetFormulaValues(cid, level, skill)
return -(level + skill), -(level + skill)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
-
Mathias Kenfi's post in (Resolvido)crashando o serve ao deslogar com efeito da potion was marked as the answerlocal config = { cooldown = 35, -- tempo entre uma magia e outra storage = 134813, effect = 49, --- efeito que vai sair } local combat = Combat() combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING) combat:setParameter(COMBAT_PARAM_EFFECT, config.effect) combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) local combat2 = Combat() combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_MANADRAIN) combat2:setParameter(COMBAT_PARAM_EFFECT, config.effect) combat2:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) function onGetFormulaValues(player, level, maglevel) cura = (12*player:getMaxHealth()/100)+(player:getSkillLevel()*6)+(maglevel*12) return cura, cura end combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onGetFormulaValues(player, level, maglevel) cura = (12*player:getMaxMana()/100)+(player:getSkillLevel()*6)+(maglevel*12) return cura, cura end combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function doCastSpell(combat, cid, variant) local creature = Creature(cid) if creature ~= nil then combat:execute(creature, variant) end end function doCastSpell2(combat2, cid, variant) local creature = Creature(cid) if creature ~= nil then combat2:execute(creature, variant) end end function onCastSpell(creature, variant) if os.time() - creature:getStorageValue(config.storage) >= config.cooldown then if creature:getSoul() <= 0 then creature:sendTextMessage(20,'Desculpe, você não tem Souls suficiente.') return true else creature:addSoul(-1) creature:setStorageValue(config.storage, os.time()+35) combat:execute(creature, variant) combat2:execute(creature, variant) addEvent(doCastSpell, 0, combat, creature:getId(), variant) addEvent(doCastSpell, 2000, combat, creature:getId(), variant) addEvent(doCastSpell, 4000, combat, creature:getId(), variant) addEvent(doCastSpell, 6000, combat, creature:getId(), variant) addEvent(doCastSpell, 8000, combat, creature:getId(), variant) addEvent(doCastSpell, 10000, combat, creature:getId(), variant) addEvent(doCastSpell, 12000, combat, creature:getId(), variant) addEvent(doCastSpell, 14000, combat, creature:getId(), variant) addEvent(doCastSpell, 16000, combat, creature:getId(), variant) addEvent(doCastSpell, 18000, combat, creature:getId(), variant) addEvent(doCastSpell, 20000, combat, creature:getId(), variant) addEvent(doCastSpell, 22000, combat, creature:getId(), variant) addEvent(doCastSpell, 24000, combat, creature:getId(), variant) addEvent(doCastSpell, 26000, combat, creature:getId(), variant) addEvent(doCastSpell, 28000, combat, creature:getId(), variant) addEvent(doCastSpell, 30000, combat, creature:getId(), variant) addEvent(doCastSpell2, 0, combat2, creature:getId(), variant) addEvent(doCastSpell2, 2000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 4000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 6000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 8000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 10000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 12000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 14000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 16000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 18000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 20000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 22000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 24000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 26000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 28000, combat2, creature:getId(), variant) addEvent(doCastSpell2, 30000, combat2, creature:getId(), variant) end else creature:sendTextMessage(20, "cooldown "..(config.cooldown - (os.time() - creature:getStorageValue(config.storage))).." seconds.") end return true end Versão Testada: TFS 1.2
-
Mathias Kenfi's post in (Resolvido)Dano Variar Pela ml -TFS 0.4 was marked as the answerlocal w = {
[1] = {ef = 47, sh = 35, dmg = COMBAT_ENERGYDAMAGE},
}
function onUseWeapon(cid, var)
local ml = (getPlayerMagLevel(cid)*25000/100)
local min, max = (25000+ml),(25000+ml)
local effect = getPlayerStorageValue(cid, 4561)
local target = getCreatureTarget(cid)
if target ~= 0 then
local wx = w[effect] or w[math.random(#w)]
doSendDistanceShoot(getThingPos(cid), getThingPos(target), wx.sh)
addEvent(doAreaCombatHealth, 100, cid, wx.dmg, getThingPos(target), 0, -min, -max, wx.ef)
end
return true
end
-
Mathias Kenfi's post in (Resolvido)Magia por Itens was marked as the answerVocê deve deixar Normal no Items.xml, você deve registrar como Runa no Spells.xml
Exemplo:
<rune name="Sword" id="ID" allowfaruse="1" charges="1" lvl="60" maglv="1" exhaustion="1000" needtarget="1" blocktype="solid" event="script" value="NOME DO ARQUIVO.lua"/>
-
Mathias Kenfi's post in (Resolvido)[PEDIDO] Spell que aumenta ataque speed was marked as the answerAumente o attackspeed da vocacao 7 e simples
Segue o script \/
function onCastSpell (cid, var)
local store,exausted = 156201,30 -- exaust na talk
if getPlayerStorageValue(cid, store) >= os.time() then
doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.")
return true
end
If getPlayerVocation(cid) = 3 then
local voc = doPlayerSetVocation
addEvent(voc, 10*1000, cid, 7)
setPlayerStorageValue(cid, store, os.time()+exausted)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "ativado 10 segundos.")
else
doPlayerSendCancel(cid, "Apenas Padins utilizam esta spell")
end
return true
end
-
Mathias Kenfi's post in (Resolvido)Pedido de 4 Spells was marked as the answerlocal combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.0, 0, -2.6, 0)
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
local condition = createConditionObject(CONDITION_CURSED) setConditionParam(condition, CONDITION_PARAM_DELAYED, 1) addDamageCondition(condition, 4, 2000, -60) setCombatCondition(combat, condition)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
Tempo que dura a "Bomba"
Delay entre as explosões. 2000=2 Segundos
Dano da "Bomba"