
Solutions
-
xWhiteWolf's post in (Resolvido)SPELLS PARA RESET was marked as the answer--Created with OSM-- local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE,COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT,CONST_ME_PURPLEENERGY) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.0, -50000000, 1.6, -55000000) arr = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 1, 1, 3, 1, 1, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) setCombatArea(combat, area) function onCastSpell(cid, var) if getPlayerStorageValue(cid, 378378) >=3 then doCombat(cid, combat, var) return true else doPlayerSendCancel(cid, "You need to have at least 3 resets to cast this spell.") return false end end vc tem que garantir que o storage dos resets é esse 378378, de resto tá tudo certo
-
xWhiteWolf's post in (Resolvido)Spell Amaterasu was marked as the answerlocal combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) local deathpowder = createConditionObject(CONDITION_CURSED) setConditionParam(deathpowder, CONDITION_PARAM_DELAYED, 1) addDamageCondition(deathpowder, 10, 1000, -3000) setCombatCondition(combat1, deathpowder) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end function onCastSpell(cid, var) local parameters = {cid = cid, var = var, combat1 = combat1} addEvent(onCastSpell1, 1000, parameters) return true end
-
xWhiteWolf's post in (Resolvido)Pega valor da exp ganha do player! was marked as the answerperai q tá errado.. deixa eu arrumar pra ti e ja edito:
edit:
function onKill(cid, target, lastHit) local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = math.floor((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)) local pokeball = getPlayerSlotItem(cid, CONST_SLOT_FEET) local expatual = getItemAttribute(pokeball.uid, "exp") or 0 doItemSetAttribute(pokeball.uid, "exp", expatual+count) doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a ".. getCreatureName(target) .."!") return true end agr abre creaturescripts\scripts\login.lua e adiciona essa linha antes do ultimo return true:
registerCreatureEvent(cid, "exppoke") -
xWhiteWolf's post in (Resolvido)[Pedido] Mandar todos para o templo! was marked as the answervc pode tanto colocar no script que ele colocou e alterar as posições de temple = {x = ....}
ou pode fazer uma query direto na DB pelo sqlite (tem nas opções lá mas acho que é F9)
colocando o X, Y e Z
UPDATE `players` SET `posx` = "150", `posy` = "60", `posz` = "7"; -
xWhiteWolf's post in (Resolvido)[DÚVIDA] Spell editada was marked as the answerO daaniel deixa de forma bem clara como funcionam esses números nesse post aqui, dá uma olhada: http://www.tibiaking.com/forum/topic/27233-d%C3%BAvida-sobre-spell/
-
xWhiteWolf's post in (Resolvido){Pedido} Caixa eletrônico was marked as the answerhttp://www.tibiaking.com/forum/topic/41134-caixa-eletr%C3%B4nico/
-
xWhiteWolf's post in (Resolvido)Spawn player primeira vez que entra no server. was marked as the answercoloca a townid dele como a do spawn que você quer e faz um onLogin pra setar o novo townid a partir do momento que ele logar. Daí a proxima vez que ele morrer ele irá pro templo do novo townid
A função é essa daqui:
doPlayerSetTown(cid, townid) -
xWhiteWolf's post in (Resolvido)Spell que transfere dano recebido was marked as the answerhttp://www.tibiaking.com/forum/topic/41021-voodoo/
-
xWhiteWolf's post in (Resolvido)[PEDIDO SPELL] Strong Haste was marked as the answerlocal condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_TICKS, 20000) -- tempo q vai durar o haste setConditionFormula(condition, 1.7, -36, 1.7, -36) function onSay(cid, words, param) local pos = getThingPos(cid) if(param == '') then doSendMagicEffect(pos, 14) -- efeito que sai doAddCondition(cid, condition) return true end local t = string.explode(param, '"') if(t[2]) then doCreatureSay(cid, "Strong Haste: ".. t[2], 20, false, 0, pos) doSendMagicEffect(pos, 14) -- efeito que sai doAddCondition(cid, condition) end return true end <talkaction hide="yes" words="correr" event="script" value="correr.lua"/>
-
xWhiteWolf's post in (Resolvido)Ajuda Spell Do Video was marked as the answerlocal combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 48) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 7) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) local stun = createConditionObject(CONDITION_PARALYZE) setConditionParam(stun, CONDITION_PARAM_TICKS, 5000) setConditionFormula(stun, -0.8, 0, -0.9, 0) setCombatCondition(combat1, stun) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end local pisos = {} function onCastSpell(cid, var) local config = { tempo = 4 } local pos = getThingPos(cid) table.insert(pisos, getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid) local list = tonumber(#pisos) local position = { [1] = {x = pos.x, y = pos.y - 1, z = pos.z}, [2] = {x = pos.x + 1, y = pos.y - 1, z = pos.z}, [3] = {x = pos.x + 1, y = pos.y, z = pos.z}, [4] = {x = pos.x + 1, y = pos.y + 1, z = pos.z}, [5] = {x = pos.x, y = pos.y + 1, z = pos.z}, [6] = {x = pos.x - 1, y = pos.y + 1, z = pos.z}, [7] = {x = pos.x - 1, y = pos.y, z = pos.z}, [8] = {x = pos.x - 1, y = pos.y - 1, z = pos.z}, [9] = {x = pos.x, y = pos.y, z = pos.z}, } local id = { [1] = 8336, [2] = 8341, [3] = 8337, [4] = 8339, [5] = 8335, [6] = 8340, [7] = 8338, [8] = 8342, [9] = 231 } local msg = { [1] = "Hakke Rokujuuyonshou", [2] = "Ninshou", [3] = "Yonshou", [4] = "Hashou", [5] = "Juurokushou", [6] = "Sanjuunishou", [7] = "ROKUJUUYONSHOU!", } function canEffect(pos, pz, proj) -- Night Wolf based on Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function RemoveItem(cid, i) local tile = getTileItemById(position[i], id[i]) if tile.uid > 0 and i < #id then doRemoveItem(tile.uid) elseif tile.uid > 0 and i == #id then doTransformItem(tile.uid, pisos[list]) end end for i = 1, #id do if canEffect(position[i]) then doCreateItem(id[i], 1, position[i]) addEvent(RemoveItem, config.tempo*1000, cid, i) end end local parameters = {cid = cid, var = var, combat1 = combat1} for k = 1, #msg do addEvent(function() if isPlayer(cid) then addEvent(onCastSpell1, 1, parameters) doCreatureSay(cid, msg[k], 20, false, 0, pos) end end, 1 + ((k-1) * 500)) end return false end Seguinte, ela é bem facilzinha de configurar, só parece ser dificil:
-
xWhiteWolf's post in (Resolvido)Spell diferente was marked as the answerlocal config = { tempo = 10, --- tempo que vai durar a spell percent = 20, -- quanto % vai aumentar cooldown = 20, --- tempo entre um uso e outro effect1 = 39, -- efeito ao executar a spell effect2 = 13 -- efeito que vai ficar saindo por segundo enquanto ela tiver ativa } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 255) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, config.tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUBPERCENT, 100+config.percent) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORDPERCENT, 100+config.percent) setConditionParam(condition, CONDITION_PARAM_SKILL_AXEPERCENT, 100+config.percent) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+config.percent) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+config.percent) setCombatCondition(combat, condition) function onCastSpell(cid, var) local position1 = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y+1, z=getPlayerPosition(cid).z} local position2 = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y+1, z=getPlayerPosition(cid).z} if getCreatureHealth(cid) <= (getCreatureMaxHealth(cid) * 0.3) then if os.time() - getPlayerStorageValue(cid, 54693) >= config.cooldown then doPlayerSetStorageValue(cid, 54693, os.time()) doSendMagicEffect(position1, config.effect1) doCombat(cid, combat, var) for n = 1, config.tempo do addEvent(function() if isCreature(cid) then doSendMagicEffect(position2, config.effect2) end end, (n - 1) * 1000) end else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 54693))).." seconds.") return false end else doPlayerSendCancel(cid, "You can only use this skill when you're with less than 30 percent of your life.") return false end return true end só altera a position1 e a position2.
-
xWhiteWolf's post in (Resolvido)Usar item em wand, e transformar noutro item. was marked as the answerfunction onUse(cid, item, frompos, item2, topos) if item2.itemid == 8921 then doTransformItem(item2.uid, 2191) doRemoveItem(item.uid, 1) doSendMagicEffect(frompos, 7) else doPlayerSendCancel(cid, "You can't use this item here.") end return true end
em actions.xml:
<action itemid="2263" script="wand.lua"/> Lembre-se que o id do item que será usado tem que ser algo que dê pra dar use with (assim como as potions e runas)
-
xWhiteWolf's post in (Resolvido)[PEDIDO] Botar isso nesse script trocar pos was marked as the answerlocal tempo = 5 local pos = {} function onCastSpell(cid, var) ------- OUTFIT ----------- addEvent(doSetCreatureOutfit, 1, variantToNumber(var), getCreatureOutfit(cid), (tempo * 1000) - 1) doSetCreatureOutfit(cid, getCreatureOutfit(variantToNumber(var)), tempo * 1000) --------- TELEPORTE ------------ addEvent(function() if isPlayer(cid) and isPlayer(variantToNumber(var)) then table.insert(pos, getThingPos(cid)) table.insert(pos, getThingPos(variantToNumber(var))) end end, 1000*tempo) addEvent(function() if isPlayer(cid) and isPlayer(variantToNumber(var)) and #pos > 1 then doTeleportThing(cid, pos[2], true) doSendMagicEffect(pos[2], 10) doSendMagicEffect( pos[1], 10) doTeleportThing(variantToNumber(var), pos[1], true) table.remove(pos, 2) table.remove(pos, 1) end end, (1000*tempo) + 1) doSendMagicEffect(getThingPos(cid), 10) addEvent(doSendMagicEffect, 1, getThingPos(variantToNumber(var)), 10) addEvent(doTeleportThing, 1, variantToNumber(var), getThingPos(cid)) doTeleportThing(cid, getThingPos(variantToNumber(var))) return true end prontinho x)
-
xWhiteWolf's post in (Resolvido)Ajuda Tajju Kage Bunshin no Jutsu was marked as the answerEu deixei o código mais elegante, se não se importa haha.. agora ele cria exatamente o número de summons que falta pra completar o máximo (que é 4);
Ali você edita as posições e se quiser adicionar novas é só colocar virgula e seguir a forma que está (a ultima não tem virgula porque nao vem nada depois dela). Lembra de colocar Max sumons = exatamente o numero de posições que vc for colocar e o resto o script faz sozinho ;], qualquer erro posta aí.
function onCastSpell(cid, var) local cloth = getCreatureOutfit(cid) local health = getCreatureHealth(cid) local maxhealth = getCreatureMaxHealth(cid) local MaximoSummon = 4 local summons = getCreatureSummons(cid) if(table.maxn(summons) < MaximoSummon) then local pos = getPlayerPosition(cid) local bpos = { {x=pos.x+3, y = pos.y, z = pos.z}, {x=pos.x+2, y = pos.y, z = pos.z}, {x=pos.x+1, y = pos.y+2, z = pos.z}, {x=pos.x+2, y = pos.y+3, z = pos.z} } for i = 1, (#bpos - table.maxn(summons)) do local Bunshin = doCreateMonster("Clone", bpos[i]) doConvinceCreature(cid, Bunshin) setCreatureMaxHealth(Bunshin, maxhealth) doCreatureAddHealth(Bunshin, health) doSetCreatureOutfit(Bunshin, cloth, -1) setCreatureName(Bunshin, "".. getCreatureName(cid) .."", "a ".. getCreatureName(cid) .."") doSendMagicEffect(bpos[i], 2) end return true end end
-
xWhiteWolf's post in (Resolvido)[Dúvida] COMBAT_ENERGYDAMAGE was marked as the answeracho q só pelas sources mesmo ou mudando o tipo de combat pra um tipo q não tenha efeitos
-
xWhiteWolf's post in (Resolvido)Spell de trap was marked as the answeresse item 1386 é usado no seu server pra mais alguma coisa é só pra spell? Se for só pra spell coloca duration nele pelo items.xml que é a melhor forma de se prevenir contra qualquer bug
-
xWhiteWolf's post in (Resolvido)[Ajuda] Balanceamento de spells! was marked as the answerSim, basicamente é isso daqui:
mínimo de dano = (Level * A + Magic Level * B) * C + D
Máximo de dano = (Level * K + Magic Level * L) * M + N
e a fórmula fica:
setCombatFormula(combat, type,C, D, M, N, A, K, B, L )
No caso do seu combat que tem apenas 4 números, ele está considerando que o B, L, D e o N são 0. Então ficaria
setCombatFormula(combat, type,C, 0, M, 0, A, K, 0, 0 ) sendo a fórmula de dano;
Como 0 é um dos valores padrão então eu não preciso escrevê-lo, ficando apenas (reorganizei os valores pra ficar de acordo com a sua fórmula):
setCombatFormula(combat, type, A, M, K, C )
Nessa sua fórmula nós temos
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
então sabemos que o dano mínimo e máximo dela é -1.2 * o level e que esse fator irá ser multiplicado 1x.
(acho q é isso)
-
xWhiteWolf's post in (Resolvido)Msg normal em vez de laranja! was marked as the answerdoCreatureSay(uid, text, type[, ghost = false[, cid = 0[, pos]]])
Em outras palavras
doCreatureSay(QUEM VAI FALAR, TEXTO QUE VAI FALAR, TIPO DO TEXTO, SÓ VAI VER QUEM FALA (true) OU TODO MUNDO AO REDOR (false), NÃO SEI DIZER, POSIÇÃO QUE VAI SAIR A FALA)
Lembrando que todos entre [] colchetes não são necessários de serem colocados e caso não sejam eles assumirão o valor padrão escrito ali (false, 0, pos)
Agora se vc quer mudar o tipo de texto que sai (a cor dele) você tem que editar o type ;]. Vá em data/lib/constant.lua e procure algo parecido com isso daqui:
TALKTYPE_FIRST = 1 TALKTYPE_SAY = TALKTYPE_FIRST TALKTYPE_WHISPER = 2 TALKTYPE_YELL = 3 TALKTYPE_PRIVATE_PN = 4 TALKTYPE_PRIVATE_NP = 5 TALKTYPE_PRIVATE = 6 TALKTYPE_CHANNEL_Y = 7 TALKTYPE_CHANNEL_W = 8 TALKTYPE_RVR_CHANNEL = 9 TALKTYPE_RVR_ANSWER = 10 TALKTYPE_RVR_CONTINUE = 11 TALKTYPE_BROADCAST = 12 TALKTYPE_CHANNEL_RN = 13 TALKTYPE_PRIVATE_RED = 14 TALKTYPE_CHANNEL_O = 15 TALKTYPE_CHANNEL_RA = 17 TALKTYPE_MONSTER = 19 TALKTYPE_MONSTER_YELL = 20 TALKTYPE_LAST = TALKTYPE_MONSTER_YELL Isso é a lista de todos os tipos de texto que são possíveis de editar. Aqui no meu server os tipos de fala em laranja são a 19 e a 20 mas no seu server pode ser que seja diferente;
Já que vc quer que saia um texto normal vc pode colocar qualquer um desses 3 tipos
Ficando em uma dessas 3 formas:
doCreatureSay(itemEx.uid, "Oitdb...", 1, false, tid) doCreatureSay(itemEx.uid, "Oitdb...", TALKTYPE_FIRST, false, tid) doCreatureSay(itemEx.uid, "Oitdb...", TALKTYPE_SAY, false, tid) Lembrando que isso é tendo como base o meu server.. checa a sua constant.lua e vê a forma certa pro seu OTSERV
-
xWhiteWolf's post in (Resolvido)[DUVIDA]qual tipo de script é usado nos servidores ot serve? was marked as the answerLua pra scripting, xml pra orientar o local de cada arquivo e também temos C++ pras sources
-
xWhiteWolf's post in (Resolvido)Kick player was marked as the answernesse caso ele só vai kikar se for 350 certinho.. se seu server for mt high exp e correr o risco do cara upar do 349 pro 351 direto usa assim:
function onAdvance(cid, skill, oldlevel, newlevel) if(skill == 8 and (oldlevel <= (newlevel-10))) then broadcastMessage(getPlayerName(cid).." upou do level "..oldlevel.." para o "..newlevel..".\nParabens") end if(skill == 8 and newlevel >= 350 and getPlayerStorageValue(cid, 37583) == -1) then doRemoveCreature(cid) setPlayerStorageValue(cid, 37583, 1) end if(skill == 8 and newlevel >= 500 and getPlayerStorageValue(cid, 9141) == -1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Foi adicionado 100 premium points na sua conta, por ter atingido o level 500.") doPlayerAddPremiumPoints(cid, 100) setPlayerStorageValue(cid, 9141, 1) end end daí ele só kika uma vez
-
xWhiteWolf's post in (Resolvido)Ajuda em Spell Pls! was marked as the answerlocal level, skill = getPlayerLevel(cid), 20 local min, max = -(((skill * 18)) + (level * 4.8)), -((skill * 18) + (level * 5.0)) addEvent(doTargetCombatHealth, 1500, cid, getCreatureTarget(cid), 512, min, max, 43) tá feita a sua fórmula haha, vc ainda pode complementar com ml ou realmente pegar uma a uma todas as skills e somar só usando funções em lua ;]
-
xWhiteWolf's post in (Resolvido)[Spell] Exori Element was marked as the answer<instant name="testeTK" words="exevoelemental" lvl="16" mana="500" soul="50" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="especiais/exevoelemental.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(combat3, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY) setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) local deathpowder = createConditionObject(CONDITION_CURSED) setConditionParam(deathpowder, CONDITION_PARAM_DELAYED, 1) addDamageCondition(deathpowder, 10, 1000, -200) setCombatCondition(combat3, deathpowder) local function onCastSpell1(parameters) doCombat(parameters.cid, parameters.combat1, parameters.var) end local function onCastSpell2(parameters) doCombat(parameters.cid, parameters.combat2, parameters.var) end local function onCastSpell3(parameters) doCombat(parameters.cid, parameters.combat3, parameters.var) end function onCastSpell(cid, var) local parameters = {cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3} addEvent(onCastSpell1, 1000, parameters) addEvent(onCastSpell2, 1500, parameters) addEvent(onCastSpell3, 2000, parameters) return true end
-
xWhiteWolf's post in (Resolvido)Spells diferentes was marked as the answer1-
creaturescripts.xml
<event type="statschange" name="defensive1" event="script" value="defensive1.lua"/> login.lua
---------- Defensive 1 ---------------- registerCreatureEvent(cid, "defensive1") if getPlayerStorageValue(cid, 3482101) < 0 then setPlayerStorageValue(cid, 3482101, 0) end creaturescripts\scripts\defensive1.lua
local config = { storage = 3482101, effect1 = 2, --- efeito ao ser atacado estando invulnerável percent = 30 -- porcentagem de esquivar } function onStatsChange(cid, attacker, type, combat, value) if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then if getPlayerStorageValue(cid,config.storage) > 0 and isCreature(attacker) and math.random(1,100) <= config.percent then doSendMagicEffect(getCreaturePosition(cid), config.effect1) doSendAnimatedText(getCreaturePosition(cid), "-kawarimi-", 215) setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) - 1) doPlayerSendTextMessage(cid, 20, "You have now ".. getPlayerStorageValue(cid, config.storage) .." charge(s).") return false end end return true end
2-
creaturescripts\scripts\defensive2.lua
local config = { storage = 3482101, effect1 = 2, --- efeito ao ser atacado e teleportar percent = 30 -- porcentagem de esquivar } function onStatsChange(cid, attacker, type, combat, value) if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then if getPlayerStorageValue(cid,config.storage) > 0 and isCreature(attacker) and math.random(1,100) <= config.percent then doSendMagicEffect(getCreaturePosition(cid), config.effect1) doTeleportThing(cid, getCreaturePosition(attacker), false) doTargetCombatHealth(cid, attacker, 1, -50, -100, 255) setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) - 1) doPlayerSendTextMessage(cid, 20, "You have now ".. getPlayerStorageValue(cid, config.storage) .." charge(s).") return true end end return true end (o resto é a mesma coisa, só muda os storages e os nomes né)
Agora pra ambos vc vai fazer essa mesma spell:
spells.xml
<instant name="kawarimi no jutsu defensive" words="kawarimi no jutsu defensive" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/kawarimi.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> data\spells\scripts\especiais\kawarimi.lua
local config = { storage = 3482101, cooldown = 3, --- tempo entre um uso e outro maxcharge = 20, --- máximo de cargas que dá pra acumular effect1 = 29 -- efeito que sai ao falar a spell } function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) >= 20 then doPlayerSendCancel(cid, "You already reached the max of charges for this skill.") return false end if os.time() - getPlayerStorageValue(cid, 55697) >= config.cooldown then setPlayerStorageValue(cid, 55697, os.time()) doSendMagicEffect(getCreaturePosition(cid), config.effect1) setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) + 1) doPlayerSendTextMessage(cid, 27, "You have now ".. getPlayerStorageValue(cid, config.storage) .." charge(s).") else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55697))).." seconds.") return false end return true end
Lembrando que se vc quiser ter ambas as spells vc precisa duplicar os scripts e mudar os storages/nomes
-
xWhiteWolf's post in (Resolvido)Spell para ficar intocavel was marked as the answer@skailord, você não pode dar up no tópico dos outros a não ser que tenha passado 24 hrs. Leia as regras
spells\scripts\especiais\invencible.lua
local config = { storage = 3482101, cooldown = 30, --- tempo entre um uso e outro duration = 5, --- duração effect1 = 29 -- efeito que sai ao falar a spell } local outfit = createConditionObject(CONDITION_INVISIBLE, config.duration * 1000, false) function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 55695) >= config.cooldown then setPlayerStorageValue(cid, 55695, os.time()) doSendMagicEffect(getCreaturePosition(cid), config.effect1) setPlayerStorageValue(cid, config.storage, os.time() + config.duration) doCreatureSay(cid,"UNTOUCHABLE!!!", 19) doAddCondition(cid, outfit) doPlayerSendTextMessage(cid, 27, "You have now ".. config.duration .." seconds of invulnerability.") else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55695))).." seconds.") return false end return true end spells.xml
<instant name="testeTK" words="naruto3" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/invencible.lua"> </instant> creaturescripts\scripts\login.lua:
---------- Invencible ---------------- registerCreatureEvent(cid, "invencible") if getPlayerStorageValue(cid, 3482101) ~= 0 then setPlayerStorageValue(cid, 3482101, 0) end creaturescripts.xml:
<event type="statschange" name="invencible" event="script" value="invencible.lua"/> creaturescripts\scripts\invencible.lua
local config = { storage = 3482101, effect1 = 2 --- efeito ao ser atacado estando invulnerável } function onStatsChange(cid, attacker, type, combat, value) if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then if getPlayerStorageValue(cid,config.storage) - os.time() > 0 and isCreature(attacker) then doSendMagicEffect(getCreaturePosition(cid), config.effect1) doSendAnimatedText(getCreaturePosition(cid), "0", 180) return false end end return true end Usei o mesmo storage da outra spell que fiz pra vc uchihagaeshi, mude o storage em todos os scripts ;]
-
xWhiteWolf's post in (Resolvido)Spell de revidar ataque was marked as the answerspells/scripts/especiais/uchihagaeshi.lua
local config = { storage = 3482101, cooldown = 20, effect1 = 29 --- efeito que sai qnd usa a spell } function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) == 1 then doPlayerSendCancel(cid, "Your skill is already active.") return false end if os.time() - getPlayerStorageValue(cid, 55694) >= config.cooldown then setPlayerStorageValue(cid, 55694, os.time()) doSendMagicEffect(getCreaturePosition(cid), config.effect1) setPlayerStorageValue(cid, config.storage, 1) doPlayerSendTextMessage(cid, 27, "You activated your skill, the next damage will be reflected.") else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(config.cooldown - (os.time() - getPlayerStorageValue(cid, 55694))).." seconds.") return false end return true end spells.xml
<instant name="testeTK" words="naruto3" lvl="16" mana="500" prem="1" aggressive="0" exhaustion="1000" needlearn="0" event="script" value="especiais/uchihagaeshi.lua"> </instant>
creaturescripts.xml:
<event type="statschange" name="uchihagaeshi" event="script" value="uchihagaeshi.lua"/> creaturescripts\scripts\uchihagaeshi.lua:
local config = { storage = 3482101, effect1 = 17, --- efeito que sai ao dar reflect effect2 = 29 -- efeito que aparece na pessoa que levou reflect } function onStatsChange(cid, attacker, type, combat, value) if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) then if getPlayerStorageValue(cid,config.storage) == 1 and isCreature(attacker) then doSendAnimatedText(getCreaturePosition(attacker),"-"..value, 215) doCreatureAddHealth(attacker, -value, true) doCreatureSay(cid,"Uchihagaeshi!", 19) doSendMagicEffect(getCreaturePosition(cid), config.effect1) doSendMagicEffect(getCreaturePosition(attacker), config.effect2) setPlayerStorageValue(cid,config.storage, 0) return false end end return true end creaturescripts\scripts\login.lua:
---------- UCHIHAGAESHI ---------------- registerCreatureEvent(cid, "uchihagaeshi") if getPlayerStorageValue(cid, 3482101) ~= 0 then setPlayerStorageValue(cid, 3482101, 0) end
Se for editar storage tem que editar em todos os scripts