Ir para conteúdo

jhon992

Conde
  • Total de itens

    631
  • Registro em

  • Última visita

  • Dias Ganhos

    12

Tudo que jhon992 postou

  1. Para tirar os frags, abaixo da linha: doCreatureSetSkullType(cid, SKULL_NONE) Coloque essa linha: db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
  2. usa isso: http://www.xtibia.com/forum/topic/175370-creaturescript-weapons-paralyze/ e sóh diminui essa parte: setConditionParam(condition, CONDITION_PARAM_SPEED, -400) -- velocidade que o monstro irá perder para -1000 ou mais, dae o player ficara paralizado. ou no lugar do -400 poem: setConditionParam(condition, CONDITION_PARAM_SPEED, -getCreatureSpeed(cid)) acho que funcionara!
  3. usa assim: --Script by mock the bear --Config local SPEED = 1 local PLAYERSPEED = 600 --End local RAILS = {7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130} --Thxy rails itemid by nord local CART = {[0] = 7132, [2] = 7132, [3] =7131, [1] =7131} local CONFIG = { [7121] = 0,[7122] = 0, [7123] = {EAST, SOUTH}, [7124] = {WEST, SOUTH}, [7125] = {EAST, NORTH}, [7126] = {WEST, NORTH}, [7127] = 0,[7128] = 0, [7129] = 0,[7130] = 0, [152] = {NORTH, SOUTH}, --modificado por Piporealino Xtibia [153] = {SOUTH, NORTH}, [154] = {EAST, WEST}, [155] = {WEST, EAST}, --Random } local reverse = {[0] = 2, 3, 0, 1} -- All that table was made by nord. local function moveTrain(cid, frompos, direc) local tab if not isPlayer(cid) then return end local pos = getCreaturePosition(cid) local rar = findRail(pos) if not rar then doPlayerSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_OUTFIT) doChangeSpeed(cid, -PLAYERSPEED) doMoveCreature(cid, direc) else tab = CONFIG[rar] if tab and type(tab) == 'table' then direc = tab[tab[1] == reverse[direc] and 2 or 1] -- by nord here end doSetItemOutfit(cid, CART[direc], -1) doMoveCreature(cid, direc) addEvent(moveTrain, SPEED, cid, pos,direc) end end function findRail(p) local p_ = {x=p.x, y=p.y, z=p.z} for i=0,10 do p_.stackpos = i local t = getTileThingByPos(p_) if isInArray(RAILS, t.itemid) then return t.itemid,t.uid end end end function onUse(cid, item, frompos) --Script by mock the bear if doPlayerRemoveItem(cid, 2151, 1) then if hasCondition(cid, CONDITION_OUTFIT) or (item.actionid < 500 and item.actionid > 503) then return false end doTeleportThing(cid, frompos, false) doPlayerSetNoMove(cid, true) doChangeSpeed(cid, PLAYERSPEED) addEvent(moveTrain, SPEED, cid, frompos, item.actionid-500) return true else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"voce precisa de um ticket.") return TRUE end return TRUE end
  4. Esse tipo de função deve ser colocada na libs para os arquivos poderem identificar. Vai em data/lib/ duplica um arquivo e renomeia para qualquer coisa, depois sóh abre e cola a função drainSpell. Acho que isso resolvera teu problema.
  5. Vai em data/actions/scripts e duplique um arquivo, nomeie para "skullamulet" sem as aspas e nele cole isso: function onUse(cid, item, fromPosition, itemEx, toPosition) local effect = 25 -- efeito ao usar if (getCreatureSkullType(cid) > 2) then doCreatureSetSkullType(cid, SKULL_NONE) doPlayerSendTextMessage(cid, 25, "Sua Skull foi retirada.") doRemoveItem(item.uid, 1) doSendMagicEffect(getPlayerPosition(cid) , effect) else doPlayerSendTextMessage(cid, 25, "Voce nao possui Skull.") end return TRUE end Agora vai em data/actions/actions.xml e cole a tag: <action itemid="8474" event="script" value="skullamulet.lua"/>
  6. Tenta isso, nem testei: Em data/actions/actions.xml: <action itemid="id do item" script="vipstorage.lua"/> Em actions/scripts/ function onUse(cid, item, frompos, item2, topos) local days = 30 -- dias que vai ficar o storage local storage = 203025 -- storage qualquer exhaustion.set(cid, storage, days*60*60*24+exhaustion.get(cid, storage)) doPlayerSendTextMessage(cid, 22, "Voce se tornou Vip.") return TRUE end Em data/movements/movements.xml: <movevent type="StepIn" actionid="15001" event="script" value="viptile.lua"/> Em movements/scripts: function onStepIn(cid, item, pos) local storage = 203025 -- msm storage de antes if isPlayer(cid) then vip = exhaustion.get(cid, storage) if vip < 1 then doTeleportThing(cid, fromPosition, false) doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente players vip podem passar.") end end return TRUE end Configura ostorage de sua preferencia e o id do item. E coloca o action id do seu tile "15001" pelo mapa editor.
  7. usa assim: function onUse(cid, item, frompos, item2, topos) local sexo = getPlayerSex(cid) if item.itemid == 2160 then if sexo == 0 then doSetPlayerSex(cid, 1) doPlayersendTextMessage(cid, MESSAGE_INFO_DESCR, "aaa") end elseif sexo == 1 then doSetPlayerSex(cid, 0) doPlayersendTextMessage(cid, MESSAGE_INFO_DESCR, "aaaaa") end return TRUE end A função getPlayerSex(cid) tinha que ser dentro da function onUse, pq ela precisa do cid = "creature id" do personagem. E tu coloco um onUse dentro de outro e faltou algum end e talz. Assim acho que funcionara corretamente.
  8. Alguma dessas funções podem ser encontradas no arquivos de libs, data/lib/. E pode ser encontrados em varios sites tambem. Quando to programando e esqueço alguma função que eu queira usar uso esse site: http://www.xtibia.com/forum/topic/138081-lualista-de-funcoes/ Pra saber a descrição de cada função é sóh usar um google tradutor ou vai meio pela logica, ou ainda pesquisa sobre a determinada.
  9. Fica assim pra premium: Vai em data/movements/script e duplica um arquivo dessa pasta e nomeie para "itemvip" sem aspas, abra-o e cole: function onEquip(cid, item, slot) if isPremium(cid) == false then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Apenas players vip 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="itemvip.lua"/> Agora vamos fazer um script para que quando a vip acabe, o item saia do slot! Abra data/creaturescripts/scripts e duplica um arquivo, renomeia para "itemlogin" sem as aspas e nele cole: function onLogin(cid) itensVip = { "2408", "8850", "7413" } -- itens vips if isPremium(cid) == false then for i=0, #itensVip do for b = 1,9 do if (getPlayerSlotItem(cid, b) == itensVip[i]) then doPlayerRemoveItem(cid, itensVip[i]) local bag = doPlayerAddItem(cid, 1988, 1) doAddContainerItem(bag, itensVip[i], 1) end end end end return TRUE end E por último, abra data/creaturescripts/creaturescripts.xml e cole a tag: <event type="login" name="ItemLogin" event="script" value="itemlogin.lua"/>
  10. Conditions - Como o nome ja diz são condições que você adiciona aos players. Nas libs do otserv se encontra todos os conditions. Lista de Conditions: CONDITION_NONE = 0 CONDITION_POISON = 1 CONDITION_FIRE = 2 CONDITION_ENERGY = 4 CONDITION_PHYSICAL = 8 CONDITION_HASTE = 16 CONDITION_PARALYZE = 32 CONDITION_OUTFIT = 64 CONDITION_INVISIBLE = 128 CONDITION_LIGHT = 256 CONDITION_MANASHIELD = 512 CONDITION_INFIGHT = 1024 CONDITION_DRUNK = 2048 CONDITION_EXHAUST = 4096 CONDITION_FOOD = 8192 CONDITION_REGENERATION = 8192 CONDITION_SOUL = 16384 CONDITION_DROWN = 32768 CONDITION_MUTED = 65536 CONDITION_ATTRIBUTES = 131072 CONDITION_FREEZING = 262144 CONDITION_DAZZLED = 524288 CONDITION_CURSED = 1048576 CONDITION_PACIFIED = 2097152 CONDITION_GAMEMASTER = 4194304 CONDITION_HUNTING = 8388608 Como adicionar em players: local condition = createConditionObject(CONDITION_NONE) -- nome do condition setConditionParam(condition, CONDITION_PARAM_TICKS, 10000) -- aqui vai o tempo de duração, 1000 = 1 segundo setConditionFormula(condition, 0, 0, 0, 0) -- o dano ao adicionar a condition Storages - Como você ja disse, storage são numeros adicionados ao player para após usar em alguma verificação, os storages ajudam a desenvolver milhares de scripts. Um exemplo de onde é usado os storages é os Sistemas Vips, dae se usa a verificação se o player possuir esse storage == 1, ele podera ter acessos a outros comandos como enetrar em portas ou em areas vips. Como adicionar em player: setPlayerStorageValue(cid, 102050, 1) -- esse comando seta o storage 102050 == 1 getPlayerStorageValue(cid, 102050) ~= 1 -- nesse ele vai verificar se o storafe 102050 esta diferente de 1 Registrar Scripts - Quase todos os scripts são registrados no login.lua, os únicos que não precisam ser registrados são os arquivos que ja são do tipo onLogin. Os outros são necessarios para que funcionem corretamente. Não tenho certeza pra que serve registrar, mais acho que tem algo que ao logar os creaturesscripts ja são adicionados ao character e ficam só esperando ativar, algo desse tipo.
  11. Troca por isso: function onStepIn(cid, item, topos) local lugardele = {x=1763, y=668, z=14, stackpos=1} -- lugar itemid = 3362 if isPlayer(cid) == TRUE then if item.actionid == 9071 then if getPlayerStorageValue(cid, 9071) == -1 then doRemoveItem(getThingfromPos(lugardele).uid, 1) doCreatureSay(cid, msg, TALKTYPE_ORANGE_1) setGlobalStorageValue(9071, 1) end end end return true end
  12. local del = {'460', '1022', '1023'} local updown = {'1', '3'} function onStepIn(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 17000) <= 0 then doTeleportThing(cid, topos, false) doRemoveItem(getTileThingByPos(frompos).uid, 1) if isPlayer(cid) then doPlayerSendCancel(cid, "You can't fly.") end return true end if (not isPremium(cid)) then doPlayerSendCancel(cid,"Voce nao tem habilidades para montar em seu Pokemon!") doPlayerSendMagicEffect(cid, 1) return true end if getPlayerStorageValue(cid, 17000) >= 1 then if topos.z == frompos.z then if getCreatureOutfit(cid).lookType == 316 then effect = 136 else effect = 2 end doSendMagicEffect(topos, effect) end end for x=-1,1 do for y=-1,1 do posa = {x=topos.x+x,y=topos.y+y,z=topos.z} if isInArray(del, getTileThingByPos(posa).itemid) then doRemoveItem(getTileThingByPos(posa).uid, 1) end end end for x=-1,1 do for y=-1,1 do pose = {x=frompos.x+x,y=frompos.y+y,z=frompos.z} if getTileThingByPos(pose).itemid == 0 then doCombatAreaHealth(cid, 0, pose, 0, 0, 0, CONST_ME_NONE) doCreateItem(460, 1, pose) end end end doCombatAreaHealth(cid, 0, topos, 0, 0, 0, CONST_ME_NONE) doCreateItem(460, 1, frompos) if topos.z > frompos.z then doCreateItem(1023, 1, frompos) doTransformItem(getTileThingByPos(frompos).uid, 1023) elseif topos.z < frompos.z then doCreateItem(1022, 1, frompos) doTransformItem(getTileThingByPos(frompos).uid, 1022) end return true end Assim deve funcionar, créditos pro @XxJapanxX
  13. Simples, não usa o Bloco de Notas. saudha Olha só uma dica de um programinha ótimo pra programar é o Notpad++, tem até no baixaki para download é só procurar. Depois da instalação dele, abra-o e vai na guia de lingaguem e escolhe a linguagem .lua, depois só abrir seus scripts do ot e organiza-los como quiser, apertando enter ou tab.
  14. Acho que é isso que tais procurando: http://www.xtibia.com/forum/topic/176267-movements-creaturescripts-vip-items-system/ Se funcionou os créditos vai pro cara que criou o tópico. sajida.
  15. Vai em data/actions/scripts e duplique um arquivo, nomeie para "tokentransform" sem as aspas e nele cole isso: function onUse(cid, item, fromPosition, itemEx, toPosition) local outfit = {200, 201, 202, 203, 204} -- coloque o numero das outfit que se vai usar local timeout = 60000 -- 1000 é equivalente a 1 segundo, 60000 = a 1 minuto if (getPlayerStorageValue(cid, 102087) <= item.uid + 5) then setPlayerStorageValue(cid, 102087, item.uid + 1) doSendMagicEffect(getPlayerPosition(cid) , effect) doSetCreatureOutfit(cid, math.random(1, #outfit), timeout) else doRemoveItem(item.uid, 1) doSendMagicEffect(getPlayerPosition(cid) , effect) doSetCreatureOutfit(cid, math.random(1, #outfit), timeout) setPlayerStorageValue(cid, 102087, -1) end return TRUE end Agora vai em data/actions/actions.xml e cole a tag: <action itemid="9020" event="script" value="tokentransform.lua"/>
  16. Meu item 7765: <item id="7765" article="a" name="mystic blade"> <attribute key="weight" value="3500" /> <attribute key="defense" value="25" /> <attribute key="attack" value="44" /> <attribute key="weaponType" value="sword" /> <attribute key="extradef" value="2" /> <attribute key="elementIce" value="8" /> <attribute key="decayTo" value="7384" /> <attribute key="showcharges" value="1" /> </item> E o 7384: <item id="7384" article="a" name="mystic blade"> <attribute key="weight" value="3500" /> <attribute key="defense" value="12" /> <attribute key="attack" value="22" /> <attribute key="weaponType" value="sword" /> <attribute key="extradef" value="2" /> </item> E no data/weapons/weapons.xml tem esse tipo de tag: <melee id="7765" level="60" unproperly="1" event="function" value="default"/>
  17. jhon992

    Scripting

    Claro que tem como. Vai em data/actions/scripts e duplique um arquivo, nomeie para "stonemonster" sem as aspas e nele cole isso: function onUse(cid, item, fromPosition, itemEx, toPosition) local effect = 30 -- efeito que ocorrera no player ao clicar na pedra local pos = getPlayerPosition(cid) -- não mecha, essa função retorna a posição atual do player doRemoveItem(item.uid, 1) doSendMagicEffect(pos, effect) pid = doSummonCreature("DEMON", getPlayerLookPos(cid)) -- no lugar de "DEMON" poem o monstro que você desejar return TRUE end Agora vai em data/actions/actions.xml e cole a tag: <action actionid="2012" event="script" value="stonemonster.lua"/> Por último com seu mapa editor, vai nas stones desejadas e coloque o actionid = 2012. Acho que só assim ja deve funcionar, qualquer erro ou duvida me pergunte.
  18. pq "mid" vai ser o "cid" do monstro que é recebido nessa linha: mid = doSummonCreature("Emperium",config.empe,false)
  19. Assim é pra funcionar: local storage = 1755 local emGuerra = 1756 local War = { fromPos={x=1349, y=1101, z=7, stackpos=253}, toPos={x=1359, y=1111, z=0, stackpos=253}, rewardRoom = {x=518,y=840,z=7,stackpos=1}} local config = { empe = {x=55, y=34, z=5}, pre1 = {x=68, y=37, z=6}, pre2 = {x=42, y=37, z=6} } local tpId = 1387 local tp = { pos1 = {x=51, y=28, z=6}, pos2 = {x=59, y=28, z=6} } function removeTp(tp) local t = getTileItemById(tp.pos1, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos1, CONST_ME_POFF) end end function removeTeleport(tps) local t = getTileItemById(tp.pos2, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos2, CONST_ME_POFF) end end function onSay(cid, words, param) if param == "open" then setGlobalStorageValue(emGuerra,1) doBroadcastMessage("War of Emperium has began!",22) mid = doSummonCreature("Emperium",config.empe,false) doSummonCreature("Emperium Guard",config.pre1,false) doSummonCreature("Emperium Guardian",config.pre2,false) addEvent(removeTp, 2*1000, tp) addEvent(removeTeleport, 2*1000, tps) return true elseif param == "close" then for _, pid in ipairs(getPlayersOnline()) do if isInArea(getPlayerPosition(pid), War.fromPos, War.toPos) then if getGlobalStorageValue(storage) ~= getPlayerGuildId(pid) then doTeleportThing(pid, War.rewardRoom, false) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE,"Sorry, your guild not win the war!") else doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_BLUE,"Your guild has domation the castle. Congratulations to help her!") end end end setGlobalStorageValue(emGuerra,0) doRemoveCreature(mid) doBroadcastMessage("The war for the castle has ended!",22) else return doPlayerSendCancel(cid,"Talk /war open[for begin the wr] or /war close[for end the war]") end return true end
  20. Entaum faiz assim, vai na pasta mods do seu ot e duplica um arquivo, nomeia para "firstitems" sem as aspas e nele cole: <?xml version="1.0" encoding="UTF-8"?> <mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes"> <config name="firstitems_config"><![CDATA[ config = { storage = 30001, items = {2050, 2382} } ]]></config> <event type="login" name="FirstItems" event="script"> <![CDATA[ domodlib('firstitems_config') function onLogin(cid) local config = { voc_items = { { -- SORC {2190}, -- wand of vortex {2175}, -- spellbook {8820}, -- mage hat {8819} -- mage robe }, { -- DRUID {2182}, -- snakebite rod {2175}, -- spellbook {8820}, -- mage hat {8819} -- mage robe }, { -- PALADIN {2410}, -- throwing knife {2530}, -- copper shield {2480}, -- legion helmet {2464} -- chain armor }, { -- KNIGHT {2409}, -- serpent sword {2530}, -- copper shield {2480}, -- legion helmet {2464} -- chain armor } }, all_items = { {2468}, -- studded legs {2643} -- leather boots }, extra_items = { {2789, 15}, {2120}, {5710} }, knight_weapons = { {2423}, -- clerical mace {2429} -- barbarian axe } } if getPlayerGroupId(cid) < 3 then if getPlayerStorageValue(cid, storage) == -1 then local common = config.voc_items[getPlayerVocation(cid)] if common ~= nil then for _, v in ipairs(common) do doPlayerAddItem(cid, v[1], v[2] or 1) end end local all = config.all_items if all ~= nil then for _, v in ipairs(all) do doPlayerAddItem(cid, v[1], v[2] or 1) end end local extra = config.extra_items local bp = doPlayerAddItem(cid, 1988, 1) if extra ~= nil then for _, v in ipairs(extra) do doAddContainerItem(bp, v[1], v[2] or 1) end end local weapons = config.knight_weapons if weapons ~= nil then for _, w in ipairs(weapons) do if isKnight(cid) then doAddContainerItem(bp, w[1], w[2] or 1) end end end setPlayerStorageValue(cid, storage, 1) end end return true end ]]></event> </mod> Créditos: Collz JDB
  21. Se não entendeu, faiz assim abre o data/creaturescripts/creaturescripts.xml e procura o script que tem o event type = kill, dae marca o nome do script correspondente dessa linha e abre o creaturescripts/scripts procure o script que voce marcou o nome e cole o script aqui. Ou cole essa tag no seu script antes do "return TRUE" doPlayerAddItem(cid,2160,1)
  22. Vlw a dica @Demonbholder, quando tiver tempo estudo essa função e mudo no tópico.
  23. Ta aew o script pra você: Duplica um arquivo na pasta data/spells/scripts e nomeia para sennin e nele cole: local outfit = {lookType = 32} -- ropa do modo sanin local tempo = 60 * 1000 -- Tempo, nesse caso esta 60 segundos Lembrando que 1000 = 1 segundo local efeito = 48 -- efeito no player local ml = 2 -- quantos ira aumentar o skill de ML local skillfist = 2 -- quantos ira aumentar o skill de Fist local skillsword = 2 -- quantos ira aumentar o skill de Sword local skillaxe = 2 -- quantos ira aumentar o skill de Axe local skillclub = 2 -- quantos ira aumentar o skill de Club local skilldistance = 2 -- quantos ira aumentar o skill de Distance local skillshield = 2 -- quantos ira aumentar o skill de Shield local health = 20 -- A cada 1 segundo quantos aumentar de vida local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, efeito) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo) 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, 250) setConditionParam(condition, CONDITION_PARAM_TICKS, tempo) 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) 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 onCastSpell(cid, var) return doCombat(cid, combat, var) end E no spells.xml cola a tag: <instant name="sannin" words="sannin" aggressive="0" lvl="1" mana="40" selftarget="1" exhaustion="1500" script="transform.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> <vocation id="4"/> </instant> Edita como você quiser!
  24. Verifica se no arquivo, data/creaturescripts/script/login.lua tem uma parte assim: doPlayerSetLossSkill(cid, 0) Se encontrar exclua! Verifica tambem se no teu creaturescripts.xml não tem nenhum arquivo do tipo onDeath ou PrepareDeath, se tiver vaia no arquivo correspondente e procure por essa mesma linha de codigo: doPlayerSetLossSkill(cid, 0) E se possuir essa linha, que provavemente é o erro, simplesmente exclua a linha.
  • Quem Está Navegando   0 membros estão online

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