Ir para conteúdo

jhon992

Conde
  • Total de itens

    631
  • Registro em

  • Última visita

  • Dias Ganhos

    12

Tudo que jhon992 postou

  1. local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) local msg = string.lower(msg) if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then if getPlayerVocation(cid) == 4 then selfSay('Hello ' .. creatureGetName(cid) .. '! What spell do you want to learn?') focus = cid talk_start = os.clock() else selfSay('Sorry, I sell spells for knights.') end elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'annihilation') and focus == cid then if pay(cid,170) then learnSpell(cid,'exori gran ico') else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'blood rage') and focus == cid then if pay(cid,170) then learnSpell(cid,'utito tempo') else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'brutal strike') and focus == cid then if pay(cid,170) then learnSpell(cid,'exori ico') else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'challenge') and focus == cid then if pay(cid,170) then learnSpell(cid,'exeta res') else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end end function onCreatureChangeOutfit(creature) end function onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end end
  2. jhon992

    Serve Save

    Editei ali em cima, vai mandar a msg após 3 segundos depois que o salve começa a ser executado, se quiser mais segundos troque o "3000" por +.
  3. luaDoAddPlayerBanishment -- bane o player, nem conhecia essa função, na lista que eu tenho aqui ela n se encontra. Onde eu vejo uma lista mais atualizada com a maioria das funções? Sem precisar procurar nas sources ou libs.
  4. Imagino que não tenha como banir apenas um char, pois os banimentos funcionam pela account.
  5. Tens que postar o script da bike para que alguem possa ajudar. Ou vai no seu script e procure por essa linha de comando "doChangeSpeed(cid, speed)" e almenta a quantidade de speed.
  6. jhon992

    Serve Save

    local config = { local config = { broadcast = {120, 30}, shallow = "no", delay = 120, events = 30 } config.shallow = getBooleanFromString(config.shallow) local function executeSave(seconds) if(isInArray(config.broadcast, seconds)) then local text = "" if(not config.shallow) then text = "[Auto Save]" else text = "O" end text = text .. " Serve irá salvar em " .. seconds .. " segundos, porfavor aguarde!" doBroadcastMessage(text) end if(seconds > 0) then addEvent(executeSave, config.events * 1000, seconds - config.events) else doSaveServer(config.shallow) addEvent(doBroadcastMessage, 3000, "[Auto Save] Dados salvo com sucesso!") end end function onThink(interval) if(table.maxn(config.broadcast) == 0) then doSaveServer(config.shallow) addEvent(doBroadcastMessage, 3000, "[Auto Save] Dados salvo com sucesso!") else executeSave(config.delay) end return true end Esse /\ éh pra aparecer a msg e para salvar a cada 5 hras, altera no globalevents.xml: <globalevent name="save" interval="18000" event="script" value="save.lua"/>
  7. Ja arrumei la emcima, só substituir o seu "addpremium" eo "removepremium".
  8. Vai em data/talkactions/scritps e duplica 3 arquivos, um renomeia para "addpremium", outro para "premiumcheck" e o ultimo "removepremium" todos sem as aspas. Agora no arquivo "addpremium" cole isso: function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local player = getPlayerByNameWildcard(tostring(t[1])) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.") return true end local pos = getCreaturePosition(player) local effect = 30 local days = tonumber(t[2]) doPlayerAddPremiumDays(player, days) doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "Voce recebeu "..days.." dia(s) premium.") doSendMagicEffect(pos, effect) return true end No arquivo "premiumcheck" cole isso: function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local player = getPlayerByNameWildcard(tostring(param)) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.." possui "..getPlayerPremiumDays(player).." dias de premium restantes.") return true end E no arquivo "removepremium" cole isso: function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") local player = getPlayerByNameWildcard(tostring(t[1])) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player nao existe.") return true end local pos = getCreaturePosition(player) local effect = 30 local days = tonumber(t[2]) doPlayerRemovePremiumDays(player, days) doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "Foi removido "..days.." dia(s) premium.") doSendMagicEffect(pos, effect) return true end E por último vai em data/talkactions/talkactions.xml e cole as tags: <talkaction words="/addpacc" access="6" event="script" value="addpremium.lua"/> <talkaction words="/premiumcheck" access="6" event="script" value="premiumcheck.lua"/> <talkaction words="/removepremium" access="6" event="script" value="removepremium.lua"/> Acho que é isso aew, nem testei, qualquer erro me avisa!
  9. tenta agora, modifiquei la em cima.
  10. tenta assim, nem testei: local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false local citypremium = { "Aramunhra", "Livingstar", "Molour", "Menutis" } -- nome das cidades que precisa ser premium para viajar function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) --if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Welcome ' .. creatureGetName(cid) .. '! I can take you to Aramunhra (250gps), Livingstar (220gps), Molour (200gps), Menutis (250gps), Seruse Bay (300gps), Amazonia (330gps) and that the hellish world of Draconia! (520gps)... Where do you want to go?') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() for i=1, #citypremium do if msgcontains(msg, tostring(citypremium[i])) and focus == cid then if isPremium(cid) == false then selfSay('Sorry, only premium players can travel to city.') focus = 0 talk_start = 0 end end end if msgcontains(msg, 'aramunhra') and focus == cid then if pay(cid,250) then selfSay('Let\'s go!') travel(cid, 1080, 488, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'livingstar') and focus == cid then if pay(cid,220) then selfSay('Let\'s go!') travel(cid, 1483, 2834, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'molour') and focus == cid then if pay(cid,200) then selfSay('Let\'s go!') travel(cid, 732, 640, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'menutis') and focus == cid then if pay(cid,250) then selfSay('Let\'s go!') travel(cid, 1608, 470, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'seruse bay') and focus == cid then if pay(cid,300) then selfSay('Let\'s go!') travel(cid, 1532, 1012, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'amazonia') and focus == cid then if pay(cid,330) then selfSay('Let\'s go!') travel(cid, 1137, 880, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'ice island') and focus == cid then if pay(cid,480) then selfSay('Let\'s go!') travel(cid, 1521, 1380, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'draconia') and focus == cid then if pay(cid,520) then selfSay('Let\'s go!') travel(cid, 781, 181, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if msgcontains(msg, 'evento') and focus == cid then if pay(cid,100) then selfSay('Let\'s go!') travel(cid, 649, 361, 6) focus = 0 talk_start = 0 else selfSay('Sorry, you don\'t have enough money.') talk_start = os.clock() end end if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then selfSay('Good Bye ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end end
  11. Nos seus scripts onde estiver: getPlayerPremium(cid) Troque por isso: isPremium(cid)
  12. @Maicondoze você deve ter feito algo errado na parte do itemlogin.lua, tenta refazer.
  13. Com esse script cada player morrera apenas uma vez ao passar por ele tile. Para morrer toda vez use assim: function onStepIn(cid, item, frompos, topos) if isPlayer(cid) == TRUE then doCreatureAddHealth(cid,-99999999) -- quantidade de vida player vai perder. doPlayerSendTextMessage(cid, 22, "Você foi morto!") end return TRUE end
  14. Troca por esse: function onSay(cid, words, param) local table, config = { toClose = {[9170] = 9169}, -- Coloque aqui os ids das portas seguindo o exemplo, a segunda tabela vai ser criada sozinha toOpen = {} }, { fromPos = {x=356,y=69,z=7}, toPos = {x=386,y=81,z=7} } for opened,closed in ipairs(table.toClose) do table.toOpen[closed] = opened end for x=config.fromPos.x, config.toPos.x do for y=config.fromPos.y, config.toPos.y do local doorPos = {x=x,y=y,z=config.fromPos.z} for stack=1,20 do doorPos.stackpos = stack for _,to in ipairs(table) do door = getThingFromPos(doorPos) if to[door.itemid] then doTransformThing(door.uid, to[door.itemid]) end end end end end return true end
  15. function onUse(cid, item, frompos, item2, topos) db1pos = {x=757, y=826, z=7, stackpos=1} -- posição item1 db2pos = {x=758, y=826, z=7, stackpos=1} -- 2 db3pos = {x=759, y=826, z=7, stackpos=1} -- 3 db4pos = {x=760, y=826, z=7, stackpos=1} -- 4 db5pos = {x=761, y=826, z=7, stackpos=1} -- 5 db6pos = {x=762, y=826, z=7, stackpos=1} -- 6 getpiece1 = getThingfromPos(db1pos) getpiece2 = getThingfromPos(db2pos) getpiece3 = getThingfromPos(db3pos) getpiece4 = getThingfromPos(db4pos) getpiece5 = getThingfromPos(db5pos) getpiece6 = getThingfromPos(db6pos) npcpos = {x=759, y=827, z=7} -- posição que sumonara o npc if item.uid == 7054 and item.itemid == 1945 and getpiece1.itemid == 10309 and getpiece2.itemid == 10310 and getpiece3.itemid == 10311 and getpiece4.itemid == 10312 and getpiece5.itemid == 10314 and getpiece6.itemid == 10315 then doRemoveItem(getpiece1.uid) doRemoveItem(getpiece2.uid) doRemoveItem(getpiece3.uid) doRemoveItem(getpiece4.uid) doRemoveItem(getpiece5.uid) doRemoveItem(getpiece6.uid) doTransformItem(item.uid,item.itemid+1) doCreateNpc('shenron', npcpos) elseif item.uid == 7054 and item.itemid == 1946 then doTransformItem(item.uid,item.itemid-1) else doPlayerSendTextMessage(cid,22,"You need right and left keys to transform key.") end return TRUE end
  16. se for sóh 2 itens poem assim: 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 itemID = 1234 -- id do item que sera removido local itemID2 = 5678 -- id do item que sera removido local quantRemove = 1 -- quantidade do item acima que sera removido local quantRemove2 = 5 -- quantidade do item acima que sera removido local storageGain = 5678 -- storage que o player vai ganhar quando o item for removido if (msgcontains(msg, 'yes') and getPlayerItemCount(cid, itemID) >= quantRemove and getPlayerItemCount(cid, itemID2) >= quantRemove2) then doPlayerRemoveItem(cid, itemID, quantRemove) doPlayerRemoveItem(cid, itemID2, quantRemove2) selfSay('MESAGEM QUE O NPC IRA FALAR AO REMOVER O ITEM AQUI ENTRE AS ASPAS.', cid) setPlayerStorageValue(cid, storageGain, 1) else selfSay('MESAGEM QUE O NPC IRA FALAR SE O PLAYER NÂO TIVER O ITEM AQUI ENTRE AS ASPAS.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  17. 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 itemID = 1234 -- id do anel local quantRemove = 1 -- quantidade do item acima que sera removido local storageGain = 5678 -- storage que o player vai ganhar quando o item for removido if (msgcontains(msg, 'yes') and doPlayerRemoveItem(cid, itemID, quantRemove)) then selfSay('MESAGEM QUE O NPC IRA FALAR AO REMOVER O ITEM AQUI ENTRE AS ASPAS.', cid) setPlayerStorageValue(cid, storageGain, 1) else selfSay('MESAGEM QUE O NPC IRA FALAR SE O PLAYER NÂO TIVER O ITEM AQUI ENTRE AS ASPAS.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  18. Vai no config.lua e procura por: showHealingDamage = true Poem true, o seu provavelmente esta false.
  19. cria outra linha identica embaixo desta: doCreateMonster("Demon", getPlayerLookPos(cid)) -- no lugar de demon, poem o nome do monstro desejado doCreateMonster("Demon", getPlayerLookPos(cid)) -- no lugar de demon, poem o nome do monstro desejado
  20. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 10, 28, 10, 29) local area = createCombatArea(AREA_CROSS7X7) setCombatArea(combat, area) function onCastSpell(cid, var) doCreatureAddHealth(getCreatureTarget(cid), math.random(900, 1000)) -- vai acertar no monstro que você ta atacando e tirar de 900 á 1000. doCombat(cid, combat, var) return TRUE end
  21. Vai em data/actions/scripts, duplica um arquivo e nomeia para "alavancamonster" sem as aspas e nele cole: function onUse(cid, item, fromPosition, itemEx, toPosition) local effect = 30 -- efeito que aparecera no player local pos = getPlayerPosition(cid) doSendMagicEffect(pos, effect) doCreateMonster("Demon", getPlayerLookPos(cid)) -- no lugar de demon, poem o nome do monstro desejado if (item.itemid == 1945) then doTransformItem(item.uid, item.itemid+1) elseif (item.itemid == 1946) then doTransformItem(item.uid, item.itemid-1) end return TRUE end Afora em data/actions/actions.xml cole a tag: <action actionid="2345" event="script" value="alavancamonster.lua"/> E na alavanca no seu server poem o actionid 2345.
  22. Vai em data/movements/scripts, duplica um arquivo e nomeia para "armatile" sem as aspas e nele cole: function onEquip(cid, item, position, fromPosition) pos = getCreaturePosition(cid) if (getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 123) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Não é possível usar o item nesta área.") return FALSE end return TRUE end Afora em data/movements/movements.xml cole a tag: <movevent type="Equip" itemid="2222" slot="ring" event="script" value="armatile.lua"/> Mude o slot na tag acima por um slot respectivo do item.
  23. Desculpa aew por falar action, viajei lgl asuhdauh. O script do @fireelemental deve funcionar certinho por dinheiro, usa ele.
  24. Não testei, mais deve funcionar. La vai: Vai em data/actions/scripts duplica um arquivo e nomeie para "tptype" sem as aspas e nele cole: function onStepIn(cid, item, pos) storageBattle = 102081 storageExausted = 102082 exaustedSeconds = 600 -- exausted em segundos if(exhaustion.check(cid, storageExausted) == TRUE) then if (exhaustion.get(cid, 102082) >= 60) then doPlayerSendCancel(cid, "Você só pode entrar no teleport após [" .. math.floor(exhaustion.get(cid, 102082) / 60 + 1) .."] minutos.") end if (exhaustion.get(cid, 102082) <= 60) then doPlayerSendCancel(cid, "Você só pode entrar no teleport após [" .. exhaustion.get(cid, 102082).."] segundos.") end return TRUE end if (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode usar com battle.") return TRUE end if (getCreatureSkullType(cid) > 0) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode usar com caveira.") return TRUE end if (getPlayerStorageValue(cid, 102081) <= 0) then setPlayerStorageValue(cid, 102081, 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Agora você está em modo pacífico.") exhaustion.set(cid, storageExausted, exaustedSeconds) else setPlayerStorageValue(cid, 102081, 0) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Agora você está em modo ofensivo.") exhaustion.set(cid, storageExausted, exaustedSeconds) end return TRUE end Depois vai em data/actions/actions.xml e cole a tag: <action actionid="2015" event="script" value="tptype.lua"/> Agora vai em data/creaturescripts/creaturescripts.xml e cole a tag: <event type="combat" name="CombatAttack" event="script" value="combat.lua"/> Vai em data/creaturescripts/scripts, duplica um arquivo, nomeia para "combat" sem as aspas e nele cole: function onCombat(cid, target) if getPlayerStorageValue(cid, 102081) > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não pode atacar.") return FALSE end return TRUE end E por último, abra o arquivo "login" na pasta data/creaturescripts/scripts e cole esta tag antes do último return true: registerCreatureEvent(cid, "CombatAttack") Só não esquece de com o mapa editor ir no teleport de sua preferencia e colocar o actionid = 2015.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...