
Solutions
-
139's post in CONDITION_BLEEDING erro com spell em ot 8.6 was marked as the answerJá tentou alterar para CONDITION_PHYSICAL?
-
139's post in Spell dando index a nil value was marked as the answerO Dr. Frankestein ficaria orgulhoso desse código.
Pelo que eu entendi deveria ser isso:
-
139's post in POTION HEALTH/MANA 70K+ was marked as the answer
-
139's post in SCRIPT DE TRAP BUGADA. was marked as the answer@raphadoidera
local c = { trapId = 2718, -- id do trap trapTime = 4, -- tempo do trap em segundos exhaustStorage = 1060602, -- storage do exhausted exhaustTime = 20 -- tempo do exhausted em segundos } local trap = createCombatObject() setCombatArea(trap, createCombatArea({ {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0}, {0,0,1,1,1,0,0}, {0,0,1,2,1,0,0}, {0,0,1,1,1,0,0}, {0,0,0,0,0,0,0}, {0,0,0,0,0,0,0} })) function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true 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 onTargetTile(cid, pos) if isWalkable(pos, true, true, true) then doSendMagicEffect(pos, 111) doCreateItem(c.trapId, 1, pos) addEvent(function() local thing = getTileItemById(pos, c.trapId).uid if(thing ~= 0) then doRemoveItem(thing) end end, c.trapTime * 1000) end end setCombatCallback(trap, CALLBACK_PARAM_TARGETTILE, "onTargetTile") function onCastSpell(cid, var) local target = variantToNumber(var) if(isPlayer(cid)) then if(math.max(0, (exhaustion.get(cid, c.exhaustStorage) or 0)) > 0) then doPlayerSendCancel(cid, "You are exhausted. Wait " .. exhaustion.get(cid, c.exhaustStorage) .. " second" .. (exhaustion.get(cid, c.exhaustStorage) > 1 and "s" or "") .. ".") return false else exhaustion.set(cid, c.exhaustStorage, c.exhaustTime) end end doCombat(cid, trap, var) return true end
-
139's post in SCRIPT DE MÍSSIL (Por Favor, me ajudem) was marked as the answerTinha feito o último rapidão pelo celular, agora ta certo:
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 41) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -78.2, 1, -88.2, 1) function onCastSpell(cid, var) local waittime = 2 -- Tempo de exhaustion local storage = 1000600 if exhaustion.check(cid, storage) then return false end local mypos = getCreaturePosition(cid) local tpos = getCreaturePosition(getCreatureTarget(cid)) local position1 = {x=tpos.x+1, y=tpos.y+1, z=tpos.z} local position2 = {x=mypos.x+3, y=mypos.y, z=mypos.z} local rng = math.random(0, 1) local toposA = {x = tpos.x + rng-1, y = tpos.y + rng, z = tpos.z} local toposB = {x = tpos.x + rng, y = tpos.y + rng-1, z = tpos.z} doSendMagicEffect(position1, 106) doSendMagicEffect(position2, 189) doSendDistanceShoot(mypos, toposA, 41) doSendDistanceShoot(mypos, toposB, 41) exhaustion.set(cid, storage, waittime) return doCombat(cid, combat, var) end
-
139's post in Spell - Big Regeneration was marked as the answer@elielder
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local voc_bonus = { -- valor da cura adicional, ex: 0%, 10%, 50%, 100%, 200% ["Tanque"] = 50, ["Suporte"] = 25, ["Dano"] = 0, } local table_vocs = { -- last_id é o último id da vocação, a tabela precisa estar em ordem crescente. [1] = {last_id = 12, voc = "Naruto", classe = "Dano"}, [2] = {last_id = 20, voc = "Sasuke", classe = "Dano"}, [3] = {last_id = 30, voc = "Chouji", classe = "Tanque"}, [4] = {last_id = 40, voc = "Hidan", classe = "Tanque"}, [5] = {last_id = 50, voc = "Hashirama", classe = "Suporte"}, [6] = {last_id = 60, voc = "Obito", classe = "Suporte"}, } local function getBonus(cid, base) local pvoc = getPlayerVocation(cid) for k, _ in ipairs(table_vocs) do if pvoc <= table_vocs[k].last_id then bonus = voc_bonus[table_vocs[k].classe]/100 + 1 total = base * bonus return total end end end function onGetPlayerMinMaxValues(cid, level, magLevel) local min = ((level*0)+(magLevel*0)+200) local max = ((level*0)+(magLevel*0)+250) return getBonus(cid, min), getBonus(cid, max) end setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
-
139's post in Scripto alohomora simples was marked as the answerTenta isso:
addEvent(function() local p = getTileItemById(fromPosition, porta).uid if p > 0 then doTransformItem(p, porta-1) end end, 2000)
-
139's post in 0 Erro ao pokemon passar por cima de tile was marked as the answerfunction onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then return true end
if getPlayerGuildId(cid) > 0 then
doPlayerSendTextMessage(cid, 27, "Voce entrou, Guild "..getPlayerGuildName(cid)..".")
else
doPlayerSendTextMessage(cid, 27, "Desculpe,mais somente players que possuem guild pode entrar nessa area.")
doTeleportThing(cid, fromPosition)
end
return true
end
-
139's post in SPELL ATTACK was marked as the answerlocal chance = 50 local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_TICKS, 5000) function onCastSpell(cid, var) if not isPlayer(cid) then return false end if math.random(1,100) > chance then doSendAnimatedText(getCreaturePosition(cid), "Miss!", 215) return false end if exhaustion.check(cid, 13117) == true then doPlayerSendCancel(cid, "Podera usar novamente dentro de 15 segundos.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end local tar = variantToNumber(var) if hasCondition(tar, CONDITION_MUTED) == true then return false else if isPlayer(tar) == true then doAddCondition(tar, condition) doSendAnimatedText(getCreaturePosition(tar), "Silenced!", 215) else doPlayerSendCancel(cid, "Silence can be cast only on other players.") return false end end exhaustion.set(cid, 13117, 15.0) return true end
-
139's post in (erro/bug) como consertar esse bug/visual da magia em target? was marked as the answerlocal combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 205) setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 1) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -99.0, 0, -190.5, 0) function onTargetCreature(cid, target) local position = {x=getThingPosition(target).x+1, y=getThingPosition(target).y+1, z=getThingPosition(target).z} doSendMagicEffect(position, 329) end setCombatCallback(combat1, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(cid, var) local waittime = 9 local storage = 99 if exhaustion.check(cid, storage) then doPlayerSendCancel(cid, "You are exhausted.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end for i = 1, 10 do addEvent(function() if isCreature(cid) and isCreature(variantToNumber(var)) then doCombat(cid, combat1, var) end end, ((i-1) * 300)) end exhaustion.set(cid, storage, waittime) return true end
-
139's post in [PEDIDO]Player é teleportado assim que tiver x porcentagem de HP em x area was marked as the answercreaturescripts.xml:
<event type="statschange" name="hpCheck" event="script" value="hpCheck.lua"/>
creaturescripts/scripts/hpCheck.lua:
local percentage = 50 local area1 = {x = x, y = y, z = z} -- canto superior esquerdo local area2 = {x = x, y = y, z = z} -- canto superior direito local area3 = {x = x, y = y, z = z} -- destino a ser teleportado local function getHpPercentage(cid) percent = 100 * getCreatureHealth(cid) / getCreatureMaxHealth(cid) percent = math.floor(percent) return(percent) end function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if getHpPercentage(cid) <= percentage then isInArea(getCreaturePosition(cid), area1, area2) then doTeleportThing(cid, area3, false) end end return true end
e no seu login.lua registre o evento:
registerCreatureEvent(cid, "hpCheck")
-
139's post in Spell em área que puxa agro dos monstros. was marked as the answerÉ só literalmente você pegar o script do exeta res (challenge) de qualquer OT e aumentar a área.
local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) local arr1 = { {1, 1, 1}, {1, 3, 1}, {1, 1, 1}, } local area = createCombatArea(arr1) setCombatArea(combat, area) function onTargetCreature(cid, target) return doChallengeCreature(cid, target) end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") function onCastSpell(cid, var) return doCombat(cid, combat, var) end
-
139's post in Item que Muda Outfit Do Summon was marked as the answerfunction onUse(cid, item, fromPosition, itemEx, toPosition) local demons = {"Demon1", "Demon2", "Demon3"} if #getCreatureSummons(cid) > 0 then for _, mid in pairs(getCreatureSummons(cid)) do if isInArray(demons, getCreatureName(mid)) then doCreatureChangeOutfit(mid, {lookType = 30, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}) return true end end doPlayerSendCancel(cid, "You dont have a demon summoned.") else doPlayerSendCancel(cid, "You have no summons.") end return true end
-
-
139's post in [OTX 8.60] Erro Portas Não Abrem was marked as the answerEntão, esse erro ocorre porque essa distro não tem a função isInArray nela.
Vai em data\lib\100-compat.lua e cola essa linha dentro:
isInArray = table.contains
-
139's post in [ACTION] Ajuda a colocar porcentagem de chance nessa tabela was marked as the answerCriei uma tabela de chance de acordo com o level e adaptei o código pra puxar a chance dela.
-
139's post in Spell Party com Bug was marked as the answerAdicionei o range,
-
139's post in oncastspell description creature not found was marked as the answerErro meu, tinha escrito o nome do combat errado.
Agora ta certo:
local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 34) setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 21) setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -38.0, 0, -38.5, 0) function onCastSpell(cid, var) for k = 0, 6 do addEvent(function() if isCreature(cid) then targ = getCreatureTarget(cid) if targ > 0 then doCombat(cid, combat1, numberToVariant(targ)) end end end, k*300) end return true end
-
139's post in (Resolvido)Alavanca so puxa se tiver 4 players! was marked as the answerTesta aí:
-
139's post in (Resolvido)[ajuda] ao matar monstro, um teleport aparece por 15 segundos was marked as the answerAlterei o script pra você poder adicionar quantos monstros quiser nele, ao invés de criar varias cópias.
Agora sobre o script não funcionar com o segundo monstro:
Confere se você registrou corretamente o evento desse script no .xml dele.
-
139's post in (Resolvido)Ajuda nesse Spell was marked as the answer@leozincorsair