Ir para conteúdo

Doidodepeda

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Curtir
    Alterei a função canWalkthrough para Impedir o atravessamento de pisos específicos (como 11059 e 11060) se já houver um jogador sobre eles e assim ninguem entra no mesmo depot que é comum em pvp então vamos retirar isso.
     
    Verificar o tipo de mundo (PVP / non-PVP / etc..) e zonas de proteção.
     
    No PVP, jogadores podem atravessar se estiverem fora de uma zona de proteção ou quando ambos não estiverem em combate.
     
    Segue as alterações:
     
    vá em Player.cpp e ache:
     
    bool Player::canWalkthrough(const Creature* creature) const { if(creature == this || hasFlag(PlayerFlag_CanPassThroughAllCreatures) || creature->isWalkable() || std::find(forceWalkthrough.begin(), forceWalkthrough.end(), creature->getID()) != forceWalkthrough.end() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if(!player) return false; if((((g_game.getWorldType() == WORLDTYPE_OPTIONAL && #ifdef __WAR_SYSTEM__ !player->isEnemy(this, true) && #endif player->getVocation()->isAttackable()) || player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground && Item::items[player->getTile()->ground->getID()].walkStack) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); }  
     
    altere para
     
    bool Player::canWalkthrough(const Creature* creature) const { if(creature == this || hasCustomFlag(PlayerCustomFlag_CanTurnhop) || creature->isWalkable() || (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster()))) return true; const Player* player = creature->getPlayer(); if(!player) return false; const Tile* tile = player->getTile(); if(tile && tile->ground) { // Verifica se o tile e o chão existem uint16_t groundID = tile->ground->getID(); if(groundID == 11059 || groundID == 11060) { return false; // Bloqueia atravessamento para esses pisos } } if((((g_game.getWorldType() == WORLDTYPE_OPTIONAL && !player->isEnemy(this, true) && #ifdef __WAR_SYSTEM__ !player->isEnemy(this, true) && #endif player->getVocation()->isAttackable()) || player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (player->getVocation()->isAttackable() && player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground && Item::items[player->getTile()->ground->getID()].walkStack) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges) || player->getAccess() <= getAccess())) return true; return (player->isGhost() && getGhostAccess() < player->getGhostAccess()) || (isGhost() && getGhostAccess() > player->getGhostAccess()); }  
    pronto só recompilar e testar.
     
  2. Gostei
    Doidodepeda deu reputação a L3K0T em BANK SYSTEM   
    Para permitir que os jogadores usem o dinheiro em seu banco para comprar itens de NPCs, você precisará modificar o arquivo modules/shop/shop.lua. Vamos supor que você tenha uma tabela player_data que armazena as informações do banco do jogador.
    Primeiro, você precisará adicionar uma nova função que verifica se o jogador tem dinheiro suficiente no banco para comprar um item. Adicione este código ao final do arquivo shop.lua:
    function getPlayerBankBalance(cid)
        local resultId = db.storeQuery("SELECT `balance` FROM `player_data` WHERE `id` = " .. getPlayerGUID(cid))
        if resultId == false then
            return false
        end
        local balance = result.getNumber(resultId, "balance")
        result.free(resultId)
        return balance
    end
    function getPlayerBankBalanceString(cid)
        local balance = getPlayerBankBalance(cid)
        if balance == false then
            return "Not available"
        else
            return formatNumber(balance) .. " gold coins"
        end
    end
    function doPlayerWithdrawFromBank(cid, amount)
        if amount <= 0 then
            return false
        end
        local balance = getPlayerBankBalance(cid)
        if balance == false or balance < amount then
            return false
        end
        db.query("UPDATE `player_data` SET `balance` = `balance` - " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid))
        doPlayerAddMoney(cid, amount)
        return true
    end

    Agora, você precisará modificar a função onBuy para permitir que o jogador compre o item usando o dinheiro do banco. Aqui está o código modificado:
    function onBuy(cid, item, subType, amount, ignoreCap, inBackpacks)
        local cost = getItemPrice(item.itemid) * amount
        
        if(getPlayerMoney(cid) + getPlayerBalance(cid) < cost) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have enough money.")
        end
        
        if(inBackpacks) then
            local container = doPlayerAddItem(cid, 2000, 1)
            if(container == 0) then
                return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any container to put the item.")
            end
            doAddContainerItem(container, item.itemid, amount)
            item = container
        else
            doPlayerAddItem(cid, item.itemid, amount)
        end
        
        doPlayerRemoveMoney(cid, cost - getPlayerBalance(cid))
        doPlayerRemoveBalance(cid, math.min(cost, getPlayerBalance(cid)))
        
        doSendAnimatedText(getThingPos(cid), "$-"..cost, TEXTCOLOR_ORANGE)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought ".. amount .." ".. getItemNameById(item.itemid) .." for ".. cost .." gold.")
        return true
    end

    Agora que você identificou onde o dinheiro do jogador está sendo verificado, você pode fazer a seguinte modificação:
    Antes:
    if getPlayerMoney(cid) < item.price then npcHandler:say('Desculpe, você não tem dinheiro suficiente.', cid) return false end
    Depois:
    if getPlayerMoney(cid) + getPlayerBalance(cid) < item.price then npcHandler:say('Desculpe, você não tem dinheiro suficiente.', cid) return false end
  3. Gostei
    Doidodepeda deu reputação a L3K0T em REVS TFS 0.4   
    Estou com algumas "revs não alteradas" e gostaria de compartilhar com vocês pois pode ajudar em alguma coisa.
     
    https://www.mediafire.com/folder/t3y80vqcnow4d/sources_revs_l3k0t
     

  4. Obrigado
    Doidodepeda deu reputação a boxxer321 em (Resolvido)Duvida RME__Mapa   
    Não, pode deixar preto
  5. Haha
    Doidodepeda recebeu reputação de Mateus Robeerto em (Resolvido)System DAMAGE   
    Sem querer, foi mal kkkkk
  6. Obrigado
    Doidodepeda deu reputação a Mateus Robeerto em (Resolvido)Adicionar (CHANCE) no script   
    local levels = { [-1] = {itemid = 6541, chance = 10}, [10] = {itemid = 6542, chance = 20}, [20] = {itemid = 6543, chance = 5}, [30] = {itemid = 6544, chance = 30}, [40] = {itemid = 6545, chance = 80}, } local config = { storage = 19333, chance = 1, --- chance de achar um item ou não k = 1, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante) experience = 19334 } local terra = {11787} function getDrops(cid) local drops = {} for i = -1, getPlayerStorageValue(cid, config.storage) do if levels[i] then local item = levels[i].itemid local chance = levels[i].chance if config.chance >= math.random(1, 100) then -- Ajustado para um intervalo de 1 a 100 if math.random(1, 100) <= chance then table.insert(drops, item) end end end end return drops end function onUse(cid, item, fromPosition, itemEx, toPosition) local drops = {} if isInArray(terra, itemEx.itemid) then drops = getDrops(cid) doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience) + 1) local experience = getPlayerStorageValue(cid, config.experience) if experience >= (8 + (getPlayerStorageValue(cid, config.storage) ^ 2)) / config.k then doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) + 1) doPlayerSendTextMessage(cid, 27, "Parabens, voce subiu de nivel! Seu nivel atual e " .. getPlayerStorageValue(cid, config.storage) .. ".") if getPlayerStorageValue(cid, config.storage) == 100 then doPlayerSendTextMessage(cid, 20, "[MINING] --> Por alcancar o nivel " .. getPlayerStorageValue(cid, config.storage) .. " voce foi premiado com o capacete de mineracao.") doPlayerAddItem(cid, 7497, 1, true) end end if config.chance >= math.random(1, 150) then if #drops >= 1 then local item = drops[math.random(1, #drops)] doPlayerSendTextMessage(cid, 27, "[MINING] --> Voce encontrou um(a) " .. getItemNameById(item) .. ".") doSendAnimatedText(toPosition, "Sucesso", 210) doPlayerAddItem(cid, item, 1, true) end doSendMagicEffect(toPosition, 3) else doSendAnimatedText(toPosition, "Tack", 215) doSendMagicEffect(toPosition, 2) return true end elseif itemEx.itemid == item.itemid then doPlayerSendTextMessage(cid, 27, "[MINING] --> Seu nivel na mineracao e: [" .. getPlayerStorageValue(cid, config.storage) .. "].") else return false end return true end  
  7. Obrigado
    Doidodepeda deu reputação a Mateus Robeerto em (Resolvido)System DAMAGE   
    local config = { effectonuse = 14, levelsdamage = 100, storagedamage = 14335 } function onUse(cid, item, frompos, item2, topos) local currentDamage = getPlayerStorageValue(cid, config.storagedamage) or 0 if currentDamage < config.levelsdamage then local newDamage = currentDamage + 1 doRemoveItem(item.uid, 1) doSendMagicEffect(topos, config.effectonuse) setPlayerStorageValue(cid, config.storagedamage, newDamage) local message = string.format("Seu dano foi aumentado para [%d/100].", newDamage) doPlayerSendTextMessage(cid, 22, message) else doPlayerSendTextMessage(cid, 22, "Você já atingiu o nível máximo de dano.\nParabéns!!!!") return false end return true end Recomendo que você coloque o dano por reset na source com valor de 1.0 ou 1.5 no máximo. Se for 2.0 ou mais, o dano alto é muito exagerado. Por isso, recomendo um valor menor, entre 1.0 e 1.5. Seria legal ter o dano por cada reset ou item ao clicar, por exemplo, 1/100 de evolução.
  8. Gostei
    No arquivo Weapons.xml dentro da pasta XML do seu servidor você pode manipular o dano das wands/rods.
  9. Obrigado
    Doidodepeda deu reputação a Mateus Robeerto em Reset System OTX 2   
    pode sim
     
    Você pode utilizar essa seção 'storage'
     local resets = getPlayerStorageValue(cid, 14335) or 0
     local damage = resets * 2.5 -- Calcula o damage por reset
  10. Obrigado
    Doidodepeda deu reputação a Mateus Robeerto em Reset System OTX 2   
    Você quer que o NPC exiba quanto de dano você tem por reset, correto?
    entao, procura essa linha .
     
     elseif msgcontains(msg, 'quantity') then         selfSay('You have a total of '..getResets(cid)..' reset(s).', cid)         talkState[talkUser] = 0     end e substitua tudo.
    elseif msgcontains(msg, 'quantity') then selfSay('Voce possui um total de ' .. getResets(cid) .. ' reset(s).', cid) talkState[talkUser] = 0 elseif msgcontains(msg, 'damage') then local resets = getPlayerStorageValue(cid, 14335) or 0 local damage = resets * 2.5 -- Calcula o damage por reset selfSay('Seu damage por reset atual e: ' .. damage, cid) -- Exibe o damage por reset ao jogador talkState[talkUser] = 0 end experimentar...
  11. Obrigado
    https://tibiaking.com/forums/topic/111239-reset-system-otx-2/?tab=comments#comment-573049
  12. Curtir
    Doidodepeda deu reputação a Mateus Robeerto em Reset System OTX 2   
    TFS 0.4
    combat.cpp
    procure esta linha.
    bool Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) Basta substituir todo o código aqui.
    bool Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) { int32_t change = 0; if (Combat2Var* var = (Combat2Var*)data) { change = var->change; if (!change) change = random_range(var->minChange, var->maxChange, DISTRO_NORMAL); } if (g_game.combatBlockHit(params.combatType, caster, target, change, params.blockedByShield, params.blockedByArmor)) return false; if (change < 0 && caster && caster->getPlayer() && target->getPlayer() && target->getPlayer()->getSkull() != SKULL_BLACK) change = change / 2; std::string value; caster->getStorage("14335", value); int32_t plus = (int32_t)(atoi(value.c_str())); double resetpower = plus * 2.5; if (plus > 0 && params.combatType != COMBAT_HEALING) { double changeModifier = 1.0 + (resetpower / 100.0); change = (int32_t)std::ceil(change * changeModifier); } if (!g_game.combatChangeHealth(params.combatType, caster, target, change, params.effects.hit, params.effects.color)) return false; CombatConditionFunc(caster, target, params, NULL); CombatDispelFunc(caster, target, params, NULL); return true; } mais uma vez procure essa linha.
    bool Combat::CombatManaFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) Basta substituir todo o código aqui.
    bool Combat::CombatManaFunc(Creature* caster, Creature* target, const CombatParams& params, void* data) { int32_t change = 0; if (Combat2Var* var = (Combat2Var*)data) { change = var->change; if (!change) change = random_range(var->minChange, var->maxChange, DISTRO_NORMAL); } if (change < 0 && caster && caster->getPlayer() && target->getPlayer() && target->getPlayer()->getSkull() != SKULL_BLACK) change = change / 2; std::string value; caster->getStorage("14335", value); int32_t plus = (int32_t)(atoi(value.c_str())); double resetpower = plus * 2.5; if (plus > 0 && params.combatType != COMBAT_HEALING) { double changeModifier = 1.0 + (resetpower / 100.0); change = (int32_t)std::ceil(change * changeModifier); } if (!g_game.combatChangeMana(caster, target, change)) return false; CombatConditionFunc(caster, target, params, NULL); CombatDispelFunc(caster, target, params, NULL); return true; } Fiz também para TFS 0.4. Ambos têm códigos diferentes na source, mas estão funcionando normalmente.
  13. Gostei
    Doidodepeda deu reputação a Vodkart em Up vocation   
    lembrando que ao invés de criar uma tabela e ir adicionando voc por voc, poderia usar somente em uma linha esssa função:
     
    doPlayerSetVocation(cid, isSorcerer(cid) and 17 or isDruid(cid) and 18 or isPaladin(cid) and 19 or 20)  
    porém o importante é dar certo, reputado.
  14. Gostei
    Doidodepeda deu reputação a MatteusDeli em (Resolvido)Tile que gasta soul ao entrar   
    @deza Boa noite, não testei o script mais acho que seria isso
     
    em data/movements crie um arquivo chamado soul.lua e cole isso nele
     
    local config = { soul = 10, -- Quantidade de soul que será removida message = { text = "Voce nao possui soul suficiente para passar aqui", color = MESSAGE_STATUS_CONSOLE_BLUE } } function onStepIn(cid, item, position, fromPosition) local playerSoul = getPlayerSoul(cid) if not isPlayer(cid) then return false end if playerSoul < config.soul then doPlayerSendTextMessage(cid, config.message.color, config.message.text) doTeleportThing(cid, fromPosition) return false end doPlayerAddSoul(cid, -config.soul) return true end  
    em movements.xml adicione esta linha nele:
     
    <movevent event="StepIn" actionid="XXXX" script="soul.lua" />  
    Aonde esta XXXX você coloca o actionId do tile que ativará o script
  15. Você Tentou
    Doidodepeda deu reputação a Mateus Robeerto em Botar EXP no codigo da source antes do numeros   
    void Creature::onGainExperience(double& gainExp, bool fromMonster, bool multiplied) { if(gainExp <= 0) return; if(master) { gainExp = gainExp / 2; master->onGainExperience(gainExp, fromMonster, multiplied); } else if(!multiplied) gainExp *= g_config.getDouble(ConfigManager::RATE_EXPERIENCE); int16_t color = g_config.getNumber(ConfigManager::EXPERIENCE_COLOR); if(color < 0) color = random_range(0, 255); std::stringstream ss; ss << "EXP: " << (uint64_t)gainExp; g_game.addAnimatedText(getPosition(), (uint8_t)color, ss.str()); } tentar ai.
  16. Você Tentou
    Doidodepeda deu reputação a Anderson Sacani em Botar EXP no codigo da source antes do numeros   
    std::stringstream ss; ss << (uint64_t)gainExp; std::string expText = "EXP: " + ss.str(); g_game.addAnimatedText(getPosition(), (uint8_t)color, expText); }  
  17. Obrigado
    Doidodepeda deu reputação a Mateus Robeerto em Botar EXP no codigo da source antes do numeros   
    void Creature::onGainSharedExperience(double& gainExp, bool fromMonster, bool multiplied) { if(gainExp <= 0) return; if(master) { gainExp = gainExp / 2; master->onGainSharedExperience(gainExp, fromMonster, multiplied); } else if(!multiplied) gainExp *= g_config.getDouble(ConfigManager::RATE_EXPERIENCE); int16_t color = g_config.getNumber(ConfigManager::EXPERIENCE_COLOR); if(color < 0) color = random_range(0, 255); std::stringstream ss; ss << "EXP: " << (uint64_t)gainExp; g_game.addAnimatedText(getPosition(), (uint8_t)color, ss.str()); }  
  18. Obrigado
    Doidodepeda deu reputação a Anderson Sacani em Botar EXP no codigo da source antes do numeros   
    Já leu o nome do método? onGainSharedExperience;
    Tente fazer modificações também em onGainExperience;
     
    void Creature::onGainExperience(double& gainExp, bool fromMonster, bool multiplied) { if(gainExp <= 0) return; if(master) { gainExp = gainExp / 2; master->onGainExperience(gainExp, fromMonster, multiplied); } else if(!multiplied) gainExp *= g_config.getDouble(ConfigManager::RATE_EXPERIENCE); int16_t color = g_config.getNumber(ConfigManager::EXPERIENCE_COLOR); if(color < 0) color = random_range(0, 255); std::stringstream ss; ss << "Exp: " << (uint64_t)gainExp; g_game.addAnimatedText(getPosition(), (uint8_t)color, ss.str()); }  
  19. Curtir
    Doidodepeda deu reputação a TsplayerT em [PEDIDO] Transform ditto   
    Bom, vou ensinar como fazer um ditto system igual pxg, ou seja, clona tipo(fire, water...), habilidades...
    Ex: se eu clonar um charizard, ele fica tipo fire/flying, e eu posso usar fly...
     
    CLIQUE NO BOTÃO A BAIXO PARA ABRIR O TUTORIAL


     
    por:: 
     
     


     
    Pronto, ele ja esta se transformando, mas e pra voltar?
    Crie um arquivo.lua com nome de dittorevert na pasta "data/talkactions/scripts".
    E dentro dele bote:
    function onSay(cid, words, param, channel)
    local thisball = getPlayerSlotItem(cid, 8)
    if getItemAttribute(thisball.uid, "ehditto") then
    doItemSetAttribute(thisball.uid, "poke",  "Ditto")
    doItemSetAttribute(thisball.uid, "ehditto",  1)
    end
    end
    Depois vá em talkactions.xml, localizado na pasta "data/talkactions" e insira esta linha:
                  <talkaction log = "yes" words = "!revert" hide="yes" event = "script" value = "dittorevert.lua"/>
    Perfeito, sistema funcionando, mas tem um problema, ele tem a mesma força do pokemon normal, como faço pra diminuir?
    Simples, vá em "data/lib" e abra o "level system.lua".
    Nele procure isso:
     
     


     
    E substitua por isso:
     
     


     
    PS: Como ali está "0.75", a força é diminuida em 1/4(um quarto).
    Pode mudar para o quanto quiser.
    EX:
    0.50 -> 2/4.
    0.25 -> 3/4.
     
    Pronto, sistema feito. Mas assim não da de indentificar que é ditto, sendo assim possivel enganar outros players. Para isso, vá em "data/creaturescripts/scripts" abra look.lua e procure por:
    table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n")
    e substitua por:
    if getItemAttribute(thing.uid, "ehditto") == 1 then
    table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." (Ditto).\n")   
    else
    table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename..".\n") 
    end
    No Goback.lua(data/actions/scripts) e no Some Functions.lua(data/lib)  procure isso:
     
     


    E apague.
     
    Em Some Functions.lua procure por:
     
     


     
    E deixe assim:
     
     


     
    Ainda no some functions.lua apague isso:
     


     
    GIF do System:
     


     
    OBS: Para que o ditto se transforme por completo, fale !revert puxe e bote ele novamente.
    Qualquer bug, avisem.
    PS: Se feito corretamente, não há bugs.
     
    Créditos:: TsplayerT por Trazer até aqui!



     

    DE REP+ PARA ME AJUDAR!
  20. Obrigado
    Aqui esta.
     
    ---Config local conf = { maxSlotCount = 1, ignoredIds = {} } --End function choose(...) --- Function by mock. local arg = {...} return arg[math.random(1, #arg)] end if not getItemAttack then function getItemAttack(uid) return getItemAttribute(uid, 'attack') end function getItemDefense(uid) return getItemAttribute(uid, 'defense') end end local function isArmor(uid) -- Function by Mock the bear. if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then return true end return false end local function isWeapon(uid) -- Function by Mock the bear. uid = uid or 0 local f = getItemWeaponType(uid) if f == 1 or f == 2 or f == 3 then return true end return false end local function isShield(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 4 then return true end return false end local function isBow(uid) -- Function by Mock the bear. uid = uid or 0 if getItemWeaponType(uid) == 5 and not isItemStackable(uid) then return true end return false end function onUse(cid, item, fromPosition, itemEx, toPosition) -- Script by mock the bear (MTB) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 -- Check if the vocation is 4 (Paladin) or 5 (Knight) if getPlayerVocation(cid) ~= 4 and getPlayerVocation(cid) ~= 5 then doPlayerSendTextMessage(cid, 24, "Only Paladins and Knights can use this item.") return true end if isInArray(conf.ignoredIds, itemEx.itemid) or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5) or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx)) or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then doPlayerSendTextMessage(cid, 24, "You can't open a slot on this item.") return true end if isCreature(itemEx.uid) then return false end local nam = getItemName(itemEx.uid) function getper() local n = 1 for i = 1, 10 do n = n + math.random(0, 10) if n < 8 * i then break end end return n end function getSlotCount(nam) local c = 0 for _ in nam:gmatch('%[(.-)%]') do c = c + 1 end return c end if getSlotCount(nam) < conf.maxSlotCount then local l = choose('hp') local p = getper() doSendMagicEffect(toPosition, 30) nam = nam .. ' [' .. l .. '.+' .. p .. '%]' doSendAnimatedText(toPosition, l .. ' ' .. p .. '%', 120) doItemSetAttribute(itemEx.uid, 'name', nam) doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, 24, "You can't open a slot on this item.") end return true end  
  21. Gostei
    tem como distribuir pra gente nao ? xD
  22. Obrigado
    Doidodepeda deu reputação a Mateus Robeerto em (Resolvido)Alguem ai tem cliente 8.6 estendido ?   
    Você tem duas opções: pode usar o DLL para ter o client estendido ou, sem o DLL, fazer a alteração no client para ler o cliente estendido. Vou mandar os dois links...
     
     
    ddraw.dll
    SEM DLL.
     
  23. Gostei
    TAG XML.
    <event type="login" name="AntiMc" event="script" value="AntiMc.lua"/>  
    LUA.
    function doKickPlayerIf(cid) if isPlayer(cid) then doRemoveCreature(cid) return true end return false end function onLogin(cid) local ips_permitidos = 3 -- configure aqui quantos jogadores podem logar com o mesmo ip local players = getPlayersOnline() local playerip = getPlayerIp(cid) local i = 0 for _,pid in ipairs(players) do if getPlayerIp(pid) == playerip then i = i + 1 end end if i > ips_permitidos then doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING,'Seu IP foi detectado pelo Anti-MC. Voce sera kickado em 5 segundos.') mayNotMove(cid,true) addEvent(doKickPlayerIf,5000,cid) end return true end Quando for postar na próxima vez, não esqueça de incluir informações sobre o seu TFS e a versão, ok?
  24. Você Tentou
    Doidodepeda deu reputação a Mateus Robeerto em Error script boss   
    tentou onDeath?
    local config = { NameBoss = "Boss Hits", rewardItem1 = {itemID = 8300, chance = 10}, -- 10% de chance de vim esse item rewardItem2 = {itemID = 8301, chance = 20}, -- 20% de chance de vim esse item rewardItem3 = {itemID = 8302, chance = 30}, -- 30% de chance de vim esse item rewardItem4 = {itemID = 8303, chance = 40}, -- 40% de chance de vim esse item effect = CONST_ME_MAGIC_RED } function onKill(cid, target) if isMonster(target) then local bossName = getCreatureName(target) print("Nome do Boss: " .. bossName) if bossName == config.NameBoss then local chanceToDropItem = math.random(1, 100) print("Chance de drop: " .. chanceToDropItem) local rewardItemID = nil if chanceToDropItem <= config.rewardItem1.chance then rewardItemID = config.rewardItem1.itemID elseif chanceToDropItem <= config.rewardItem1.chance + config.rewardItem2.chance then rewardItemID = config.rewardItem2.itemID elseif chanceToDropItem <= config.rewardItem1.chance + config.rewardItem2.chance + config.rewardItem3.chance then rewardItemID = config.rewardItem3.itemID elseif chanceToDropItem <= config.rewardItem1.chance + config.rewardItem2.chance + config.rewardItem3.chance + config.rewardItem4.chance then rewardItemID = config.rewardItem4.itemID end if rewardItemID then doPlayerAddItemEx(cid, rewardItemID, 1) doSendMagicEffect(getCreaturePosition(cid), config.effect) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você recebeu um item raro como recompensa por derrotar o Boss!") print("Item dropado: " .. rewardItemID) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Você não recebeu nenhum item como recompensa por derrotar o Boss.") end else print("Boss não encontrado no banco de dados ou não é 'Boss Hits'.") end end end  
  25. Obrigado
    Doidodepeda deu reputação a Imperius em Error script boss   
    data > creaturescripts > creaturescripts.xml
     
    <event type="kill" name="killTheBoss" event="script" value="killTheBoss.lua"/> <event type="login" name="killTheBossLogin" event="script" value="killTheBoss.lua"/>  
    data > creaturescripts > scripts > killTheBoss.lua
     
    local config = { monsters = {"Boss Hits"}, rewards = { {itemID = 8300, chanceToGainInPercent = 10, quantity = 1}, {itemID = 8301, chanceToGainInPercent = 20, quantity = 1}, {itemID = 8302, chanceToGainInPercent = 30, quantity = 1}, {itemID = 8303, chanceToGainInPercent = 40, quantity = 1}, }, effect = 27, } -- Função para selecionar um item com base na porcentagem function selectRandomItem() local totalChance = 0 for _, reward in pairs(config.rewards) do totalChance = totalChance + reward.chanceToGainInPercent end local randomValue = math.random(1, totalChance) local cumulativeChance = 0 for _, reward in pairs(config.rewards) do cumulativeChance = cumulativeChance + reward.chanceToGainInPercent if randomValue <= cumulativeChance then return reward end end end function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then if getCreatureMaster(target) ~= nil then return true end local monsterNameKilled = getCreatureName(target) if isInArray(config.monsters, monsterNameKilled) then local selectedItem = selectRandomItem() doPlayerAddItem(cid, selectedItem.itemID, selectedItem.quantity) doSendMagicEffect(getCreaturePosition(cid), config.effect) end end return true end function onLogin(cid) registerCreatureEvent(cid, "killTheBoss") return true end  

Informação Importante

Confirmação de Termo