Ir para conteúdo
Banner com Efeitos

xWhiteWolf

Héroi
  • Registro em

  • Última visita

Tudo que xWhiteWolf postou

  1. só não entendi isso daqui:
  2. Primeiro vc cria a vocação no seu vocations.xml, feito isso vc pode ir atrás do npc aqui no fórum mesmo.. tem um monte desse estilo. A função principal é ele checar sua vocação, se vc não for troll então ele seta sua vocação como troll
  3. function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if isPlayer(cid) then while getCreatureHealth(cid) ~= getCreatureMaxHealth(cid) and getCreatureMana(cid) ~= getCreatureMaxMana(cid) and getThingPos(cid) == toPosition do addEvent(function() if isCreature(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid)/15) doCreatureAddMana(cid, getCreatureMaxMana(cid)/15) doSendAnimatedText(toPosition, "+ " .. getCreatureMaxHealth(cid)/15 .. "", math.random(1, 255)) end end, 1000) end end return true end
  4. ae galera, fiz certinho aqui: local arr = { {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0} } local area = createCombatArea(arr) function onCastSpell(cid, var) doCreatureSay(cid, "I WILL UNLEASH THE FURY OF HELL!", 20) addEvent(function() if isCreature(cid) then doAreaCombatHealth(cid, 1, getThingPos(cid), area, -1000, -3000, CONST_ME_MORTAREA) end end, 5000) return true end em arr vcs editam a area que vcs quiserem. doAreaCombatHealth(cid, 1, getThingPos(cid), area, -1000, -3000, CONST_ME_MORTAREA) aqui vcs editam o resto: 1 é o tipo de combat, os possiveis são: COMBAT_NONE = 0 COMBAT_PHYSICALDAMAGE = 1 COMBAT_ENERGYDAMAGE = 2 COMBAT_EARTHDAMAGE = 4 COMBAT_POISONDAMAGE = 4 COMBAT_FIREDAMAGE = 8 COMBAT_UNDEFINEDDAMAGE = 16 COMBAT_LIFEDRAIN = 32 COMBAT_MANADRAIN = 64 COMBAT_HEALING = 128 COMBAT_DROWNDAMAGE = 256 COMBAT_ICEDAMAGE = 512 COMBAT_HOLYDAMAGE = 1024 COMBAT_DEATHDAMAGE = 2048 -1000 e -3000 são os danos minimos e máximos e const_me_mortarea é o efeito. Daí no monstro é só adicionar <attack name="delayed" interval="1000" chance="15"/> sendo interval o tempo q ele vai tentar usar a magia e chance é a chance de ela sair. Nesse caso a cada 1 segundo ele faz um número aleatorio entre 1 e 100, se esse número for menor que 15 então ele solta a magia.
  5. eu tinha feito por addEvent mesmo llucas, dá uma olhada no tópico q vc vai ver
  6. "Voce sabe o comando q poe na config para healar mais rapido e bater mais rapido?"x4 QUAL A NECESSIDADE DISSO? auueuhauheu não é comando, vc tem que ir em data/xml/vocations.xml e editar a attackspeed, a manaticks e a healticks healticks é de quantos em quantos segundos vai recuperar a quantidade de mana lá... só colocar um numero baixo, lembre-se que o tempo é em milisegundos então 1000 = 1 segundo. Pra bater mais rápido é a attackspeed (tb em milisegundos), 1000 = 1 segundo entre 1 ataque e outro
  7. nos primórdios do tibia actionid servia para callbacks que indicavam ações e uniqueid era pra separar alguns tipos de items especiais.. Hoje em dia ambas servem com o propósito de aumentar a quantidade de numeros disponiveis.. Se antes vc só podia ter no maximo 9.000 scripts, agora vc pode ter 9.000 usando actionid e + 9.000 usando unique id.
  8. ok, pode deixar... vou fazer uns testes hoje a noite e posto aqui o resultado
  9. não faço a minima idéia de como fazer um npc que caminha por uma rota pré definida, se não eu te ajudava.. não sei nem se é possível.
  10. ela foi feita pra ser usada juntamente com esse sistema http://www.tibiaking...-castle-war-20/ A função é questão é um movements... (mas como eu sei disso??) simples, é só olhar o callback function onStepIn(cid, item, position, fromPosition) função ao pisar dentro, parametros: cid, item, posição final, posição inicial) daí vc abre seu movements.xml e coloca essa linha aqui: <movevent type="StepIn" actionid ="2000" event="script" value="nomedoscript.lua"/> o movement type é o mesmo da callback, ou seja, stepin.. actionid vc coloca o numero q vc quiser (tb poderia ser itemid ou uniqueid), event é oque deve ser feito, no caso a gente quer que ele leia o script, então coloque "script" e value sera o nome do script que eu quero que ele leia.
  11. funciona do mesmo jeito..
  12. eu também era de outro fórum mas cansei de algumas coisas que aconteciam... no tibiaking me baniram porque eu liberava scripts que o povo vendia e na otnet eles ficaram mudando tanto de site que o contéudo foi todo jogado no lixo, hoje em dia é quase impossível achar um link no google que leve pro post certo. Aqui no TK eu não tive nenhum problema e o pessoal parece que tá reunido aqui, eu resolvo as dúvidas de quem não manja e tento ensinar pra que eles possam ensinar outros.
  13. não precisa adicionar nada em creaturescripts.xml, só no login.lua mesmo. salve o arquivo em actions como miner.lua e adiciona a tag no actions.xml <action itemid="2553" script="miner.lua"/> fim x) obs: se possivel clique em melhor resposta pra que o tópico fique como resolvido
  14. xWhiteWolf postou uma resposta no tópico em Suporte Tibia OTServer
    a função é onDeath.. o cid é o monster então não tem como pegar isInParty(cid) pq o cid tá se referindo ao monstro nesse caso, e não ao player que o matou. o certo seria assim: if isInParty(killer[1]) == false then setPlayerStorageValue(killer[1], Storage, 1) doCreatureSay(cid, "Nããããooo!", TALKTYPE_ORANGE_1) doCreateMonster(Monster, pos) else doCreateMonster(Monster, pos) for i, pla in ipairs(getPartyMembers(getPartyLeader(killer[1]))) do -- Essa parte comeca a parte do grupo setPlayerStorageValue(pla, Storage, 1) -- adiciona 1 stora pra kda integrante do grupo end doCreatureSay(cid, "Nããããooo!", TALKTYPE_ORANGE_1) end end end
  15. @Daaniel, vc confundiu as funções: doPlayerRemoveItem(cid, itemid, count[, subtype]) doRemoveItem(uid[, count]) a primeira tem cid, id do item, quantidade e subtipo a segunda tem uid (uid é a identidade) e quantidade os colchetes servem pra identificar quais são os parametros opcionais. @Skydangerous como ela não é infinita a primeira coisa que vc faz é ver a function e a quantidade dela. a function deve estar como function onUse(cid, item, frompos, item2, topos); então vc deve colocar isso daqui antes do ultimo return true if item.type > 1 then doChangeTypeItem(item.uid,item.type-1) else doRemoveItem(item.uid,1) end
  16. exatamente como vc pediu... terra = {351,352,353,354,355} levels = { [-1] = 2229, ---- skull [0] = 1294, --- small stone [1] = 3976, --- worm [10] = 2149, -- Small Emerald [12] = 2146, -- Small Sapphire [15] = 2145, -- Small Diamond [17] = 2150, -- Small Amethyst [20] = 2147, -- Small Ruby [25] = 2144, -- Black Pearls [27] = 2143, -- White Pearls [30] = 2157, -- Gold Nuggets [35] = 2156, --- red gem [36] = 2158, -- blue gem [37] = 2155, -- green gem [38] = 2153, -- violet gem [39] = 2154, -- yellow gem [40] = 2157, -- small enchanted emerald [42] = 2157, -- Small Enchanted Sapphiire [45] = 2158, -- Small Enchanted Amethyst [50] = 2161, -- Small Enchanted Ruby [70] = 2162 -- Life Crystal } local config = { storage = 19333, chance = 40, --- chance de achar um item ou não k = 2, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } function onUse(cid, item, fromPosition, itemEx, toPosition) local drops = {} function getDrops(cid) for i= -1,getPlayerStorageValue(cid, config.storage) do if levels[i] then table.insert(drops, levels[i]) end end return true end if isInArray(terra, itemEx.itemid) then getDrops(cid) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1) local experience = getPlayerStorageValue(cid, config.experience) if experience >= (getPlayerStorageValue(cid, config.storage)^2)/config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".") if getPlayerStorageValue(cid, config.storage) == 50 then doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1,100) then if #drops >= 1 then local item = drops[math.random(1,#drops)] doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".") doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 3) else doSendMagicEffect(toPosition, 2) return TRUE end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".") else return FALSE end return true end agora é só ir no creaturescripts\scripts\login.lua e colocar antes do ultimo return true: if getPlayerStorageValue(cid, 19333) == -1 then setPlayerStorageValue(cid, 19333, 0) elseif getPlayerStorageValue(cid, 19334) == -1 then setPlayerStorageValue(cid, 19334, 0) end obs: a fórmula pro level da skill tá assim: level atual x level atual / k dá pra mudar mas eu prefiri fazer assim pq a função quadrática é crescente então a cada level ia precisar de mais experiencia doque o level anterior, mas fica a seu critério mudar. Pode parecer que tá bem fácil upar no começo, mas lembre-se doque eu falei. Fazendo uma continha simples você descobre que se precisa de somente 50 mineiradas pra pegar level 10, mas a mesma conta nos diz que é necessário 1250 mineiradas pra se chegar no 50. Então cuidado com oque faz na fórmula auheuhauheuh Também tomei a liberdade de editar o formato inicial das recompensas.. fiz a cada 2 leveis pra facilitar e não complicar o script ainda mais, mas ainda assim está dentro daquilo que vc falou anteriormente. Espero que vc tenha gostado porque leveu quase 4 horas pra fazer isso aí auhuhauhauh
  17. tem vários scripts que eu tiro de outros jogos (ou de outros servers) auhauhauh a graça do tibia é justamente essa mobilidade toda EDIT: ADICIONEI O MONSTRO DA SKILL AGORA, DIVIRTAM-SE >.<
  18. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_COMBAT_NONE) local arr = { {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {0, 1, 0}, {0, 3, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, } local area = createCombatArea(arr) setCombatArea(combat, area) local function doPushCreature(uid,direction,distance,time) if isCreature(uid) == TRUE then local rand = (2*math.random(0,1))-1 local rand2 = math.random(-1,0) if direction == 0 then signal = {0,rand,-rand,rand,-rand,0,-1,-1,-1,0,0,0} elseif direction == 1 then signal = {1,1,1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 2 then signal = {0,rand,-rand,rand,-rand,0,1,1,1,0,0,0} elseif direction == 3 then signal = {-1,-1,-1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 4 then signal = {-1,rand2,(-rand2)-1,0,1,rand2+1,rand2,0} elseif direction == 5 then signal = {1,-rand2,-((-rand2)-1),0,1,rand2+1,rand2,0} elseif direction == 6 then signal = {-1,rand2,(-rand2)-1,0,-1,(-rand2)-1,rand2,0} else signal = {1,-rand2,-((-rand2)-1),0,-1,(-rand2)-1,rand2,0} end local pos = getThingPos(uid) nsig = #signal nvar = 0 repeat nvar = nvar+1 newpos = {x=pos.x+(signal[nvar]),y=pos.y+(signal[(nsig/2)+nvar]),z=pos.z} newtile = {x=newpos.x,y=newpos.y,z=newpos.z,stackpos=0} until getTileThingByPos(newtile).uid ~= 0 and hasProperty(getTileThingByPos(newtile).uid,3) == FALSE and queryTileAddThing(uid,newpos) == 1 or nvar == (nsig/2) if canWalk(newpos) == TRUE then if distance == nil or distance == 1 then doTeleportThing(uid,newpos,TRUE) else distance = distance-1 doTeleportThing(uid,newpos,TRUE) if time ~= nil then addEvent(doPushCreature,time,uid,direction,distance,time) else addEvent(doPushCreature,500,uid,direction,distance,500) end end end end end local function getPosfromArea(cid,area) icenter = math.floor(table.getn(area)/2)+1 jcenter = math.floor(table.getn(area[1])/2)+1 center = area[icenter] ivar = table.getn(area) jvar = table.getn(area[1]) i = table.getn(area)^2 j = table.getn(area[1])^2 if center[jcenter] == 3 then local pos = getThingPos(cid) if getPlayerLookDir(cid) == 0 then effectpos = {x=pos.x,y=pos.y-1,z=pos.z} signal = {-1,1,1,2} elseif getPlayerLookDir(cid) == 1 then effectpos = {x=pos.x+1,y=pos.y,z=pos.z} signal = {1,-1,2,1} elseif getPlayerLookDir(cid) == 2 then effectpos = {x=pos.x,y=pos.y+1,z=pos.z} signal = {1,-1,1,2} else effectpos = {x=pos.x-1,y=pos.y,z=pos.z} signal = {-1,1,2,1} end doSendMagicEffect(effectpos, 2) else signal = {-1,1,1,2} end POSITIONS = {} P = 0 repeat pvar = {0,0} I = area[ivar] J = I[jvar] i = i-1 j = j-1 if J == 1 then if jvar < jcenter then pvar[signal[3]] = signal[1]*math.abs((jcenter-jvar)) elseif jvar > jcenter then pvar[signal[3]] = signal[2]*math.abs((jcenter-jvar)) end if ivar < icenter then pvar[signal[4]] = signal[1]*math.abs((icenter-ivar)) elseif ivar > icenter then pvar[signal[4]] = signal[2]*math.abs((icenter-ivar)) end end if jvar > 1 then jvar = (jvar-1) elseif ivar > 1 then jvar = table.getn(area[1]) ivar = (ivar-1) end local pos = getThingPos(cid) local areapos = {x=pos.x+(pvar[1]),y=pos.y+(pvar[2]),z=pos.z} if pos.x ~= areapos.x or pos.y ~= areapos.y then P = P+1 POSITIONS[P] = areapos end until i <= 0 and j <= 0 return POSITIONS end function canWalk(pos, creature, pz, proj) -- nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end local creature = getTopCreature(pos) if creature.type > 0 then return false end if getTilePzInfo(pos) and not pz then return false end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function onCastSpell(cid, var) pos = getPosfromArea(cid,arr) n = 0 while n < #pos do n = n+1 thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253} if isCreature(getThingfromPos(thing).uid) == TRUE then doPushCreature(getThingfromPos(thing).uid,getPlayerLookDir(cid)) doSendAnimatedText(getThingPos(cid), "GET OFF", 215) end end return doCombat(cid, combat, var)end
  19. NextBR, poste o script em tempo real por favor... ia contribuir muito pro estudo do pessoal e com esse novo conhecimento a gente poderia fazer uns scripts muito mais fodas pra trazer pro fórum.
  20. eu dei uma mexida nos créditos pra ver se some o problema deles.. se algum dos caras q disse q tava dando erro antes pudesse testar agora, eu agradeceria
  21. bom saber, mas vc sabe porque o subid é 2? Seria algo do tipo 0 = heal, 1 = support e 2 = agressive?
  22. xWhiteWolf postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    acho q vc esqueceu de configurar o script: local posCoal = {x = 169, y = 58, z = 7} -- POSIÇÃO DO COAL, ONDE O GOLD DEVE ESTAR
  23. o primeiro tem que ser um npc mesmo? achei esse script aqui http://www.tibiaking.com/forum/topic/11649-npc-guard-ataca-players-com-skulls/
  24. faz um movements pro item em questão com a função onRemoveItem(moveItem, tileItem, position, cid) Se o storage for 1 então return false. se for 0 então return true. Daí é só fazer uma action que torna o item untradeable: ao clicar no item deixar o storage 1 e ao clicar dnv, se tiver o storage 1 seta o storage 0 e manda uma msg: "Item Unlocked" Tenta fazer sozinho, se não conseguir me manda PM que eu volto aqui e tento te ajudar OBS: meu script de Aura System tem um negócio desse, só que eu usei porque no caso o item não poderia ser removido do slot. Mas pra fazer ele não ser removido do player teria que ser onRemoveItem. OBS2: Lembra de fazer o item untradeable quando ele estiver locked porque se não o cara vai dar trade no item locked e vai ativar o script que vai retornar false e vai bugar a porra toda

Informação Importante

Confirmação de Termo