Ir para conteúdo
  • Cadastre-se

Vodkart

Héroi
  • Total de itens

    3259
  • Registro em

  • Dias Ganhos

    228

Posts postados por Vodkart

  1. tenta usar addEvent, +ou- assim:

     

    local conf = {
       stunTime = 4500,
       delayCast = 600,
       scream = "EXPLOSION FIRE",
       speakChance = 5,
       speakList = {"Did you get burned?", "I like well-done meat"}
    }
    local s = 0
    -- Combat
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_LIFEDRAIN)
    -- Stun
    local stun = createConditionObject(CONDITION_PARALYZE)
    setConditionParam(stun, CONDITION_PARAM_TICKS, conf.stunTime)
    setConditionFormula(stun, -1, 0, -1, 0)
    
    local function setInitCast(cid)
       if isCreature(cid) then
          doAddCondition(cid, stun)
          doCreatureSetLookDir(cid, SOUTH)
          doCreatureSay(cid, conf.scream, TALKTYPE_MONSTER_YELL)
       end
    end
    function onCastSpell(cid, var)
       setInitCast(cid)
       addEvent(function()
       if not isCreature(cid) then
          return true
       elseif s > conf.stunTime then
          return true
       end
       doCreatureSetLookDir(cid, SOUTH)
       s = s + 250
       end, 250)
       return doCombat(cid, combat, var)
    end

     

  2. function onSay(cid, words, param)
    local level = getPlayerLevel(cid)
    local vocation = getPlayerVocationName(cid)
    local health, maxhealth = getCreatureHealth(cid), getCreatureMaxHealth(cid)
    local mana, maxmana = getCreatureMana(cid), getCreatureMaxMana(cid)
    local balance, pdays = getPlayerBalance(cid), getPlayerPremiumDays(cid)
    local fist, club, sword, axe = getPlayerSkillLevel(cid, 0), getPlayerSkillLevel(cid, 1), getPlayerSkillLevel(cid, 2), getPlayerSkillLevel(cid, 3)
    local distance, shield, fishing, magic =  getPlayerSkillLevel(cid, 4), getPlayerSkillLevel(cid, 5), getPlayerSkillLevel(cid, 6), getPlayerMagLevel(cid)
    local lvldodge = getPlayerStorageValue(cid, 98798644)
    local lvlcrit  = getPlayerStorageValue(cid, 48903)
    local lvlatk = getPlayerStorageValue(cid, 48904)
    local a = os.time()
    local b = math.floor((getPlayerStorageValue(cid, 13545) - a)/(24 * 60 * 60))
    local reset = getPlayerStorageValue(cid, 54676)
    local cap = getPlayerFreeCap(cid)
    local msg = "Vocation: "..vocation.."\nLevel: ".. level .."\nHP: ".. health .."/".. maxhealth .."\nMP: ".. mana .."/".. maxmana .."\nCapacity: ".. cap .."\nBalance: "..balance.."\nPremium Days: "..pdays.."\nDodge Level: ".. lvldodge .."\nCritical Level: ".. lvlcrit .."\nBOOSTER ATK: ".. lvlatk .."\nMagic Level: ".. magic .."\n[VIP] Days: ".. (b < 0 and 0 or b) .."\nReset Count: ".. reset .." \n\nFist: ".. fist .."\nClub: ".. club .."\nSword: ".. sword .."\nAxe: ".. axe .."\nDistance: ".. distance .."\nShield: ".. shield .."\nFishing: ".. fishing ..""
    doPlayerPopupFYI(cid, msg)
    return true
    end

     

  3. já existe a função de remover o boss, basta usá-la.

     

    function onUse(cid, item, fromPosition, itemEx, toPosition)
    	
    	local players = {}
    	for i = 1, #BossRoom.alavanca do
    		local v = getTopCreature(BossRoom.alavanca[i]).uid 
    		players[i] = isPlayer(v) and v or nil
    	end
    	
    	function checkPlayersInRoom() -- Responsável por verificar se há jogadores na sala enfrentando o boss.
    		local player_room = 0
    		for x = BossRoom.areaSalaBoss[1].x, BossRoom.areaSalaBoss[2].x do
    			for y = BossRoom.areaSalaBoss[1].y, BossRoom.areaSalaBoss[2].y do
    				for z = BossRoom.areaSalaBoss[1].z, BossRoom.areaSalaBoss[2].z do
    					local pos = {x=x, y=y, z=z,stackpos = 253}
    					local thing = getThingfromPos(pos)
    					if thing.itemid > 0 and isPlayer(thing.uid) == true then
    						player_room = player_room+1
    					end
    				end
    			end
    		end
    		return player_room
    	end
    	
    	
    	if #players < BossRoom.minPlayers then
    		doPlayerSendCancel(cid, "You need at least "..BossRoom.minPlayers.." players to enter.")
    		return true
    	end
    	
    	if checkPlayersInRoom() >= 1 then
    		doPlayerSendTextMessage(cid,19, "There is already a team in the boss room.") 
    		return true
    	end
    	
    	function playersTP(position) -- Responsável por teleportar os jogadores
    		for i = 1, 6 do
    			if players[i] then
    				doTeleportThing(players[i], position)
    				doSendMagicEffect(position, CONST_ME_TELEPORT)
    			end
    		end
    	end
    	
    	function removeBoss() -- Responsavel por Remover o BOSS da sala (caso os players nao tenham matado)
    		for x = BossRoom.areaSalaBoss[1].x, BossRoom.areaSalaBoss[2].x do
    			for y = BossRoom.areaSalaBoss[1].y, BossRoom.areaSalaBoss[2].y do
    				for z = BossRoom.areaSalaBoss[1].z, BossRoom.areaSalaBoss[2].z do
    					local area = {x = x, y = y, z = z}
    					local creature = getTopCreature(area).uid
    					if isCreature(creature) then 
    						doRemoveCreature(creature)
    					end
    				end
    			end
    		end
    	end
    	
    	function checkBossTime() -- Responsável por verificar se os jogadores matou ou não o boss após 10 minutos.
    		for x = BossRoom.areaSalaBoss[1].x - 1, BossRoom.areaSalaBoss[2].x + 1 do
    			for y = BossRoom.areaSalaBoss[1].y - 1, BossRoom.areaSalaBoss[2].y + 1 do
    				local pos = {x=x, y=y, z=BossRoom.areaSalaBoss[1].z}
    				local m = getTopCreature(pos).uid
    				if m ~= 0 and isMonster(m) and isInArray(BossRoom.name, getCreatureName(m)) then
    					playersTP(BossRoom.positionKickPlayer)
    					removeBoss()
    				end
    			end 
    		end
    		return false 
    	end
    	removeBoss()
    	playersTP(BossRoom.positionSalaBoss)
    	doCreateMonster(BossRoom.name, BossRoom.positionSpawnBoss)
    	addEvent(checkBossTime, BossRoom.timeToKill*60*1000)
    	return true
    end

     

  4. 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 shopWindow = {}
    local t = {
    [2195] = {price = 15, vocs = {1,5}}, -- [ITEMID] = {valor e vocation ids}
    [2493] = {price = 25, vocs = {2,6}},
    [2361] = {price = 30, vocs = {3,7}},
    [8851] = {price = 20, vocs = {4,8}},
    [8925] = {price = 30, vocs = {1,5}},
    [2640] = {price = 50, vocs = {3,7}},
    [2494] = {price = 100, vocs = {2,6}},
    [9932] = {price = 50, vocs = {4,8}},
    [2472] = {price = 70, vocs = {1,5}},
    [8931] = {price = 100, vocs = {1,5}}
    }
    local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
    if t[item] and not doPlayerRemoveMoney(cid, t[item].price)  then
    selfSay("you dont have "..t[item].price.." gps.", cid)
    else
    doPlayerAddItem(cid, item)
    selfSay("Here your item!", cid)
    end
    return true
    end
    if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE')) then
    for var, ret in pairs(t) do
    if isInArray(ret.vocs, getPlayerVocation(cid)) then
    table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
    end
    end
    openShopWindow(cid, shopWindow, onBuy, onSell)
    end
    return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())

     

  5. <talkaction words="/task;!task" event="buffer"><![CDATA[
    domodlib('task_func')
    param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
    if isInArray({"counter","contador"},param) then
    	setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
    	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true
    elseif isInArray({"daily","diaria"},param) then
    	if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
    		doPlayerSendCancel(cid, "Desculpe, Mas você não está em nenhuma Daily Task.") return true
    	elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
    		doPlayerSendCancel(cid,"Desculpe, Mas Você não terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true
    	end
    	return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".")
    end
    if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
    	doPlayerSendCancel(cid, "você não está em nenhuma task.") return true
    end 
    return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".")
    ]]></talkaction>

     

     

    por

     

    <talkaction words="/task;!task" event="buffer"><![CDATA[
    domodlib('task_func')
    param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
    if isInArray({"counter","contador"},param) then
    	setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
    	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] O contador foi "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "ativado" or "desativado")..".") return true
    elseif isInArray({"pontos","points","ponto","point"},param) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] Voce tem ".. getTaskPoints(cid) .." Task Points.") return true
    elseif isInArray({"daily","diaria"},param) then
    	if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
    		doPlayerSendCancel(cid, "Desculpe, Mas você não está em nenhuma Daily Task.") return true
    	elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
    		doPlayerSendCancel(cid,"Desculpe, Mas Você não terminou a Daily Task a tempo! Por favor volte ao npc e comece uma nova Daily Task!") return true
    	end
    	return doShowTextDialog(cid, 8983, "[->] CURRENT DAILY TASK INFO [<-]\n\nNome: "..daily_task[daily].name.."\nProgresso: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nPrazo para entrega: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonstros para caçar: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperiencia: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "Nenhum item de recompensa")..".")
    end
    if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
    	doPlayerSendCancel(cid, "você não está em nenhuma task.") return true
    end 
    return doShowTextDialog(cid, 8983, "-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "Nenhum")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experiencia: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nRedward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "Nenhum item de recompensa")..".")
    ]]></talkaction>

     

     

     

    só usa agora !task points

  6. na lib tenta deixar assim:

     

    monsters_boosteds = { -- Configuracao dos monstros que irão ter exp e loot aumentados
    	[1] = {monster_name = "Dwarf", exp = 0.05, loot = 7},
    	[2] = {monster_name = "Goblin", exp = 0.05, loot = 5},
    	[3] = {monster_name = "Orc", exp = 0.25, loot = 15},
        [4] = {monster_name = "Dwarf Soldier", exp = 0.35, loot = 10},
        --[5] = {monster_name = "NOME DO MONSTRO", exp = "PORCENTAGEM DE EXP", loot = "PORCENTAGEM DO LOOT"},
    }

     

     

    o onKill

     

    function onKill(cid, target, damage, flags)
    	if not (isMonster(target)) then
    		return true
    	end
    	if (string.lower(getCreatureName(target)) == string.lower(getGlobalStorageValue(monster_name_backup))) then
    	local percent = tonumber(getGlobalStorageValue(74813))
    	local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
    	local amount = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent))
    	doPlayerAddExperience(cid, amount)
    	addLoot(getCreaturePosition(target), getCreatureName(target), {})
    	end
    	return true
    end
    function addLoot(position, name, ignoredList)
        local check = false
        for i = 0, 255 do
            position.stackpos = i
            corpse = getTileThingByPos(position)
            if corpse.uid > 0 and isCorpse(corpse.uid) then
                check = true 
                break
            end
        end
    	if check == true then
            local newRate = (1 + (getGlobalStorageValue(monster_loot_backup)/100)) * getConfigValue("rateLoot")
            local mainbp = doCreateItemEx(1987, 1)
            local monsterLoot = getMonsterLootList(name)
            for i, loot in pairs(monsterLoot) do
                if math.random(1, 100000) <= newRate * loot.chance then 
                    if #ignoredList > 0 then
                        if (not isInArray(ignoredList, loot.id)) then
                            doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
                        end
                    else
                        doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
                    end
                end
            end
            doAddContainerItemEx(corpse.uid, mainbp)  
        end
    end

     

     

    OBS: O EVENTO TEM QUE SER COMEÇADO DE NOVO PARA ATUALIZAR A EXP NA STORAGE, ou seja, testa só depois que dar o boost exp

  7. local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
    local amount = math.floor(getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)
    doPlayerAddExperience(cid, amount)

     

    se quer adicionar em porcentagem, pode ser assim:

     

    local percent = 0.25 -- 25%
    local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
    local amount = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent))
    doPlayerAddExperience(cid, amount)

     

  8. local slots = {CONST_SLOT_HEAD, CONST_SLOT_ARMOR, CONST_SLOT_LEGS, CONST_SLOT_FEET, CONST_SLOT_LEFT, CONST_SLOT_RIGHT}
    for _, i in pairs(slots) do
       local check = getPlayerSlotItem(cid, i)
       if check.uid ~= 0 then
          doPlayerSendTextMessage(cid, 24, "Você não pode fazer está ação com algum item equipado! Retire todos os seus itens e coloque em sua backpack.")
          return true
       end
    end

     

  9. Em 17/04/2022 em 14:02, Breniinx disse:

    @Vodkart Vod, tem como adicionar uma talkactions para saber o horário que falta para conseguir pegar o baú novamente? o script é perfeito e tá funcionando normalmente

     

    function onSay(cid, words, param)
    	local storage, ip = 18000, getPlayerIp(cid)
    	return doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, getIpStorageValue(ip, storage) - os.time() <= 0 and "Voce esta habilitado para receber sua recompensa." or "Espere " .. timeString(getIpStorageValue(ip, storage) - os.time()) .. " para pegar um novo item!")
    end

     

  10. local STORAGE = 91811 
    local imortal_time = 5 --Segundos.
    local homem = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} --outfit que muda caso seja homem
    local mulher = {lookType = 156, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} --outfit que muda caso seja mulher
    function onCastSpell(cid, var)
    	if getPlayerStorageValue(cid, STORAGE) > os.time() then
    		doPlayerSendCancel(cid, "Você já está imortal.")
    		return true
    	end
    	setPlayerStorageValue(cid, STORAGE, os.time() + imortal_time)
    	doPlayerSendTextMessage(cid, 27, "During ".. imortal_time .." you'll be imortal.")
    	doSetCreatureOutfit(cid, getPlayerSex(cid) == 0 and mulher or homem, imortal_time*1000)
    	doCombat(cid, combat, var)
    	return true
    end

     

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo