Tudo que Storm postou
-
(Resolvido)Item Armadilha
@xMateuss È só mudar na XML para : -- <movevent type="StepIn" itemid="3202" event="script" value="tiles.lua"/>
-
(Resolvido)Item Armadilha
-- Movements ; registre na XML e no seu map editor ; -- <movevent type="StepIn" actionid="3202" event="script" value="tiles.lua"/> function onStepIn(cid, item, position, fromPosition) local pid = getCreaturePosition(cid) local monster_damage = -100 -- Quanto de HP o monster irá perder se pisar local monster_effect = 10 -- Efeito quando o monstro pisar no tile local level_max = 200 -- Level que irá começar a levar dano ao pisar no tile ; local player_damage = -100 -- Quanto de HP o player irá perder se pisar local player_effect = 10 -- Efeito quando o Player pisar no tile local player_mana = -100 -- Quanto de MANA o player irá perder se pisar if isMonster(cid) then doCreatureAddHealth(cid, monster_damage) doSendMagicEffect(pid, monster_effect) return true end if isPlayer(cid) then if getPlayerLevel(cid) >= level_max then doCreatureAddHealth(cid, player_damage) doCreatureAddMana(cid, player_mana) doSendMagicEffect(pid, player_effect) return true end return true end return true end
-
Item que recupera soul.
Fiz um creaturescripts onThink que a cada segundo verifica se o player tem o item e uma quantidade de soul menor que o limite ; -- CreatureScripts ; tag na XML = <event type="think" name="Soul" event="script" value="Soul.lua"/> -- Registre no Login.lua = registerCreatureEvent(cid, "Soul") function onThink(cid, interval) local max = 100 -- Máximo de soul local soul = 1 -- Quantidade de soul adicionada a mais ou menos 0.46 segundos local item = 4315 -- ID do item que precisa ser equipado local slot = CONST_SLOT_AMMO -- Slot que o item precisa ser equipado // no caso está no slot AMMO if not isPlayer(cid) then return true end if ( getPlayerSlotItem(cid, slot).itemid == item ) and getPlayerSoul(cid) <= max then doPlayerAddSoul(cid, soul) return true end return true end Na parte dos slots , eles podem ser ; CONST_SLOT_HEAD CONST_SLOT_NECKLACE CONST_SLOT_BACKPACK CONST_SLOT_ARMOR CONST_SLOT_RIGHT CONST_SLOT_LEFT CONST_SLOT_LEGS CONST_SLOT_FEET CONST_SLOT_RING CONST_SLOT_AMMO
-
Item que recupera soul.
A script de um item que recupera soul ; -- Action ; tag na XML = <action itemid="2200" event="script" value="SOUL.lua"/> function onUse(cid, item, fromPosition, itemEx, toPosition) local soul = 100 -- Quantidade de soul adicionada ao usar o item ; doPlayerAddSoul(cid, soul) doRemoveItem(item.uid, 1) return doPlayerSendTextMessage(cid, 15, "You receive ".. soul .." points") end
-
Item que recupera soul.
doPlayerAddSoul(cid, soul)
-
Alavanca com timer
function onUse(cid, item, fromPosition, itemEx, toPosition) local storage = 324566 local exaust = 15 if os.time() - getPlayerStorageValue(cid, storage) <= exaust * 60 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O Comando está em exaustão") return true end setPlayerStorageValue(cid, storage, os.time()) return true end
-
(Resolvido)ERRO Quando O Char Morrer n Entrar Mais
Isso ta acontecendo porque o lugar onde o player respawna não existe , ou seja , cheque as posições das cidades no seu Map Editor
-
(Resolvido)Salvar Vocation
@zLockey9 Coloquei para relogar o player e evitar esse problema ; function onUse(cid, item, frompos, item2, topos) if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!") return false else doPlayerSetVocation(cid, 14) doCreatureSay(cid, "Madara Owns!!", 19) doSendMagicEffect(getCreaturePosition(cid), 224) doRemoveCreature(cid) doCreatureChangeOutfit(cid, {lookType = 452}) setPlayerStorageValue(cid, 16200, 1) setPlayerStorageValue(cid, 300, (getPlayerVocation(cid))) doRemoveItem(item.uid) return true end return true end
-
Preciso de um script
@Cleiton Felipi Enfim , troque a storage para outro numero que não seja 12345 e teste. -- Movements -- Não esqueça de colocar o ActionID no tile no seu Map Editor -- Tag na XML = <movevent type="StepIn" actionid="48000" event="script" value="quest.lua"/> function onStepIn(cid, item, position, fromPosition) local storage = 34556 local effect = 3 local message = "Você não pode entrar nesse local" -- Entre aspas local pos = getCreaturePosition(cid) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, storage) >= 1 then doSendMagicEffect(pos, effect) doPlayerSendTextMessage(cid, 20, message) doTeleportThing(cid, fromPosition) return false end return true end
-
Preciso de um script
Script atualizada , erro resolvido ;
-
(Resolvido)Salvar Vocation
function onUse(cid, item, frompos, item2, topos) if getVocationInfo(getPlayerVocation(cid)).name == "Madara" then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce ja é um madara!") return false else doPlayerSetVocation(cid, 14) doCreatureSay(cid, "Madara Owns!!", 19) doSendMagicEffect(getCreaturePosition(cid), 224) doPlayerSave(cid) doCreatureChangeOutfit(cid, {lookType = 452}) setPlayerStorageValue(cid, 16200, 1) setPlayerStorageValue(cid, 300, (getPlayerVocation(cid))) doRemoveItem(item.uid) return true end return true end
-
Preciso de um script
-- Movements -- Não esqueça de colocar o ActionID no tile no seu Map Editor -- Tag na XML = <movevent type="StepIn" actionid="48000" event="script" value="quest.lua"/> function onStepIn(cid, item, position, fromPosition) local storage = 12345 local effect = 3 local message = "Você não pode entrar nesse local" -- Entre aspas local pos = getCreaturePosition(cid) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, storage) > 0 then doSendMagicEffect(pos, effect) doPlayerSendTextMessage(cid, 20, message) return false end return true end
-
[BUG] Sistema de refinamento!
Se eu não me engano essa script não tem a opção de refinar shields ;
-
[PEDIDO] NPC que teleporta que quer 10 items
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid -- local config = { topos = {x = 115, y = 200, z = 7}, itemid = 11695, count = 10 } local pos = getCreaturePosition(cid) if(msgcontains(msg, 'yes')) then if doPlayerRemoveItem(cid, config.itemid, config.count) then doTeleportThing(cid, config.topos) selfSay('Teleported!!', cid) doSendMagicEffect(pos, 5) else selfSay('You dont have '.. config.count ..' '.. getItemNameById(config.itemid) ..' . ', cid) doSendMagicEffect(pos, 2) return true end return true end end -- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Contagem Regressiva
function doShowTimeByPos(uid, pos, duration, type) type = type or 20 for i = 0, (duration - 1) do addEvent(function() if isCreature(uid) then doCreatureSay(uid, tostring(duration - i), type, false, 0, pos) end end, i * 1000) end return true end
-
Block Summon
Depende ; manda a tag da XML da spell que summona o monstro
-
Help Please Stone
-- Actions local olditens = {5435, 5215} -- Aqui dentro coloque os ids do set que irá se transformar local newitens = {2134, 2156} -- Aqui dentro coloque os ids do novo set que irá se transformar function onUse(cid, item, fromPosition, itemEx, toPosition) local pid = getCreaturePosition(cid) for _, check in ipairs(olditens) do if getPlayerItemCount(cid, check) > 0 then doPlayerRemoveItem(cid, check, 1) end end for _, id in ipairs(newitens) do doPlayerAddItem(cid, id, 1) end doSendMagicEffect(pid, 3) doPlayerSendTextMessage(cid, 13,"Itens Changeds") doRemoveItem(item.uid, 1) return true end
-
Erro de script
Posta o arquivo em Data/lib/004-Database
-
item que faz o palyer falar
function onUse(cid, item, fromPosition, itemEx, toPosition) local text = "olá , tchau" return doCreatureSay(cid, text, TALKTYPE_SAY) end
-
Aura 1 e 2 Mudanças
-- CONFIGURAÇÕES aurastr = 25950 -- storage da aura estr = 25951 -- storage para o exhaust porcentagem = 100 -- chance de curar em cada volta da aura, em porcentagem quantheal = 5 -- porcentagem do hp máximo que cada cura irá curar. (No caso, irá curar 5% do hp máximo cada cura) tempo = 1180 -- tempo para dar uma volta no player (este tempo foi o que achei mais agradável visualmente, é recomendável não mudar) tipoaura = 30 -- número do efeito da aura (efeito de distância, pode ser identificado com /x no jogo) efeitocura = 59 -- número do efeito quando a cura chega ao player (efeito de posição fixa, pode ser identificado com /z no jogo) -- Função que chama a aura function efeitosAura1(i,tm,cid) if(isCreature(cid)) then local atual = getCreaturePosition(cid) local posaura = { {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=atual.x, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=(atual.y)-1, z=atual.z}, {x=(atual.x)+1, y=atual.y, z=atual.z}, {x=(atual.x)+1, y=(atual.y)+1, z=atual.z}, {x=atual.x, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=(atual.y)+1, z=atual.z}, {x=(atual.x)-1, y=atual.y, z=atual.z}, } local chances = math.random(100) if(chances<=porcentagem/8) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/quantheal) if(i<=8 and i>1) then else end doSendMagicEffect(atual, efeitocura) local direito = {x = getCreaturePosition(cid).x - 2,y = getCreaturePosition(cid).y - 2, z = getCreaturePosition(cid).z} doSendMagicEffect(direito, efeitocura) end if(i<=8 and getPlayerStorageValue(cid, aurastr)==2) then i = i+1 tm = tempo/8 return addEvent(efeitosAura1,tm,i,tm,cid) elseif(i>8 and getPlayerStorageValue(cid, aurastr)==2) then return efeitosAura1(1,0,cid) else return TRUE end else return TRUE end end -- Função principal function onSay(cid, words, param, channel) if getPlayerStorageValue(cid, 89123) <= 0 then doPlayerSendCancel(cid, "Você precisa ter feito a quest.") return true end if getPlayerStorageValue(cid, 25943) == 2 then doPlayerSendCancel(cid, "Você precisa desativar sua aura level 2.") return true end if getPlayerStorageValue(cid, 27651) == 2 then doPlayerSendCancel(cid, "Você precisa desativar sua aura level 3.") return true end if getPlayerStorageValue(cid, 28911) == 2 then doPlayerSendCancel(cid, "Você precisa desativar sua aura level 4.") return true end if(param=="on") then if getPlayerStorageValue(cid, estr) > os.time() then doPlayerSendCancel(cid, "Espere "..(getPlayerStorageValue(cid, estr) - os.time()).." segundos para poder habilitar aura level 1 novamente.") else if(getPlayerStorageValue(cid, aurastr)==2) then doPlayerSendCancel(cid,"Sua Aura Level 1 já está habilitada.") elseif(getPlayerStorageValue(cid, aurastr)==-1) then doPlayerSendCancel(cid,"Aura Level 1 ligada!") setPlayerStorageValue(cid, aurastr, 2) efeitosAura1(1,tempo/8,cid) end end elseif(param=="off") then if(getPlayerStorageValue(cid, aurastr)== 2) then setPlayerStorageValue(cid, estr, os.time()+2) setPlayerStorageValue(cid, aurastr, -1) doPlayerSendCancel(cid,"Aura Level 1 desligada!") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Digite '!aura on' para ligar sua aura, e '!aura off' para desligá-la.") end return true end
-
Aura 1 e 2 Mudanças
È bem simples ; configure nessa parte (Configure as posições do lado que você quiser) local direito = {x = getCreaturePosition(cid).x - 2,y = getCreaturePosition(cid).y - 2, z = getCreaturePosition(cid).z} Código ;
-
Alavanca para TP de 1+ players
local config = { inicio = { player2 = {x = 123, y = 123, z =123}, player3 = {x = 456, y = 456, z =456}, player4 = {x = 789, y = 789, z =789} }, final = { player1 = {x = 666, y = 666, z =6}, -- Pos final do player que puxou a alavanca ; player2 = {x = 777, y = 777, z =7}, player3 = {x = 888, y = 888, z =8}, player4 = {x = 999, y = 999, z =9} } } function onUse(cid, item, fromPosition, itemEx, toPosition) doTeleportThing(cid, config.final.player1) doPlayerSendTextMessage(cid, 21, "Bem vindo") if ( isPlayer(getTopCreature(config.inicio.player2).uid) and getTopCreature(config.inicio.player2).uid >= 1 ) then doPlayerSendTextMessage(getTopCreature(config.inicio.player2).uid, 21, "Bem vindo") doTeleportThing(getTopCreature(config.inicio.player2).uid, config.final.player2) return true end if ( isPlayer(getTopCreature(config.inicio.player3).uid) and getTopCreature(config.inicio.player3).uid >= 1 ) then doPlayerSendTextMessage(getTopCreature(config.inicio.player3).uid, 21, "Bem vindo") doTeleportThing(getTopCreature(config.inicio.player3).uid, config.final.player3) return true end if ( isPlayer(getTopCreature(config.inicio.player4).uid) and getTopCreature(config.inicio.player4).uid >= 1 ) then doPlayerSendTextMessage(getTopCreature(config.inicio.player4).uid, 21, "Bem vindo") doTeleportThing(getTopCreature(config.inicio.player4).uid, config.final.player4) return true end return true end Lembrando que o player que puxar a alavanca já será teleportado ;
-
Aura 1 e 2 Mudanças
No caso sairia apenas o efeito /z 59 e a aura em torno do personagem não ?
-
Skill em Monster
Em spells.XML fica assim ; <instant name="Nome_da_Spell" words="Nome_da_Spell" allowfaruse="1" lvl="65" mana="120" direction="1" prem="0" exhaustion="1000" blocktype="all" enabled="0" script="Nome_do_Arquivo.lua"> <vocation id="0"/> </instant> Na XML do monstro fica assim ; <attack name="Nome_da_Spell" interval="4000" chance="20" target="1" min="-3300" max="-4500"> </attack>
-
eu quero script! bpssa trabalho 100%
Não entendi ... qual mudança quer na script ?