Ir para conteúdo

Oneshot

Marquês
  • Total de itens

    1347
  • Registro em

  • Última visita

  • Dias Ganhos

    36

Tudo que Oneshot postou

  1. Muito bom, você está avançando muito rapidamente, garoto. Há outra maneira de fazer essa mesma função sem usar pairs e ipairs e tabelas, consegue fazer? Resposta
  2. Diogo, você não entende que ele está fazendo isso para irritar, ele fica copiando o mesmo post dele que nem um retardado mental.
  3. Por favor, tranquem o tópico. Abraços.
  4. local specialDescriptions = { [1] = {[0] = "a titan", [1] = "a titan"}, [2] = {[0] = "a demigoddess", [1] = "a demigod"}, [3] = {[0] = "a goddess", [1] = "a god"} } local storage = 8181 function onLook(cid, thing, position, lookDistance) if not isPlayer(thing.uid) then return true end local n = getCreatureStorage(thing.uid, storage) if not specialDescriptions[n] then return true end local sex = getPlayerSex(thing.uid) if not specialDescriptions[n][sex] then return true end doPlayerSetSpecialDescription(thing.uid, "\n".. (sex == 0 and "She" or "He") .." is ".. specialDescriptions[n][sex] ..".") return true end Siga o mesmo procedimento passado pelo notle2012, só trocando o script. O meu funcionará um pouco diferente, você só precisa ir colocando valores maiores em uma única storage. Se a storage do jogador for igual a 1, então ele terá o título titan, caso seja igual a 2, passa a ser demigoddess/demigod, e por aí vai. Abraços.
  5. function onUse(cid, item, fromPosition, itemEx, toPosition) if not isInArray({1, 2, 5, 6}, getPlayerVocation(cid)) then doPlayerSendCancel(cid, "Desculpe, apenas Mages podem usar esse item.") doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end if getCreatureMaxMana(cid) > 1807735400 then doPlayerSendCancel(cid, "Desculpe, você já atingiu o máximo de pontos de mana.") doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 500) doSendMagicEffect(fromPosition, 12) doSendAnimatedText(fromPosition, "+500 Mana!", TEXTCOLOR_BLUE) doRemoveItem(item.uid, 1) return true end Abraços.
  6. Isso é uma talkaction ou uma action, colega?
  7. Aliás, Mr. Sabedoria, 00 é igual a 1. E lá se vai sua teoria de garoto de 8º série de descobrir o resultado de 0 dividido por 0. 0³/0³ = 0³-³ = 00 = 1 Pitágoras e toda a matemática manda abraços.
  8. O erro está na falta de um parênteses que esqueci de fechar. function onSay(cid, words, param) if not isInArray({1, 2, 5, 6}, getPlayerVocation(cid)) then doPlayerSendCancel(cid, "Desculpe, apenas Mages podem usar esse item.") doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end if not doPlayerRemoveItem(cid, 8201, 1) then doPlayerSendCancel(cid, "Desculpe, você não possui mais ".. getItemNameById(8302)) doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end if getCreatureMaxMana(cid) > 1807735400 then doPlayerSendCancel(cid, "Desculpe, você já atingiu o máximo de pontos de mana.") doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 500) doSendMagicEffect(getPlayerPosition(cid), 12) doSendAnimatedText(getPlayerPosition(cid), "+500 Mana!", TEXTCOLOR_BLUE) return true end
  9. Sério, eu até suporto a desorganização dessa área, o monte de pedidos repetidos e entre outros. Mas o que eu não suporto é a falsa moderação, são usuários como você, que fazem questão de postar um aviso, para apenas ganhar posts. Não ligo que você queira fazer sua parte na organização do fórum, mas se algo está errado, clique no botão Denuncie, envie o seu aviso a moderação e pare de ficar postando eles nos tópicos, porque você não está ajudando desse jeito. Um grande abraço.
  10. Sobre o problema do Diogo passado anteriormente: A única solução para o problema acima é 2, por causa do Teorema de Pitágoras que todos (acho eu) aprenderam em meados da quinta série. "O quadrado da hipotenusa é igual à soma dos quadrados dos catetos" O Teorema de Pitágoras é meio que uma consequência da aplicação de semelhança de triângulos, da aplicação daquelas relações métricas. a² = c . m b² = c . n Somando as duas equações, temos: a² + b² = c . m + c . n a² + b² = c . (m + n) c = m + n a² + b² = c . c => a² . b² = c² Assim como o triângulo retângulo de lados 3, 4 e 5, é chamado de triângulo pitagórico, porque além de respeitar o teorema, os lados são consecutivos. Ele aparece muito na Fuvest. Não sei, acho que é isso '-'
  11. Sim, Isso é uma talkaction ou uma action? No caso eu arrumei todo o script dos dois jeitos. function onSay(cid, words, param) if not isInArray({1, 2, 5, 6}, getPlayerVocation(cid) then doPlayerSendCancel(cid, "Desculpe, apenas Mages podem usar esse item.") doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end if not doPlayerRemoveItem(cid, 8201, 1) then doPlayerSendCancel(cid, "Desculpe, você não possui mais ".. getItemNameById(8302)) doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end if getCreatureMaxMana(cid) > 1807735400 then doPlayerSendCancel(cid, "Desculpe, você já atingiu o máximo de pontos de mana.") doSendMagicEffect(fromPosition, CONST_ME_POFF) return true end setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 500) doSendMagicEffect(getPlayerPosition(cid), 12) doSendAnimatedText(getPlayerPosition(cid), "+500 Mana!", TEXTCOLOR_BLUE) return true end
  12. local ip = "127.0.0.1" local players = {1, 2, 3, 4} function onLogin(cid) if doConvertIntegerToIp(getPlayerIp(cid)) ~= ip and isInArray(getPlayerGUID(cid)) then return false end return true end
  13. Oneshot

    [Resolvido]

    Tente assim local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else str = str .. " Please choose your outfit." doPlayerSendOutfitWindow(cid) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "kill") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "PlayerLogout") registerCreatureEvent(cid, "Slot") registerCreatureEvent(cid, "zombieevent") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "deathBroadcast") registerCreatureEvent(cid, "DeathBroadcast") registerCreatureEvent(cid, "Idle") if(config.useFragHandler) then registerCreatureEvent(cid, "SkullCheck") end registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "onkill2") registerCreatureEvent(cid, "DeathC") registerCreatureEvent(cid, "ProtectLevel") registerCreatureEvent(cid, "WarLoss") registerCreatureEvent(cid, "Ranking") registerCreatureEvent(cid, "Hitmsg") registerCreatureEvent(cid, "Slot") return true end
  14. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local position = {x=936, y=1093, z=10} -- Posição que o jogador será teleportado. local itemId = 11328 -- ID do item que será removido do jogador. local chance = 75 -- Porcentagem de sucesso 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 onCreatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, "Marte") then selfSay("Basta agora você me dar uma {"..getItemNameById(itemId).."} e mais 1000 gps que eu te levarei.", cid) talkState[cid] = 0 elseif msgcontains(msg, 'mandibulas') then chance = (tonumber(chance) and tonumber(chance) * 100 or 100000) if doPlayerRemoveItem(cid, itemId, 1) then if chance > math.random(1, 100000) then doTeleportThing(cid, position) else selfSay("Desculpe, mas {".. getItemNameById(itemId) .."} quebrou no processo.", cid) end else selfSay("É necessário uma {"..getItemNameById(itemId).."} pra que eu possa abrir o teleporte.", cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback) npcHandler:addModule(FocusModule:new())
  15. No caso o tópico está pedindo um script e não levantando uma discussão sobre conexão de internet e seus tipos. Bom, existe um modo que "barra" o login nos personagens, mas não na conta. local ip = "127.0.0.1" local accountId = "god" function onLogin(cid) if doConvertIntegerToIp(getPlayerIp(cid)) ~= ip and getPlayerAccount(cid) == accountId then return false end return true end <event type="login" name="accProtection" event="script" value="nome_do_arquivo.lua"/>
  16. Oneshot

    [Resolvido]

    Desculpe, não sou o Vodkart, mas creio que posso te ajudar. Abra o arquivo login.lua em data/creaturescripts/scripts, procure por isso: local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end Apague, substituindo por isso: doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
  17. Escrevendo um tutorial; Desenvolvendo um pequeno add-on para chat.cpp
  18. Oneshot

    Npc Que Da Vocaçao

    Eu fiz para o criador do tópico, ele quis apenas para uma vocação, então o fiz assim. Abraços.
  19. TFS 0.2 ou TFS 0.3.6 <globalevent name = "teamBattleStart" interval="3600" event="script"> TFS 0.4 <globalevent name = "teamBattleStart" interval="3600000" event="script"> Teste.
  20. Para o NPC local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local NPC_NEED_ITEMS = {{9971, 1}} -- Itens, caso o modo de promotion seja "items" local NPC_NEED_LEVEL = 200 local NPC_NEED_PROMOTION = 1 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 local function ordinalprefix(n) local ordinal = {[1] = "st", [2] = "nd", [3] = "rd"} return n .. (ordinal[n] or "th") end function onCreatureSayCallback(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, "promotion") then if getPlayerLevel(cid) < NPC_NEED_LEVEL then selfSay("Sorry, but you need level ".. NPC_NEED_LEVEL .." to be promoted.", cid) return end if getPlayerPromotionLevel(cid) ~= NPC_NEED_PROMOTION then selfSay("Sorry, but you need to have {".. ordinalprefix(NPC_NEED_PROMOTION) .."} promotion.", cid) return end local say = "So do you want to be promoted, heh? I need" for n = 1, #NPC_NEED_ITEMS do local sep = (n == 1 and " " or (n == #NPC_NEED_ITEMS and " and " or ", ")) say = say .. sep .. math.max(1, NPC_NEED_ITEMS[n][2]) .." ".. getItemNameById(NPC_NEED_ITEMS[n][1]) end selfSay(say, cid) talkSate[talkUser] = 1 end if talkState[talkUser] == 1 then if msgcontains(msg, "yes") then local ret = {} for _, item in ipairs(NPC_NEED_ITEMS) do local g = getPlayerItemById(cid, true, item[1]) if g.uid > 0 and math.max(1, g.type) > item[2] then table.insert(ret, {g.uid, item[2]}) else ret = {} break end end if #ret > 0 then for _, item in ipairs(ret) do doRemoveItem(item[1], item[2]) end selfSay("May the Gods bless you. You are now promoted.", cid) doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1) else selfSay("You do not have all the items I need", cid) npcHandler:releaseFocus(cid) end elseif msgcontains(msg, "no") then selfSay("Alright.") npcHandler:releaseFocus(cid) end end return true end npcHandler:setMessage(MESSAGE_GREET, "Hello, |PLAYERNAME|. Do you want the {promotion}?") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback) npcHandler:setCallback(CALLBACK_GREET, onGreetCallback) npcHandler:addModule(FocusModule:new()) Para que o NPC apareça e suma globalevents/scripts/nome_do_arquivo.lua local npc_name = "The Promotion King" local npc_position = {x = 160, y = 54, z = 7} function onThink(interval) local NPC = doCreateNpc(npc_name, position) addEvent(doRemoveCreature, 60 * 60 * 1000, NPC) return true end globalevents.xml <globalevent name="promotionnpc" time="00:00:00" event="script" value="save.lua"/> Não esqueça de configurar os itens aqui: local NPC_NEED_ITEMS = {{9971, 1}} local NPC_NEED_ITEMS = {{ITEM1, COUNT1}, {ITEM2, COUNT2}, {ITEM3, COUNT3}, ..., {ITEM999, COUNT999}} Abraços.
  21. Primeiramente, obrigado pela contribuição, continue a estudar a linguagem Lua e melhorar seus scripts. Mas, sinceramente, você não fez nada aí, simplesmente se utilizou de um "bug", ou melhor, de uma verificação interna dos servidores relacionado ao sistema de promotion. Quando você configura duas vocações X e Y, onde o fromvoc de Y é X e usa a função doPlayerSetVocation(cid, Y), ao sair do jogo, o sistema verifica outra variável do jogador, o promotionLevel, se esse é menor que o necessário para ser a vocação Y, então ele automaticamente retorna a vocação para X. Para exemplificar melhor, tomaremos como exemplo, Sorcerer e Master Sorcerer <vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="3" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> <vocation id="5" name="Master Sorcerer" description="a master sorcerer" needpremium="1" gaincap="10" gainhp="5" gainmana="30" gainhpticks="12" gainhpamount="1" gainmanaticks="2" gainmanaamount="2" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="1" lessloss="30"> <formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/> <skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/> </vocation> Veja, como dito anteriormente, o fromvoc da vocação Master Sorcerer (ID 5) é o Sorcerer (ID 1). Ao, equivocadamente, usar a função doPlayerSetVocation(cid, 5) sem usar antes doPlayerSetPromotionLevel(cid, 1), você está "bugando" o sistema, fazendo com que a vocação não seja permanente. Mas, mesmo assim, belo artifício usado. Abraços.
  22. Oneshot

    Npc Que Da Vocaçao

    Fiz um aqui. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local NPC_PROMOTION_MODE = "items" -- "money" or "items" local NPC_NEED_VOCATION = 4 -- Vocação necessária local NPC_NEED_LEVEL = 200 -- Level necessário local NPC_NEED_PROMOTION = 0 -- Promotion necessária local NPC_PROMOTION_MONEY = 10000 -- Dinheiro (Todos os tipos: Crystal coins, Platinum Coins e Gold coins) local NPC_PROMOTION_ITEMS = {{9971, 1}} -- Itens, caso o modo de promotion seja "items" 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 onGreetCallback(cid) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if getPlayerVocation(cid) == NPC_NEED_VOCATION and getPlayerLevel(cid) >= NPC_NEED_LEVEL and getPlayerPromotionLevel(cid) == NPC_NEED_PROMOTION then npcHandler:setMessage(MESSAGE_GREET, "Hello, |PLAYERNAME|. Do you want the {promotion}?") talkState[talkUser] = 1 return true end if getPlayerVocation(cid) ~= NPC_NEED_VOCATION then selfSay("I do not want to talk with you", cid) return false elseif getPlayerLevel(cid) < NPC_NEED_LEVEL or getPlayerPromotionLevel(cid) < NPC_NEED_PROMOTION then selfSay("Sorry, you are not strong enough.", cid) return false elseif getPlayerPromotionLevel(cid) > NPC_NEED_PROMOTION then selfSay("Sorry, but you are already promoted.", cid) return false end npcHandler:setMessage(MESSAGE_GREET, "Do you want the {promotion}, |PLAYERNAME|?", cid) return true end function onCreatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if talkState[talkUser] == 1 then if msgcontains(msg, "promotion") then if NPC_PROMOTION_MODE == "money" then selfSay("So do you want to be promoted, heh? I need ".. NPC_PROMOTION_MONEY .." gold pieces to promote you. Agreed?", cid) talkState[talkUser] = 2 else local say = "So do you want to be promoted, heh? I need" for n = 1, #NPC_PROMOTION_ITEMS do local sep = (n == 1 and " " or (n == #NPC_PROMOTION_ITEMS and " and " or ", ")) say = say .. sep .. math.max(1, NPC_PROMOTION_ITEMS[n][2]) .." ".. getItemNameById(NPC_PROMOTION_ITEMS[n][1]) end selfSay(say, cid) talkSate[talkUser] = 3 end end elseif talkState[talkUser] == 2 then if msgcontains(msg, "yes") then if doPlayerRemoveMoney(cid, NPC_PROMOTION_MONEY) then selfSay("May the Gods bless you. You are now promoted.", cid) doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1) else selfSay("You do not have all the money I need.", cid) npcHandler:releaseFocus(cid) end elseif msgcontains(msg, "no") then selfSay("Alright.") npcHandler:releaseFocus(cid) end elseif talkState[talkUser] == 3 then if msgcontains(msg, "yes") then local ret = {} for _, item in ipairs(NPC_PROMOTION_ITEMS) do local g = getPlayerItemById(cid, true, item[1]) if g.uid > 0 and math.max(1, g.type) > item[2] then table.insert(ret, {g.uid, item[2]}) else ret = {} break end end if #ret > 0 then for _, item in ipairs(ret) do doRemoveItem(item[1], item[2]) end selfSay("May the Gods bless you. You are now promoted.", cid) doPlayerSetPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1) else selfSay("You do not have all the items I need", cid) npcHandler:releaseFocus(cid) end elseif msgcontains(msg, "no") then selfSay("Alright.") npcHandler:releaseFocus(cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback) npcHandler:setCallback(CALLBACK_GREET, onGreetCallback) npcHandler:addModule(FocusModule:new()) Só mudar a vocação necessária nessa linha: NPC_NEED_VOCATION = 4
  23. Se não me engano, eu coloquei para que o comando /biohazard close só fosse executado se fossem contados mais de dois jogadores. E o sistema não conta GODs no evento, mesmo que eles entrem pelo portal, eles não irão ser contados, por isso você não consegue iniciar o evento com o comando. Mesmo assim, estou adicionando várias coisas sugeridas no tópico e logo, logo uma nova versão sairá.
  24. É, infelizmente. O máximo que você pode fazer é uma gambiarra desse tipo. function onSay(cid, words, param, channel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "É proibido a divulgação de outros servidores.") return true end <talkaction words="pokeice.servegame.com;pokedigimon.no-ip.org" event="script" value="nome_do_arquivo.lua"/>
  25. A maioria dos sistemas de anti-divulgação existentes são feitos nas sources, e aposto que você provavelmente não as tem, por ser poketibia. Ps: Sistema é com I e não com Y
  • Quem Está Navegando   0 membros estão online

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