Ir para conteúdo

Rusherzin

Membro
  • Registro em

  • Última visita

Tudo que Rusherzin postou

  1. @Mirkaan, eu consigo pensar em uma alternativa: criar um creaturescript com o callback onCombat. Vou deixar aqui abaixo o que acredito ser a forma correta, porém não cheguei a testar se está realmente funcional. function onCombat(cid, target) if isMonster(target) and isMonster(cid) then return false end return true end <event type="combat" name="MonsterAttackEachOther" event="script" value="monsterAttackeEachOther.lua"/> E dentro do arquivo XML de cada monstro que tem ataque em área tu queria que colocar isso: <script> <event name="MonsterAttackEachOther"/> </script>
  2. Esqueci de retornar falso quando não der certo, pera. function onCastSpell(cid, var) local itemsToCombine = {{itemid=2160, qtd=1}, {itemid=2152, qtd=1}} local itemResult = {itemid=2155, qtd=1} for i=1, #itemsToCombine do if (getPlayerItemCount(cid, itemsToCombine[i].itemid) < itemsToCombine[i].qtd) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) doPlayerSendTextMessage(cid, 27, "Você precisa de "..itemsToCombine[i].qtd.." "..getItemNameById(itemsToCombine[i].itemid)..".") return false end if (i == #itemsToCombine) then for i=1, #itemsToCombine do doPlayerRemoveItem(cid, itemsToCombine[i].itemid, itemsToCombine[i].qtd) end doPlayerAddItem(cid, itemResult.itemid, itemResult.qtd) return doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE) end end return true end
  3. @kinomoto, a única maneira que consigo pensar é tu fazer uma magia normal e checar se o cara tem os itens quando ele usa ela. Exemplo: function onCastSpell(cid, var) local itemsToCombine = {{itemid=2160, qtd=1}, {itemid=2152, qtd=1}} local itemResult = {itemid=2155, qtd=1} for i=1, #itemsToCombine do if (getPlayerItemCount(cid, itemsToCombine[i].itemid) < itemsToCombine[i].qtd) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return doPlayerSendTextMessage(cid, 27, "Você precisa de "..itemsToCombine[i].qtd.." "..getItemNameById(itemsToCombine[i].itemid)..".") end if (i == #itemsToCombine) then for i=1, #itemsToCombine do doPlayerRemoveItem(cid, itemsToCombine[i].itemid, itemsToCombine[i].qtd) end doPlayerAddItem(cid, itemResult.itemid, itemResult.qtd) return doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE) end end return true end Não testei o código, mas creio que funcione.
  4. local bonus = {{0, 1, 2}, {1, 2, 1.75}, {2, 3, 1.5}, {3, 4, 1.25} } function onUse(cid, item, frompos, item2, topos) for k, v in pairs(bonus) do if getPlayerSkillLevel(cid,3) >= v[1] and getPlayerSkillLevel(cid,3) <= v[2] then return doCreatureAddMana(cid, mana / v[3]) end end end
  5. Não tenho certeza se entendi exatamente o que tu queria fazer, mas testa com esse código. local function setBagAttribute(cid, item, set) if (not item.uid) then return false end if (not doRemoveItem(item.uid, 1)) then return false end local item = doPlayerAddItem(cid, item.itemid) doItemSetAttribute(item, "description", (set==1 and "[Set Bag Vazia]" or "[Set Bag Cheia]")) return doItemSetAttribute(item, "used", set) end function onUse(cid, item, frompos, item2, topos) local itemids = { [1] = 2498, -- cabeça [4] = 2492, --- armor [5] = 2520, --- direita [6] = 7404, -- esquerda [7] = 2470, -- legs [8] = 11113 --boots } local storage = 73182 --- storage que vai ser usada pra salvar se o player já usou ou não local outfit = 351 -- outfit que vai dar if (getItemAttribute(item.uid, "used") == 1) then for v,k in pairs(itemids) do if (getPlayerItemCount(cid, k) <= 0) then return doPlayerSendTextMessage(cid, 27, "Precisa ter todos os itens para transformar em bag!") end end for v,k in pairs(itemids) do doPlayerRemoveItem(cid, k, 1) end setPlayerStorageValue(cid, storage, 0) doRemoveCondition(cid, CONDITION_OUTFIT) return setBagAttribute(cid, item, 0) end for v,k in pairs(itemids) do doPlayerAddItem(cid, k, 1) end setPlayerStorageValue(cid, storage, 1) doSetCreatureOutfit(cid, {lookType = outfit}, -1) doPlayerSendTextMessage(cid, 27, "O full set foi criado na sua mochila!") return setBagAttribute(cid, item, 1) end
  6. Posta o que tu fez que supostamente dá para "clonar" que eu te ajudo.
  7. Rusherzin postou uma resposta no tópico em Formação de Equipe
    Nome: Anderson Skype: anderson.altstaff Idade: 19 Opinião: O servidor parece okay, mapa diferente do que geralmente é usado na maioria dos NTOs (o que já é muito bom) e pelo visto também tem sistemas diferentes. O que eu faria para melhorá-lo é tentar acrescentar ideias e opinar nas configurações de futuros sistemas, tendo certeza de que está balanceado, não só entre as vocações como em questão de hunts, quests e etc. Motivo/Carga: De forma primordial, tenho uma certa disponibilidade de tempo no momento e gosto de reservar uma parte dela para desenvolver/programar, porém não tenho muitas ideias e projetos próprios no momento, então ando procurando equipes precisando de membros. Sobre o cargo, sei fazer scripts em LUA, tanto com arquivos "separados" quanto com MODS e também sei programar em PHP e Javascript.
  8. Nos últimos dias tive problemas para ler os dados de funções que retornam tabelas (não tinha acesso a source da função no momento para ir checar quais eram os dados presentes) então resolvi fazer essa função bem simples para printar os dados das tabelas no console. Ela faz basicamente a mesma coisa que a função print_r do PHP só que é um pouquinho menos organizada. Enfim, se souber a estrutura de uma tabela, vai entender o output dessa função e vai ser bem útil. function print_r(tabela) if type(tabela) ~= "table" then return tabela end local result = "{" for ind, x in pairs(tabela) do x = (type(x) == "table") and print_r(x) or x..(ind==#tabela and "\n" or ",\n ") result = result..'['..ind..'] = '..x end return result.."}" end Um exemplo de uso aleatório seria: - Tu está trabalhando com uma função que retorna um array e ele é assim: {7, 6, 5, 4, 3, {"hi", "bye"}, "great"} (só que tu não sabes, óbvio), então tu usa a função print_r na função que retorna esse array e o resultado será assim no console:
  9. Consegui arrumar um tempo para tentar fazer agora pela manhã, tenta assim: <globalevent name="TopFragger" interval="5" script="monthlyfragger.lua" /> function addItemToDepot(cid, item, count) local items = {item} local count = (count>1) and {count} or {1} for a,b in ipairs(items) do local pid = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..cid.." AND `itemtype` = 2589 ORDER BY `sid` DESC LIMIT 1"):getDataInt("sid") local sid = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..cid.." AND `itemtype` = 2594 AND `pid` = "..pid.." ORDER BY `sid`"):getDataInt("sid") local newsid = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..cid.." ORDER BY `sid` DESC LIMIT 1"):getDataInt("sid")+1 return db.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..cid..","..newsid..","..sid..","..b..","..count[a]..",'')") or false end end local hora = 22 -- pode ser de 0 (meia-noite) do último dia do mês até 24, que seria meia noite do primeiro dia do próximo mês function onThink(cid, interval) local gStorage = 56661 if(os.date("%m", os.time()+(3600 * 24-hora)) ~= os.date("%m") and os.time() >= getGlobalStorageValue(gStorage)) then local period = 86400 * 30 local fraggers = db.getResult("SELECT `p`.`id`, COUNT(*) `kills` FROM `player_killers` pk LEFT JOIN `killers` k ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` WHERE `k`.`unjustified` = 1 AND `pd`.`date` >= "..(os.time()-period).." GROUP BY `p`.`id` ORDER BY `kills` DESC") local fragrank = {} local reward = {2160, 1} -- id do item e quantidade if(fraggers:getID() ~= -1) then repeat table.insert(fragrank, {id=fraggers:getDataInt("id"), frags=fraggers:getDataInt("kills")}) until not fraggers:next() fraggers:free() end if(fragrank[1]) then local playeron = false local playercid = nil for _, pid in ipairs(getPlayersOnline()) do if getCreatureName(pid) == getPlayerNameByGUID(fragrank[1].id) then playeron = true playercid = pid end end if(playeron) then doPlayerAddItem(playercid, reward[1], reward[2]) doBroadcastMessage(getPlayerNameByGUID(fragrank[1].id).." foi o jogador com mais frags no mês.") setGlobalStorageValue(gStorage, os.time()+2590000) else if(addItemToDepot(fragrank[1].id, reward[1], reward[2]) ~= false) then doBroadcastMessage(getPlayerNameByGUID(fragrank[1].id).." foi o jogador com mais frags no mês.") setGlobalStorageValue(gStorage, os.time()+2590000) end end end end return true end Obs: Em vez de apagar os frags do servidor, estou levando em conta apenas os que aconteceram no último mês.
  10. Configurou a tabela de forma errada. E sim, botei efeito, só mudar na variável: local posToBe = {x=1001, y=904, z=7} local effect = 45 local posToGo = { ["konoha"] = {x=894, y=831, z=7}, ["south florest"] = {x=911, y=1179, z=7}, ["suna"] = {x=563, y=1144, z=7}, ["south island"] = {x=1086, y=1397, z=7}, ["ilhazinha"] = {x=1100, y=1531, z=7}, ["mist"] = {x=1145, y=1218, z=7}, ["south desert"] = {x=1495, y=1052, z=7} } function onSay(cid, words, param) local playerpos = getCreaturePosition(cid) if(playerpos.x ~= posToBe.x or playerpos.y ~= posToBe.y or playerpos.z ~= posToBe.z) then return end if(posToGo[string.lower(words)]) then doTeleportThing(cid, posToGo[string.lower(words)], true) doSendMagicEffect(getCreaturePosition(cid), effect) end end
  11. <?xml version="1.0" encoding="UTF-8"?> <npc name="Walker" script="walkernpc.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100" /> <look type="140" head="77" body="81" legs="79" feet="95" addons="0" /> </npc> 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) end local lastSound = 0 function onThink() if lastSound < os.time() then lastSound = (os.time() + 6) selfSay("MENSAGEM") end npcHandler:onThink() end npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  12. Tem alguma ideia de onde que fica salvo os frags dos players? Eu realmente não lembro onde é, se eu entender como funciona, posso até fazer.
  13. Bom, não sei quantas coordenadas x e/ou y. Se me disser para qual lado ela fica torta, posso te explicar como tu pode ir arrumando até achar a posição certa. Fora isso, as outras coisas que tu pediu, tenta com esse script: local outfit = {lookType = 370} -- outfit local tempo = 60 -- tempo em segundos. local effect = {41} -- effect no player, caso queira apenas 1, basta remover os outros numeros. local ml = 50 -- quantos ira aumentar o skill de ML local skillfist = 50 -- quantos ira aumentar o skill de Fist local skillsword = 50 -- quantos ira aumentar o skill de Sword local skillaxe = 50 -- quantos ira aumentar o skill de Axe local skillclub = 50 -- quantos ira aumentar o skill de Club local skilldistance = 50 -- quantos ira aumentar o skill de Distance local skillshield = 50 -- quantos ira aumentar o skill de Shield local health = 100 -- A cada 1 segundo quantos aumentar de vida local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml) setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist) setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword) setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe) setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub) setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance) setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield) setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_SPEED, 300) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setCombatCondition(combat, condition) local condition = createConditionObject(CONDITION_REGENERATION) setConditionParam(condition, CONDITION_PARAM_SUBID, 1) setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo*1000) setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health) setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 1000) setCombatCondition(combat, condition) local sys = createConditionObject(CONDITION_OUTFIT) setConditionParam(sys, CONDITION_PARAM_TICKS, tempo) addOutfitCondition(sys, outfit) setCombatCondition(combat, sys) function magicEffect3(tempo2,tempo3,cid) if (isCreature(cid)) then if getPlayerStorageValue(cid, 102053) > 0 and getCreatureCondition(cid, CONDITION_REGENERATION, 1) then local position = {x=getPlayerPosition(cid).x, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} for i=1, #effect do doSendMagicEffect(position, effect[i]) end end end end local sys = createConditionObject(CONDITION_OUTFIT) setConditionParam(sys, CONDITION_PARAM_TICKS, tempo*1000) addOutfitCondition(sys, outfit) setCombatCondition(combat, sys) function onCastSpell(cid, var) local position129 = {x=getPlayerPosition(cid).x+1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z} if getPlayerStorageValue(cid, 102053) ~= 1 or getCreatureCondition(cid, CONDITION_REGENERATION, 1) == false then doCombat(cid, combat, var) tempo2 = 0 while (tempo2 ~= (tempo*1000)) do addEvent(magicEffect3, tempo2, tempo2, tempo*1000, cid) tempo2 = tempo2 + 300 end setPlayerStorageValue(cid, 102053,1) -- storage verifica transformado, quando = 1 player esta transformado. doCreatureSay(cid, "Kyuubi Furie", TALKTYPE_MONSTER) doSendMagicEffect(position129, 130) else doPlayerSendCancel(cid, "Sorry, you are transformed.") end end
  14. Só criar um XML com algo mais ou menos assim: <?xml version="1.0" encoding="UTF-8"?> <npc name="Rusherzin" script="default.lua" walkinterval="3000" floorchange="0" access="5" level="100" maglevel="1"> <health now="15" max="15"/> <look type="495" head="114" body="119" legs="114" feet="114" corpse="3058"/> <parameters> <parameter key="message_greet" value=""/> </parameters> </npc>
  15. Não, é uma talkaction, bota em talkactions/scripts/.
  16. Tem algum problema com o código que está validando esse email. Esse site não parece gesior, então não sei exatamente onde fica o arquivo que trata disso. Teria que descobrir qual é esse arquivo para ver qual é o problema com o código. Se não souber como procurar, aconselho que use algum programa que procure dentro de arquivos e procurar por The Email field must contain a valid email address.
  17. Okay, fiz um script aqui, só lembra de colocar ali na tabela posToGo o nome da ilha com todas letras minúsculas, os jogadores podem falar com letras maiusculas ou minúsculas, mas ali no código tem que estar com letras minúsculas. local posToBe = {x=893, y=830, z=7} local posToGo = {["konoha"] = {x=894, y=831, z=7}, ["ilha"] = {x=895, y=895, z=7}} function onSay(cid, words, param) local playerpos = getCreaturePosition(cid) if(playerpos.x ~= posToBe.x or playerpos.y ~= posToBe.y or playerpos.z ~= posToBe.z) then return end if(posToGo[string.lower(words)]) then doTeleportThing(cid, posToGo[string.lower(words)], true) end end No talkactions.xml tu bota uma tag assim: <talkaction words="konoha;ilha" event="script" value="teleport.lua"/> Separa o nome das ilhas por ; .
  18. Não tenho certeza se entendi exatamente o que tu querias que eu fizesse, mas... tenta dessa forma: local config = { mana = 0, seconds = 0, storage = 111313, semMana = "Você não tem mana suficiente.", msg = "Você precisa aguardar %d segundos para usar essa magia novamente.", } local area = createCombatArea(AREA_CIRCLE2X2) function onCastSpell(cid, var) local target = getCreatureTarget(cid) if(isCreature(target) == 0) then return true end if getPlayerStorageValue(cid, config.storage) == -1 then setPlayerStorageValue(cid, config.storage, os.time()-config.seconds) end if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)))) return true end if getPlayerMana(cid) >= config.mana then doPlayerAddMana(cid, -config.mana) setPlayerStorageValue(cid, config.storage, os.time()) for x = 1, 40 do addEvent(furyAttackTarget,250*x+500,cid,target,{x = getCreaturePosition(target).x + math.random(-1,1), y = getCreaturePosition(target).y + math.random(-1,1), z = getCreaturePosition(target).z}) end else doPlayerSendCancel(cid, config.semMana) doSendMagicEffect(getPlayerPosition(cid),2) end return true end function furyAttackTarget(cid,target,pos) if isCreature(cid) == TRUE and isCreature(target) == TRUE then doSendDistanceShoot({x = getCreaturePosition(target).x - math.random(4,6), y = getCreaturePosition(target).y - 5, z = getCreaturePosition(target).z},pos,3) doAreaCombatHealth(cid,COMBAT_FIREDAMAGE,pos,area,-1,-200,36) doAreaCombatHealth(cid,COMBAT_FIREDAMAGE,pos,area,-1,-500,36) end end
  19. Okay, o npc não vai interagir com o player, né? Ele só vai estar ali, correto?
  20. Não entendi o que tu quer fazer, pode explicar melhor?
  21. local pos = {x = 32581, y = 31487, z = 9} local stor = 23901 function onStepIn(cid, item, position, fromPosition) if getPlayerStorageValue(cid, stor) <=0 then doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "You need access to pass on this teleport.") else doTeleportThing(cid, pos) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) end return true end
  22. local config = { mana = 0, seconds = 10, storage = 10, semMana = "Você não tem mana suficiente.", msg = "Você precisa aguardar %d segundos para usar essa magia novamente.", } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 6) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -3000, 0, -6000) function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) == -1 then setPlayerStorageValue(cid, config.storage, os.time()-config.seconds) end if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)))) return true end if getPlayerMana(cid) >= config.mana then doPlayerAddMana(cid, -config.mana) setPlayerStorageValue(cid, config.storage, os.time()) local Target = getCreatureTarget(cid) local Pos = getCreaturePosition(Target) doTeleportThing(cid,Pos) addEvent(doCombat, 0, cid, combat, var) else doPlayerSendCancel(cid, config.semMana) doSendMagicEffect(getPlayerPosition(cid),2) end return true end
  23. Pelo que entendi, tu clicaria no item 4646 e se tivesse o item 4863 equipado no slot da flecha, iria transformá-lo em 4864. Se for isso, acho que seria assim: <action itemid="4646" event="script" value="deletechest.lua"/> function onUse(cid, item) if getPlayerSlotItem(cid, CONST_SLOT_ARROW).itemid == 4863 then doTransformItem(getPlayerSlotItem(cid, CONST_SLOT_ARROW).uid, 4864) end end
  24. There you go local config = { itemid = 2180, -- id da bomba duration = 10, -- duration antes de ser removida actionid = 13245, -- actionid que sera setado na bomba (pro movements) effect = 3, -- efeito que sai ao colocar a bomba msg = "The bomb has been planted" -- mensagem que sai ao ser colocado a bomba } function onCastSpell(cid, var) local position = getCreaturePosition(cid) local posx = {-3, -2, -1, 0, 1, 2, 3} local posy = {{-1, 0, 1}, {-2, -1, 0, 1, 2}, {-3, -2, -1, 0, 1, 2, 3}, {-3, -2, -1, 0, 1, 2, 3}, {-3, -2, -1, 0, 1, 2, 3}, {-2, -1, 0, 1, 2}, {-1, 0, 1}} if getTileInfo(position).protection then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não pode usar em protection zone.") end for i=1, #posx do for j=1, #posy[i] do local posbomb = {x=position.x+posx[i], y=position.y+posy[i][j], z=position.z} if (not getTileInfo(posbomb).protection) then local item = doCreateItem(config.itemid, 1, posbomb) setItemAid(item, config.actionid) doItemSetAttribute(item, 'ref', getCreatureName(cid)) doSendMagicEffect(posbomb, config.effect) addEvent(removeBomba, config.duration * 1000, posbomb, config.itemid) end end end doCreatureSay(cid, config.msg, 20) return true end
  25. Não tem o arquivo quests.xml? Acho que lá posso encontrar a storage e o valor certo para terminar cada missão..

Informação Importante

Confirmação de Termo