-
-
Npc que cobra tp!
local STORAGE = 30023 -- Storage necessária para viajar local DESTINO = {x = 424, y = 400, z = 13} -- POSIÇÃO DE DESTINO -- Configurar Aqui local von = 2160 -- Id Do item que você deseja remover local dale = 100 -- Quantidade do item que voce deseja remover local txt = "Você não tem TAL ITEM" -- Colocar a resposta caso o jogador não tenha os itens -- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "reborn") then if (getPlayerStorageValue(cid,30023) ~= 4) and (getPlayerStorageValue(cid,43234) == 1) then if doPlayerRemoveItem(cid, von, dale) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) else selfSay(txt, cid) end elseif getPlayerStorageValue(cid,30023) == 4 then selfSay("Voce ja rebornou, vaza daqui fdp antes que eu retire seu Reborn!", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Npc que cobra tp!
Testa ai! local STORAGE = 30023 -- Storage necessária para viajar local DESTINO = {x = 424, y = 400, z = 13} -- POSIÇÃO DE DESTINO -- Configurar Aqui local von = 2160 -- Id Do item que você deseja remover local dale = 100 -- Quantidade do item que voce deseja remover local txt = "Você não tem TAL ITEM" -- Colocar a resposta caso o jogador não tenha os itens -- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "reborn") then selfSay("Já falou com a Bulma?, Tem Certesa Que Deseja Proceseguir ?.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if (getPlayerStorageValue(cid,30023) ~= 4) and (getPlayerStorageValue(cid,43234) == 1) then local player = Player(cid) if player:removeItem(von, dale) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, DESTINO) doSendMagicEffect(DESTINO, 10) else selfSay(txt, cid) end elseif getPlayerStorageValue(cid,30023) == 4 then selfSay("Voce ja rebornou, vaza daqui fdp antes que eu retire seu Reborn!", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
[PEDIDO] Meteoros
Não sei se é isso que você deseja mas testa ai. local combat = createCombatObject() local combat2 = createCombatObject() local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat1, COMBAT_PARAM_EFFECT, 36) local combat2 = createCombatObject() setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -10, -230, -9.40, -100) local stun = createConditionObject(CONDITION_PARALYZE) setConditionParam(stun, CONDITION_PARAM_TICKS, 2000) setConditionFormula(stun, -0.9, 1, -0.9, 1) setCombatCondition(combat1, stun) local stun = createConditionObject(CONDITION_PARALYZE) setConditionParam(stun, CONDITION_PARAM_TICKS, 3000) setConditionFormula(stun, -0.9, 1, -0.9, 1) setCombatCondition(combat2, stun) local meteor_water = createCombatObject() setCombatParam(meteor_water, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(meteor_water, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatFormula(meteor_water, COMBAT_FORMULA_LEVELMAGIC, -10, -300, -10.66, -100) arr = { {0, 0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 3, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0} } local combat_area = createCombatArea(arr) setCombatArea(combat, combat_area) local function meteorCast(p) doCombat(p.cid, p.combat, positionToVariant(p.pos)) end local function stunEffect(cid) doSendMagicEffect(getThingPos(cid), CONST_ME_STUN) end function onTargetTile(cid, pos) if (math.random(0, 0) == 0) then local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1}) if (isInArray(underWater, ground.itemid) == TRUE) then local newpos = {x = pos.x - 9, y = pos.y - 8, z = pos.z} addEvent(meteorCast, 100, {cid = cid, pos = pos, combat = meteor_water}) else local newpos = {x = pos.x - 9, y = pos.y - 8, z = pos.z} addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = combat2}) end end end function onTargetTile2(cid, pos) if (math.random(0, 6) == 1) then local ground = getThingfromPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 1}) if (isInArray(underWater, ground.itemid) == TRUE) then local newpos = {x = pos.x - 9, y = pos.y - 8, z = pos.z} doSendDistanceShoot(newpos, pos, 3) addEvent(meteorCast, 100, {cid = cid, pos = pos, combat = meteor_water}) else local newpos = {x = pos.x - 9, y = pos.y - 8, z = pos.z} doSendDistanceShoot(newpos, pos, 3) addEvent(meteorCast, 100, {cid = cid,pos = pos, combat = combat1}) end end end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") setCombatCallback(combat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2") function onCastSpell(cid, var) for i=1, 4 do doCombat(cid, combat, var) end return doCombat(cid, combat, var) end
-
-
Thensus Warrior reagiu a uma resposta no tópico: (Resolvido)Deixar runa ser usada apenas em si mesmo
-
(Resolvido)Deixar runa ser usada apenas em si mesmo
Fiz um improvisado aqui, estou sem tempo para verificar se esta funcionando, verifica ai e me avisa. data/actions/actions.xml <action itemid="ID DA RUNA" script="doubleHeal.lua"/> data/actions/scripts/doubleHeal.lua local storageCoolDown = 95555 local storageTime = 10 local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, 50) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) function onGetFormulaValues(cid, level, maglevel) min = (level * 3 + maglevel * 2.74) + 80 max = (level * 3 + maglevel * 3.8) + 120 return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onUse(player, item, fromPosition, target, toPosition, isHotkey) if target == player then if player:getStorageValue(storageCoolDown) < os.time() then player:setStorageValue(storageCoolDown, os.time() + storageTime * 1) local var = {type = 1, number = player:getId()} combat:execute(creature, var) addEvent(function() combat:execute(creature, var) end, 2*1000) else player:sendTextMessage(MESSAGE_STATUS_SMALL, "You must wait 10 seconds to use this rune again.") return false end else player:sendTextMessage(MESSAGE_STATUS_SMALL, "Can be used only on you.") end return true end
-
-
Script de Alavanca
Boa tarde, fiz um aqui porem não tive tempo para testar, verifica ai. data/actions/actions.xml <action fromaid="14561" toaid="14566" script="stones.lua" /> data/actions/scripts/stones.lua local posStone = { [14561] = Position(x,y,z), -- Posição da Pedra 1 [14562] = Position(x,y,z), -- Posição da Pedra 2 [14563] = Position(x,y,z), -- Posição da Pedra 3 [14564] = Position(x,y,z), -- Posição da Pedra 4 [14565] = Position(x,y,z), -- Posição da Pedra 5 [14566] = Position(x,y,z) -- Posição da Pedra 6 } local idStone = 1285 -- Id da Stone local function createStone(item, von, dale) Game.createItem(von, 1, dale) if item then item:transform(1945) end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 1945 then local tile = Tile(posStone[item.actionid]) local stone = tile:getItemById(idStone) if stone then stone:remove() item:transform(1946) addEvent(createStone(item, idStone, posStone[item.actionid]), 30*60*1000) end end return true end
-
Script action locktype
Tenta Assim então colega... local config = { [7737] = {7, 96, 214, 70, 23, 859, 857, 21}, [7739] = {220, 35, 244, 55, 91, 854, 855, 856, 13}, [9076] = {47, 237, 78, 257, 99, 854, 855, 856, 859, 857, 60} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local storage = 33330 -- Escolha a Storage do seu Agrado! local monsterNames = config[item.itemid] local condition = Condition(CONDITION_OUTFIT) local dale = monsterNames[math.random(#monsterNames)] condition:setOutfit(dale, dale) condition:setTicks(300*1000) if not monsterNames then return true end if player:getStorageValue(storage) < 1 then player:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'You will stay 5 minutes transformed in a monster!') player:addAchievementProgress('Masquerader', 100) item:getPosition():sendMagicEffect(36) player:addCondition(condition) player:setStorageValue(storage, 2) player:changeSpeed(40) addEvent(function() if player:getStorageValue(storage) == 2 then player:changeSpeed(-40) player:setStorageValue(storage, 0) end end, 300*1000) else player:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'You lost your monster disguise!') player:removeCondition(CONDITION_OUTFIT) player:setStorageValue(storage, 0) player:changeSpeed(-40) end return true end
-
Script action locktype
Testa assim amigo: local config = { [7737] = {'orc warrior', 'pirate cutthroat', 'dworc voodoomaster', 'dwarf guard', 'minotaur mage', 'ogre shaman', 'ogre brute', 'rat'}, [7739] = {'serpent spawn', 'demon', 'juggernaut', 'behemoth', 'ashmunrah', 'vexclaw', 'grimeleech', 'hellflayer', 'black sheep'}, [9076] = {'quara hydromancer', 'diabolic imp', 'banshee', 'frost giant', 'lich', 'vexclaw', 'grimeleech', 'hellflayer', 'ogre shaman', 'ogre brute', 'pig'} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local storage = 33330 -- Escolha a Storage do seu Agrado! local monsterNames = config[item.itemid] local condition = Condition(CONDITION_OUTFIT) condition:setOutfit(0, monsterNames[math.random(#monsterNames)]) condition:setTicks(300*1000) if not monsterNames then return true end if player:getStorageValue(storage) < 1 then player:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'You will stay 5 minutes transformed in a monster!') player:addAchievementProgress('Masquerader', 100) item:getPosition():sendMagicEffect(36) player:addCondition(condition) player:setStorageValue(storage, 2) player:changeSpeed(40) addEvent(function() if player:getStorageValue(storage) == 2 then player:changeSpeed(-40) player:setStorageValue(storage, 0) end end, 300*1000) else player:sendTextMessage(MESSAGE_STATUS_DEFAULT, 'You lost your monster disguise!') player:removeCondition(CONDITION_OUTFIT) player:setStorageValue(storage, 0) player:changeSpeed(-40) end return true end