Ir para conteúdo

brendoonh

Visconde
  • Total de itens

    298
  • Registro em

  • Última visita

  • Dias Ganhos

    1

Histórico de Reputação

  1. Upvote
    brendoonh deu reputação a zipter98 em Comando !cp teleportar após 10 segundos. Como fazer?   
    data/talkactions/scripts
    local teleport_time, exhaust = 10, 20 --Respectivamente, tempo para teleportar e cooldown. function channel_teleport(cid, time) if not isPlayer(cid) then return true elseif getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "You can't teleport while in battle.") return true elseif time <= 0 then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, 2910, os.time() + exhaust * 60) return true end doPlayerSendTextMessage(cid, 27, time) addEvent(channel_teleport, 1000, cid, time - 1) end function onSay(cid) if getPlayerStorageValue(cid, 2910) > os.time() then doPlayerSendCancel(cid, "This command is still in cooldown. Wait "..(getPlayerStorageValue(cid, 2910) - os.time()).." seconds to use it again.") return true elseif getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, "You can't use this command in battle.") return true end channel_teleport(cid, teleport_time) return true end Tag: <talkaction words="!cp" event="script" value="nome_do_arquivo.lua"/>  
  2. Upvote
    brendoonh deu reputação a Caronte em Bug Look   
    Aqui @@brendoonh, http://www.xtibia.com/forum/forum/587-tutoriais-de-programacao/
    Qualquer dúvida cria um tópico que a gente ajuda, não se esqueça que o compilador precisa ter uma lib para compilar o tibia..., somente o compilador não dá...
     
  3. Upvote
    brendoonh deu reputação a Caronte em Bug Look   
    @@brendoonh, opa fácil.
     
    Vá na pasta das suas source, procure por: You see, em game.cpp...
     
    role um pouco para baixo até achar algo parecido com isso:
    player->sendTextMessage(MSG_INFO_DESCR, ss.str()); acho que o seu terá algo diferente de: MSG_INFO_DESCR

    Coloque MSG_INFO_DESCR no lugar.
  4. Upvote
    brendoonh deu reputação a FLC em FLC - Attempt to mapping - ShowOff   
    Show Off :~
     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     
     
    Dicas? Sugestões?
  5. Upvote
    brendoonh deu reputação a zipter98 em House   
    Instale esse creatureevent nas suas sources. Depois, crie um arquivo em data/creatureevents/scripts com extensão .lua e coloque o seguinte conteúdo:
    function onMoveItem(cid, item, fromPosition, toPosition) if getTileInfo(toPosition).house then local house_id, cid_house = getHouseFromPos(toPosition), getHouseByPlayerGUID(getPlayerGUID(cid)) local guest_list = getHouseAccessList(house_id, 0x100):explode("\n") if house_id == cid_house or (#guest_list > 0 and isInArray(guest_list, getCreatureName(cid))) then return true end return false end return true end Tag (não se esqueça de registrar o evento em login.lua): <event type="move" name="throwItemAtHouse" event="script" value="nome_do_arquivo.lua"/>  
  6. Upvote
    brendoonh deu reputação a MatheusGlad em Adicionar limite   
    Não tive esse problema com os slots infinitos, qualquer coisa faz uma talkaction teste e printa o storage 32149
    print(getPlayerStorageValue(cid, 32149))

     
    Vai aparecer no console quantos slots o player tem.
     
    E o negocio que voce falou das msgs:
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="xtibia.com" enabled="yes"> <config name="Loot_func"><![CDATA[ info = { OnlyPremium = false, AutomaticDeposit = true, BlockMonsters = {}, BlockItemsList = {10020,5919,5809,5804,5015}, maxSlotsStorage = 32149, defaultMaxSlot = 3, -- deixe false pra desabilitar itemAddValue = 2, -- vai adicionar 2 slots ao usar o item coinnames = {"gold coin", "platinum coin", "crystal coin"}, } function setPlayerStorageTable(cid, storage, tab) local tabstr = "&" for i,x in pairs(tab) do tabstr = tabstr .. i .. "," .. x .. ";" end setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1)) end function getPlayerStorageTable(cid, storage) local tabstr = getPlayerStorageValue(cid, storage) local tab = {} if type(tabstr) ~= "string" then return {} end if tabstr:sub(1,1) ~= "&" then return {} end local tabstr = tabstr:sub(2, #tabstr) local a = string.explode(tabstr, ";") for i,x in pairs(a) do local b = string.explode(x, ",") tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2] end return tab end function isInTable(cid, item) for _,i in pairs(getPlayerStorageTable(cid, 27000))do if tonumber(i) == tonumber(item) then return true end end return false end function addItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, 27000) do table.insert(x,getPlayerStorageTable(cid, 27000)[i]) end if x ~= 0 then table.insert(x,tonumber(item)) setPlayerStorageTable(cid, 27000, x) else setPlayerStorageTable(cid, 27000, {item}) end end function removeItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, 27000) do table.insert(x,getPlayerStorageTable(cid, 27000)[i]) end for i,v in ipairs(x) do if tonumber(v) == tonumber(item) then table.remove(x,i) end end return setPlayerStorageTable(cid, 27000, x) end function ShowItemsTabble(cid) local str,n = "-- Lista de Loot --\n\n",0 for i = 1,#getPlayerStorageTable(cid, 27000) do n = n + 1 str = str..""..n.." - "..getItemNameById(getPlayerStorageTable(cid, 27000)[i]).."\n" end return doShowTextDialog(cid, 2529, str) end function getContainerItems(containeruid) local items = {} local containers = {} if type(getContainerSize(containeruid)) ~= "number" then return false end for slot = 0, getContainerSize(containeruid)-1 do local item = getContainerItem(containeruid, slot) if item.itemid == 0 then break end if isContainer(item.uid) then table.insert(containers, item.uid) end table.insert(items, item) end if #containers > 0 then for i,x in ipairs(getContainerItems(containers[1])) do table.insert(items, x) end table.remove(containers, 1) end return items end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid) local piles = 0 if #item > 0 then for i,x in pairs(item) do if getThing(x).type < 100 then local it = getThing(x) doTransformItem(it.uid, itemid, it.type+quant) if it.type+quant > 100 then doPlayerAddItem(cid, itemid, it.type+quant-100) end else piles = piles+1 end end else return doPlayerAddItem(cid, itemid, quant) end if piles == #item then doPlayerAddItem(cid, itemid, quant) end end function AutomaticDeposit(cid,item,n) local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1) doPlayerSendTextMessage(cid, 23, "{AUTO-LOOT} Collected " .. deposit .. " gold coins sent to your bank account.") return doPlayerDepositMoney(cid, deposit) end function corpseRetireItems(cid, pos) local check = false for i = 0, 255 do pos.stackpos = i tile = getTileThingByPos(pos) if tile.uid > 0 and isCorpse(tile.uid) then check = true break end end if check == true then local items = getContainerItems(tile.uid) for i,x in pairs(items) do if isInArray(getPlayerStorageTable(cid, 27000), tonumber(x.itemid)) then if isItemStackable(x.itemid) then doPlayerAddItemStacking(cid, x.itemid, x.type) if info.AutomaticDeposit == true and isInArray({"2148","2152","2160"},tonumber(x.itemid)) then AutomaticDeposit(cid,x.itemid,x.type) end else doPlayerAddItem(cid, x.itemid) end doRemoveItem(x.uid) end end end end ]]></config> <event type="login" name="LootLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "MonsterAttack") return true end]]></event> <event type="death" name="LootEventDeath" event="script"><![CDATA[ domodlib('Loot_func') function onDeath(cid, corpse, deathList) local killer,pos = deathList[1],getCreaturePosition(cid) addEvent(corpseRetireItems,1,killer,pos) return true end]]></event> <event type="combat" name="MonsterAttack" event="script"><![CDATA[ domodlib('Loot_func') if isPlayer(cid) and isMonster(target) and not isInArray(info.BlockMonsters,string.lower(getCreatureName(target))) then registerCreatureEvent(target, "LootEventDeath") end return true]]></event> <talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[ domodlib('Loot_func') if info.defaultMaxSlot and getPlayerStorageValue(cid, info.maxSlotsStorage) <= 0 then setPlayerStorageValue(cid, info.maxSlotsStorage, info.defaultMaxSlot) end local t = string.explode(string.lower(param), ",") local stt = getPlayerStorageTable(cid, 27000) for i = 1, #info.coinnames do local p = table.find(stt, getItemIdByName(info.coinnames[i], false)) if p then table.remove(stt, p) end end if info.OnlyPremium == true and not isPremium(cid) then doPlayerSendCancel(cid, "you must be a premium account.") return true elseif not t[1] then ShowItemsTabble(cid) return true elseif t[1] == "clear" then setPlayerStorageTable(cid, 27000, {}) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce removeu todos os items da lista") return true elseif tonumber(t[1]) or tonumber(t[2]) then doPlayerSendCancel(cid, "enter !autoloot add,name or !autoloot remove,name") return true elseif isInArray({"add","remove"}, tostring(t[1])) then local func,check = tostring(t[1]) == "add" and addItemTable or removeItemTable, tostring(t[1]) == "add" and true or false local item = getItemIdByName(tostring(t[2]), false) if t[2] ~= "gold" and not item then doPlayerSendCancel(cid, "O item nao existe") return true elseif t[2] ~= "gold" and check == true and isInArray(info.BlockItemsList, item) then doPlayerSendCancel(cid, "Esse item nao é permitido a ser adicionado.") return true elseif t[2] ~= "gold" and isInTable(cid, item) == check then doPlayerSendCancel(cid, "This Item "..(check == true and "already" or "is not").." in your list.") return true elseif t[2] ~= "gold" and check and info.defaultMaxSlot and #stt >= getPlayerStorageValue(cid, info.maxSlotsStorage) and not table.find(info.coinnames, t[2]) then doPlayerSendCancel(cid, "You cannot add more than " .. getPlayerStorageValue(cid, info.maxSlotsStorage) .. " items in your list.") return true end if t[2] ~= "gold" then func(cid, item) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "Voce adicionou o item "..t[2].." a sua lista" or "Voce removeu o item "..t[2].." from the list") return true else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "Voce ativou a coleta de gold automatica." or "Voce desativou a coleta de gold automatica.") for i = 1, #info.coinnames do local item = getItemIdByName(info.coinnames[i], false) if not item then error("shit happened. check coin names") else if isInTable(cid, item) ~= check then func(cid, item) --doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "Voce adicionou o item "..info.coinnames[i].." a sua lista" or "Voce removeu o item "..info.coinnames[i].." from the list") end end end end end return true]]></talkaction> <action itemid="5889" event="buffer"><![CDATA[ domodlib('Loot_func') local s = doPlayerRemoveItem(cid,item.itemid,1) if s then setPlayerStorageValue(cid, info.maxSlotsStorage, getPlayerStorageValue(cid, info.maxSlotsStorage)+info.itemAddValue) doSendAnimatedText(getPlayerPosition(cid), "Boosted" , COLOR_RED) doSendMagicEffect(getPlayerPosition(cid), 26) else doPlayerSendCancel(cid, "Pick up the item first.") end return true ]]></action> </mod>
  7. Upvote
    brendoonh deu reputação a MatheusGlad em Piso que teleporta player e sumona monstro, depois 2 minuto's monstros summonados sao removidos   
    local tilepos = {x=136, y=48, z=7} -- Posiçao do tile noroeste ( /\ < ) local sq = 3 -- Area 3x3 usar somente numeros impares > 2 local monster = "Demon" local time = 2 -- Tempo em minutos pra desaparecer local tptime = 10 -- tempo em segundos pra desaparecer tp local tppos = {x=135, y=48, z=7} -- lugar do tp local tpdest = {x=134,y=55, z=7} -- destino do tp function getUidsInArea(extr1, extr2) local dat = {} for y = extr1.y, extr2.y do for x = extr1.x, extr2.x do if isCreature(getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) end end end return dat end function summonAndRemove(monster, pos, t) local function removeCreatureEvent(uid) if isCreature(uid) then doRemoveCreature(uid) end end local uid = doSummonCreature(monster, pos) addEvent(removeCreatureEvent, t*1000, uid) end function createTpAndRemove(pos, topos, t) local function removeTp(pos) pos.stackpos = 1 local thing = getThingFromPos(pos) if thing.itemid == 1387 then doRemoveItem(thing.uid) end end doCreateTeleport(1387, topos, pos) addEvent(removeTp, t*1000, pos) end function onStepIn(cid, item, pos, frompos) if sq < 3 or sq%2 == 0 then return error("SOMENTE NUMEROS IMPARES MAIORES QUE 2") end local uids = getUidsInArea(tilepos, {x=tilepos.x+sq-1, y=tilepos.y+sq-1, z=tilepos.z}) if #uids == 0 then tppos.stackpos = 1 local tpthing = getThingFromPos(tppos) if tpthing.itemid == 1387 then doRemoveItem(tpthing.uid) end for y = tilepos.y, tilepos.y+sq-1 do for x = tilepos.x, tilepos.x+sq-1 do if y == tilepos.y+(sq-1)/2 and x == tilepos.x+(sq-1)/2 then doTeleportThing(cid, {x=x, y=y, z=tilepos.z}) else summonAndRemove(monster, {x=x, y=y, z=tilepos.z}, time*60) end end end addEvent(createTpAndRemove, time*60*1000, tppos, tpdest, tptime) else doTeleportThing(cid,frompos,true) return doPlayerSendCancel(cid, "There is people inside right now.") end end
  8. Upvote
    brendoonh deu reputação a MatheusGlad em Adicionar limite   
    Substitui por isso, tem os tres pedidos ai, o item que da mais storage voce muda o id la em baixo no final do mod.
    <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Loot System" version="1.0" author="Vodkart And Mkalo" contact="xtibia.com" enabled="yes"> <config name="Loot_func"><![CDATA[ info = { OnlyPremium = false, AutomaticDeposit = true, BlockMonsters = {}, BlockItemsList = {10020,5919,5809,5804,5015}, maxSlotsStorage = 32149, defaultMaxSlot = 3, -- deixe false pra desabilitar itemAddValue = 2, -- vai adicionar 2 slots ao usar o item } function setPlayerStorageTable(cid, storage, tab) local tabstr = "&" for i,x in pairs(tab) do tabstr = tabstr .. i .. "," .. x .. ";" end setPlayerStorageValue(cid, storage, tabstr:sub(1, #tabstr-1)) end function getPlayerStorageTable(cid, storage) local tabstr = getPlayerStorageValue(cid, storage) local tab = {} if type(tabstr) ~= "string" then return {} end if tabstr:sub(1,1) ~= "&" then return {} end local tabstr = tabstr:sub(2, #tabstr) local a = string.explode(tabstr, ";") for i,x in pairs(a) do local b = string.explode(x, ",") tab[tonumber(b[1]) or b[1]] = tonumber(b[2]) or b[2] end return tab end function isInTable(cid, item) for _,i in pairs(getPlayerStorageTable(cid, 27000))do if tonumber(i) == tonumber(item) then return true end end return false end function addItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, 27000) do table.insert(x,getPlayerStorageTable(cid, 27000)[i]) end if x ~= 0 then table.insert(x,tonumber(item)) setPlayerStorageTable(cid, 27000, x) else setPlayerStorageTable(cid, 27000, {item}) end end function removeItemTable(cid, item) local x = {} for i = 1,#getPlayerStorageTable(cid, 27000) do table.insert(x,getPlayerStorageTable(cid, 27000)[i]) end for i,v in ipairs(x) do if tonumber(v) == tonumber(item) then table.remove(x,i) end end return setPlayerStorageTable(cid, 27000, x) end function ShowItemsTabble(cid) local str,n = "-- Lista de Loot --\n\n",0 for i = 1,#getPlayerStorageTable(cid, 27000) do n = n + 1 str = str..""..n.." - "..getItemNameById(getPlayerStorageTable(cid, 27000)[i]).."\n" end return doShowTextDialog(cid, 2529, str) end function getContainerItems(containeruid) local items = {} local containers = {} if type(getContainerSize(containeruid)) ~= "number" then return false end for slot = 0, getContainerSize(containeruid)-1 do local item = getContainerItem(containeruid, slot) if item.itemid == 0 then break end if isContainer(item.uid) then table.insert(containers, item.uid) end table.insert(items, item) end if #containers > 0 then for i,x in ipairs(getContainerItems(containers[1])) do table.insert(items, x) end table.remove(containers, 1) end return items end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid) local piles = 0 if #item > 0 then for i,x in pairs(item) do if getThing(x).type < 100 then local it = getThing(x) doTransformItem(it.uid, itemid, it.type+quant) if it.type+quant > 100 then doPlayerAddItem(cid, itemid, it.type+quant-100) end else piles = piles+1 end end else return doPlayerAddItem(cid, itemid, quant) end if piles == #item then doPlayerAddItem(cid, itemid, quant) end end function AutomaticDeposit(cid,item,n) local deposit = item == tonumber(2160) and (n*10000) or tonumber(item) == 2152 and (n*100) or (n*1) doPlayerSendTextMessage(cid, 23, "{AUTO-LOOT} Collected " .. deposit .. " gold coins sent to your bank account.") return doPlayerDepositMoney(cid, deposit) end function corpseRetireItems(cid, pos) local check = false for i = 0, 255 do pos.stackpos = i tile = getTileThingByPos(pos) if tile.uid > 0 and isCorpse(tile.uid) then check = true break end end if check == true then local items = getContainerItems(tile.uid) for i,x in pairs(items) do if isInArray(getPlayerStorageTable(cid, 27000), tonumber(x.itemid)) then if isItemStackable(x.itemid) then doPlayerAddItemStacking(cid, x.itemid, x.type) if info.AutomaticDeposit == true and isInArray({"2148","2152","2160"},tonumber(x.itemid)) then AutomaticDeposit(cid,x.itemid,x.type) end else doPlayerAddItem(cid, x.itemid) end doRemoveItem(x.uid) end end end end ]]></config> <event type="login" name="LootLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "MonsterAttack") return true end]]></event> <event type="death" name="LootEventDeath" event="script"><![CDATA[ domodlib('Loot_func') function onDeath(cid, corpse, deathList) local killer,pos = deathList[1],getCreaturePosition(cid) addEvent(corpseRetireItems,1,killer,pos) return true end]]></event> <event type="combat" name="MonsterAttack" event="script"><![CDATA[ domodlib('Loot_func') if isPlayer(cid) and isMonster(target) and not isInArray(info.BlockMonsters,string.lower(getCreatureName(target))) then registerCreatureEvent(target, "LootEventDeath") end return true]]></event> <talkaction words="!autoloot;/autoloot" event="buffer"><![CDATA[ domodlib('Loot_func') if info.defaultMaxSlot and getPlayerStorageValue(cid, info.maxSlotsStorage) <= 0 then setPlayerStorageValue(cid, info.maxSlotsStorage, info.defaultMaxSlot) end local t = string.explode(string.lower(param), ",") if info.OnlyPremium == true and not isPremium(cid) then doPlayerSendCancel(cid, "you must be a premium account.") return true elseif not t[1] then ShowItemsTabble(cid) return true elseif tonumber(t[1]) or tonumber(t[2]) then doPlayerSendCancel(cid, "enter !autoloot add,name or !autoloot remove,name") return true elseif isInArray({"add","remove"}, tostring(t[1])) then local func,check = tostring(t[1]) == "add" and addItemTable or removeItemTable, tostring(t[1]) == "add" and true or false local item = getItemIdByName(tostring(t[2]), false) if not item then doPlayerSendCancel(cid, "O item nao existe") return true elseif check == true and isInArray(info.BlockItemsList, item) then doPlayerSendCancel(cid, "Esse item nao é permitido a ser adicionado.") return true elseif isInTable(cid, item) == check then doPlayerSendCancel(cid, "This Item "..(check == true and "already" or "is not").." in your list.") return true elseif check and info.defaultMaxSlot and #getPlayerStorageTable(cid, 27000) >= getPlayerStorageValue(cid, info.maxSlotsStorage) then doPlayerSendCancel(cid, "You cannot add more than " .. getPlayerStorageValue(cid, info.maxSlotsStorage) .. " items in your list.") return true end func(cid, item) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "Voce adicionou o item "..t[2].." a sua lista" or "Voce removeu o item "..t[2].." from the list") return true end return true]]></talkaction> <action itemid="5889" event="buffer"><![CDATA[ domodlib('Loot_func') local s = doPlayerRemoveItem(cid,item.itemid,1) if s then setPlayerStorageValue(cid, info.maxSlotsStorage, getPlayerStorageValue(cid, info.maxSlotsStorage)+info.itemAddValue) else doPlayerSendCancel(cid, "Pick up the item first.") end return true ]]></action> </mod>
  9. Upvote
    brendoonh deu reputação a MatheusGlad em Piso que teleporta player e sumona monstro, depois 2 minuto's monstros summonados sao removidos   
    data\movements\scripts\nomedoscript.lua:
    local tilepos = {x=136, y=48, z=7} -- Posiçao do tile noroeste ( /\ < ) local sq = 3 -- Area 3x3 usar somente numeros impares > 2 local monster = "Demon" local time = 2 -- Tempo em minutos pra desaparecer function getUidsInArea(extr1, extr2) local dat = {} for y = extr1.y, extr2.y do for x = extr1.x, extr2.x do if isCreature(getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) end end end return dat end function summonAndRemove(monster, pos, t) local function removeCreatureEvent(uid) if isCreature(uid) then doRemoveCreature(uid) end end local uid = doSummonCreature(monster, pos) addEvent(removeCreatureEvent, t*1000, uid) end function onStepIn(cid, item, pos, frompos) if sq < 3 or sq%2 == 0 then return error("SOMENTE NUMEROS IMPARES MAIORES QUE 2") end local uids = getUidsInArea(tilepos, {x=tilepos.x+sq-1, y=tilepos.y+sq-1, z=tilepos.z}) if #uids == 0 then for y = tilepos.y, tilepos.y+sq-1 do for x = tilepos.x, tilepos.x+sq-1 do if y == tilepos.y+(sq-1)/2 and x == tilepos.x+(sq-1)/2 then doTeleportThing(cid, {x=x, y=y, z=tilepos.z}) else summonAndRemove(monster, {x=x, y=y, z=tilepos.z}, time*60) end end end else doTeleportThing(cid,frompos,true) return doPlayerSendCancel(cid, "There are people inside right now.") end end xml:
    <movevent type="StepIn" actionid="2930" event="script" value="nomedoscript.lua"/>
  10. Upvote
    brendoonh deu reputação a MatheusGlad em [Pedido] Spell 8.60 -   
    O que voce quiz dizer com "encostar"? Ficar do lado do player?
    Se for isso soh editando a source pra adicionar funçao onWalk, ou fazer uma gambiarra pra ficar dando check de tanto em tanto tempo no player pra ve se tem alguem do lado dele o que pode acabar lagando, posso fazer mas avisei .
     
    Segunda spell:
     
    Bem deve funcionar:
     
    data\spells\scripts\hook.lua:
    local range = 7 local interval = 50 -- velocidade do projetil em ms. ex: 1 sqm em 50 ms local stepsinterval = 50 -- velocidade de cada passo que a criatura vai dar ate chegar ao player local mindmg, maxdmg = 50, 100 -- min e max dmg em PLAYER, o dobro em monstros local dirs = { [0] = {0, -1}, [1] = {1, 0}, [2] = {0, 1}, [3] = {-1, 0} } function testTimes(pos, range, dir, interval) for i = 1, range do addEvent(doSendAnimatedText, interval*i, {x=pos.x+dirs[dir][1]*i, y=pos.y+dirs[dir][2]*i, z=pos.z}, i, 180) end end function forceWalk(cid, dir, distance, interval) local pos = getCreaturePosition(cid) local function teleportCreatureEvent(cid, topos) if isCreature(cid) then doTeleportThing(cid, topos, true) end end if interval > 0 then for i = 1, distance do addEvent(teleportCreatureEvent, i*interval, cid, {x=pos.x+dirs[dir][1]*i, y=pos.y+dirs[dir][2]*i, z=pos.z}) end else doTeleportThing(cid, {x=pos.x+dirs[dir][1]*distance, y=pos.y+dirs[dir][2]*distance, z=pos.z}) end return true end function isWalkable(pos) pos.stackpos = 1 local tile = getThingFromPos(pos) if not getTileInfo(pos).protection and (tile.itemid == 0 or (not isCreature(tile.uid) and not hasProperty(tile.uid, 0) and not hasProperty(tile.uid, 2) and not hasProperty(tile.uid, 3))) then return true end return false end function onCastSpell(cid, var) local playerpos = getPlayerPosition(cid) local dir = getPlayerLookDir(cid) local distance, target for d = 1, range do local uid = getThingFromPos({x=playerpos.x+dirs[dir][1]*d, y=playerpos.y+dirs[dir][2]*d, z=playerpos.z, stackpos=255}).uid if isCreature(uid) and not getTileInfo({x=playerpos.x+dirs[dir][1]*d, y=playerpos.y+dirs[dir][2]*d, z=playerpos.z}).protection then distance = d target = uid break end if not isWalkable({x=playerpos.x+dirs[dir][1]*d, y=playerpos.y+dirs[dir][2]*d, z=playerpos.z}) then distance = d break end end if distance then doSendDistanceShoot(playerpos, {x=playerpos.x+dirs[dir][1]*distance, y=playerpos.y+dirs[dir][2]*distance, z=playerpos.z}, 2) if target then addEvent(forceWalk, interval*distance, target, (dir+2)%4, distance-1, stepsinterval) addEvent(doTargetCombatHealth, interval*distance, cid, target, COMBAT_PHYSICALDAMAGE, -mindmg*2, -maxdmg*2, nil) end else doSendDistanceShoot(playerpos, {x=playerpos.x+dirs[dir][1]*range, y=playerpos.y+dirs[dir][2]*range, z=playerpos.z}, 2) end --testTimes(playerpos, range, dir, interval) return true end tag:
    <instant name="Hook" words="fresh meat" lvl="8" mana="1" exhaustion="2000" needlearn="0" event="script" value="hook.lua"> <vocation id="1"/> <vocation id="2"/> <vocation id="3"/> <vocation id="4"/> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> Como voce nao deixou claro se a criatura atingida pela "arrow" seria "arrastada" ou simplesmente dar teleport eu botei os dois, soh botar o stepsinterval = 0 pra dar teleport
     
    O problema eh que nao tem como eu fazer uma funçao pra desativar os movimentos do player enquanto ele esta sendo arrastado, isso pode acabar dando bugs, se for o caso voce vai ter que deixar o stepsinterval = 0 e o player nao vai ser arrastado
  11. Upvote
    brendoonh deu reputação a Vodk em Auto Loot v1.2   
    Atualização v1.2: Funciona em OTpokémon. Além de Premium, agora tem VIPTIME. Atualização v1.1: AutomaticDeposit adicionado. Introdução: É um sistema que você pegue os loots automaticamente.
     
    O sistema contém:
     
    Menu: Há um menu mostrando quais itens estão marcados para lootear automaticamente.
     


     
     
     
     
     
     
    Mods:
     
     
     
     
     
    Comandos:
    /autoloot -- mostra a sua lista de items /autoloot add,nome do item -- adiciona o item na loot list /autoloot remove,nome do item -- remove o item da loot list Configurando:
    OnlyPremium = true vc precisa ser premium para usar o comando -------------------------------------------------------------------------------- AutomaticDeposit = true Se o dinheiro que ele dropar ao invés de ir para bag vai para o banco -------------------------------------------------------------------------------- BlockMonsters = {} aqui você pode bloquear alguns monstro para ele não usar o auto loot, exemplo: BlockMonsters = {'demon','medusa'} -------------------------------------------------------------------------------- Também tem como bloquear alguns itens para serem adicionados a loot list, exemplo: BlockItemList = {2160,2163  
    "ok Vodkart, tem pra premium mas e se meu servidor for de Vip Time?"
     
     
    Simples:
    Troque: if info.OnlyPremium == true and not isPremium(cid) then doPlayerSendCancel(cid, "you must be a premium account.") return true por: if info.OnlyPremium == true and getPlayerStorageValue(cid, 13540) - os.time() <= 0 then doPlayerSendCancel(cid, "you must be a vip account.") return true  
    Caso seu servidor precise que relogue para atualizar a loot list, adicione isso:
    func(cid, item) -- depois desta linha doPlayerSave(cid) -- essa função
  12. Upvote
    brendoonh deu reputação a dyego2008 em [Encerrado] Duvida sources   
    Isso é para adicionar sistemas novos, você precisa de um server open source, você pode usar o Stian Dev que é um bom compilador, você precisa ter as sources do seu server, a source é boa para projetos sérios.
  13. Upvote
    brendoonh recebeu reputação de Caronte em Alavanca Monster   
    Exatamente isso, mitou mesmo.. Valeu agora foi!! Vou testar.. VALEUU !!!

    Rep+ pra todos que ajudaram !!


    Script perfeito, como eu queria!! Obrigado @@Caronte
  14. Upvote
    brendoonh deu reputação a Antharaz em Alavanca Monster   
    Não olhei a extensão dos arquivos ashuasuhhuas, mito u.u agora ele já sabe ql o erro, vou até dar +rep pra vc, mesmo eu não tendo nada haver com o tópico uhashuasu
  15. Upvote
    brendoonh deu reputação a ShinySprite em Alavanca Monster   
    Alavancakill tu colocou em um arquivo xml, era pra ser um arquivo .lua... deu para perceber isso no video
    mesma coisa no onkill


  16. Upvote
    brendoonh deu reputação a Caronte em Alavanca Monster   
    Crie um arquivo em creaturescripts/scripts/onkill.lua
    function onKill(homi, bixa) if getCreatureName(bixa) == "a Boss" then doSetStorage(65643, 0) end return true end Tag em creaturescripts.xml
    <event type="kill" name="killboss" event="script" value="onkill.lua"/> Registre no login.lua
    registerCreatureEvent(cid, "killboss") coloque antes do último return true
     
     
    A alavanca, coloque em actions/scripts/alavancakill.lua
    function onUse(cid, item) if getStorage(65643) < 1 then doCreateMonster("a Boss", getThingPos(cid)) doSetStorage(65643, 1) else doPlayerSendCancel(cid, "Voce deve matar primeiro o boss") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end end Tag em actions.xml
    <action actionid="3779" event="script" value="alavancakill.lua"/> Não se esqueça de alterar o nome do boss, no primeiro script que eu te passei.
  17. Upvote
    brendoonh recebeu reputação de Caronte em [Show off] Caronte (Daniel)   
    Nossa, muita talento envolvido. Parabéns!!
  18. Upvote
    brendoonh deu reputação a Lucas CP em Bug spell   
    Muda essa linha
    doCreatureSay(cid, "Master Heap Up" ,20) para
    doCreatureSay(cid, "Master Heap Up" ,19)
  19. Upvote
    brendoonh deu reputação a Caronte em [Show off] Caronte (Daniel)   
    Alguns dos poucos:  
    [
     

     

     

     

     
     
     
     
  20. Upvote
    brendoonh deu reputação a SkyLigh em Teleport   
    function onAdvance(cid, skill, oldLevel, newLevel)
    local pos, lvl, stg = {x=210, y= 10, z= 6 }, 300, 99001 -- pos, level, storage para nao repetir 2x
    if newLevel == 300 and getPlayerStorageValue(cid, 99001) <= 0 then
    setPlayerStorageValue(cid,99001,1)
    doTeleportThing(cid, pos, false)
    doPlayerSendTextMessage(cid, 22, "Você upou level 300 e foi teleportado")
    return true
    end
    end
     

     
  21. Upvote
    brendoonh deu reputação a SkyLigh em Script de remover pedra por tempo   
    local config = { pos = {x=174, y=116, z=12}, stoneid = 1353, time = 30 -- time in seconds to remove the stone } function onUse(cid, item, fromPosition, itemEx, toPosition) local stone = getTileItemById(config.pos,config.stoneid).uid if(stone > 0) then doRemoveItem(stone,1) doPlayerSendTextMessage(cid,22,"A pedra foi removida") doSendMagicEffect(config.pos, CONST_ME_MAGIC_RED) addEvent(doCreateItem, config.time * 1000, config.stoneid, 1, config.pos) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) else doPlayerSendCancel(cid, "A pedra ja foi removida, aguarde 30 segundos para abrir novamente.") end return true end
  22. Upvote
    brendoonh deu reputação a SkyLigh em [PEDIDO] Evento Double Exp   
    Talkaction.XML
    <talkaction words="/doubleexp" access="5" event="script" value="exp.lua"/> Taltaction/script/exp.lua
    function onSay(cid, words, param, channel) local config = { storage = 102590, } if(param == 'cancel') then if getGlobalStorageValue(config.storage) > 0 then setGlobalStorageValue(config.storage, -1) doBroadcastMessage("Double Exp cancelado") end return true end param = tonumber(param) if(not param or param < 0) then doPlayerSendCancel(cid, "Apenas maiores que 0.") return true end if getGlobalStorageValue(config.storage) - os.time() <= 0 then setGlobalStorageValue(config.storage, os.time()+param*60*60) doBroadcastMessage("Exp bonus ativado 50% + EXP por "..param.." horas! Aproveite.") end return true end Creature.XML
    <event type="kill" name="ExpBonus" event="script" value="exp.lua"/> Creature/script/exp.lua
    function onKill(cid, target) if isPlayer(cid) and isMonster(target) then if getGlobalStorageValue(102590) - os.time() >= 1 then local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = ((getMonsterInfo(string.lower(getCreatureName(target))).experience*1.5*exp)/2) doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end else return TRUE end return TRUE end Creature/script/login.LUA
    registerCreatureEvent(cid, "ExpBonus")
    Movido para resolvidos
  23. Upvote
    brendoonh deu reputação a Lucas CP em script de gm   
    Se for TFS 1.x você pode colocar na parte de player.lua da pasta events. Player:onMoveItem(item, count, fromPosition, toPosition)
    Antes do último return coloca isso:
    if self:getGroup():getId() > 1 then self:sendCancelMessage("Sorry, not possible.") self:getPosition():sendMagicEffect(CONST_ME_POFF) return false end Em outras versões só mudar na src:
    em game.cpp
    e editar essa parte:
    Game::playerMoveItem Se não me engano
  24. Upvote
    brendoonh deu reputação a Refe em Bau que dê item aleatorio   
    function onUse(cid, item, fromPos, item2, toPos) local item1 = xxx -- 30 % de chance local item2 = xxx -- 60 % de chance local item3 = xxx -- 10% de chance local sto = 255465 local tempo = 24*60*60 -- Em segundos if math.random(1,10) == 1 or math.random(1,10) == 2 or math.random(1,10) == 3 and os.time()-getPlayerStorageValue(cid, sto) > tempo then doPlayerAddItem(cid, item1) setPlayerStorageValue(cid, sto, os.time()) elseif math.random(1,10) == 4 or math.random(1,10) == 5 or math.random(1,10) == 6 or math.random(1,10) == 7 or math.random(1,10) == 8 or math.random(1,10) == 9 and os.time()-getPlayerStorageValue(cid, sto) > tempo then doPlayerAddItem(cid, item2) setPlayerStorageValue(cid, sto, os.time()) elseif math.random(1,10) == 10 and os.time()-getPlayerStorageValue(cid, sto) > tempo then doPlayerAddItem(cid, item3) setPlayerStorageValue(cid, sto, os.time()) else doPlayerSendCancel(cid, "Voce precisa esperar 1 Dia fazer a quest!") return true end end
  25. Upvote
    brendoonh deu reputação a Refe em Bau que dê item aleatorio   
    function onUse(cid, item, fromPos, item2, toPos) local premios = {xxx, xxx, xxx, xxx} local sto = 255465 local tempo = 24*60*60 -- Em segundos if os.time()-getPlayerStorageValue(cid, sto) > tempo then local randomChance = math.random(1, #premios) doPlayerAddItem(cid, premios[randomChance]) setPlayerStorageValue(cid, sto, os.time()) else return doPlayerSendCancel(cid, "Voce precisa esperar 1 Dia fazer a quest!") end return true end
  • Quem Está Navegando   0 membros estão online

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