Ir para conteúdo

Wise

Membro
  • Registro em

  • Última visita

Tudo que Wise postou

  1. Bom, após ter feito o download das páginas HTML do Flags Calculator, você pode abrir a que você deseja calcular um valor (flags / custom flags). Ao abrir uma das páginas, aparecerá uma lista de privilégios e outra de limitações (ou dependendo, se for custom flag, terá os privilégios do player e da conta). Basta marcar as opções que te agradam e conforme você as seleciona, um novo número é formado. Depois que você tiver tudo à seu gosto, procure pela tag em que deseja adicionar as flags / custom flags (groups.xml) e adicione esses valores calculados, aos respectivos parâmetros das tags. Fim. Ex: Calculei esse valor para as custom flags: 134217727. E esse para as flags: 514019538477048. Meu novo group ID vai ficar: <group id="7" name="Owner" flags="514019538477048" customFlags="134217727" access="5" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="5000" maxVips="500" outfit="302"/> No próprio tópico da Flags Calculator, há uma explicação de como usar. Fiz uma explicação muito básica, é apenas isso.
  2. Me informei melhor sobre a versão do seu servidor. Substitua as tags do seu groups.xml (data/XML): <?xml version="1.0" encoding="UTF-8"?> <groups> <group id="1" name="Player" flags="0" access="0" maxdepotitems="0" maxvipentries="0" /> <group id="2" name="Tutor" flags="137455730688" access="0" maxdepotitems="0" maxvipentries="200" /> <group id="3" name="Admin" flags="272730398714" access="1" maxdepotitems="0" maxvipentries="200" /> </groups>
  3. SearchPlayer (Find Person / exiva) é uma função usada em uma spell, que se localiza na source. Então, ela teria de ser alterada em C++. bool InstantSpell::SearchPlayer(const InstantSpell*, Creature* creature, const std::string& param) { Player* player = creature->getPlayer(); if(!player || player->isRemoved()) return false; Player* targetPlayer = NULL; ReturnValue ret = g_game.getPlayerByNameWildcard(param, targetPlayer); if(ret != RET_NOERROR || !targetPlayer || targetPlayer->isRemoved()) { player->sendCancelMessage(ret); g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF); return false; } if(targetPlayer->hasCustomFlag(PlayerCustomFlag_NotSearchable) && !player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)) { player->sendCancelMessage(RET_PLAYERWITHTHISNAMEISNOTONLINE); g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF); return false; } std::stringstream ss; ss << targetPlayer->getName() << " " << g_game.getSearchString(player->getPosition(), targetPlayer->getPosition(), true, true) << "."; player->sendTextMessage(MSG_INFO_DESCR, ss.str().c_str()); g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_WRAPS_BLUE); return true; } Porém, existem outras possibilidades de se criar o que você quer, em Lua. Tenho duas em mente: Spell que localiza um target. Talkaction (pode-se configurar pra ter perda de mana no uso, exhausted, vocações, etc; como uma spell).
  4. Wise respondeu ao post em um tópico de gil em Suporte Tibia OTServer
    Informe o que você quer que aconteça, daí vejo se posso te ajudar.
  5. Não, não errei. Em servidores mais recentes, a função onTimer não existe mais. E como ele não informou a versão que ele usa, usei o callback que eu uso nos meus test servers. Basta então fazer como o membro disse, mude o callback para onTime.
  6. Frags é o que se denomina como sendo o número de jogadores mortos (kills) por um creature ID player. Na verdade, você se referiu às flags/custom flags. Que no caso, são os privilégios e limitações aplicados à determinado group ID. Você pode calcular os valores delas, usando o Flags Calculator.
  7. reloadactions.lua (data/globalevents/scripts): function onTimer() doReloadInfo(RELOAD_ACTIONS) return true end Tag - globalevents.xml (data/globalevents): <globalevent name="ReloadActions" time="13:00" event="script" value="reloadactions.lua"/>
  8. @CreatServer Embora o que você quer seja um pouco semelhante ao pedido do membro, esse tópico já foi solucionado. Crie o seu próprio e informe seu pedido nele.
  9. Dá pra simplificar. Veja se entende o exemplo, básico: cids.lua (data/lib): players_id = {} alavanca.lua (data/actions/scripts): function onUse(cid) if #players_id > 0 then -- se a tabela tiver ao menos um elemento.. for i = 1, #players_id do -- do primeiro elemento da tabela, ao último.. if cid ~= players_id[i] then return false end -- se cid não estiver incluso na tabela, retorne false.. end doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) -- se o escopo acima for false, teleporte o cid para o templo de sua town.. else table.insert(players_id, cid) -- se a tabela não possuir pelo menos um elemento, então o cid é inserido na mesma.. end return true end E sim, a tabela é setada à zero elementos quando é feito o shutdown. PS: explicação sem muitos detalhes aprofundados, nos comentários, só pra você entender.
  10. Só faltou a tag pra determinar o tempo de duração (em segundos) do corpse: <attribute key="duration" value="600" />
  11. É por conta do internetês que muitas dessas confusões são causadas. Errei a leitura por um erro de escrita seu. Eu li direto, action/script, seria talkactions\scripts, já que os diretórios talk action e script não existem. Peço desculpas para o tópico em geral, pelo ocorrido.
  12. Sim, para qualquer arma.
  13. Você leu o que eu disse? O erro foi seu, num detalhe da explicação. Apenas isso, amigo.
  14. Wise respondeu ao post em um tópico de Morfeusinho em Suporte Tibia OTServer
    Estou desatualizado sobre os sistemas do Tibia Global, desde que vendi minha account há alguns anos. Informe o que você quer que aconteça e eu vejo se posso te ajudar.
  15. Você usa um script com callback onSay em actions, coloca a tag em talkactions, e não tem problemas? Nossa, que distro é esse? Amigo, você apenas mandou ele colocar o script da talkaction no diretório incorreto, desse modo não vai executar o arquivo e resultará em alguns erros de localização do mesmo. Enquanto a esse detalhe, peguei pra ajudar a partir das tentativas falhas de outros membros e não li bem o post principal. Eu errei mesmo, por falta de atenção. Corrigi meu post anterior.
  16. Existem tutoriais com ótimos conteúdos de scripting no fórum, principalmente para iniciantes. Basta procurar. Aulas de Scripting
  17. local storage = 8910 -- storage local effect = {10, 11} -- {efeito de ida, efeito da volta} local vocs = {1, 2, 3} -- vocation IDs local position = {x=32263, y=32341, z=7} --Position pra onde o player vai ao usar a spell local pos = {} function onSay(cid) if not isInArray(vocs, getPlayerVocation(cid)) then return doPlayerSendCancel(cid, 'Your vocation is not allowed to use this command.') end if getPlayerStorageValue(cid, storage) ~= 1 then setPlayerStorageValue(cid, storage, 1) table.insert(pos, getCreaturePosition(cid)) doTeleportThing(cid, position) doSendMagicEffect(getThingPos(cid), effect[1]) else setPlayerStorageValue(cid, storage, 0) table.remove(pos) doTeleportThing(cid, pos[1]) doSendMagicEffect(getThingPos(cid), effect[2]) end return true end (códigos do membro danihcv)
  18. table.remove(table [, pos]) Esse metamétodo remove um elemento de uma posição da tabela, ou se a posição não for especificada, remove o último elemento da mesma. Ex: t = {'Suicide', 0, 1, 2, 'TibiaKing'} #t = 5 table.remove(t, 4) -- remove o elemento número 4 table.foreach(t, print) -- exibe o conteúdo da tabela posição - elemento 1 - Suicide 2 - 0 3 - 1 4 - TibiaKing Logo: #t = 4
  19. Criar um arquivo com callback onSay em actions e adicionar a tag em talkactions? Não vai dar certo.
  20. Fiz para que o player fique mudo, imóvel e receba danos de fogo por tempo indeterminado (até morrer). Tente: deathground.lua (data/movements/scripts): local muted = createConditionObject(CONDITION_MUTED) setConditionParam(muted, CONDITION_PARAM_TICKS, -1) local fire = createConditionObject(CONDITION_FIRE) setConditionParam(fire, CONDITION_PARAM_PERIODICDAMAGE, -1000) setConditionParam(fire, CONDITION_PARAM_TICKS, -1) setConditionParam(fire, CONDITION_PARAM_TICKINTERVAL, 2000) function onStepIn(cid) doAddCondition(cid, muted) doAddCondition(cid, fire) doCreatureSetNoMove(cid, true) return true end Tag - movements.xml (data/movements): <movevent type="StepIn" actionid="ACTIONID" event="script" value="deathground.lua"/>
  21. Não. Nesse caso, eu fiz por storage, e não por uma coluna numa tabela na database.
  22. Wise respondeu ao post em um tópico de Freeze em Suporte Tibia OTServer
    Veja que o exhaustion time é setado de modo geral, através dessa condição que, faz uso de um valor estipulado em config.lua e subtrai-se 100. Em config.lua, procure por timeBetweenExActions. Lá vai estar o valor desse tempo em milissegundos. Ex: timeBetweenExActions = 1000 Logo, o exhaustion time será 1000 - 100 = 900 milissegundos. Você pode definir o exhaust por uma variável no script, por exemplo. Basta alterar a condição que eu citei no início por: local etime = 700 -- exhaustion in milliseconds local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, etime) Ficaria então: local config = { removeOnUse = "yes", usableOnTarget = "yes", -- can be used on target? (fe. healing friend) splashable = "no", realAnimation = "no", -- make text effect visible only for players in range 1x1 healthMultiplier = 1.0, manaMultiplier = 1.0 } config.removeOnUse = getBooleanFromString(config.removeOnUse) config.usableOnTarget = getBooleanFromString(config.usableOnTarget) config.splashable = getBooleanFromString(config.splashable) config.realAnimation = getBooleanFromString(config.realAnimation) local POTIONS = { [8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion [7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion [7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8, 11, 12}, vocStr = "knights and paladins"}, -- strong health potion [7591] = {empty = 7635, splash = 2, health = {450, 550}, level = 80, vocations = {4, 8, 12}, vocStr = "knights"}, -- great health potion [8473] = {empty = 7635, splash = 2, health = {860, 890}, level = 130, vocations = {4, 8, 12}, vocStr = "knights"}, -- ultimate health potion [7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion [7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7, 9, 10, 11}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion [7590] = {empty = 7635, splash = 7, mana = {350, 410}, level = 80, vocations = {1, 2, 5, 6, 9, 10}, vocStr = "sorcerers and druids"}, -- great mana potion [8472] = {empty = 7635, splash = 3, health = {360, 450}, mana = {350, 390}, level = 80, vocations = {3, 7, 11}, vocStr = "paladins"} -- great spirit potion } local etime = 700 -- milissegundos local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, etime) function onUse(cid, item, fromPosition, itemEx, toPosition) local potion = POTIONS[item.itemid] if(not potion) then return false end if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then if(not config.splashable) then return false end if(toPosition.x == CONTAINER_POSITION) then toPosition = getThingPos(item.uid) end doDecayItem(doCreateItem(2016, potion.splash, toPosition)) doTransformItem(item.uid, potion.empty) return true end if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED) return true end if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1) return true end local health = potion.health if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then return false end local mana = potion.mana if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then return false end doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE) if(not realAnimation) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) else for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do if(isPlayer(tid)) then doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid) end end end doAddCondition(cid, exhaust) if(not potion.empty or config.removeOnUse) then doRemoveItem(item.uid, 1) return true end doRemoveItem(item.uid, 1) doPlayerAddItem(cid, potion.empty, 1) return true end
  23. Já que não é por stages, não tem necessidade de um escopo pra redefinir a variável. Tente: function onSay(cid) return doPlayerPopupFYI(cid, 'Server Information:\n\nExperience rate: x'..getConfigInfo('rateExperience')..'\nSkills rate: x'..getConfigInfo('rateSkill')..'\nLoot rate: x'..getConfigInfo('rateLoot')..'\nMagic rate: x'..getConfigInfo('rateMagic')..'\nSpawns rate: x'..getConfigInfo('rateSpawn')..'\nProtection level: '..getConfigInfo('protectionLevel')) and true end
  24. Wise respondeu ao post em um tópico de Snowsz em Suporte Tibia OTServer
    Tentou corretamente? function onDeEquip(cid) return doPlayerSendCancel(cid, "You can't remove this item.") and false end <movevent type="DeEquip" itemid="ITEMID" slot="ring" event="script" value="filename.lua"/>
  25. Sim. Não notei que você queria assim, desculpe. Editei o post anterior. Basta alterar a tabela: local t = { -- [actionID] = {vocs = {vocationIDs}, items = {itemIDs}} [54001] = {vocs = {1, 2, 5, 6}, items = {7424}}, -- mages [54002] = {vocs = {3, 7}, items = {8858, 2352}}, -- paladins [54003] = {vocs = {4, 8}, items = {7417}}, -- knights/sword [54004] = {vocs = {3, 7}, items = {7450}}, -- knights/club [54005] = {vocs = {3, 7}, items = {8926}} -- knights/axe } E a tag: <action actionid="54001-54005" event="script" value="chests.lua"/>

Informação Importante

Confirmação de Termo