Ir para conteúdo

Bodak Reborn

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Bodak Reborn recebeu reputação de Orientalz em (Resolvido)Todos ganham item ao matar boss   
    creaturescripts/script
    nome_arquivo.lua
    local config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3... qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3... effect = 27, -- efeito ao matar o monstro. } function onKill(cid, target) if isInArray(config.monster, getCreatureName(target)) then for i = 1, #config.item do doPlayerAddItem (cid, config.item[i], config.qnt[i]) end doPlayerSendTextMessage (cid, 19, "Você receberá uma recompensa por derrotar o "..getCreatureName(target)..".") doSendMagicEffect (getThingPos (cid), config.effect) end return true end XML:
    <event type="kill" name="killBossReward" event="script" value="nome_arquivo.lua"/> Registre o evento em login.lua:
    registerCreatureEvent(cid, "killBossReward")  
  2. Curtir
    Bodak Reborn recebeu reputação de Marcos FeaR em [pedido] Regen Stamina Trainer   
    Eu esqueci de colocar uma tag.
    Aqui:
    <movevent type="StepOut" actionid="actiond_id" event="script" value="nome_arquivo.lua" />  
  3. Gostei
    Bodak Reborn recebeu reputação de maicao22 em gaz'haragoth Spells   
    local voc = {1, 2, 3, 4, 5, 6, 7, 8} arr = { {0, 0, 0, 0, 0, 0, 1, 0, 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}, {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, 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, 0, 1, 0, 0, 0, 0, 0, 0}, } local area = createCombatArea(arr) local combat = createCombatObject() setCombatArea(combat, area) function onTargetTile(cid, pos) local creatureTable = {} local n, i = getTileInfo({x=pos.x, y=pos.y, z=pos.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=i}).uid while v ~= 0 do if isCreature(v) == true then table.insert(creatureTable, v) if n == #creatureTable then break end end i = i + 1 v = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=i}).uid end end if #creatureTable ~= nil and #creatureTable > 0 then for r = 1, #creatureTable do if creatureTable[r] ~= cid then local min = 30000 local max = 30000 if isPlayer(creatureTable[r]) == true and isInArray(voc, getPlayerVocation(creatureTable[r])) == true then doTargetCombatHealth(cid, creatureTable[r], COMBAT_ENERGYDAMAGE, -min, -max, CONST_ME_NONE) elseif isMonster(creatureTable[r]) == true then doTargetCombatHealth(cid, creatureTable[r], COMBAT_ENERGYDAMAGE, -min, -max, CONST_ME_NONE) end end end end doSendMagicEffect(pos, CONST_ME_PURPLEENERGY) return true end setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile") local function delayedCastSpell(cid) if isCreature(cid) == true then doCombat(cid, combat, positionToVariant(getCreaturePosition(cid))) doCreatureSay(cid, "Gaz'haragoth calls down: DEATH AND DOOM!", TALKTYPE_ORANGE_2) end end function onCastSpell(cid, var) doCreatureSay(cid, "Gaz'haragoth begins to channel DEATH AND DOOM into the area! RUN!", TALKTYPE_ORANGE_2) addEvent(delayedCastSpell, 5000, cid) return true end  
  4. Gostei
    Bodak Reborn recebeu reputação de BrunoWots em [SUPORTE] Script ponte rookgaard   
    function onUse(cid, item, frompos, item2, topos) tile1 = {x = 32100, y = 32205, z = 8, stackpos = 1} tile2 = {x = 32101, y = 32205, z = 8, stackpos = 1} local playerTile = {x = 32100, y = 32205, z = 8} local playerTile1 = {x = 32101, y = 32205, z = 8} gettile1 = getThingfromPos(tile1) gettile2 = getThingfromPos(tile2) if item.itemid == 1945 then for i = 1133, 1134 do doTransformItem(item.uid, 1946) end doCreateItem(493,1,tile1) doCreateItem(493,1,tile2) doCreateItem(4799,1,tile1) doCreateItem(4797,1,tile2) if isCreature(getTopCreature(playerTile).uid) then doTeleportThing(getTopCreature(playerTile).uid, {x = 32102, y = 32205, z = 8}) end if isCreature(getTopCreature(playerTile1).uid) then doTeleportThing(getTopCreature(playerTile1).uid, {x = 32102, y = 32205, z = 8}) end elseif item.itemid == 1946 then for i = 1133, 1134 do doTransformItem(item.uid, 1945) end doCreateItem(1284,1, tile1) doCreateItem(1284,1, tile2) doRemoveItem(gettile1.uid, 1) doRemoveItem(gettile2.uid, 1) else doPlayerSendCancel(cid,"Sorry, not possible.") end return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end  
  5. Gostei
    Bodak Reborn recebeu reputação de gabirucola em Desabilitar PVP   
    Só faltou eu colocar os creaturescripts, lel.
    Achei esse script do zipter.
     
    talkactions
    local msg = "Agora seu sistema PvP está %s." function onSay(cid, words, param) local _table = { ["on"] = {"ativado", 1}, ["off"] = {"desativado", 0}, } if _table[param:lower()] then local mode = _table[param:lower()] setPlayerStorageValue(cid, 91821, mode[2]) doPlayerSendTextMessage(cid, 27, msg:format(mode[1])) end return true end  
    creaturescripts
     
    XML:
    <event type="statschange" name="PvPStats" event="script" value="nome do arquivo.lua"/> <event type="target" name="PvPTarget" event="script" value="nome do arquivo.lua"/> <event type="login" name="PvPLogin" event="script" value="nome do arquivo.lua"/> script
    function onTarget(cid, target) if isPlayer(target) and isPlayer(cid) then if getPlayerStorageValue(cid, 91821) < 1 then doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.") return false end end return true end function onStatsChange(cid, attacker, type, combat, value) if isPlayer(cid) and isPlayer(attacker) and type == STATSCHANGE_HEALTHLOSS then if getPlayerStorageValue(attacker, 91821) < 1 then doPlayerSendCancel(attacker, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o.") return false end end return true end function onLogin(cid) registerCreatureEvent(cid, "PvPTarget") registerCreatureEvent(cid, "PvPStats") return true end Caso não consiga colocar a tag nas talkactions, me avise.
  6. Curtir
    Bodak Reborn recebeu reputação de BangxD em Spell de tirar summon e ganhar newtype   
    @zPerseu, eu atualizei o código lá em cima, substitua-o pelo seu.
  7. Gostei
    Bodak Reborn recebeu reputação de GM Kinagon em [SCRIPT] Use no item e ganha outfit   
    @wougoplex
     
    Caso seja uma outfit que não aparecerá no seu "armário de roupas" - que pode ser aberto clicando em você pelo botão direito - utilize:
    local looktype = 651321 -- looktype da outfit. function onUse(cid, item, frompos, item2, topos) if getCreatureOutfit (cid).lookType ~= looktype then doSetCreatureOutfit (cid, {lookType = looktype}, -1) doRemoveItem (item.uid, 1) else doPlayerSendTextMessage (cid, 19, "Você já está utilizando esta roupa!") end return true end  
    Caso você queira que seja uma outfit que possa ser trocada infinitas vezes pelo "armário", utilize:
    local looktype = 6513849 -- storage da outfit. function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue (cid, looktype) ~= 1 then setPlayerStorageValue (cid, looktype, 1) doRemoveItem (item.uid, 1) else doPlayerSendTextMessage (cid, 19, "Você já possui esta roupa!") end return true end  
  8. Gostei
    Bodak Reborn recebeu reputação de Marombalexx em Addon System (Fly, ride, surf, look e evolution)   
    Yo boyz, cá estou novamente.
    Eu estava procurando um Addon System funcional e vi que todos tinham bugs, então eu peguei um aqui no fórum mesmo, corrigi os bugs e fiz para que o sistema funcione com fly, ride, surf, look e que o addon suma quando o pokémon evoluir. Também é possível substituir um addon por outro, sem que o pokémon fique com o addon antigo.
    São muitos arquivos envolvidos, então, se eu esquecer algo e o sistema não esteja 100%, por favor, me fale.
    Deixei alguns exemplos no código para caso você esteja com preguiça e queira testar, além de comentar como adicionar novos addons.
     
    OBS: Eu testei apenas em PDA PokexCyan (TFS 1.0).
     
     
    actions/scripts
    nome_arquivo.lua
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getOldAddon (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end function onUse(cid, item, fromPosition, itemEx, toPosition) local numero = addons[item.itemid].looktype local pb = itemEx.uid local pk = addons[item.itemid].pokemon if not isPokeball(itemEx.itemid) then doPlayerSendCancel(cid, "Você só poder usar este item em uma poke ball.") return true end if getPlayerSlotItem (cid, 8).uid == pb and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) then doPlayerSendCancel (cid, "Desmonte do seu pokémon e volte-o para a poke ball.") return true end if getItemAttribute(pb, "addon") and getItemAttribute(pb, "addon") == numero then doPlayerSendCancel(cid, "Seu pokémon já está com este addon.") return true end if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Por favor, volte o seu pokémon para a poke ball.") return true end if getItemAttribute(pb, "poke") ~= pk then doPlayerSendCancel(cid, "Desculpe, você não pode adicionar este addon neste pokémon.") return true end if getItemAttribute (pb, "addon") and getItemAttribute (pb, "addon") > 1 then doPlayerSendTextMessage(cid, 27, "Você substituiu um "..getItemNameById (getOldAddon (getItemAttribute (pb, "addon"))).." por um "..getItemNameById (item.itemid).."!") else doPlayerSendTextMessage(cid, 27, "Agora seu pokémon usará este "..getItemNameById (item.itemid).."!") end doRemoveItem(item.uid, 1) doSetItemAttribute(pb, "addon", numero) return true end  
    actions.xml:
    <action itemid="13989;12344;13990;ID do item; ID do item;" event="script" value="nome_arquivo.lua"/>  
    em actions/order.lua, abaixo de:
    if not isCreature(pk) then pk = doCreateMonster(pokemon, backupPos) if not isCreature(pk) then doPlayerSendCancel(cid, "You can't stop flying/riding here.") return true end doConvinceCreature(cid, pk) end  
    adicione:
    local pb = getPlayerSlotItem(cid, 8).uid local flyAdd = flysAddon[getItemAttribute (pb, "addon")] local rideAdd = ridesAddon[getItemAttribute (pb, "addon")] if flyAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end elseif rideAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end end  
    em lib/configuration.lua, será necessário adicionar três tabelas, uma para fly, outra para ride e outra para surf. Nesta tabela, o nome do pokémon não é requirido, o que talvez faça você se perder. Se você achar necessário, comente com "--" o nome do pokémon.
    Exemplo:
    [205] = {540, 1200}, -- Pidgeot [850] = {210, 800}, -- Dragonair procure por: flys
    e acima disso adicione:
    flysAddon = { [205] = {540, 1200}, [201] = {541, 1200}, --[número do looktype normal] = {looktype voando, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    ridesAddon = { [556] = {555, 30}, --[número do looktype] = {looktype montado, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    surfsAddon = { [201] = {541, 10}, [552] = {553, 10}, --[número do looktype] = {looktype nadando, speed da tabela abaixo.} }  
    em lib/order.lua, procure por:
    elseif skill == "fly" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    depois, no mesmo arquivo, procure por:
    elseif skill == "ride" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    em movements/surf.lua, procure por:
    if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7 doTeleportThing(cid, fromPosition, false) return true end  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute(pb, "addon")][1]}, -1) end  
    logo abaixo disso, vocês vão encontrar:
    (isso não envolve o funcionamento do sistema de addon, mas é um bug que eu achei no meu surf. Todos os pokémon tinham velocidade fixa de 1500.)
    local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate  
    substitua por:
    local speed = 75 + PlayerSpeed + surfs[getPokemonName(getCreatureSummons(cid)[1])].speed * 8 * speedRate  
    no mesmo arquivo, procure por:
    if getItemAttribute(item.uid, "nick") then doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1) else doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1) end doSummonMonster(cid, pokemon) local pk = getCreatureSummons(cid)[1]  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if surfsAddon[getItemAttribute(pb, "addon")] then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute(pb, "addon")}, -1) end end  
     
    em actions/goback.lua, procure por:
    doSendMagicEffect(getCreaturePosition(pk), effect)  
    abaixo adicione:
    local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb, "addon") if not look then doSetItemAttribute(pb, "addon", 0) end if look and look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end  
    em actions/evolution.lua, procure por:
    local ball = getPlayerSlotItem(cid, 8).uid  
    há 12 linhas iguais a essa nesse arquivo e embaixo de TODAS elas, adicione:
    doItemSetAttribute (ball, "addon", 0)  
    em creaturescripts/look.lua, procure por:
    if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end  
    se novamente, esse código aparece duas vezes no arquivo.
    E também, novamente, embaixo dos dois, adicione:
    if getItemAttribute(thing.uid, "addon") then if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then if getItemAttribute(thing.uid, "addon") > 1 then table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".") end end end  
    E no começo desse arquivo, adicione:
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getAddonId (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end  
    a tabela "addons" deve ser a mesma que a do actions/addon.lua. Então, quando você adicionar algo no addon.lua, deverá adicionar também no look.lua.
     
    em login.lua, procure por:
     
    doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)  
    e substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[poke].looktype + 351}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end
  9. Gostei
    Bodak Reborn recebeu reputação de Graycat em Preço do item no look   
    Yo boyz! 
    Eu estava atrás desse sistema há um tempo e não achava em lugar nenhum. Estudei bastante sobre lua e depois de um tempo eu consegui fazer eu mesmo, então vou disponibilizá-lo para vocês.
    Eu testei o sistema em PDA (PokeXCyan) TFS 1.0, mas deve funcionar para outras bases. O script em si não é complexo, é apenas chato de adicionar os itens na tabela. Eu vou deixar a tabela que eu fiz com os itens que tem no servidor para qual eu fiz o script aqui embaixo como spoiler, para caso você queira poupar tempo.
    Essa tabela deve ser adicionada no começo do código em creaturescripts/look.lua.
    Caso queira adicionar o sistema para pokémon também, basta você pegar a tabela que está localizada em npc/pokemon seller.lua.
     
    Ao código:
    Em look.lua, procure por:
    elseif getItemAttribute(thing.uid, "unique") then substitue o
    else return true end que está "linkado" a esse IF por
    elseif NPCPrice[iname.name] then local qnt = 0 if thing.type == 0 then qnt = 1 else qnt = thing.type end local p = getThingPos(thing.uid) local calculo = NPCPrice[iname.name].price * qnt table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, "\n"..iname.description.." Price: $"..calculo..".") if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true end Ficando assim:
     
    Caso queira que o preço no look funcione para pokémon também, procure por
    table.insert(str, "It is genderless.") tem 3 linhas iguais a esse no look.lua. A linha na qual eu me refiro é a primeira encontrada no arquivo.
     
    Depois do end, adicione:
     
    local boosts = getItemAttribute(thing.uid, "boost") or 0 local precocertos = 0 if boosts > 50 then precocertos = ((gastostones[50] * 5) * 400) + ((boosts - 50) * 100000) else precocertos = ((gastostones[boosts] * 5) * 400) end if getItemAttribute (thing.uid, "ehditto") then pokename = "Ditto" end local pokeCost = pokePrice[pokename] or math.floor(pokes[pokename].level * 150) if pokename == "Ditto" then table.insert (str, " Not sellable.") elseif pokes[pokename] then if boosts == 0 then table.insert (str, " Price: $"..pokeCost) else table.insert (str, " Price: $"..pokeCost.. " + $"..precocertos.. " (BOOST)") end end  
    E pronto, o preço no look está adicionado ao seu servidor.
     
    @EDIT:
    Vou postar também o script do Pokémon Seller, porque ele estava bugado no meu servidor, provavelmente estará no servidor de vocês também.
    npcs/scripts
    pokemon seller.lua

  10. Gostei
    Bodak Reborn recebeu reputação de martimtiburcio em Preço do item no look   
    Yo boyz! 
    Eu estava atrás desse sistema há um tempo e não achava em lugar nenhum. Estudei bastante sobre lua e depois de um tempo eu consegui fazer eu mesmo, então vou disponibilizá-lo para vocês.
    Eu testei o sistema em PDA (PokeXCyan) TFS 1.0, mas deve funcionar para outras bases. O script em si não é complexo, é apenas chato de adicionar os itens na tabela. Eu vou deixar a tabela que eu fiz com os itens que tem no servidor para qual eu fiz o script aqui embaixo como spoiler, para caso você queira poupar tempo.
    Essa tabela deve ser adicionada no começo do código em creaturescripts/look.lua.
    Caso queira adicionar o sistema para pokémon também, basta você pegar a tabela que está localizada em npc/pokemon seller.lua.
     
    Ao código:
    Em look.lua, procure por:
    elseif getItemAttribute(thing.uid, "unique") then substitue o
    else return true end que está "linkado" a esse IF por
    elseif NPCPrice[iname.name] then local qnt = 0 if thing.type == 0 then qnt = 1 else qnt = thing.type end local p = getThingPos(thing.uid) local calculo = NPCPrice[iname.name].price * qnt table.insert(str, "You see ") if thing.type > 1 then table.insert(str, thing.type.." "..iname.plural..".") else table.insert(str, iname.article.." "..iname.name..".") end table.insert(str, "\n"..iname.description.." Price: $"..calculo..".") if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then table.insert(str, "\nItemID: ["..thing.itemid.."]") table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]") end sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str)) return false else return true end Ficando assim:
     
    Caso queira que o preço no look funcione para pokémon também, procure por
    table.insert(str, "It is genderless.") tem 3 linhas iguais a esse no look.lua. A linha na qual eu me refiro é a primeira encontrada no arquivo.
     
    Depois do end, adicione:
     
    local boosts = getItemAttribute(thing.uid, "boost") or 0 local precocertos = 0 if boosts > 50 then precocertos = ((gastostones[50] * 5) * 400) + ((boosts - 50) * 100000) else precocertos = ((gastostones[boosts] * 5) * 400) end if getItemAttribute (thing.uid, "ehditto") then pokename = "Ditto" end local pokeCost = pokePrice[pokename] or math.floor(pokes[pokename].level * 150) if pokename == "Ditto" then table.insert (str, " Not sellable.") elseif pokes[pokename] then if boosts == 0 then table.insert (str, " Price: $"..pokeCost) else table.insert (str, " Price: $"..pokeCost.. " + $"..precocertos.. " (BOOST)") end end  
    E pronto, o preço no look está adicionado ao seu servidor.
     
    @EDIT:
    Vou postar também o script do Pokémon Seller, porque ele estava bugado no meu servidor, provavelmente estará no servidor de vocês também.
    npcs/scripts
    pokemon seller.lua

  11. Gostei
    Bodak Reborn recebeu reputação de Yago Blind. em [PEDIDO] Hunt Excluisiva.   
    Como faltou algumas informações, fiz do jeito que entendi.
    Crie um teleport sem coordenadas pelo remeres (os que vão teleportar para a cave).
    Nesses teleports, coloque um action id.
     
    movements/scripts
    nome_arquivo.lua
    function onStepIn(cid, item, position, fromPosition) local config = { storage = 789456, from = {x = 1049, y = 1051, z = 6}, -- coordenada do canto superior esquerdo da área. to = {x = 1051, y = 1053, z = 7}, -- coordenada do canto inferior direito da área. maxPlayers = 1, -- quantos jogadores poderão entrar na área ao mesmo tempo. pos = {x = 1050, y = 1056, z = 7}, -- para onde o jogador será teleportado. } local function getPlayersInArea(left, right) local playersInArea = {} for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), left, right) then table.insert(playersInArea, cid) end end return playersInArea end if isPlayer(cid) then if getPlayerStorageValue (cid, config.storage) < os.time() then doPlayerSendTextMessage(cid, 19, "MSG caso o player não tenha acesso.") doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doTeleportThing(cid, fromPosition, true) else doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) end if table.getn(getPlayersInArea(config.from, config.to)) < config.maxPlayers and getPlayerStorageValue (cid, config.storage) > os.time() then doSendMagicEffect(fromPosition, CONST_ME_TELEPORT) doTeleportThing (cid, config.pos) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) elseif table.getn(getPlayersInArea(config.from, config.to)) >= config.maxPlayers and getPlayerStorageValue (cid, config.storage) > os.time() then doPlayerSendTextMessage (cid, 19, "MSG caso já tenha o limite de jogadores dentro da área.") doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doTeleportThing(cid, fromPosition, true) end end return true end  
    movements.xml
    <movevent type="StepIn" actionid="ACTION_ID_DO_TP" event="script" value="nome_arquivo.lua" />  
    actions/scripts
    nome_arquivo.lua
    function onUse(cid, item, frompos, item2, topos) local config = { timeExhausted = 24, -- tempo em horas para poder usar o item novamente. timeForUse = 6, -- tempo em horas que o player poderá entrar na cave. exhausted = 456789, storage = 789456, toKnow = 123456, effect = 27, -- efeito que dará ao usar o item. } if getPlayerStorageValue(cid, config.exhausted) < os.time() then setPlayerStorageValue (cid, config.storage, config.timeForUse * 60 * 60 + os.time()) setPlayerStorageValue (cid, config.exhausted, config.timeExhausted * 60 * 60 + os.time()) setPlayerStorageValue (cid, config.toKnow, 1) doSendMagicEffect (getThingPos(cid), config.effect) doPlayerSendTextMessage (cid, 19, "MSG informando que o jogador tem acesso à área.") else doPlayerSendTextMessage (cid, 19, "MSG caso o player esteja exhaustado. (Sobre ter que esperar 24 horas)") end return true end  
    actions.xml
    <action itemid="ID_DO_ITEM" event="script" value="nome_arquivo.lua"/>  
    creaturescripts/scripts
    nome_arquivo.lua
    local config = { toKnow = 123456, storage = 789456, pos = {x = 1050, y = 1056, z = 7}, -- para onde o jogador será teleportado caso o tempo tenha acabado. } function onKill(cid, target, lastHit) if getPlayerStorageValue (cid, config.toKnow) == 1 then if getPlayerStorageValue (cid, config.storage) < os.time () then doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doRemoveCreature (cid) end end return true end function onLogin(cid) if getPlayerStorageValue (cid, config.toKnow) == 1 then if getPlayerStorageValue (cid, config.storage) < os.time () then doTeleportThing (cid, config.pos) setPlayerStorageValue (cid, config.toKnow, 0) end end return true end  
    creaturescripts.xml
    <event type="login" name="timeAcess" event="script" value="nome_arquivo.lua"/> <event type="kill" name="timeAcessKill" event="script" value="nome_arquivo.lua"/>  
    Em creaturescripts/login.lua procure por "registerCreatureEvent" e coloque isso embaixo:
    registerCreatureEvent(cid, "timeAcess") registerCreatureEvent(cid, "timeAcessKill")  
    PS: Eu testei apenas os códigos de actions e movements. Não testei os códigos de creaturescripts, logo, são passíveis de erros.
  12. Gostei
    Bodak Reborn recebeu reputação de gabirucola em (Resolvido)[RESOLVIDO] healar mana em area PZ   
    Em creaturescripts, chame essa função de tantos em tantos segundos:
    function healPZ (health) if getTileInfo(getThingPos(cid)).protection then doPlayerAddHealth (cid, health) end return true end  
  13. Gostei
    Na variável que define a vida a ser adicionada, coloque:
    + getPlayerLevel(cid)  
  14. Gostei
    Bodak Reborn recebeu reputação de PedroSTT em (Resolvido)Puxar a alavanca c/ item no piso certo , se não , morre   
    Disponha. =)
  15. Gostei
    Bodak Reborn recebeu reputação de ADM jeanasgotine em Addon System (Fly, ride, surf, look e evolution)   
    Yo boyz, cá estou novamente.
    Eu estava procurando um Addon System funcional e vi que todos tinham bugs, então eu peguei um aqui no fórum mesmo, corrigi os bugs e fiz para que o sistema funcione com fly, ride, surf, look e que o addon suma quando o pokémon evoluir. Também é possível substituir um addon por outro, sem que o pokémon fique com o addon antigo.
    São muitos arquivos envolvidos, então, se eu esquecer algo e o sistema não esteja 100%, por favor, me fale.
    Deixei alguns exemplos no código para caso você esteja com preguiça e queira testar, além de comentar como adicionar novos addons.
     
    OBS: Eu testei apenas em PDA PokexCyan (TFS 1.0).
     
     
    actions/scripts
    nome_arquivo.lua
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getOldAddon (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end function onUse(cid, item, fromPosition, itemEx, toPosition) local numero = addons[item.itemid].looktype local pb = itemEx.uid local pk = addons[item.itemid].pokemon if not isPokeball(itemEx.itemid) then doPlayerSendCancel(cid, "Você só poder usar este item em uma poke ball.") return true end if getPlayerSlotItem (cid, 8).uid == pb and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) then doPlayerSendCancel (cid, "Desmonte do seu pokémon e volte-o para a poke ball.") return true end if getItemAttribute(pb, "addon") and getItemAttribute(pb, "addon") == numero then doPlayerSendCancel(cid, "Seu pokémon já está com este addon.") return true end if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Por favor, volte o seu pokémon para a poke ball.") return true end if getItemAttribute(pb, "poke") ~= pk then doPlayerSendCancel(cid, "Desculpe, você não pode adicionar este addon neste pokémon.") return true end if getItemAttribute (pb, "addon") and getItemAttribute (pb, "addon") > 1 then doPlayerSendTextMessage(cid, 27, "Você substituiu um "..getItemNameById (getOldAddon (getItemAttribute (pb, "addon"))).." por um "..getItemNameById (item.itemid).."!") else doPlayerSendTextMessage(cid, 27, "Agora seu pokémon usará este "..getItemNameById (item.itemid).."!") end doRemoveItem(item.uid, 1) doSetItemAttribute(pb, "addon", numero) return true end  
    actions.xml:
    <action itemid="13989;12344;13990;ID do item; ID do item;" event="script" value="nome_arquivo.lua"/>  
    em actions/order.lua, abaixo de:
    if not isCreature(pk) then pk = doCreateMonster(pokemon, backupPos) if not isCreature(pk) then doPlayerSendCancel(cid, "You can't stop flying/riding here.") return true end doConvinceCreature(cid, pk) end  
    adicione:
    local pb = getPlayerSlotItem(cid, 8).uid local flyAdd = flysAddon[getItemAttribute (pb, "addon")] local rideAdd = ridesAddon[getItemAttribute (pb, "addon")] if flyAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end elseif rideAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end end  
    em lib/configuration.lua, será necessário adicionar três tabelas, uma para fly, outra para ride e outra para surf. Nesta tabela, o nome do pokémon não é requirido, o que talvez faça você se perder. Se você achar necessário, comente com "--" o nome do pokémon.
    Exemplo:
    [205] = {540, 1200}, -- Pidgeot [850] = {210, 800}, -- Dragonair procure por: flys
    e acima disso adicione:
    flysAddon = { [205] = {540, 1200}, [201] = {541, 1200}, --[número do looktype normal] = {looktype voando, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    ridesAddon = { [556] = {555, 30}, --[número do looktype] = {looktype montado, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    surfsAddon = { [201] = {541, 10}, [552] = {553, 10}, --[número do looktype] = {looktype nadando, speed da tabela abaixo.} }  
    em lib/order.lua, procure por:
    elseif skill == "fly" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    depois, no mesmo arquivo, procure por:
    elseif skill == "ride" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    em movements/surf.lua, procure por:
    if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7 doTeleportThing(cid, fromPosition, false) return true end  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute(pb, "addon")][1]}, -1) end  
    logo abaixo disso, vocês vão encontrar:
    (isso não envolve o funcionamento do sistema de addon, mas é um bug que eu achei no meu surf. Todos os pokémon tinham velocidade fixa de 1500.)
    local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate  
    substitua por:
    local speed = 75 + PlayerSpeed + surfs[getPokemonName(getCreatureSummons(cid)[1])].speed * 8 * speedRate  
    no mesmo arquivo, procure por:
    if getItemAttribute(item.uid, "nick") then doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1) else doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1) end doSummonMonster(cid, pokemon) local pk = getCreatureSummons(cid)[1]  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if surfsAddon[getItemAttribute(pb, "addon")] then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute(pb, "addon")}, -1) end end  
     
    em actions/goback.lua, procure por:
    doSendMagicEffect(getCreaturePosition(pk), effect)  
    abaixo adicione:
    local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb, "addon") if not look then doSetItemAttribute(pb, "addon", 0) end if look and look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end  
    em actions/evolution.lua, procure por:
    local ball = getPlayerSlotItem(cid, 8).uid  
    há 12 linhas iguais a essa nesse arquivo e embaixo de TODAS elas, adicione:
    doItemSetAttribute (ball, "addon", 0)  
    em creaturescripts/look.lua, procure por:
    if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end  
    se novamente, esse código aparece duas vezes no arquivo.
    E também, novamente, embaixo dos dois, adicione:
    if getItemAttribute(thing.uid, "addon") then if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then if getItemAttribute(thing.uid, "addon") > 1 then table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".") end end end  
    E no começo desse arquivo, adicione:
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getAddonId (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end  
    a tabela "addons" deve ser a mesma que a do actions/addon.lua. Então, quando você adicionar algo no addon.lua, deverá adicionar também no look.lua.
     
    em login.lua, procure por:
     
    doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)  
    e substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[poke].looktype + 351}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end
  16. Gostei
    Bodak Reborn recebeu reputação de Viny 13 em Addon System (Fly, ride, surf, look e evolution)   
    Yo boyz, cá estou novamente.
    Eu estava procurando um Addon System funcional e vi que todos tinham bugs, então eu peguei um aqui no fórum mesmo, corrigi os bugs e fiz para que o sistema funcione com fly, ride, surf, look e que o addon suma quando o pokémon evoluir. Também é possível substituir um addon por outro, sem que o pokémon fique com o addon antigo.
    São muitos arquivos envolvidos, então, se eu esquecer algo e o sistema não esteja 100%, por favor, me fale.
    Deixei alguns exemplos no código para caso você esteja com preguiça e queira testar, além de comentar como adicionar novos addons.
     
    OBS: Eu testei apenas em PDA PokexCyan (TFS 1.0).
     
     
    actions/scripts
    nome_arquivo.lua
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getOldAddon (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end function onUse(cid, item, fromPosition, itemEx, toPosition) local numero = addons[item.itemid].looktype local pb = itemEx.uid local pk = addons[item.itemid].pokemon if not isPokeball(itemEx.itemid) then doPlayerSendCancel(cid, "Você só poder usar este item em uma poke ball.") return true end if getPlayerSlotItem (cid, 8).uid == pb and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) then doPlayerSendCancel (cid, "Desmonte do seu pokémon e volte-o para a poke ball.") return true end if getItemAttribute(pb, "addon") and getItemAttribute(pb, "addon") == numero then doPlayerSendCancel(cid, "Seu pokémon já está com este addon.") return true end if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Por favor, volte o seu pokémon para a poke ball.") return true end if getItemAttribute(pb, "poke") ~= pk then doPlayerSendCancel(cid, "Desculpe, você não pode adicionar este addon neste pokémon.") return true end if getItemAttribute (pb, "addon") and getItemAttribute (pb, "addon") > 1 then doPlayerSendTextMessage(cid, 27, "Você substituiu um "..getItemNameById (getOldAddon (getItemAttribute (pb, "addon"))).." por um "..getItemNameById (item.itemid).."!") else doPlayerSendTextMessage(cid, 27, "Agora seu pokémon usará este "..getItemNameById (item.itemid).."!") end doRemoveItem(item.uid, 1) doSetItemAttribute(pb, "addon", numero) return true end  
    actions.xml:
    <action itemid="13989;12344;13990;ID do item; ID do item;" event="script" value="nome_arquivo.lua"/>  
    em actions/order.lua, abaixo de:
    if not isCreature(pk) then pk = doCreateMonster(pokemon, backupPos) if not isCreature(pk) then doPlayerSendCancel(cid, "You can't stop flying/riding here.") return true end doConvinceCreature(cid, pk) end  
    adicione:
    local pb = getPlayerSlotItem(cid, 8).uid local flyAdd = flysAddon[getItemAttribute (pb, "addon")] local rideAdd = ridesAddon[getItemAttribute (pb, "addon")] if flyAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end elseif rideAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end end  
    em lib/configuration.lua, será necessário adicionar três tabelas, uma para fly, outra para ride e outra para surf. Nesta tabela, o nome do pokémon não é requirido, o que talvez faça você se perder. Se você achar necessário, comente com "--" o nome do pokémon.
    Exemplo:
    [205] = {540, 1200}, -- Pidgeot [850] = {210, 800}, -- Dragonair procure por: flys
    e acima disso adicione:
    flysAddon = { [205] = {540, 1200}, [201] = {541, 1200}, --[número do looktype normal] = {looktype voando, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    ridesAddon = { [556] = {555, 30}, --[número do looktype] = {looktype montado, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    surfsAddon = { [201] = {541, 10}, [552] = {553, 10}, --[número do looktype] = {looktype nadando, speed da tabela abaixo.} }  
    em lib/order.lua, procure por:
    elseif skill == "fly" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    depois, no mesmo arquivo, procure por:
    elseif skill == "ride" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    em movements/surf.lua, procure por:
    if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7 doTeleportThing(cid, fromPosition, false) return true end  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute(pb, "addon")][1]}, -1) end  
    logo abaixo disso, vocês vão encontrar:
    (isso não envolve o funcionamento do sistema de addon, mas é um bug que eu achei no meu surf. Todos os pokémon tinham velocidade fixa de 1500.)
    local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate  
    substitua por:
    local speed = 75 + PlayerSpeed + surfs[getPokemonName(getCreatureSummons(cid)[1])].speed * 8 * speedRate  
    no mesmo arquivo, procure por:
    if getItemAttribute(item.uid, "nick") then doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1) else doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1) end doSummonMonster(cid, pokemon) local pk = getCreatureSummons(cid)[1]  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if surfsAddon[getItemAttribute(pb, "addon")] then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute(pb, "addon")}, -1) end end  
     
    em actions/goback.lua, procure por:
    doSendMagicEffect(getCreaturePosition(pk), effect)  
    abaixo adicione:
    local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb, "addon") if not look then doSetItemAttribute(pb, "addon", 0) end if look and look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end  
    em actions/evolution.lua, procure por:
    local ball = getPlayerSlotItem(cid, 8).uid  
    há 12 linhas iguais a essa nesse arquivo e embaixo de TODAS elas, adicione:
    doItemSetAttribute (ball, "addon", 0)  
    em creaturescripts/look.lua, procure por:
    if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end  
    se novamente, esse código aparece duas vezes no arquivo.
    E também, novamente, embaixo dos dois, adicione:
    if getItemAttribute(thing.uid, "addon") then if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then if getItemAttribute(thing.uid, "addon") > 1 then table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".") end end end  
    E no começo desse arquivo, adicione:
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getAddonId (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end  
    a tabela "addons" deve ser a mesma que a do actions/addon.lua. Então, quando você adicionar algo no addon.lua, deverá adicionar também no look.lua.
     
    em login.lua, procure por:
     
    doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)  
    e substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[poke].looktype + 351}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end
  17. Gostei
    Bodak Reborn recebeu reputação de Vodkart em Addon System (Fly, ride, surf, look e evolution)   
    Yo boyz, cá estou novamente.
    Eu estava procurando um Addon System funcional e vi que todos tinham bugs, então eu peguei um aqui no fórum mesmo, corrigi os bugs e fiz para que o sistema funcione com fly, ride, surf, look e que o addon suma quando o pokémon evoluir. Também é possível substituir um addon por outro, sem que o pokémon fique com o addon antigo.
    São muitos arquivos envolvidos, então, se eu esquecer algo e o sistema não esteja 100%, por favor, me fale.
    Deixei alguns exemplos no código para caso você esteja com preguiça e queira testar, além de comentar como adicionar novos addons.
     
    OBS: Eu testei apenas em PDA PokexCyan (TFS 1.0).
     
     
    actions/scripts
    nome_arquivo.lua
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getOldAddon (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end function onUse(cid, item, fromPosition, itemEx, toPosition) local numero = addons[item.itemid].looktype local pb = itemEx.uid local pk = addons[item.itemid].pokemon if not isPokeball(itemEx.itemid) then doPlayerSendCancel(cid, "Você só poder usar este item em uma poke ball.") return true end if getPlayerSlotItem (cid, 8).uid == pb and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) then doPlayerSendCancel (cid, "Desmonte do seu pokémon e volte-o para a poke ball.") return true end if getItemAttribute(pb, "addon") and getItemAttribute(pb, "addon") == numero then doPlayerSendCancel(cid, "Seu pokémon já está com este addon.") return true end if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Por favor, volte o seu pokémon para a poke ball.") return true end if getItemAttribute(pb, "poke") ~= pk then doPlayerSendCancel(cid, "Desculpe, você não pode adicionar este addon neste pokémon.") return true end if getItemAttribute (pb, "addon") and getItemAttribute (pb, "addon") > 1 then doPlayerSendTextMessage(cid, 27, "Você substituiu um "..getItemNameById (getOldAddon (getItemAttribute (pb, "addon"))).." por um "..getItemNameById (item.itemid).."!") else doPlayerSendTextMessage(cid, 27, "Agora seu pokémon usará este "..getItemNameById (item.itemid).."!") end doRemoveItem(item.uid, 1) doSetItemAttribute(pb, "addon", numero) return true end  
    actions.xml:
    <action itemid="13989;12344;13990;ID do item; ID do item;" event="script" value="nome_arquivo.lua"/>  
    em actions/order.lua, abaixo de:
    if not isCreature(pk) then pk = doCreateMonster(pokemon, backupPos) if not isCreature(pk) then doPlayerSendCancel(cid, "You can't stop flying/riding here.") return true end doConvinceCreature(cid, pk) end  
    adicione:
    local pb = getPlayerSlotItem(cid, 8).uid local flyAdd = flysAddon[getItemAttribute (pb, "addon")] local rideAdd = ridesAddon[getItemAttribute (pb, "addon")] if flyAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end elseif rideAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end end  
    em lib/configuration.lua, será necessário adicionar três tabelas, uma para fly, outra para ride e outra para surf. Nesta tabela, o nome do pokémon não é requirido, o que talvez faça você se perder. Se você achar necessário, comente com "--" o nome do pokémon.
    Exemplo:
    [205] = {540, 1200}, -- Pidgeot [850] = {210, 800}, -- Dragonair procure por: flys
    e acima disso adicione:
    flysAddon = { [205] = {540, 1200}, [201] = {541, 1200}, --[número do looktype normal] = {looktype voando, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    ridesAddon = { [556] = {555, 30}, --[número do looktype] = {looktype montado, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    surfsAddon = { [201] = {541, 10}, [552] = {553, 10}, --[número do looktype] = {looktype nadando, speed da tabela abaixo.} }  
    em lib/order.lua, procure por:
    elseif skill == "fly" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    depois, no mesmo arquivo, procure por:
    elseif skill == "ride" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    em movements/surf.lua, procure por:
    if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7 doTeleportThing(cid, fromPosition, false) return true end  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute(pb, "addon")][1]}, -1) end  
    logo abaixo disso, vocês vão encontrar:
    (isso não envolve o funcionamento do sistema de addon, mas é um bug que eu achei no meu surf. Todos os pokémon tinham velocidade fixa de 1500.)
    local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate  
    substitua por:
    local speed = 75 + PlayerSpeed + surfs[getPokemonName(getCreatureSummons(cid)[1])].speed * 8 * speedRate  
    no mesmo arquivo, procure por:
    if getItemAttribute(item.uid, "nick") then doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1) else doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1) end doSummonMonster(cid, pokemon) local pk = getCreatureSummons(cid)[1]  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if surfsAddon[getItemAttribute(pb, "addon")] then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute(pb, "addon")}, -1) end end  
     
    em actions/goback.lua, procure por:
    doSendMagicEffect(getCreaturePosition(pk), effect)  
    abaixo adicione:
    local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb, "addon") if not look then doSetItemAttribute(pb, "addon", 0) end if look and look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end  
    em actions/evolution.lua, procure por:
    local ball = getPlayerSlotItem(cid, 8).uid  
    há 12 linhas iguais a essa nesse arquivo e embaixo de TODAS elas, adicione:
    doItemSetAttribute (ball, "addon", 0)  
    em creaturescripts/look.lua, procure por:
    if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end  
    se novamente, esse código aparece duas vezes no arquivo.
    E também, novamente, embaixo dos dois, adicione:
    if getItemAttribute(thing.uid, "addon") then if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then if getItemAttribute(thing.uid, "addon") > 1 then table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".") end end end  
    E no começo desse arquivo, adicione:
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getAddonId (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end  
    a tabela "addons" deve ser a mesma que a do actions/addon.lua. Então, quando você adicionar algo no addon.lua, deverá adicionar também no look.lua.
     
    em login.lua, procure por:
     
    doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)  
    e substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[poke].looktype + 351}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end
  18. Gostei
    Bodak Reborn recebeu reputação de Bruno Carvalho em Addon System (Fly, ride, surf, look e evolution)   
    Yo boyz, cá estou novamente.
    Eu estava procurando um Addon System funcional e vi que todos tinham bugs, então eu peguei um aqui no fórum mesmo, corrigi os bugs e fiz para que o sistema funcione com fly, ride, surf, look e que o addon suma quando o pokémon evoluir. Também é possível substituir um addon por outro, sem que o pokémon fique com o addon antigo.
    São muitos arquivos envolvidos, então, se eu esquecer algo e o sistema não esteja 100%, por favor, me fale.
    Deixei alguns exemplos no código para caso você esteja com preguiça e queira testar, além de comentar como adicionar novos addons.
     
    OBS: Eu testei apenas em PDA PokexCyan (TFS 1.0).
     
     
    actions/scripts
    nome_arquivo.lua
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getOldAddon (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end function onUse(cid, item, fromPosition, itemEx, toPosition) local numero = addons[item.itemid].looktype local pb = itemEx.uid local pk = addons[item.itemid].pokemon if not isPokeball(itemEx.itemid) then doPlayerSendCancel(cid, "Você só poder usar este item em uma poke ball.") return true end if getPlayerSlotItem (cid, 8).uid == pb and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 63215) >= 1) then doPlayerSendCancel (cid, "Desmonte do seu pokémon e volte-o para a poke ball.") return true end if getItemAttribute(pb, "addon") and getItemAttribute(pb, "addon") == numero then doPlayerSendCancel(cid, "Seu pokémon já está com este addon.") return true end if #getCreatureSummons(cid) > 0 then doPlayerSendCancel(cid, "Por favor, volte o seu pokémon para a poke ball.") return true end if getItemAttribute(pb, "poke") ~= pk then doPlayerSendCancel(cid, "Desculpe, você não pode adicionar este addon neste pokémon.") return true end if getItemAttribute (pb, "addon") and getItemAttribute (pb, "addon") > 1 then doPlayerSendTextMessage(cid, 27, "Você substituiu um "..getItemNameById (getOldAddon (getItemAttribute (pb, "addon"))).." por um "..getItemNameById (item.itemid).."!") else doPlayerSendTextMessage(cid, 27, "Agora seu pokémon usará este "..getItemNameById (item.itemid).."!") end doRemoveItem(item.uid, 1) doSetItemAttribute(pb, "addon", numero) return true end  
    actions.xml:
    <action itemid="13989;12344;13990;ID do item; ID do item;" event="script" value="nome_arquivo.lua"/>  
    em actions/order.lua, abaixo de:
    if not isCreature(pk) then pk = doCreateMonster(pokemon, backupPos) if not isCreature(pk) then doPlayerSendCancel(cid, "You can't stop flying/riding here.") return true end doConvinceCreature(cid, pk) end  
    adicione:
    local pb = getPlayerSlotItem(cid, 8).uid local flyAdd = flysAddon[getItemAttribute (pb, "addon")] local rideAdd = ridesAddon[getItemAttribute (pb, "addon")] if flyAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end elseif rideAdd then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute (pb, "addon")}, -1) end end  
    em lib/configuration.lua, será necessário adicionar três tabelas, uma para fly, outra para ride e outra para surf. Nesta tabela, o nome do pokémon não é requirido, o que talvez faça você se perder. Se você achar necessário, comente com "--" o nome do pokémon.
    Exemplo:
    [205] = {540, 1200}, -- Pidgeot [850] = {210, 800}, -- Dragonair procure por: flys
    e acima disso adicione:
    flysAddon = { [205] = {540, 1200}, [201] = {541, 1200}, --[número do looktype normal] = {looktype voando, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    ridesAddon = { [556] = {555, 30}, --[número do looktype] = {looktype montado, número da tabela abaixo.} }  
    procure por: rides
    e acima disso adicione:
    surfsAddon = { [201] = {541, 10}, [552] = {553, 10}, --[número do looktype] = {looktype nadando, speed da tabela abaixo.} }  
    em lib/order.lua, procure por:
    elseif skill == "fly" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    depois, no mesmo arquivo, procure por:
    elseif skill == "ride" then  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[getPokemonName(getCreatureSummons(cid)[1])][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (pb, "addon")][1]}, -1) end  
    em movements/surf.lua, procure por:
    if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7 doTeleportThing(cid, fromPosition, false) return true end  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if getItemAttribute(pb, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[getPokemonName(getCreatureSummons(cid)[1])].lookType}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute(pb, "addon")][1]}, -1) end  
    logo abaixo disso, vocês vão encontrar:
    (isso não envolve o funcionamento do sistema de addon, mas é um bug que eu achei no meu surf. Todos os pokémon tinham velocidade fixa de 1500.)
    local speed = 75 + PlayerSpeed + getSpeed(getCreatureSummons(cid)[1]) * 8 * speedRate  
    substitua por:
    local speed = 75 + PlayerSpeed + surfs[getPokemonName(getCreatureSummons(cid)[1])].speed * 8 * speedRate  
    no mesmo arquivo, procure por:
    if getItemAttribute(item.uid, "nick") then doCreatureSay(cid, getItemAttribute(item.uid, "nick")..", I'm tired of surfing!", 1) else doCreatureSay(cid, getItemAttribute(item.uid, "poke")..", I'm tired of surfing!", 1) end doSummonMonster(cid, pokemon) local pk = getCreatureSummons(cid)[1]  
    e abaixo adicione:
    local pb = getPlayerSlotItem(cid, 8).uid if surfsAddon[getItemAttribute(pb, "addon")] then if getItemAttribute(pb, "addon") > 1 then doSetCreatureOutfit(pk, {lookType = getItemAttribute(pb, "addon")}, -1) end end  
     
    em actions/goback.lua, procure por:
    doSendMagicEffect(getCreaturePosition(pk), effect)  
    abaixo adicione:
    local pk = getCreatureSummons(cid)[1] local pb = getPlayerSlotItem(cid, 8).uid local look = getItemAttribute(pb, "addon") if not look then doSetItemAttribute(pb, "addon", 0) end if look and look > 0 then doSetCreatureOutfit(pk, {lookType = look}, -1) end  
    em actions/evolution.lua, procure por:
    local ball = getPlayerSlotItem(cid, 8).uid  
    há 12 linhas iguais a essa nesse arquivo e embaixo de TODAS elas, adicione:
    doItemSetAttribute (ball, "addon", 0)  
    em creaturescripts/look.lua, procure por:
    if getItemAttribute(thing.uid, "gender") == SEX_MALE then table.insert(str, "It is male.") elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then table.insert(str, "It is female.") else table.insert(str, "It is genderless.") end  
    se novamente, esse código aparece duas vezes no arquivo.
    E também, novamente, embaixo dos dois, adicione:
    if getItemAttribute(thing.uid, "addon") then if flysAddon[getItemAttribute (thing.uid, "addon")] or ridesAddon[getItemAttribute (thing.uid, "addon")] or surfsAddon[getItemAttribute (thing.uid, "addon")] then if getItemAttribute(thing.uid, "addon") > 1 then table.insert(str, " Has the addon "..getItemNameById (getAddonId (getItemAttribute (thing.uid, "addon")))..".") end end end  
    E no começo desse arquivo, adicione:
    local addons = { [14876] = {pokemon = "Shiny Charizard" , looktype = 1950}, [12344] = {pokemon = "Pidgeot" , looktype = 205}, [13990] = {pokemon = "Pidgeot" , looktype = 201}, --[ID do item] = {nome do pokémon, looktype}, } local function getAddonId (looktype) for index, value in pairs (addons) do if value.looktype == looktype then return index end end end  
    a tabela "addons" deve ser a mesma que a do actions/addon.lua. Então, quando você adicionar algo no addon.lua, deverá adicionar também no look.lua.
     
    em login.lua, procure por:
     
    doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)  
    e substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = flysAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = surfs[poke].looktype + 351}, -1) else doSetCreatureOutfit(cid, {lookType = surfsAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end  
    procure por:
    doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)  
    substitua por:
    if getItemAttribute(item.uid, "addon") < 1 then doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1) else doSetCreatureOutfit(cid, {lookType = ridesAddon[getItemAttribute (item.uid, "addon")][1]}, -1) end
  19. Gostei
    Bodak Reborn recebeu reputação de Pepeco em (Resolvido)Function   
    onSay - talkaction
    ao dizer algo (que você define no script ou no XML), execute o código.
     
    onThink - creaturescripts/globalevents
    há dois tipos de onThink, mas os dois tem o mesmo conceito. A cada 0,5 segundo (se eu não me engano), execute o código.
    Como o que você citou não tem cid (creature id) como parâmetro, quer dizer que é globalevents. Se tivesse cid como parâmetro, seria creaturescripts.
     
    onPrepareDeath - creaturescripts
    quando alguém vai tomar o hit que vai matá-lo, execute o código.
     
    onKill - creaturescripts
    ao matar alguém, execute o código.
     
    Falar de todas é complicado, porque existem várias... olha pelo XML, normalmente os nomes são auto-explicativos.
  20. Gostei
    Bodak Reborn recebeu reputação de zPerseu em Spell de tirar summon e ganhar newtype   
    Não cara, eu mandei esse aqui:
     
  21. Gostei
    Bodak Reborn recebeu reputação de Babilonia em [pedido] Regen Stamina Trainer   
    Eu esqueci de colocar uma tag.
    Aqui:
    <movevent type="StepOut" actionid="actiond_id" event="script" value="nome_arquivo.lua" />  
  22. Gostei
    Bodak Reborn recebeu reputação de kinglekke em Npcs Nao Respondem   
    Exemplo o Dalk:
    <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|, I can sell to you: {Diamond Account}, {Sex Change}, what you want?"/> </parameters> Ele diz isso quando tu da "hi", se o NPC que você está tentando conversar não tenha isso, pode ser o motivo do bug.
  23. Gostei
    Bodak Reborn recebeu reputação de murilao em (Resolvido)[Pedido] Script Stamina Refill   
    Eu não conheço muito bem TFS 1.2, então eu meio que "chutei" as funções.
     
    actions/scripts
    nome_arquivo.lua
    local staminaTime = 2 -- quantas horas vai recuperar. function onUse(cid, item, fromPosition, itemEx, toPosition) player:setStamina (cid, player:getStamina(cid) + staminaTime * 60) player:sendTextMessage (cid, 19, "You've recovered "..staminaTime.." hours of stamina.") doRemoveItem(item.uid, 1) return true end  
    XML:
    <action itemid="ID do item" event="script" value="nome_arquivo.lua"/>  
  24. Gostei
    Bodak Reborn recebeu reputação de Babilonia em (Resolvido)Usar item só se tiver tal storage.   
    local stor = {30023, 4} local storage = 657489 function onUse(cid, item, fromPos, toPos) if getPlayerStorageValue(cid, stor[1]) ~= stor[2] then return doPlayerSendCancel(cid, 'You can\'t use this item.') and false end if getPlayerStorageValue (cid, storage) == 1 then return true end doRemoveItem(item.uid, 2415) doPlayerSetVocation(cid, 525) doCreatureChangeOutfit(cid, {lookType = 462}) doSendMagicEffect(toPos, 32) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Agora voce foi promovido.') setPlayerStorageValue (cid, storage, 1) doRemoveItem(item.uid) return true end  
  25. Gostei
    Bodak Reborn deu reputação a Vodkart em (Resolvido)broadcast apenas pra quem tem storage   
    function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você nao pertence a guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estao no comando do castelo, va dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) -- primeiro tile -- if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) then for _, cid in pairs(getPlayersOnline()) do if getPlayerGuildId(cid) > 0 and getPlayerGuildName(cid) == getGlobalStorageValue(COH_STATUS) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atencao! A guild "..getPlayerGuildName(cid).." esta tentando dominar o castelo, preparem-se!") end end setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then for _, cid in pairs(getPlayersOnline()) do if getPlayerGuildId(cid) > 0 and getPlayerGuildName(cid) == getGlobalStorageValue(COH_STATUS) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atençao! A guild "..getPlayerGuildName(cid).." esta muito proxima do domíinio, ataquem!") end end setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) end end return true end  

Informação Importante

Confirmação de Termo