Ir para conteúdo

jhon992

Conde
  • Total de itens

    631
  • Registro em

  • Última visita

  • Dias Ganhos

    13

Tudo que jhon992 postou

  1. Estou aqui hoje para trazer um sistema simples que eu criei, porém pode ser até muito útil, o Sistema de Reputação ! Esse sistema vai funcionar da seguinte forma, você adiciona os monstros que darão Rep+ ao morrer, e a cada monstro desse, o player que o matou conquista +1 ponto de Reputação. Exemplo de monstro que seria legal adicionar: Bosses. Outro meio de ganhar Reputação com esse sistema será matando outros players que estejam pk. E o único meio de perder Pontos de Reputação é matando players que não estejam pk. O Sistema também vem com um rank de Reputação que sera adicionado nas talkactions e listara os tops Reputação e um comando para verificar seus pontos de reputação. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Para que Esse Sistema pode ser Útil: Vamos pensar da seguinte maneira, pontos ao matar. Diminuirá o número de pk's in-game pois mais players vão querer mata-los. (REP +) Pontos negativos ao matar players comuns, também contribuirá para diminuição de pk's. (REP -) Pontos por matar bosses e outros monstros fortes, vai estimular os player's a matarem monstros mais perigosos. (REP +) Esse Sistema pode ser útil também para que só players com certa quantidade de Rep+ possam: -Entrar em lugares; -Fazer quests; -Usar magias; -Usar outras talkactions; -E várias outras coisas. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Agora vamos ao que interessa os scripts: Primeiro vai em "data/creaturescripts/scripts/" duplica um arquivo dessa pasta e renomeia para "repsystem" sem as aspas, nele cole: --<Script by jhon992>-- function onKill(cid, target, lastHit) vetMonster = { "Demon", "Morgaroth", "Hydra", "Dragon" } -- adicionar monstros que darão rep+ -- Ao matar monstros do vetMonster, ganhara rep+. for i=0, #vetMonster do if (getCreatureName(target) == vetMonster[i]) then setPlayerStorageValue(cid, 102086, getPlayerStorageValue(cid, 102086)+1) doSendAnimatedText(getThingPos(cid), 'Rep+', 30) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você ganhou 1 ponto de reputação por matar um "..vetMonster[i]..".") return TRUE end end -- Ao matar um pk, ganhara rep+. if (isPlayer(target) == true) then if (getCreatureSkullType(target) > 2) then setPlayerStorageValue(cid, 102086, getPlayerStorageValue(cid, 102086)+1) doSendAnimatedText(getThingPos(cid), 'Rep+', 30) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você ganhou 1 ponto de reputação por matar "..getCreatureName(target)..".") return TRUE end -- Ao matar um player normal, ganhara rep-. setPlayerStorageValue(cid, 102086, getPlayerStorageValue(cid, 102086)-1) doSendAnimatedText(getThingPos(cid), 'Rep-', 144) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você perdeu 1 ponto de reputação por matar "..getCreatureName(target)..".") return TRUE end return TRUE end Agora em "data/creaturescripts/creaturescripts.xml" cole a tag: <event type="kill" name="RepSystem" event="script" value="repsystem.lua"/> Entre na pasta "data/creaturescripts/scripts" novamente, e abra o arquivo "login.lua" sem as aspas. Nele cole a tag: -- Verificar se é primeira vez que loga, pois ao usar storage ele ja começa com -1, -- Então vamos zera-lo para que sua Reputação comece do 0. if (getPlayerStorageValue(cid, 102087) ~= 1) then setPlayerStorageValue(cid, 102087, 1) setPlayerStorageValue(cid, 102086, 0) end registerCreatureEvent(cid, "RepSystem") Terminamos a parte do Sistema e agora vamos para o talkaction de rank. Vai na pasta "data/talkaction/scripts", duplique um arquivo e remomeie para "rankrep" sem as aspas. Abra-o e cole: function getPlayerNameByGUID2(n) local c = db.getResult("SELECT `name` FROM `players` WHERE `id` = "..n..";") if c:getID() == -1 then return "SQL_ERROR["..n.."]" end return c:getDataString("name") end function onSay(cid, words, param) if (param == "") then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você possui "..getPlayerStorageValue(cid, 102086).." pontos de Reputação.") return TRUE end if (param == "rank") then local max = 50 local letters_to_next = 50 local name_now local name = "Highscore for Reputação\n" local rkn = 0 local no_break = 0 name = name.."\n" name = name.."Rank. Pontos | Nome do Jogador\n" local v = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = 102086 ORDER BY cast(value as INTEGER) DESC;") local kk = 0 repeat if kk == max or v:getID() == -1 then break end kk = kk+1 name_now, l = getPlayerNameByGUID2(v:getDataInt("player_id")), string.len(getPlayerNameByGUID2(v:getDataInt("player_id"))) space = "" for i=1, letters_to_next-l do space = space.." " end if name_now == nil then name_now = 'sql error['..v:getDataInt("player_id")..']' end name = name..kk..". "..v:getDataInt("value").." | "..name_now..space.." \n" until v:next() == false if name ~= "Highscore\n" then doPlayerPopupFYI(cid, name) end return TRUE else doPlayerSendCancel(cid, "Command valid: !rep, !rep rank.") return TRUE end end E por último mais não menos importante, abra "data/talkactions/talkacitons.xml" e cole a tag: <talkaction words="!rep" event="script" value="rankrep.lua"/> Pronto, terminamos o nosso Simple Reputation System! -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----- Reputation Door----- Vai em data/actions/script, duplica um arquivo e nomeia para "repDoor" sem as aspas e nele cole: function onUse(cid, item, frompos, item2, topos) local quantRep = 30 -- quantidade de reset para entrar na porta newnPosition = {x=784, y=805, z=7} -- onde será teleportado ao clicar na porta if item.actionid == 2085 and getPlayerStorageValue(cid, 102086) >= quantRep then doTeleportThing(cid, newnPosition) doSendMagicEffect(newnPosition, 10) else doCreatureSay(cid, "Voce nao tem reputação suficiente para entrar!", TALKTYPE_ORANGE_1) end return TRUE end Agora em data/actions/actions.xml cole a tag: <action actionid="2085" script="repDoor.lua"/> E por último com seu mapa editor, vai na porta desejada do seu server e coloque o actionid 2085. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Agora para fazer alavancas, baús e etc, basta seguir o exemplo do script acima da repDoor. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----- Quantidade de Reputação para usar determinado item ----- Vai em data/movements/script e duplica um arquivo dessa pasta e nomeie para "itemRep" sem aspas, abra-o e cole: local quantRep = 30 -- quantidade de reset para usar determinado item function onEquip(cid, item, slot) if getPlayerStorageValue(cid, 102086) < quantRep then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players com "..quantRep.." pontos de reputação ou mais, podem usar essa arma!") return FALSE end return TRUE end Agora vai em data/movements/movements.xml abre e adicione a tag: <movevent type="Equip" itemid="id do seu item" slot="hand" event="script" value="itemRep.lua"/> Troque os slots na tag acima como desejar, tipos de slots: head armor legs hand shield ring necklace feet pickupable Para itens que você for usar com a mesma quantidade de reps que o item anterior, apenas crie uma nova tag no movementes.xml com o itemid diferente. Senão você devera criar um novo script com o nome diferente e mudar a quantRep. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----- Comprar determinado item com Pontos de Reputação ----- Vai em data/talkactions/scripts, duplique um arquivo e nomeiei para "buyrep" sem as aspas e nele cole: local itemNames = { {name = "Dragon Shield", pontos = 2}, -- nome do item e pontos que gastara. {name = "Crown Armor", pontos = 8}, {name = "Arbalest", pontos = 25}, {name = "Heroic Axe", pontos = 20}, {name = "Magic Sword", pontos = 30}, {name = "Demon Armor", pontos = 50} } function onSay(cid, words, param, channel) if param == "" then for i=1, #itemNames do if i == 1 then text = "-- Lista de Items --\n" else text = text .. (itemNames[i].name) .." = ".. itemNames[i].pontos .." pontos\n" end end doShowTextDialog(cid,8977,text) return true end param = string.upper(param) for j=1, #itemNames do if (param == string.upper(itemNames[j].name)) then if getPlayerStorageValue(cid, 102086) < tonumber(itemNames[j].pontos) then doPlayerSendCancel(cid,"Você não possui pontos suficientes.") return true else doPlayerAddItem(cid, getItemIdByName(param)) doPlayerSendTextMessage(cid, 22, "Você comprou 1 ".. itemNames[j].name ..".") setPlayerStorageValue(cid, 102086, getPlayerStorageValue(cid, 102086) - itemNames[j].pontos) return true end end end doPlayerSendCancel(cid,"Este item não existe.") return true end Agora em data/talkactions/talkactions.xml cole a tag: <talkaction words="!buy" event="script" value="buyrep.lua"/> Em jogo, ao falar "!buy" aparecera a lista de itens que pode ser comprado e seus determinados custos, conforme foram configurados no arquivo "buyrep.lua". Para comprar um item basta ter a quantidade de reputação necessaria e usar o comando "!buy NomeDoItem". -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----- Mostrar Reputação no Look (by Vodkart)----- Vai em data/creaturescripts/scripts, duplique um arquivo e nomeiei para "showrep" sem as aspas e nele cole: function getReps(cid) return getPlayerStorageValue(cid,102086) < 0 and 0 or getPlayerStorageValue(cid,102086) end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\n[Reps: " .. getReps(thing.uid) .."]") end return true end No creaturescripts.xml cole a tag: <event type="look" name="showRep" event="script" value="showrep.lua"/> E no arquivo login.lua, antes do último return true: registerCreatureEvent(cid, "showRep") -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----- Versão 2.0 repsystem.lua ----- Caso você queira que cada monstro que você matar de pontos diferentes de reputação, voce deve substituir oque tem dentro do seu arquivo inicialmente criado e nomeado como repsystem.lua por isso: É isso aew galera, qualquer coisa que precise ser modificado ou dica para melhorar os scripts e o sistema serão bem vindas!
  2. Primeiro nos "data/items/items.xml" você deve editar os dois rings: <item id="ID DO RING" article="a" name="ring heal"> <attribute key="weight" value="80" /> <attribute key="slotType" value="ring" /> <attribute key="transformEquipTo" value="ID DO RING PISCANDO" /> <attribute key="stopduration" value="1" /> <attribute key="showduration" value="1" /> </item> <item id="ID DO RING PISCANDO" article="a" name="ring heal"> <attribute key="weight" value="100" /> <attribute key="decayTo" value="0" /> <attribute key="transformDeEquipTo" value="2214" /> <attribute key="duration" value="450" /> <attribute key="healthGain" value="1" /> <attribute key="healthTicks" value="1000" /> <attribute key="manaGain" value="4" /> <attribute key="manaTicks" value="1000" /> <attribute key="showduration" value="1" /> </item> Agora vai em "data/movements/movements.xml" e adiciona a tag: <movevent type="Equip" itemid="ID DO RING" slot="ring" event="function" value="onEquipItem"/> <movevent type="Equip" itemid="ID DO RING PISCANDO" slot="ring" event="function" value="onEquipItem"/> <movevent type="DeEquip" itemid="ID DO RING PISCANDO" slot="ring" event="function" value="onDeEquipItem"/>
  3. tenta no lugar de reqTries usar a função normal doPlayerAddSkillTry(cid, SKILL_SWORD, getPlayerRequiredSkillTries(cid, SKILL_SWORD, 95)) [29/11/2011 22:34:15] data/creaturescripts/scripts/lowlevellock.lua:4: attempt to call global 'getExperienceForLevel' (a nil value) E se for seguir pela logica, esse erro acima é o mesmo que o primeiro. Então essa função não existe, provavelmente pra concertar tens que criar essa função na libs, ou no distro, ou baixa um distro mais atual que resolve todos seus problemas.
  4. Entra na pasta do teu otserv, vais achar uma pasta "mods" nela tem um arquivo "buypremium_command" abre ele, dae tu edita ali: days = 90, cost = 10000, maxDays = 360 days = quantidade de dias que compra ao usar o comando. cost = preço por essa quantidade de dias. maxDays = máximo de dias premium que o player pode ter.
  5. No primeiro a linha errada é essa: doPlayerAddExperience(cid, (getExperienceForLevel(150) - getPlayerExperience(cid))) A função #do certa seria essa: doPlayerAddExp, então: doPlayerAddExp(cid, (getExperienceForLevel(150) - getPlayerExperience(cid))) Já na segunda não tenho certeza mais acho que em todos os getPlayerRequiredMana faltou um espaço para o script poder identificar o valor. Tenta fazer assim, trocar isso: doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,40))) Por isso: doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid, 40))) Ou seja, um espaço após a virgula. Faiz em todos os 3 get e testa o script.
  6. Acho que isso aqui pode te ajudar: http://www.xtibia.com/forum/topic/126636-lista-de-atribute-keys-para-itensxml/ e para duração: <attribute key="decayTo" value="0" /> <attribute key="duration" value="3600" /> <attribute key="showduration" value="1" />
  7. Para tua primeira dúvida, entre no arquivo "data/creaturescripts/scripts/login.lua" e cole isso: if (getPlayerStorageValue(cid, 102522) ~= 1) then doPlayerAddPremiumDays(cid, 3) -- 3 é igual numero de dias setPlayerStorageValue(cid, 102522,1) end E a segunda dúvida, vai em "data/npc" abra o arquivo do seu npc do barco e procure a linha: <parameter key="travel_destinations" value="sul city,2483,2439,7,0;"/> Vou explicar a linha de código acima, no value onde esta sul city seria o nome da sua cidade, {2483,2439,7} é a posição do mapa que o barco vai levar e o último 0 é o preço da passagem. Então basta configurar os zeros no seu npc!
  8. tenta usar esse aqui, dei uma configurada. Obs: Não testei! local config = { removeOnUse = "no", 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}, -- strong health potion [7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 80}, -- great health potion [8473] = {empty = 7635, splash = 2, health = {800, 1000}, level = 130}, -- ultimate health potion [7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion [7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50}, -- strong mana potion [7590] = {empty = 7635, splash = 7, mana = {200, 300}, level = 80}, -- great mana potion [8472] = {empty = 7635, splash = 3, health = {200, 400}, mana = {110, 190}, level = 80} -- great spirit potion } local exhaust2 = createConditionObject(CONDITION_EXHAUST_HEAL) setConditionParam(exhaust2, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100)) 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(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) 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, exhaust2) local v = getItemParent(item.uid) if(not potion.empty or config.removeOnUse) then return true end if fromPosition.x == CONTAINER_POSITION then for _, slot in ipairs({CONST_SLOT_LEFT, CONST_SLOT_RIGHT, CONST_SLOT_AMMO}) do local tmp = getPlayerSlotItem(cid, slot) if tmp.itemid == potion.empty and tmp.type < 100 then doChangeTypeItem(item.uid, item.type - 1) return getPlayerFreeCap(cid) >= getItemInfo(potion.empty).weight and doChangeTypeItem(tmp.uid, tmp.type + 1) or doPlayerAddItem(cid, potion.empty, 1) end end else doChangeTypeItem(item.uid, item.type - 1) doCreateItem(potion.empty, 1, fromPosition) return true end if v.uid == 0 then if item.type == 1 and isInArray({CONST_SLOT_LEFT, CONST_SLOT_RIGHT, CONST_SLOT_AMMO}, fromPosition.y) then doTransformItem(item.uid, potion.empty) else -- serversided autostack should take care of this doPlayerAddItem(cid, potion.empty, 1) doChangeTypeItem(item.uid, item.type - 1) end return true else doChangeTypeItem(item.uid, item.type - 1) local size = getContainerSize(v.uid) for i = 0, size-1 do local tmp = getContainerItem(v.uid, i) if tmp.itemid == potion.empty and tmp.type < 100 then return getPlayerFreeCap(cid) >= getItemInfo(potion.empty).weight and doChangeTypeItem(tmp.uid, tmp.type + 1) or doPlayerAddItem(cid, potion.empty, 1) end end if getContainerSize(v.uid) < getContainerCap(v.uid) then doAddContainerItem(v.uid, potion.empty) else doPlayerAddItem(cid, potion.empty, 1) end end return true end
  9. Criei algumas Sprites de armas para meu otserv e resolvi disbonibilizar para vocês! São minhas primeiras Sprites, espero que possam utilizar e aprovar e não só me jugar. Nomes sugestivos: 1º = AK - 47 2º = Mp5 Navy 3º = Elite Beretta 4º = Desert Eagle 5º = Benelli M3 6º = Sniper Rifle 7º = AWP É isso aew, espero ter ajudo e bom proveito!
  10. jhon992

    Bleach Ot

    tenta o ultimo script desse tópico aqui quem sabe ajuda: http://www.xtibia.com/forum/topic/173246-spelltransformaganha-skillclubaxesword/
  11. Provavelmente tu deve saber que ao trocar a distro, perde-se algumas funções. E essas funções deviam ser utilizadas para o sistema de fly e de surf. A solução agora é migrar para outro sistema de fly e surf ou trocar a distro pela anterior novamente ou achar as funções anteriores para poder adicionar nas sua lib do otserv. Espero ter te dado uma clareada aew!
  12. As notas você deve fazer que nem na primeira situação, usando o Dat Editor. Primeiro testa no seu otserv quando você junta 1000 Dollars e clica neles que sprite aparece, após isso tens que achar a sprite correspondente no Dat Editor e substituir pelo sprite que você deseja! Ja o moves seria muito complicado, eu nem sei como fazer. Mais acho que os caras devem ter feito um bag com o nome "moves" e colocar para não poder mover ela, e dentro delas colocaram runas com esses determinados sprites, e cada vez que trocasse de pokemon essa bag mudaria. Acho que a logica é essa. Mais nem sei como fazer. =/
  13. Me matei um pokin pra faze esse script, mais ta aew a parte que eu fiz pelo menos. Fiz apenas a parte de talkactions que é mais a minha aréa, dae a parte das quest's tens que encontrar outro scripter pra faze pra ti. Vai em "data/talkactions/talkactions.xml" e poem a tag: <talkaction words="!reset" script="reset.lua"/> Agora entre na pasta "talkactions/scripts" duplique algum arquivo dessa pasta e renomeie para "reset" sem as aspas, e nele cole: -- <Script by jhon992> -- function onSay(cid, words, param, channel) if (param ~= "mixedpromo" and param ~= "spinpromo" and param ~= "sacredpromo" and param ~= "supremepromo" and param ~= "forgottenpromo" and param ~= "novapromo") then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Incorrect parameter.") return TRUE end local config = { mixedlvl = 10000, -- level para resetar mixed spinlvl = 60000, -- level para resetar spin sacredlvl = 95000, -- level para resetar sacred supremelvl = 310000, -- level para resetar supreme forgottenlvl = 550000, -- level para resetar forgotten novalvl = 715000, -- level para resetar nova vocationMixed = 5, -- id vocação mixed vocationSpin = 6, -- id vocação spin vocationSacred = 7, -- id vocação sacred vocationSupreme = 11, -- id vocação supreme vocationForgotten = 12, -- id vocação forgotten vocationNova = 13, -- id vocação nova lvlreset = 8, -- level apos resetar primeiras vocações lvlSacred = 30000, -- level apos resetar vocação sacred lvlNew = 100000, -- level apos resetar útimas 3 vocações player = getPlayerGUID(cid), -- não mexa! pz = "no", -- players precisam estar em protection zone para usar? ("yes" or "no"). battle = "yes", -- players deve estar sem battle ("yes" or "no") premium = "no" -- se precisa ser premium account ("yes" or "no") } if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You should be in the protection zone for use.") return TRUE end if(config.premium == "yes") and (not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Only players with premium account can use.") return TRUE end if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You can not use in battle.") return TRUE end if (param == "mixedpromo") then if (getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4) then if (getPlayerLevel(cid) >= config.mixedlvl) then doPlayerSetVocation(cid, config.vocationMixed) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..", `experience` = 0 WHERE `id` = "..config.player) return TRUE else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You need level "..config.mixedlvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.") return TRUE end end if (param == "spinpromo") then if (getPlayerVocation(cid) == 5) then if (getPlayerLevel(cid) >= config.spinlvl) then doPlayerSetVocation(cid, config.vocationSpin) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlreset..", `experience` = 0 WHERE `id` = "..config.player) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You need level "..config.spinlvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.") return TRUE end end if (param == "sacredpromo") then if (getPlayerVocation(cid) == 6) then if (getPlayerLevel(cid) >= config.sacredlvl) then doPlayerSetVocation(cid, config.vocationSacred) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlSacred..", `experience` = 0 WHERE `id` = "..config.player) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You need level "..config.sacredlvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.") return TRUE end end if (param == "supremepromo") then if (getPlayerVocation(cid) == 10) then if (getPlayerLevel(cid) >= config.supremedlvl) then doPlayerSetVocation(cid, config.vocationSupreme) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlNew..", `experience` = 0 WHERE `id` = "..config.player) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You need level "..config.supremelvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.") return TRUE end end if (param == "forgottenpromo") then if (getPlayerVocation(cid) == 11) then if (getPlayerLevel(cid) >= config.forgottenlvl) then doPlayerSetVocation(cid, config.vocationForgotten) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlNew..", `experience` = 0 WHERE `id` = "..config.player) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You need level "..config.forgottenlvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.") return TRUE end end if (param == "novapromo") then if (getPlayerVocation(cid) == 12) then if (getPlayerLevel(cid) >= config.novalvl) then doPlayerSetVocation(cid, config.vocationNova) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `level` = "..config.lvlNew..", `experience` = 0 WHERE `id` = "..config.player) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You need level "..config.novalvl..".") return TRUE end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You don't have vocation for this reset.") return TRUE end end return TRUE end Deixei bem configurável pra você configurar como se achar melhor. Explicando como funciona: Resolvi fazer tudo em um script só, então não tinha como eu por para identificar apenas aqueles parâmetros que tu queria, se eu fizesse daquele jeito teria que fazer vários scripts diferentes. Então vai funcionar da seguinte forma, tens que falar "!reset mixedpromo" ou "!reset spinpromo" sem as aspas, e assim por diante. Espero ter te ajudado um pouco, e é isso aew!
  14. jhon992

    Server Save

    Faiz assim esse globalSaveEnable = true, poem = false. Agora vai em "data/globalevents/globalevents.xml" e se nãe existir essa tag ainda então crie: <globalevent name="save" interval="3600" event="script" value="save.lua"/> O interval vai ser = o tempo em segundos para o save! Agora na pasta "data/globalevents/scripts" duplique algum arquivo e nomeie para "save" sem as aspas e nele cole: 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 = "Full s" else text = "S" end text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!" doBroadcastMessage(text) end if(seconds > 0) then addEvent(executeSave, config.events * 1000, seconds - config.events) else doSaveServer(config.shallow) end end function onThink(interval, lastExecution, thinkInterval) if(table.maxn(config.broadcast) == 0) then doSaveServer(config.shallow) else executeSave(config.delay) end return true end É isso aew, espero ter ajudado
  15. Demorei mais terminei, achei até legal a weapon =) Vai em "dat/creaturescripts/creaturescripts.xml" poem a tag: <event type="attack" name="SwordPar" event="script" value="sworpar.lua"/> Agora abra a pasta "creaturescripts/scripts", encontre o seu arquivo login.lua abra e cole a tag: registerCreatureEvent(cid, "SwordPar") Agora o principal, copie e cole um arquivo dessa mesma pasta e renomeie para "swordpar" sem as aspas e nele cole: -- <Script by jhon992> -- local weaponpar = 2377 -- id do item que dara paralize local chancepar = 5 -- chance de ocorrer o paralize (10 = 10%, 20 = 20%, 30 = 30%, 1 = 1%, 5 = 5%) e assim por diante local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0) -- aqui edita os valores pro dano de paralize, vai mudando ae e testando até achar o desejado local condition = createConditionObject(CONDITION_PARALYZE) setConditionParam(condition, CONDITION_PARAM_TICKS, 20000) -- aqui vai o tempo de paralyze, 1000 = 1 segundo setConditionFormula(condition, -0.9, 0, -0.9, 0) setCombatCondition(combat, condition) function onAttack(cid, target) if ((getCreaturePosition(target).x == getCreaturePosition(cid).x or getCreaturePosition(target).x == getCreaturePosition(cid).x+1 or getCreaturePosition(target).x == getCreaturePosition(cid).x-1) and (getCreaturePosition(target).y == getCreaturePosition(cid).y or getCreaturePosition(target).y == getCreaturePosition(cid).y+1 or getCreaturePosition(target).y == getCreaturePosition(cid).y-1)) then if (getPlayerSlotItem(cid, 5).itemid == weaponpar or getPlayerSlotItem(cid, 6).itemid == weaponpar) then if (math.random(1,100) > (100 - chancepar)) then doPlayerSendTextMessage(cid, 23, getCreatureName(target).." has paralized.") doAddCondition(target, condition) return true else return true end end end return true end é isso aew, espero te ajudar e ajudar muitos outros com a mesma dúvida. =)
  16. Isso é meio complicadinho de ensinar, primeiro você deve baixar um Dat Editor e pesquisa tutoriais de como usar. Vo deixar um link de um tutorial pra te dar uma clareada: http://www.xtibia.com/forum/topic/164402-aprendendo-usar-dat-editor/ Vou explicar mais ou menos agora: Você deve baixar o Dat Editor(procure na seção de downloads que encontrara), depois abrir os arquivos Dat e Spr de seu cliente do pokemon nele. Após você ira procurar o item que é essa pokebola na parte esquerda desse programa, ao achar você deve dar um import nas sprites do monstro que você quer adicionar. Depois sigua esse tutorial : http://www.xtibia.com/forum/topic/38886-criando-monstros-dat-editor/ Espero ter te ajudado!
  17. aqui tem um tutorial bom pra explicar isso, que funciona tanto pra poketibia quanto pra qualquer otserv. Ta aew o link: http://www.xtibia.com/forum/topic/154428-criando-novos-pokes-ou-monsters-tibia-em-geral/
  18. ta aew: function onSay(cid, words, param, channel) local cargas = 5 if (getCreatureSkullType(cid) == SKULL_BLACK) then if (getPlayerItemCount(cid, 10064) > 0 and getPlayerStorageValue(cid, 102065) == cargas) then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerRemoveItem(cid, 10064, 1) doPlayerSendTextMessage(cid, 25, "Black Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065,0) return true end if getPlayerItemCount(cid, 10064) > 0 then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerSendTextMessage(cid, 25, "Black Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065, getPlayerStorageValue(cid, 102065)+1) else doPlayerSendTextMessage(cid, 25, "Voce precisa Do Iten Vip Para Remover Skull!") end end if (getCreatureSkullType(cid) == SKULL_RED) then if (getPlayerItemCount(cid, 10064) > 0 and getPlayerStorageValue(cid, 102065) == cargas) then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerRemoveItem(cid, 10064, 1) doPlayerSendTextMessage(cid, 25, "Red Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065,0) return true end if getPlayerItemCount(cid, 10064) > 0 then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerSendTextMessage(cid, 25, "Red Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065, getPlayerStorageValue(cid, 102065)+1) else doPlayerSendTextMessage(cid, 25, "Voce precisa Do Iten Vip Para Remover Skull!") end end if (getCreatureSkullType(cid) == SKULL_NONE) then doPlayerSendTextMessage(cid, 25, "Voce Nao Tem Mas Nem Uma Skull Para Retirar!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return TRUE end
  19. o teu script ta certo só falta colocar no "actions.xml" a tag: <action uniqueid="50102" event="script" value="nomedoteuscript.lua"/> e na alavanca com o mapa editor poem o id "50102". E configura as posições corretas que ficarão os itens no scripts. Se puder passar todas as posições, Exemplo: posição item 1 : (x = 10, y = 20, z = 6) posição item2 : (x = 50, y = 30, z = 5) . . posição playerTeleportado: (x= 100, y = 50, z = 7) Eu configuro pra ti, é sóh passar!
  20. que merda hdasdsahu, vai diminuindo os exp ali do script e vai testando até achar o certo. Muda as tags desse tipo: doPlayerSetExperienceRate(cid, 90) -- diminiu o 90, o 65 e assim por diante. --multiplicam absurdamente, era pra dar 3600 exp mas ta dando 378000 regra de 3: 90*3600 = 378000*x x = 324000 / 378000 x = 0.85 então o primeiro: doPlayerSetExperienceRate(cid, 90) troca pra doPlayerSetExperienceRate(cid, 0.85) vê se funciona e me avisa. Se funcionar vais te que m falar quanto de xp que ta dando a cada estagio e quando que era pra dar.
  21. o meu acontecia um problema parecido, quando eu editava algum player direto pela database e depois logava esse player e soltava uma magia qualquer, dava um frezze imenso e caia o servidor. Tenta usa uma database limpa só pra teste.
  22. vi isso sóh em codigo nas sources, ta aew o link: http://www.xtibia.com/forum/topic/139627-autostacking-items/
  23. poem 1 no config.lua
  24. malz aew, meu google crome não tava abrindo spoiler mais resolvi. Ta aew te script nem testei ainda se der ero me avisa: function onSay(cid, words, param, channel) if (getCreatureSkullType(cid) == SKULL_BLACK) then if (getPlayerItemCount(cid, 10064) > 0 and getPlayerStorageValue(cid, 102065) == 1) then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerRemoveItem(cid, 10064, 1) doPlayerSendTextMessage(cid, 25, "Black Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065,0) return true end if getPlayerItemCount(cid, 10064) > 0 then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerSendTextMessage(cid, 25, "Black Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065,1) else doPlayerSendTextMessage(cid, 25, "Voce precisa Do Iten Vip Para Remover Skull!") end end if (getCreatureSkullType(cid) == SKULL_RED) then if (getPlayerItemCount(cid, 10064) > 0 and getPlayerStorageValue(cid, 102065) == 1) then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerRemoveItem(cid, 10064, 1) doPlayerSendTextMessage(cid, 25, "Red Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065,0) return true end if getPlayerItemCount(cid, 10064) > 0 then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerSendTextMessage(cid, 25, "Red Skull Retirada.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE) setPlayerStorageValue(cid, 102065,1) else doPlayerSendTextMessage(cid, 25, "Voce precisa Do Iten Vip Para Remover Skull!") end end if (getCreatureSkullType(cid) == SKULL_NONE) then doPlayerSendTextMessage(cid, 25, "Voce Nao Tem Mas Nem Uma Skull Para Retirar!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return TRUE end
  25. qual teu sistema de vip?
  • Quem Está Navegando   0 membros estão online

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