Ir para conteúdo
Banner com Efeitos

Muvukaa

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Haha
    Muvukaa recebeu reputação de Mateus Robeerto em Tem Como Fazer Esse Sistema Para TFS 0.3.6 8.60 ???   
    @WakeSoft EU NÃO ACHEI ESSE SISTEMA EM NENHUM FORUM DE TIBIA.
  2. 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.
     
  3. Curtir
    tenta assim!
     
     
    function onUse(cid, item, frompos, item2, topos) local requiredCapacity = 360001.42 -- Minimum inventory capacity in oz local chestUID = 1624 if item.uid == chestUID then if getPlayerStorageValue(cid, chestUID) == -1 then if getPlayerLevel(cid) >= 0 then -- Check if the player has enough space in the inventory if getPlayerFreeCap(cid) < requiredCapacity then doPlayerSendCancel(cid, "You need at least 360001.42 oz of free capacity to use this chest.") return true end -- Add backpacks with ID 10518 to the player's inventory for i = 1, 42 do if not doPlayerAddItem(cid, 10518, 1) then doPlayerSendCancel(cid, "You don't have enough space for the backpacks.") return true end end -- Add 1,000,000 coins (ID 6527) inside a backpack (ID 10518) and repeat 100 times for i = 1, 100 do local backpack = doCreateItemEx(10518, 1) if backpack ~= 0 then for j = 1, 42 do doAddContainerItem(backpack, 6527, 100) end doPlayerAddItemEx(cid, backpack, false) else doPlayerSendCancel(cid, "You don't have enough space for the backpacks.") return true end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have won a prize.") setPlayerStorageValue(cid, chestUID, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to be level 0 to use this chest.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already received the bonus from this chest.") end end return true end
  4. Haha
  5. Gostei
    @L3K0T O SEU DEU CERTO L3KOT MUITO OBRIGADO PELA AJUDA MOVA PARA SEÇÃO DE RESOLVIDOS.
  6. Curtir
    local lvlcrit = 48913 -- armazenamento para críticos normais local lvlcritDanger = 48904 -- armazenamento para críticos perigosos local multiplier = 1.5 -- multiplicador de dano function onCombat(cid, target) if isPlayer(cid) and isCreature(target) then local criticalChance = getPlayerStorageValue(cid, lvlcrit) or 0 local criticalDangerChance = getPlayerStorageValue(cid, lvlcritDanger) or 0 local chance = math.random(1, 1000) if chance <= (criticalDangerChance * 3) then local damageDanger = 100 -- Valor do dano crítico DANGER (ajuste conforme necessário) doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damageDanger, -damageDanger, 255) doSendAnimatedText(getCreaturePosition(target), "DANGER!", 190) doSendMagicEffect(getCreaturePosition(cid), 52) return true elseif chance <= (criticalChance * 4) then local damageBooster = 200 -- Valor do dano crítico BOOSTER (ajuste conforme necessário) doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damageBooster, -damageBooster, 255) doSendAnimatedText(getCreaturePosition(target), "+BOOSTER!", 31) doSendMagicEffect(getCreaturePosition(cid), 54) return true else return true end end return true end  
  7. Curtir
    Eu só dei uma melhorada no script e limpei a sintaxe em LUA.
    local criticalConfig = { normal = { storage = 48913, damage = 100, chanceMultiplier = 3, effect = 54, text = "+BOOSTER!", textColor = 31, combatEffect = 255 }, danger = { storage = 48904, damage = 150, chanceMultiplier = 3, effect = 52, text = "DANGER!", textColor = 190, combatEffect = 255 } } function onCombat(cid, target) if isPlayer(cid) and isCreature(target) then local chance = math.random(1, 1000) local function applyCritical(criticalType) local config = criticalConfig[criticalType] local criticalChance = getPlayerStorageValue(cid, config.storage) or 0 if chance <= (criticalChance * config.chanceMultiplier) then local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, config.combatEffect) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -config.damage, -config.damage, 0, 0) doCombat(cid, combat, numberToVariant(target)) doSendAnimatedText(getCreaturePosition(target), config.text, config.textColor) doSendMagicEffect(getCreaturePosition(cid), config.effect) return true end return false end -- Tenta aplicar o crítico 'normal' e se falhar, tenta aplicar o 'danger' if not applyCritical('normal') then applyCritical('danger') end end return true end  
  8. Gostei
    Bota o piso laranja que ao logar o jogador vai ser jogado pro lado caso tenha alguém no piso principal.
  9. Obrigado
    Muvukaa recebeu reputação de L3K0T em Compilando o OTClient Mehah no Visual Studio 2022   
    ótimo tutorial parabéns
  10. Curtir
    Muvukaa deu reputação a L3K0T em Compilando o OTClient Mehah no Visual Studio 2022   
    Bem-vindo ao tutorial sobre como compilar o OTClient Mehah no Visual Studio 2022! Neste tutorial, vou guiá-lo pelo processo de configuração do ambiente de desenvolvimento e compilação do OTClient Mehah no Visual Studio 2022
     
     
    Tutorial: Compilando o OTClient Mehah no Visual Studio 2022
     
     
    Passo 1:  Downloads necessários baixe todos primeiro
     
    Visual Studio 2022 Comunidade:
    Faça o download:  https://visualstudio.microsoft.com/pt-br/downloads/


     
     
    Microsoft Visual C++ Redistributable 2015-2022: 
    Download:  32bits: https://aka.ms/vs/17/release/vc_redist.x86.exe  ou 64 bits: https://aka.ms/vs/17/release/vc_redist.x64.exe
     
     
    Git: Se ainda não tiver o Git instalado, faça o download: https://git-scm.com/download/win
     

     
     
    Passo 2: Instalando abra o visual studio 22 ai quando chegar nessa tela você marca essas opções e desmarca as outras:
     

     

     
     
    instalando o git, pode só dar next até o final...
     

     
    instalando o Microsoft Visual C++ Redistributable 2015-2022
    abra seu powershell
     
    digite os comando 1 por vez:
     
    git clone https://github.com/Microsoft/vcpkg  
    cd vcpkg  
    .\bootstrap-vcpkg.bat  
     
    bibliotecas 64bits referente ao seus sistema
      .\vcpkg install boost-iostreams:x64-windows boost-asio:x64-windows boost-system:x64-windows boost-variant:x64-windows boost-lockfree:x64-windows luajit:x64-windows glew:x64-windows boost-filesystem:x64-windows boost-uuid:x64-windows physfs:x64-windows openal-soft:x64-windows libogg:x64-windows libvorbis:x64-windows zlib:x64-windows opengl:x64-windows openssl:x64-windows liblzma:x64-windows nlohmann-json:x64-windows protobuf:x64-windows  
    bibliotecas 32bits referente ao seus sistema
      .\vcpkg install boost-iostreams:x86-windows boost-asio:x86-windows boost-system:x86-windows boost-variant:x86-windows boost-lockfree:x86-windows luajit:x86-windows glew:x86-windows boost-filesystem:x86-windows boost-uuid:x86-windows physfs:x86-windows openal-soft:x86-windows libogg:x86-windows libvorbis:x86-windows zlib:x86-windows opengl:x86-windows openssl:x86-windows liblzma:x86-windows nlohmann-json:x86-windows protobuf:x86-windows  
    por final:
    .\vcpkg integrate install
     
     
    Download cliente mehah versão nova: https://github.com/mehah/otclient
     
    Agora só abrir o projeto pelo visual studio e clica compilar que vai configura tudo certinho e vai compilar
     


     
     
     
  11. Curtir
    local COLOR_RED = 180 -- Defina a cor que você está usando local tableBoss = { ["Amazon"] = {seconds = 10, newBoss = "Amazon"} } local function timer(position, duration) local t = duration addEvent(function() if t > 0 then doSendAnimatedText(position, tostring(t), COLOR_RED) t = t - 1 timer(position, t) else -- Respawn do boss após a contagem regressiva addEvent(doCreateMonster, 1000, tableBoss["Amazon"].newBoss, position) end end, 1000) end function onKill(cid, target, damage, flags) if isPlayer(target) then return true end local boss = tableBoss[getCreatureName(target)] if not boss then return true end local position = getCreaturePosition(target) local timeLeft = boss.seconds doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "O boss renascerá em " .. timeLeft .. " segundos na posição: " .. position.x .. ", " .. position.y .. ", " .. position.z) -- Exibe a posição no texto timer(position, boss.seconds) -- Inicia o contador regressivo para o respawn do boss addEvent(function() for i = 1, boss.seconds do addEvent(function() local remainingTime = timeLeft - i if remainingTime > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "O boss renascerá em " .. remainingTime .. " segundos na posição: " .. position.x .. ", " .. position.y .. ", " .. position.z) -- Exibe a posição no texto end end, i * 1000) end end, 1) return true end  
  12. Curtir
    Muvukaa deu reputação a LeoTK em [Novo Critical System] Critical System 2021   
    Servidor testado 0.3.6 8.60 ✅ - Podendo funcionar em 0.4 ⚠️
     
    Primeiro vou explicar um pouco sobre ele é base do script do @xWhiteWolf e modificado para escalar com skill pelo @BangxD e agora modificado novamente para não só funcionar com players mas também com todos os monstros.
     
    Instalação
    Se ja tem instalado siga as instruções abaixo para instalar o script basta remover o registro do login.lua, alterar a tag XML pela nova fornecida Caso não tenha instalado basta instalar normalmente criando o arquivo critical.lua e adicionando as tag no XML  
    Tag XML
     
    Script
     
     
  13. Curtir
    Muvukaa deu reputação a MatteusDeli em Reflect stones (storage)   
    @FearWar
     
    data\creaturescripts\scripts crie um arquivo chamado reflectStone.lua e adicione isso nele:
    local lvldodge = 48903 local percent = 0.5 function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS and isCreature(attacker) then if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then value = math.ceil(value*(percent)) doCreatureAddHealth(attacker, -value) doSendAnimatedText(getCreaturePos(cid), "Reflected!", 6) return false end end return true end  
    creaturescripts.xml:
    <event type="statschange" name="ReflectStone" event="script" value="reflectStone.lua"/>  
    login.lua:
    registerCreatureEvent(cid, "ReflectStone")  
  14. Curtir
    É um tutorial ou você precisa de suporte sobre o mesmo, eu nao entendi??
  15. Curtir
    Isso??
     
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH) function damage(cid, level, maglevel, targetPosition) local min = 1000000000 local max = 1000000000 return -min, -max, getDirectionTo(targetPosition) -- Retorna também a direção para o alvo end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "damage") function onCastSpell(cid, var) local target = variantToPosition(var) local targetCreature = getTopCreature(target).uid local direction = getDirectionTo(getCreaturePosition(targetCreature)) local newVar = createCombatArea(getAreaAround(target, 1, 1)) -- Define a área de ataque em torno do alvo setCombatArea(combat, newVar) return doCombat(cid, combat, var), direction end -- Função auxiliar para obter a direção para uma posição alvo function getDirectionTo(targetPosition) local creaturePosition = getCreaturePosition(cid) local dx = targetPosition.x - creaturePosition.x local dy = targetPosition.y - creaturePosition.y if math.abs(dx) > math.abs(dy) then if dx > 0 then return DIRECTION_EAST else return DIRECTION_WEST end else if dy > 0 then return DIRECTION_SOUTH else return DIRECTION_NORTH end end end  
  16. Haha
    <vocation id="2" name="Mage"
     <vocation id="3" name="Paladin"
     <vocation id="4" name="Knight"
    <vocation id="6" name="[VIP] Mage"
    <vocation id="7" name="[VIP] Paladin"
    <vocation id="8" name="[VIP] Knight"
     
    QUERO QUE O SCRIPT FUNCIONE QUANDO USA GEMA NO JOGO E QUANDO DESLOGA E LOGA FICA COM EFEITO.
     
    creatuescript .logingema.lua
    function onLogin(cid) setPlayerStorageValue(cid, 47112120, 2) local voc = getPlayerVocation(cid) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) end return TRUE end creaturescript .logout.lua
    function onLogout(cid) setPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)],0) return TRUE end creaturescript.xml
    <event type="logout" name="PlayerLogout" script="logout.lua"/> <event type="login" name="gema" event="script" value="logingema.lua"/> data/lib .gems
    function onUse(cid, item, fromPosition, itemEx, toPosition) gem = gems.id[getPlayerVocation(cid)] if item.itemid == gem then doUseGem(cid, item, getPlayerVocation(cid)) end return TRUE end data/lib/ .pivi
    function doUseGem(cid, item) local voc = getPlayerVocation(cid) local interval = gems.interval[voc] if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then return FALSE end setPlayerStorageValue(cid, gems.storage[voc], 1) sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) doRemoveItem(item.uid, 1) return TRUE end function sendGemEffect(cid, storage, interval) local pos = getThingPos(cid) local voc = getPlayerVocation(cid) local color = 1 if voc == 1 then color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)] elseif voc == 2 then color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)] elseif voc == 3 then color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)] elseif voc == 4 then color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)] end doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) >= 1 then addEvent(sendGemEffect, interval, cid, storage, interval) end end function doRemoveGemEffect(cid) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) < 1 then return FALSE end setPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)], 0) return TRUE end function doRemoveAllGemEffect(cid) for i = 1, table.maxn(gms.storage) do setPlayerStorageValue(cid, gems.storage[i], 0) end return TRUE function isGemActivated(cid) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then return TRUE end return FALSE end data/lib .pivi_const
    gems = { id = {2156, 2155, 2158, 2154, 2156, 2155, 2158, 2154}, storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008}, interval = {750, 750, 750, 750, 750, 750, 750, 750}, -- Intervalo dos efeitos } gemMsg = { rnd = {"´ . ,", ". ´ ,", "` . ,", ", ` ."}, colorDruid = {180,180}, colorSorcerer = {30,215}, colorPaladin = {251,10}, colorKnight = {204,212}, colorElderDruid = {180,180}, colorMasterSorcerer = {30,215}, colorRoyalPaladin = {251,10}, colorEliteKnight = {204,212} } action/script .gems
    local config = { minLevel = 200, -- Level mínimo para adquirir a gema. } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerLevel(cid) >= config.minLevel then gem = gems.id[getPlayerVocation(cid)] if item.itemid == gem then doUseGem(cid, item, getPlayerVocation(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você adquiriu uma gema espíritual.") doSendMagicEffect(getCreaturePosition(cid), 65) end else doPlayerSendCancel(cid, "Voc\ê precisa ser level "..config.minLevel.." para adquirir a gema esp\íritual.") end return TRUE end action.xml
    <action itemid="2156" script="gems.lua" /> <action itemid="2155" script="gems.lua" /> <action itemid="2154" script="gems.lua" /> <action itemid="2158" script="gems.lua" />
  17. Curtir
    function onSay(cid, words, param, channel) local t = {} for i = 1, getPlayerInstantSpellCount(cid) do local spell = getPlayerInstantSpellInfo(cid, i - 1) if(spell.mlevel ~= 1) then if(spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.mlevel < b.mlevel end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if(prevLevel ~= spell.mlevel) then if(i ~= 1) then line = "\n" end line = line .. "Spells for Magic Level " .. spell.mlevel .. "\n" prevLevel = spell.mlevel end text = text .. line .. " " .. spell.words .. " : " .. spell.mana .. "\n" end doShowTextDialog(cid, 2175, text) return true end  
  18. Curtir
    Em vez de contar a exp quando a pessoa morrer e depois novamente quando logar, usando 3 storages pra isso, acredito que seria melhor anotar o level na morte e simplesmente o npc conferir se o level atual é menor que o anterior salvo.
    Ainda dá pra melhorar algumas coisas, mas isso aqui funcionou pra mim:
     
    creaturescripts.xml:
    <event type="preparedeath" name="Exp_P" event="script" value="exp_buy.lua"/>  
    login.lua:
    registerCreatureEvent(cid, "Exp_P")  
    exp_buy.lua
     
    function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) setPlayerStorageValue(cid, 135215, getPlayerExperience(cid)) return true end  
    e nos npcs, expbuy.lua:
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local config = { itemid = 9020, count = 300, past_level = getPlayerStorageValue(cid, 135215) } if isInArray({"recover", "recuperar", "exp", "experience"}, string.lower(msg)) then npcHandler:say("Do you wish to recover the lost experience after your death for "..config.count.." "..getItemNameById(config.itemid).."? {yes}", cid) talkState[talkUser] = 1 elseif (msgcontains(string.lower(msg), 'yes') and talkState[talkUser] == 1) then if config.past_level ~= -1 and getPlayerLevel(cid) < config.past_level then if doPlayerRemoveItem(cid, config.itemid, config.count) then doPlayerAddExperience(cid, getExperienceForLevel(config.past_level) - getExperienceForLevel(getPlayerLevel(cid))) npcHandler:say("Thank you! Here is your experience.", cid) setPlayerStorageValue(cid, 135215, -1) else npcHandler:say("Sorry, you don't have enough "..getItemNameById(config.itemid).."!", cid) talkState[talkUser] = 0 end else npcHandler:say("Sorry, you have not died or have already recovered your lost experience!", cid) talkState[talkUser] = 0 end elseif string.lower(msg) == "no" then npcHandler:say("Then not", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
  19. Curtir
    data > npc > scripts > NomeDoNPC.lua
     
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local config = { itemID = 11192, -- ID da Moeda VIP quantity = 100, -- Quantidade de moedas que o jogador precisa ter na mochila minLevel = 8 -- Level minimo que o jogador precisa ter para comprar a promotion } local itemName = getItemNameById(config.itemID) function checkPlayerHavePromotion(cid) local currentVocation = getPlayerVocation(cid) - 4 local vocationPromoted = getPromotedVocation(currentVocation) - 4 return currentVocation == vocationPromoted; end function checkPlayerHaveItems(cid, message, keywords, parameters, node) if (not npcHandler:isFocused(cid)) then return false end if (config.minLevel ~= nil and getPlayerLevel(cid) < config.minLevel) then npcHandler:say('You must reach level '..config.minLevel..' to buy promotion.', cid) return true end if checkPlayerHavePromotion(cid) then npcHandler:say('You are already promoted!', cid) return true end if (not doPlayerRemoveItem(cid, config.itemID, config.quantity)) then npcHandler:say('You do not have enough '..itemName..'!', cid) return true end doPlayerSetVocation(cid, getPlayerVocation(cid) + 4) npcHandler:say(parameters.text, cid) return true end local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, { npcHandler = npcHandler, onlyFocus = true, text = "I can promote you for "..config.quantity.." {"..itemName.."}. Do you want me to promote you?" }) node1:addChildKeyword({'yes'}, checkPlayerHaveItems, { npcHandler = npcHandler, text = "Congratulations! You are now promoted." }) node1:addChildKeyword({'no'}, StdModule.say, { npcHandler = npcHandler, onlyFocus = true, reset = true, text = "Alright then, come back when you are ready." }) npcHandler:addModule(FocusModule:new())
    data > npc > NomeDoNPC.xml
     
    <?xml version="1.0" encoding="UTF-8"?> <npc name="NomeDoNPC" script="data/npc/scripts/NomeDoNPC.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="160" head="77" body="79" legs="56" feet="115" addons="0"/> </npc>
     
  20. Curtir
    local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local vocation = { [2] = 6, [3] = 7, [4] = 8 } function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end local talkUser = cid msg = string.lower(msg) local level = 717217 if isInArray({"promotion", "promote", "promo"}, msg) then selfSay("You need to have 100 VIP COINS and be at level 717217!", cid) talkState[talkUser] = 1 elseif msg == "yes" and talkState[talkUser] == 1 then local playerVocation = getPlayerVocation(cid) if vocation[playerVocation] then if getPlayerLevel(cid) >= level then if getPlayerItemCount(cid, 11192) >= 100 then doPlayerRemoveItem(cid, 11192, 100) local newVocationId = vocation[playerVocation] doPlayerSetVocation(cid, newVocationId) doSendMagicEffect(getPlayerPosition(cid), 12) selfSay("Congratulations, you've been promoted!", cid) else selfSay("You do not have enough VIP COINS to be promoted.", cid) end else selfSay("Sorry, you need to be at level " .. level .. " or above to be promoted!", cid) end else selfSay("Sorry, you cannot receive promotion.", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())  
  21. Curtir
    local maxPlayers = 5 function onThink(interval, lastExecution) local t, ret = {}, "TOP " .. math.min(maxPlayers, getWorldCreatures(0)) .. " Rank Level e Reset (LIVE):\n" for _, cid in ipairs(getPlayersOnline()) do table.insert(t, {cid, getPlayerLevel(cid), getPlayerStorageValue(cid, 54676)}) end table.sort(t, function(a, b) return a[2] > b[2] end) for i = 1, math.min(#t, maxPlayers) do ret = ret .. "\n" .. i .. " - " .. getCreatureName(t[i][1]) .. ": Level: [" .. t[i][2] .. "] - Reset: [" .. t[i][3] .. "]" end print(ret) end  
  22. Curtir
    Boa tarde!
     
    executa essa query na sua db
     
     
  23. Curtir
    Você precisa criar um creaturescript com o evento de onLogin e fazer a lógica.
  24. Curtir
    Muvukaa deu reputação a Fabi Marzan em [SQLite] -=[TFS]=- 0.4 8.60 Não funciona [Movements]   
    ?????
    Eu não vejo o problema
    a única coisa foi que você colocou ao contrário
    doPlayerSendTextMessage(cid, 22, "Você precisa ser VIP ou falar com o ADM para passar por este piso.")
    e
     doPlayerSendTextMessage(cid, 22, "Você precisa ser level 717217 ou falar com o ADM para passar por este piso.")
    function onStepIn(cid, item, position, fromPosition) if getPlayerGuildId(cid) > 0 then if getPlayerLevel(cid) >= 717217 then if getPlayerStorageValue(cid, 13545) - os.time() <= 0 then doPlayerSendTextMessage(cid, 22, "WELCOME!") doSendMagicEffect(getCreaturePosition(cid), 28) else doTeleportThing(cid, fromPosition) doPlayerSendTextMessage(cid, 22, "Você precisa ser VIP ou falar com o ADM para passar por este piso.") doSendMagicEffect(getCreaturePosition(cid), 2) end else doTeleportThing(cid, fromPosition) doPlayerSendTextMessage(cid, 22, "Você precisa ser level 717217 ou falar com o ADM para passar por este piso.") doSendMagicEffect(getCreaturePosition(cid), 2) end else doTeleportThing(cid, fromPosition) doPlayerSendTextMessage(cid, 22, "Você precisa fazer parte de alguma guild ou fala com ADM para passar por este piso.") doSendMagicEffect(getCreaturePosition(cid), 2) end return TRUE end  
  25. Curtir
    Não tenho conhecimento disso
    mas o jeito que eu sei seria modificar os scripts para que não detecte os nomes da lista, como neste caso os scripts acima
     
    if not isInArray(blocked_name, getPlayerName(cid)) then -- scripts return true end  

Informação Importante

Confirmação de Termo