Ir para conteúdo

jhon992

Conde
  • Total de itens

    631
  • Registro em

  • Última visita

  • Dias Ganhos

    13

Tudo que jhon992 postou

  1. jhon992

    Weapon Script.

    Primeiro em data/creaturescripts/scripts, cria um arquivo chamado "health_level" sem as aspas e nele cole: local storage = 3456 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if isPlayer(attacker) then if getPlayerStorageValue(attacker, storage) > 0 then doCreatureAddHealth(attacker, getPlayerLevel(attacker)*2) end end end return true end function onCombat(cid, target) if isPlayer(cid) then registerCreatureEvent(target, "healthLevel") end return true end Agora no creaturescripts.xml as tags: <event type="statschange" name="healthLevel" event="script" value="health_level.lua"/> <event type="combat" name="healthHit" event="script" value="health_level.lua"/> E no login.lua, antes do último return true põe: registerCreatureEvent(cid, "healthHit")
  2. @20cm, aparece algum erro no executável? Coloca-se as tags no creaturescripts.xml e no login.lua e o nome do script coloca-se attackvocation?
  3. Reformulei a parte de ip, não tenho certeza se vai funcionar pois não testei mais ficou assim: local playersNeeded = 10 local ipsNeeded = 6 local minimumLevel = 150 local storageId = 47578 local pointsForPlayer = 10 local function sendPlayersList(cid, list) for i, pid in ipairs(list) do local level = getPlayerLevel(pid) < minimumLevel and " - " .. getPlayerLevel(cid) .. " level " or "" local valid = getCreatureStorage(pid, storageId) > 1 and " - already received!" or "" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. level) end end function onSay(cid, words, param, channel) if(getPlayerGuildLevel(cid) == 3) then local leaderGuild = getPlayerGuildId(cid) local players = getPlayersOnline() local guildMembersValid = {} local guildMembersInvalid = {} for i, pid in ipairs(players) do if(leaderGuild == getPlayerGuildId(pid)) then if(getPlayerLevel(pid) >= minimumLevel and tonumber(getCreatureStorage(pid, storageId)) < 2) then table.insert(guildMembersValid, pid) else table.insert(guildMembersInvalid, pid) end end end if(#guildMembersValid >= playersNeeded) then local IPs = {} for i=1, #guildMembersValid do local ip = getPlayerIp[guildMembersValid[i]] if not isArray(ip, IPs) then table.insert(IPs, ip) end end end if(#IPs >= ipsNeeded) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Players that received points:") sendPlayersList(cid, guildMembersValid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Players that did not receive points:") sendPlayersList(cid, guildMembersInvalid) local accounts = {} for i, pid in ipairs(guildMembersValid) do table.insert(accounts, getPlayerAccountId(pid)) doCreatureSetStorage(pid, storageId, os.time()) end db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+" .. pointsForPlayer .. " WHERE `id` IN (" .. table.concat(accounts, ',') .. ");") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, #guildMembersValid .. " players from your guild are valid (" .. playersNeeded .. " required), but you have together only " .. #IPs .. " IPs (" .. ipsNeeded .. " required)") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Valid players:") sendPlayersList(cid, guildMembersValid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid players:") sendPlayersList(cid, guildMembersInvalid) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, #guildMembersValid .. " players from your guild are valid, " .. playersNeeded .. " required. Minimum level required is " .. minimumLevel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Valid players:") sendPlayersList(cid, guildMembersValid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid players:") sendPlayersList(cid, guildMembersInvalid) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only guild leader can request points.") end return true end Caso erro, fale que tento arrumar
  4. Sinceramente, não vejo nada que possa ser feito qualquer linguagem que não possa ser feito em Java... Sem falar que Java é uma das linguagens mais usadas em todo mundo, onde pode se fazer desde um simples aplicativo até um sistema super robusto. Pode procurar em qualquer rank de linguagem mais usada, que Java esta antes de C++, VB e Delphi. Põe Java no projeto que eu participo de certeza.
  5. jhon992

    Weapon Script.

    Da pra usar essa mesma função. local storage = 3456 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if isPlayer(attacker) then if getPlayerStorageValue(attacker, storage) > 0 then doCreatureAddHealth(attacker, getPlayerLevel(attacker)*2) end end end return true end
  6. @Gustavo, uma ótima indicação como desenvolvedor Lua, com toda certeza seria o Vodkart.... - Não acredito que não colocaram programação Java no XDev, deu té desanimo agora.
  7. @Derlexy, a variável que defini isso é "chance" tanto no primeiro quanto no segundo script, mas não aconselho a mudá-la porque fiz vários testes para poder deixar o mais balanceado possível. Então se deseja que o item dure mais, simplesmente adicione mais pontos de durabilidade nele no arquivo "039-durabilidade".
  8. local config = { stone_id = 391, -- id da stone position_stone = {x=2456,y=2466,z=7, stackpos=1}, -- x,y,z põe as posições em que criara a pedra seconds = 20 } function onUse(cid, item, frompos, item2, topos) if getThingfromPos(config.position_stone).uid > 0 then doRemoveItem(getThingfromPos(config.position_stone).uid) doPlayerSendTextMessage(cid, 23, "Você precisa passar em "..(config.seconds).." segundos, senão a pedra nascerá novamente!") addEvent(createStone, config.seconds*1000) end if item.itemid == 1945 then doTransformItem(item.uid,item.itemid+1) else doTransformItem(item.uid,item.itemid-1) end return true end function createStone() doCreateItem(config.stone_id, 1, config.position_stone) end
  9. Vai em data/actions/scripts, duplica um arquivo e nomeia para "remove_stone" nele cola: function onUse(cid, item, frompos, item2, topos) local position_stone = {x=2456,y=2466,z=7, stackpos=1} -- x,y,z põe as posições em que criara a pedra if getThingfromPos(position_stone).uid > 0 then doRemoveItem(getThingfromPos(position_stone).uid) end if item.itemid == 1945 then doTransformItem(item.uid,item.itemid+1) else doTransformItem(item.uid,item.itemid-1) end return true end No actions.xml cola a tag: <action actionid="2041" event="script" value="remove_stone.lua"/> Agora com o Mapa Editor, vai na alavanca e põe o actionid 2041 nela.
  10. Nem analisei teu direito e vi que não ia funcionar então criei o meu. E agora que fui olhar seu script que percebi que a única coisa que falta no teu script é a "msg" ali que não vai funcionar. E ja que criei o script tbm, pra não perder o post em vão, ta ele ai: Vai em data/movements/scripts, duplica um arquivo e nomeia para "stone_tile" sem as aspas e nele cole: local stone_id = 391 -- id da stone local position_stone = {x=2456,y=2466,z=7, stackpos=1} -- x,y,z põe as posições em que criara a pedra function onStepIn(cid, item, topos) if isPlayer(cid) then if getThingfromPos(position_stone).uid > 0 then doRemoveItem(getThingfromPos(position_stone).uid) end doCreateItem(stone_id, 1, position_stone) end return true end Em movements.xml cole a tag: <movevent type="StepIn" actionid="20302" event="script" value="stone_tile.lua"/> E por último basta por o actionid 20302 no tile do seu server, com o Mapa Editor.
  11. @Reportado, área errada. O correto seria Pedidos e dúvidas - Programação. --------------------------------- Relacionado a dúvida: Se você quer mudar só algum nome como de skills, basta abrir pelo Notepad++, procurar pelo nome do skill e trocar.
  12. local runa = 2394 local msg = "Equipe a %s na mão, para poder atirar." local attackmin, attackmax = 300, 340 -- attack minimo, attack maximo local ring = { -- [iddoitemnoslotdoring] = acrescimonohit [1234] = 30, [1235] = 50 } function onCastSpell(cid, var) local left, right = getPlayerSlotItem(cid, CONST_SLOT_LEFT), getPlayerSlotItem(cid, CONST_SLOT_RIGHT) if not isInArray({left.itemid, right.itemid}, runa) then return doPlayerSendCancel(cid, msg:format(getItemNameById(runa))) end if doPlayerRemoveItem(cid, 2543, 1) then -- troque pelo id da bolt target = getCreatureTarget(cid) if (target <= 0) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Selecione um target.") return false end hit = (math.random(attackmin,attackmax) + getPlayerSkillLevel(cid, SKILL_DISTANCE) / 3) if ring[getPlayerSlotItem(cid, CONST_SLOT_RING).itemid] then hit = hit + ring[getPlayerSlotItem(cid, CONST_SLOT_RING).itemid] end doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hit, -hit, CONST_ME_MORTAREA) doSendDistanceShoot(getCreaturePos(cid), getCreaturePos(target), CONST_ANI_BOLT) return true else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não possui balas.") end return false end @Edited: - Arrumado.
  13. Eu vou ajudar s. kk Olha com oque eu vou te passar provavelmente removera a criação de char com o mesmo nome, mais não resolvera em nada a busca no site. Primeiro vou te passar os scripts e depois digo como funciona! Em data/creaturescripts/scripts, crie um arquivo chamando "loginName" sem as aspas e nele cole: function onLogin(cid) local name = db.getResult("SELECT `name` FROM `players` WHERE `group_id` <= 2;") local change_minutes = 3 -- quantos minutos para o nome ser trocado, antes que seja trocado altomaticamente. repeat if name:getID() == -1 then break end name_now = name:getDataString("name") if getCreatureName(cid) == string.sub(name_now, 7) then if getPlayerStorageValue(cid, 59831) <= 0 then setPlayerStorageValue(cid, 59832, 60*change_minutes+os.time()) setPlayerStorageValue(cid, 59831, 1) end if ((getPlayerStorageValue(cid, 59832)-os.time())/60) > 0 then addEvent(changeName, 1000*(getPlayerStorageValue(cid, 59832)-os.time())) local str = "Perigo, seu nome ja existe. Troque ele usando o comando: !name NomeQueVoceQuiser".."\n" str = str.."Você tem ".. ((getPlayerStorageValue(cid, 59832)-os.time())/60) .." minutos para trocar, caso não troque o nome sera trocado altomaticamente." doPlayerPopupFYI(cid,str) else changeName(cid) end end until name:next() == false return true end function changeName(cid) if isPlayer(cid) and getPlayerStorageValue(cid, 59831) > 0 then local param = {"Sir ","Warrior ","Guadiator ","Mister "} -- nome que ira para frente do jogador, caso ele não o troque. local name = getCreatureName(cid) local nome = getPlayerGUID(cid) local new_name = param[math.random(1,#param)]..name local name = db.getResult("SELECT `name` FROM `players` WHERE `group_id` <= 2;") local cont = 0 repeat if name:getID() == -1 then break end name_now = name:getDataString("name") if name_now == new_name then cont = cont+1 break end until name:next() == false if cont > 0 then changeName(cid) else db.executeQuery("UPDATE `players` SET `name` = '"..new_name.."' WHERE `id`= " .. nome .. ";") setPlayerStorageValue(cid, 59831, 0) addEvent(doRemoveCreature, 100, cid) end end return true end No creaturescripts.xml cole a tag: <event type="login" name="LoginName" script="loginName.lua"/> Agora em data/talkactions/scripts, crie um arquivo chamado "changeName" sem as aspas e nele cole: -- Creditos a Won Helder, apocarai, MatheusMkalo function onSay(cid, words, param) local maxLen = 25 -- tamanho maximo do nome local proibido = {"%[", "%]", "%(", "%)", "%{", "%}"} -- simbolos proibidos if getPlayerStorageValue(cid, 59831) > 0 then for i = 1, #proibido do if param:find(proibido[i]) then doPlayerSendCancel(cid,"Você não pode colocar isso no nome.") return true end end if tostring(param) == "" then -- checkar se não é nome vazio doPlayerSendCancel(cid, "Você deve informar um nome.") return true end if string.len(tostring(param)) > maxLen then doPlayerSendCancel(cid, "Você pode usar no máximo " .. maxLen .. " letras.") return TRUE end local result = db.getResult("SELECT `id` FROM `players` WHERE `name` = '".. db.escapeString(param) .."'") if result:getID() == 1 or getCreatureByNameWildcard(param) then return doPlayerSendCancel(cid, "Já existe alguém com esse nome.") end local result = db.getResult("SELECT `id` FROM `players` WHERE `name` = '[VIP] ".. db.escapeString(param) .."'") if result:getID() == 1 or getCreatureByNameWildcard(param) then return doPlayerSendCancel(cid, "Um jogador vip ja possui este nome.") end setPlayerStorageValue(cid, 59831, 0) db.executeQuery("UPDATE `players` SET `name` = '"..param.."' WHERE `id` = "..getPlayerGUID(cid)..";") doPlayerSendTextMessage(cid,25,"Você será deslogado em 3 segundos.") addEvent(doRemoveCreature, 3*1000, cid, true) end return TRUE end Na talkactions.xml poe a tag: <talkaction words="!name" event="script" value="changeName.lua"/> ------------------------------------------------------------------------------------------- Vai funcionar da seguinte maneira, você ainda vai poder criar o char com o mesmo nome do cara vip só que ao logar aparecera uma mensagem na tela dizendo que esse nome ja existe e que voce tem alguns minutos para trocalo usando o comando "!name NovoNome" e se não trocar o seu nome troca altomaticamente apos alguns minutos.
  14. Creio que não tenha nada a ver com o script. Ve se em algum creaturescript "onDeath", "prepareDeath" ou "onLogin" tem algum setPlayerStamina ou um doPlayerAddStamina, se tiver, remova, se não tiver então não sei onde pode ser o problema.
  15. Por condition ficaria assim: local outfit = {lookType = 67} -- outfit da transformação. local tempo = 60 -- tempo de duração em segundos. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 40000) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 130) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 130) setConditionParam(condition, CONDITION_PARAM_BUFF, true) setCombatCondition(combat, condition) local sys = createConditionObject(CONDITION_OUTFIT) setConditionParam(sys, CONDITION_PARAM_TICKS, tempo*1000) addOutfitCondition(sys, outfit) setCombatCondition(combat, sys) function onCastSpell(cid, var) return doCombat(cid, combat, var) end
  16. Vai em data/globalevents/scripts, cria um arquivo chamado "stamina" sem as aspas e nele cole: function onThink(interval, lastExecution, thinkInterval) local stamina = db.getResult("SELECT `id`, `stamina` FROM `players` WHERE `group_id` <= 2;") local stamina_hour = 3600000 -- 1 hra de stamina, o tempo é calculado em milesegundos. Exemplo: 1 min = 600000 mileseg. repeat if stamina:getID() == -1 then break end id, stamina_now = stamina:getDataInt("id"), stamina:getDataInt("stamina") if stamina_now < 151200000 then stamina_verifica = 151200000 - stamina_now if stamina_verifica < stamina_hour then db.executeQuery("UPDATE `players` SET `stamina` = '"..stamina_now+stamina_verifica.."' WHERE `id` == '"..id.."';") else db.executeQuery("UPDATE `players` SET `stamina` = '"..stamina_now+stamina_hour.."' WHERE `id` == '"..id.."';") end end until stamina:next() == false return true end Agora em globalevents.xml a tag: <globalevent name="stamina" interval="1800" event="script" value="stamina.lua"/> O interval no xml é o tempo em segundos para executar o script. O script funciona da seguinte maneira, cada vez que ele executar esta configurado no stamina.lua para ser adicionado 1 hra de stamina pra quem ta offline. Caso seu pedido tenha sido resolvido, reporte para um moderador clicando em "Denunciar" logo abaixo do post para que o tópico seja movido para resolvidos.
  17. @gahgah, não conheço nada parecido com isso de bloquiar alto reconnect =/ Creio que a dúvida principal do tópico tenha sido resolvida então estou reportando o tópico para que seja movido para Resolvidos.
  18. local trainerNames = {"Training Monk","Trainer"} -- põe o nome de todo tipo de trainer do seu servidor. function onThink(interval, lastExecution) for x=1,#getOnlinePlayers() do if getPlayerAccess(getCreatureByName(getOnlinePlayers()[x])) < 4 and (not isPlayerPzLocked(getCreatureByName(getOnlinePlayers()[x]))) and getOnlinePlayers()[x] ~= "Account Manager" and (not isInArray(trainerNames, getCreatureName(getCreatureTarget(cid)))) then if getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564) == -1 then local numero = math.random(0,99999) doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Anti-bot system by Antharaz. Seu número de confirmação anti-bot é: '..numero..'. Por favor digite !anthaab XXXXX onde XXXXX é seu número de confirmação.') setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9564,numero) elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == -1 then setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,1) doPlayerSendTextMessage(getCreatureByName(getOnlinePlayers()[x]), MESSAGE_STATUS_WARNING, 'Último aviso. Confirme seu número gerado pelo sistema anti-bot pelo comando !anthaab ou você será teleportado ao templo.') elseif getPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565) == 1 then doTeleportThing(getOnlinePlayers()[x], getTownTemplePosition(getPlayerTown(getOnlinePlayers()[x]))) setPlayerStorageValue(getCreatureByName(getOnlinePlayers()[x]),9565,-1) end end end return TRUE end Caso sua dúvida tenha sido resolvida, use o "Denunciar" abaixo do post para reportar o tópico fazendo assim com que ele seja movido para área de Pedidos Atendidos, deixando a comunidade mais limpa e organizada.
  19. Isso é em duvida de website, da uma olhadinha la. Vou até pedir para moverem o tópico.
  20. Não é login, é config mesmo eu que me enganei. O erro deve estar no site então, na hora de adicionar a city no player criado.
  21. Tens quanto de dinheiro pra investir? Compra um PC novo!
  22. Vou te dar uma solução não é aconselhavel, caso cause lag no servidor tire-o. Esse script vai salvar o próprio player a cada meio segundo. Vai em data/creaturescripts/scripts, cria um arquivo e nomeia pra "playersave", sem as aspas e nele cole: function onThink(cid, interval) doPlayerSave(cid, true) return true end Em creaturescripts.xml poe a tag: <event type="think" name="PlayerSave" event="script" value="playersave.lua"/> E no login.lua, antes do último return true: registerCreatureEvent(cid, "PlayerSave")
  23. jhon992

    Save All

    Tente usar isso, quem sabe resolva: http://www.xtibia.com/forum/topic/141846-solucao-para-clone-items/
  24. Com o Map Editor você deve configurar uma nova cidade. Não lembro certinho como faz, mais basta abrir seu mapa com o Map Editor depois em alguma aba acima basta achar a opção de criar nova Town, dae você poe o nome e id da town se não me engano. Depois no seu login.lua você deve configurar essa parte > newPlayerTownId = 1 < com o id da cidade que você criou.
  • Quem Está Navegando   0 membros estão online

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