alguem pode arrumar a spell karamatsu ela faz a trap + n some com o tempo e se poder por essas 3 magias para ser obtida por Storage agradeço rep+
Karamatsu
local config = { mana = 1000, seconds = 10, storage = 10, semMana = "Você não tem mana suficiente.", msg = "Você precisa aguardar %d segundos para usar essa magia novamente.", }
local function useAgain(cid) setPlayerStorageValue(cid, config.storage, 2) return TRUE end
local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_CREATEITEM, 8009)
local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_CREATEITEM, 8010)
local combat3 = createCombatObject() setCombatParam(combat3, COMBAT_PARAM_EFFECT, 28)
local combat4 = createCombatObject() setCombatParam(combat4, COMBAT_PARAM_EFFECT, 39)
arr1 = { {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, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 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} }
arr2 = { {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, 0, 0, 0, 0, 0, 0, 0}, {0,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1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0}, {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1}, {0, 0, 1, 1, 1, 0, 0, 0, 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} }
local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2) local area3 = createCombatArea(arr3) local area4 = createCombatArea(arr4) setCombatArea(combat1, area1) setCombatArea(combat2, area2) setCombatArea(combat3, area3) setCombatArea(combat4, area4) function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) == -1 then setPlayerStorageValue(cid, config.storage, os.time()-config.seconds) end if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)))) return true end if getPlayerMana(cid) >= config.mana then doPlayerAddMana(cid, -config.mana) setPlayerStorageValue(cid, config.storage, os.time()) addEvent(doCombat, 000, cid, combat1, var) addEvent(doCombat, 000, cid, combat2, var) addEvent(doCombat, 000, cid, combat3, var) addEvent(doCombat, 000, cid, combat4, var) else doPlayerSendCancel(cid, config.semMana) doSendMagicEffect(getPlayerPosition(cid),2) end return true end
2 Spell
local config = {
mana = 1200, seconds = 10, storage = 10, semMana = "Você não tem mana suficiente.", msg = "Você precisa aguardar %d segundos para usar essa magia novamente.", }
local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_EFFECT, 50) setCombatParam(combat1, COMBAT_PARAM_CREATEITEM, 1499)
local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_EFFECT, 54) setCombatParam(combat2, COMBAT_PARAM_CREATEITEM, 1499)
arr1 = { {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, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 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, 0}, }
arr2 = { {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, 0, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 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, 0}, }
local area1 = createCombatArea(arr1) local area2 = createCombatArea(arr2)
setCombatArea(combat1, area1) setCombatArea(combat2, area2)
function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) == -1 then setPlayerStorageValue(cid, config.storage, os.time()-config.seconds) end if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)))) return true end if getPlayerMana(cid) >= config.mana then doPlayerAddMana(cid, -config.mana) setPlayerStorageValue(cid, config.storage, os.time()) addEvent(doCombat, 0, cid, combat1, var) addEvent(doCombat, 0, cid, combat2, var) else doPlayerSendCancel(cid, config.semMana) doSendMagicEffect(getPlayerPosition(cid),2) end return true end
3 Spell
local config = {
storage = 25, -- storage que salva o delay da magia time = 200, -- tempo que deve esperar para usar a magia em segundos player = true, -- funciona com player true/false monster = false, -- funciona com monstros true/false npc = false, -- funciona com npc true/false manapercent = 0.40, -- quantidade de mana }
function onCastSpell(cid, var)
local function doSend(pos1, pos2, num)
if getPlayerLevel(getCreatureTarget(cid)) > 100 then doSendDistanceShoot(getCreaturePosition(pos1), getCreaturePosition(pos2), 4) doSendMagicEffect(getCreaturePosition(pos2),47) doSendDistanceShoot(getCreaturePosition(pos2), getCreaturePosition(pos1), 4) doSendMagicEffect(getCreaturePosition(pos2),47) doSendDistanceShoot(getCreaturePosition(pos2), getCreaturePosition(pos1), 4) doSendMagicEffect(getCreaturePosition(pos1),47) doSendDistanceShoot(getCreaturePosition(pos1), getCreaturePosition(pos2), 4) doSendMagicEffect(getCreaturePosition(pos1),47) if type(num) == "number" and num == 1 then local pp1 = getCreaturePosition(pos1) local pp2 = getCreaturePosition(pos2) doTeleportThing(pos2, pp1) doTeleportThing(pos1, pp2) doSendMagicEffect(getCreaturePosition(pos1), 10) doSendMagicEffect(getCreaturePosition(pos2), 10) end
else return false end
return true end local target = getCreatureTarget(cid) if type(target) ~= "number" or target == 0 then doPlayerSendCancel(cid, "Você precisa selecionar algum oponente para fazer isso.") return false end if getPlayerLevel(target) > 80 then else doPlayerSendCancel(cid, "Você não pode fazer isso com essa criatura, apenas com players.") return false end if getPlayerStorageValue(cid, config.storage) > os.time() then doPlayerSendCancel(cid, "Você tem que esperar "..getPlayerStorageValue(cid, config.storage) - os.time().." segundos para usar essa magia novamente.") return false else if getPlayerMana(cid) >= (config.manapercent * getCreatureMaxMana(cid)) then doPlayerAddMana(cid, -(config.manapercent * getCreatureMaxMana(cid))) for i = 1, 20 do addEvent(doSend, i*100, cid, target, 0) end addEvent(doSend, 2000, cid, target, 1) setPlayerStorageValue(cid, config.storage, os.time() + config.time) else doPlayerSendCancel(cid, "Você não possuí mana suficiente.") end end
return true end