Ir para conteúdo

bfs102030

Campones
  • Total de itens

    86
  • Registro em

  • Última visita

Posts postados por bfs102030

  1. Ola boa noite, eu estou precisando de uma ajuda com sistema de Auction System, na verdade ele esta funcionando perfeitamente. eu apenas gostaria de adiciona a funçao de BALANCE = ( consultar o saldo) eu tentei acrescentar algo no script porem não obtive sucesso.

     

    auctionsystem.lua



    local config = {
            levelRequiredToAdd = 20,
            maxOffersPerPlayer = 5,
            SendOffersOnlyInPZ = true,
            blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2433, 6300, 6301}
            }
    function onSay(cid, words, param, channel)
            if(param == '') then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                    return true
            end
            local t = string.explode(param, ",")
            if(t[1] == "add") then
                    if((not t[2]) or (not t[3]) or (not t[4])) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                            return true
                    end
                    if(not tonumber(t[3]) or (not tonumber(t[4]))) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.")
                            return true
                    end
                    if(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.")
                            return true
                    end
                    local item = getItemIdByName(t[2])
                    if(not item) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
                            return true
                    end
                    if(getPlayerLevel(cid) < config.levelRequiredToAdd) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.")
                            return true
                    end
                    if(isInArray(config.blocked_items, item)) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.")
                            return true
                    end
                    if(getPlayerItemCount(cid, item) < (tonumber(t[4]))) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).")
                            return true
                    end
                    local check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";")
                    if(check:getID() == -1) then
                    elseif(check:getRows(true) >= config.maxOffersPerPlayer) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")")
                            return true
                    end
                    if(config.SendOffersOnlyInPZ) then    
                            if(not getTilePzInfo(getPlayerPosition(cid))) then
                                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.")
                                    return true
                            end
                    end
                    if(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.")
                            return true
                    end
                                    local itemcount, costgp = math.floor(t[4]), math.floor(t[3])
                    doPlayerRemoveItem(cid, item, itemcount)
                    db.query("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")")
                                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.")
            end
            if(t[1] == "buy") then
                    if(not tonumber(t[2])) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                            return true
                    end
                    local buy = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")
                    if(buy:getID() ~= -1) then
                            if(getPlayerMoney(cid) < buy:getDataInt("cost")) then
                                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.")
                                    buy:free()
                                    return true
                            end
                            if(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("player"))) then
                                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.")
                                    buy:free()
                                    return true
                            end
                            if(getPlayerFreeCap(cid) < getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")))then
                                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getDataString("item_name") .. ". It weight " .. getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.")
                                    buy:free()
                                    return true
                            end
                            if(isItemStackable((buy:getDataString("item_id")))) then
                                    doPlayerAddItem(cid, buy:getDataString("item_id"), buy:getDataInt("count"))
                            else
                                    for i = 1, buy:getDataInt("count") do
                                            doPlayerAddItem(cid, buy:getDataString("item_id"), 1)
                                    end
                            end
                            doPlayerRemoveMoney(cid, buy:getDataInt("cost"))
                            db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")
                            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") .. " gps!")
                            db.query("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. buy:getDataInt("player") .. ";")
                            buy:free()
                    else
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                    end
            end
            if(t[1] == "remove") then
                    if((not tonumber(t[2]))) then
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                            return true
                    end
                                    if(config.SendOffersOnlyInPZ) then    
                                            if(not getTilePzInfo(getPlayerPosition(cid))) then
                                                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.")
                                                    return true
                                            end
                    end
                    local delete = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";")        
                    if(delete:getID() ~= -1) then
                            if(getPlayerGUID(cid) == delete:getDataInt("player")) then
                                    db.query("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";")
                                    if(isItemStackable(delete:getDataString("item_id"))) then
                                            doPlayerAddItem(cid, delete:getDataString("item_id"), delete:getDataInt("count"))
                                    else
                                            for i = 1, delete:getDataInt("count") do
                                                    doPlayerAddItem(cid, delete:getDataString("item_id"), 1)
                                            end
                                    end
                                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.")
                            else
                                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!")
                            end
                    delete:free()
                    else
                            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.")
                    end
            end
            if(t[1] == "balance") then
                    local balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
                    if(balance:getDataInt("auction_balance") < 1) then
                            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.")
                            balance:free()
                            return true
                    end
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. getPlayerBalance(cid)("auction_balance") .. " gps from auction system!")
                    balance:free()
                    end
            if(t[1] == "receber") then
                    local balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
                    if(balance:getDataInt("auction_balance") < 1) then
                            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.")
                            balance:free()
                            return true
                    end
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. balance:getDataInt("auction_balance") .. " gps from auction system!")
                    doPlayerAddMoney(cid, balance:getDataInt("auction_balance"))
                    db.query("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. getPlayerGUID(cid) .. ";")
                    balance:free()
            end
            return true
    end

     

    essa e a parte que eu tentei adicionar porem nao gerou sucesso.

     

            if(t[1] == "receber") then
                    local balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
                    if(balance:getDataInt("auction_balance") < 1) then
                            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.")
                            balance:free()
                            return true
                    end

     

    Gerou o seguinte erro no TFS

     



    [21:1:06.820] [Error - TalkAction Interface]
    [21:1:06.821] data/talkactions/scripts/auctionsystem.lua:onSay
    [21:1:06.821] Description:
    [21:1:06.823] data/talkactions/scripts/auctionsystem.lua:140: attempt to call a
    number value
    [21:1:06.824] stack traceback:
    [21:1:06.825]   data/talkactions/scripts/auctionsystem.lua:140: in function <dat
    a/talkactions/scripts/auctionsystem.lua:7>

     

    Eu tenho uma outra duvida também. Neste mesmo sistema eu uso uma PHP no gesior. Ela mostra o item que esta a venda com todas as informações, porem mostra o preço que o player  colocou a venda da seguinte forma 5000000gps eu gostaria que mostrasse na forma de KK"S Exemplo: eu colocar um item pra vender por 5kk e aparecer assim 5kk, ou se for 5500000 gps mostrar 5,5kk

     

    Auction System PHP



    <?PHP
    $auctions = $SQL->query('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC')->fetchAll();
    $players = 0;
           
        $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Instruзхes<b></TD></TR><TR BGCOLOR='.$config['site']['lightborder'].'><TD><center><img src="images/shop/item market.png"></center></TR></TD></TABLE><br />';
        if(empty($auctions))
        {
            $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Lista de Items</b></td></TR><TR BGCOLOR='.$config['site']['lightborder'].'><TD>Atualmente hб nenhum Item no Market.</TD></TR></TABLE>';
            $main_content .= '<br />';
        }
        else
        {
        foreach($auctions as $auction) {
            $players++;
                if(is_int($players / 2))
                    $bgcolor = $config['site']['lightborder'];
                else
                    $bgcolor = $config['site']['darkborder'];
            $cost = round($auction['cost']/1000, 2);
            $content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$auction['id'].'</center></TD><TD><center><img src="/item_images/'.$auction['item_id'].'.gif"/></center></TD><TD><center>'.$auction['item_name'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($auction['name']).'">'.$auction['name'].'</a></center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.'<img src="images/items/2160.gif"><br /><small>'.$auction['cost'].'gps</small></center></TD><TD><center><b><font color="maroon">!market buy, '.$auction['id'].'</b></center></TR>';
        }
        
        $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>Item</center></b></TD><TD class="white"><b><center>Item Attributes</center></b></TD><TD class="white"><b><center>Vendedor</center></b></TD><TD class="white"><b><center>Quantidade</center></b></TD><TD class="white"><b><center>Valor</center></b></td><TD class="white"><b><center>Comprar</center></b></td></TR>'.$content.'</TABLE>';
    }
        ?> 

  2. Ola galera boa tarde, estou precisando de uma ajudinha em alguns scripts do meu servidor 8,60 TFS 0,4

    Bom os scripts estão funcionando porem da um erro no TFS quando são usados. gostaria de arrumar pois pode vir a se tornar bug, sei la.

     

    1º script 

     

    Spell: Exori Stun >> quando um personagem usa essa spell o player que a recebe fica imóvel  por alguns segundos.

    ela esta funcionando porem da esse ero no TFS

     

     

    Spoiler
     
    local combat = createCombatObject()
        setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
        setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
        setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
        setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
        setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
        setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
     
    function onCastSpell(cid, var)
    local storage = 302020 

    if getPlayerStorageValue(cid, storage) < 1 then
    doPlayerSendCancel(cid, "Desculpe, Você tem que Fazer a [The Destyne Quest] para usar está magia.")
    return false
    end
        
        local target = variantToNumber(var)    
        doTargetCombatCondition(0, target, exhausted, CONST_ME_MAGIC_RED)
        local exhausted = createConditionObject(CONDITION_EXHAUST)
        setConditionParam(exhausted, CONDITION_PARAM_TICKS,6000)
        
        doCreatureSetNoMove(target, true) 
        addEvent(doCreatureSetNoMove, 6000, target, false)
        
        return doCombat(cid, combat, var)
    end 

      

        <instant name="stun rox" words="exori stun" lvl="270" mana="1700" prem="1" range="4" needtarget="1" exhaustion="4500" blockwalls="1" needlearn="0" event="script" value="pbot/exori stun.lua">
            <vocation id="3"/>
            <vocation id="7"/>
            <vocation id="11"/>
        </instant>  local combat = createCombatObject()
        setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
        setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
        setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
        setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
        setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
        setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
     
    function onCastSpell(cid, var)
    local storage = 302020 

    if getPlayerStorageValue(cid, storage) < 1 then
    doPlayerSendCancel(cid, "Desculpe, Você tem que Fazer a [The Destyne Quest] para usar está magia.")
    return false
    end
        
        local target = variantToNumber(var)    
        doTargetCombatCondition(0, target, exhausted, CONST_ME_MAGIC_RED)
        local exhausted = createConditionObject(CONDITION_EXHAUST)
        setConditionParam(exhausted, CONDITION_PARAM_TICKS,6000)
        
        doCreatureSetNoMove(target, true) 
        addEvent(doCreatureSetNoMove, 6000, target, false)
        
        return doCombat(cid, combat, var)
    end 

      

        <instant name="stun rox" words="exori stun" lvl="270" mana="1700" prem="1" range="4" needtarget="1" exhaustion="4500" blockwalls="1" needlearn="0" event="script" value="pbot/exori stun.lua">
            <vocation id="3"/>
            <vocation id="7"/>
            <vocation id="11"/>
        </instant> 
     

     

    erro

     



    [17:57:36.414] [Error - Spell Interface]
    [17:57:36.415] data/spells/scripts/stun/exori stun.lua:onCastSpel
    [17:57:36.421] Description:
    [17:57:36.423] (luaDoTargetCombatCondition) Condition not found 

     

    2º Monster Revive >> criei uma spell que sumona um monster (Teen Wolf), quando alguém mata esse meu SUMON nasce outro mais forte (Werewoolf)

    estou usando um script hamado Monster Revive pra que o sumon reviva sobre meu comando assim como o 1º que morreu. O script funciona porem da esse erro no TFS

     

    script



    function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    local area = 18 ------- A area que o efeito vai alcançar----
    local effect = 23 --- Id do efeito de área para deixar mais bonito escolha um vibrante e colorido--------
    local creature = "werewoolf" -- Monstro que revive ---
    function doSendDistanceEffectAround(cid, position, AreaNumber, type)  
    local numberInArea = tonumber(AreaNumber)
    local distance0 = {x=position.x, y=position.y-numberInArea, z=position.z}
    local distance1 = {x=position.x+numberInArea, y=position.y, z=position.z}
    local distance2 = {x=position.x, y=position.y+numberInArea, z=position.z}
    local distance3 = {x=position.x-numberInArea, y=position.y, z=position.z}
    return doSendDistanceShoot(position, distance0, type) and doSendDistanceShoot(position, distance1, type) and doSendDistanceShoot(position, distance2, type) and doSendDistanceShoot(position, distance3, type)
    end 

    doSendDistanceEffectAround(cid, getCreaturePosition(cid), area, effect)
    doConvinceCreature(getCreatureMaster(cid), doCreateMonster(creature, getCreaturePosition(cid)))
    return doRemoveCreature(cid)
    end 

      

      <event type="preparedeath" name= "revive" event="script" value="monsterevive.lua"/> 

     

    erro



    [18:11:47.996] [Error - CreatureScript Interface]
    [18:11:47.997] data/creaturescripts/scripts/killinginthenameof.lua:onKill
    [18:11:47.999] Description:
    [18:11:48.001] (luaGetCreatureMaster) Creature not found 

    [18:11:48.003] [Error - CreatureScript Interface]
    [18:11:48.005] function onKill(cid, target, lastHit)
    [18:11:48.007]     if(getCreatureName(target) == 'Shard Of Corruption') the
    [18:11:48.008]         doPlayerSetStorageValue(cid, 7343, 11)
    [18:11:48.010]         doCreatureSay(cid, "Done", TALKTYPE_ORANGE_1)
    [18:11:48.012]     end
    [18:11:48.013]     return TRUE
    [18:11:48.015] end:onKill
    [18:11:48.026] Description:
    [18:11:48.028] (luaGetCreatureName) Creature not found

     

    3º Sacre Annihilator >> e uma anihilator de 4 players, so pode 1 vocação de cada, cada player tem seu SQM especifico e cada player tem que levar um sacrifício (ITEM) que é colocado

    logo ao lado, o script funciona porem esta dando erro no TFS quando : apenas 1 player puxar a alavanca sem mais ninguém encima

      zmoEAi.png

     

    Script



    function onUse(cid, item, frompos, item2, topos)
        -- Item ID and Uniqueid --
        switchUniqueID = 1913
        switchID = 1945
        switch2ID = 1946
        axeID    = 7434
        bowID = 8855
        rodID    = 8910
        wandID    = 8922
     
     
        -- Level to do the quest --
        questlevel = 30
     
     
        piece1pos = {x=33225, y=31681, z=13, stackpos=1} -- Where the first piece will be placed
        getpiece1 = getThingfromPos(piece1pos)
     
        piece2pos = {x=33224, y=31681, z=13, stackpos=1} -- Where the second piece will be placed
        getpiece2 = getThingfromPos(piece2pos)
     
        piece3pos = {x=33223, y=31681, z=13, stackpos=1} -- Where the third piece will be placed
        getpiece3 = getThingfromPos(piece3pos)
     
        piece4pos = {x=33222, y=31681, z=13, stackpos=1} -- Where the fourth piece will be placed
        getpiece4 = getThingfromPos(piece4pos)
     
        player1pos = {x=33225, y=31682, z=13, stackpos=253} -- Where player1 will stand before pressing lever
        player1 = getThingfromPos(player1pos)
        player2pos = {x=33224, y=31682, z=13, stackpos=253} -- Where player2 will stand before pressing lever
        player2 = getThingfromPos(player2pos)
        player3pos = {x=33223, y=31682, z=13, stackpos=253} -- Where player3 will stand before pressing lever
        player3 = getThingfromPos(player3pos)
        player4pos = {x=33222, y=31682, z=13, stackpos=253} -- Where player4 will stand before pressing lever
        player4 = getThingfromPos(player4pos)
     
        knightvoc = getPlayerVocation(player1.uid)   -- The vocation of player1
        paladinvoc = getPlayerVocation(player2.uid)  -- The vocation of player2
        druidvoc = getPlayerVocation(player3.uid)    -- The vocation of player3
        sorcerervoc = getPlayerVocation(player4.uid) -- The vocation of player4
     
        nplayer1pos = {x=33239, y=31682, z=13} -- The new position of player1
        nplayer2pos = {x=33238, y=31682, z=13} -- The new position of player2
        nplayer3pos = {x=33237, y=31682, z=13} -- The new position of player3
        nplayer4pos = {x=33236, y=31682, z=13} -- The new position of player4
     
     
        player1level = getPlayerLevel(player1.uid) -- Checking the level of player1
        player2level = getPlayerLevel(player2.uid) -- Checking the level of player2
        player3level = getPlayerLevel(player3.uid) -- Checking the level of player3
        player4level = getPlayerLevel(player4.uid) -- Checking the level of player4
     
     
        -- Check if all players has the correct vocation
        if knightvoc == 4 or knightvoc == 8 or knightvoc == 12 and
        paladinvoc == 3 or paladinvoc == 7 or paladinvoc == 11 and
        druidvoc == 2 or druidvoc == 6 or druidvoc == 10 and
        sorcerervoc == 1 or sorcerervoc == 5 or sorcerervoc == 9 then    
     
     
        -- Check if all players are standing on the correct positions
        if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
            if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and    player4level >= questlevel then
                if item.uid == switchUniqueID and item.itemid == switchID and getpiece1.itemid == axeID and getpiece2.itemid == bowID and getpiece3.itemid == rodID and getpiece4.itemid == wandID then
                    doSendMagicEffect(player1pos,2)
                    doTeleportThing(player1.uid,nplayer1pos)
                    doSendMagicEffect(nplayer1pos,10)
                    doRemoveItem(getpiece1.uid,1)
     
                    doSendMagicEffect(player2pos,2)
                    doTeleportThing(player2.uid,nplayer2pos)
                    doSendMagicEffect(nplayer2pos,10)
                    doRemoveItem(getpiece2.uid,1)
     
                    doSendMagicEffect(player3pos,2)
                    doTeleportThing(player3.uid,nplayer3pos)
                    doSendMagicEffect(nplayer3pos,10)
                    doRemoveItem(getpiece3.uid,1)
     
                    doSendMagicEffect(player4pos,2)
                    doTeleportThing(player4.uid,nplayer4pos)    
                    doSendMagicEffect(nplayer4pos,10)
                    doRemoveItem(getpiece4.uid,1)
     
                    doTransformItem(item.uid,item.itemid+1)
                elseif item.uid == switchUniqueID and item.itemid == switch2ID then
                    doTransformItem(item.uid,item.itemid-1)
                else
                    doPlayerSendCancel(cid,"Desculpe, você precisa colocar os itens corretos nos locais corretos.")
                end
                else
                return 0
                end
            else
                doPlayerSendCancel(cid,"Desculpe, todos os jogadores na sua equipe devem ser de nível " .. questlevel .. ".")
            end
        else
            doPlayerSendCancel(cid,"Desculpe, todos os 4 jogadores devem estar nas posições de corretas.")
        end
        return 1
    end

     

     

    erro



    [18:22:11.891] [Error - Action Interface]
    [18:22:11.892] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.892] Description:
    [18:22:11.893] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #6 

    [18:22:11.894] [Error - Action Interface]
    [18:22:11.894] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.895] Description:
    [18:22:11.896] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #6 

    [18:22:11.897] [Error - Action Interface]
    [18:22:11.898] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.898] Description:
    [18:22:11.899] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #6 

    [18:22:11.900] [Error - Action Interface]
    [18:22:11.904] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.906] Description:
    [18:22:11.908] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #6 

    [18:22:11.910] [Error - Action Interface]
    [18:22:11.913] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.915] Description:
    [18:22:11.917] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #3 

    [18:22:11.919] [Error - Action Interface]
    [18:22:11.921] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.923] Description:
    [18:22:11.926] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #3 

    [18:22:11.929] [Error - Action Interface]
    [18:22:11.931] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.932] Description:
    [18:22:11.933] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #3 

    [18:22:11.936] [Error - Action Interface]
    [18:22:11.938] data/actions/scripts/quests/superanih.lua:onUse
    [18:22:11.940] Description:
    [18:22:11.942] (internalGetPlayerInfo) Player not found when requesting player i
    nfo #3 

     

     

    Desde já agradeço a quem puder ajudar e REP+

  3. Ola Galera, estou precisando de ajuda com alguns scripts, já procurei algo parecido em forums porem não achei. Meu servidor e versão 8,60 TFS 0,4

    • bom esses são scripts de spells de monstros, eu peguei eles no (Otland), estão dando erro no meu TFS porem os monsters que atacam essas spells estão no spawn porem nao estao atacando essas spells. Acho que essas magiassao para outro TFS se puderem modificar para o meu.
    •  SEGUE ERROS E SCRIPTS

     

     

     



    [18:57:53.934] [Error - Test Interface]
    [18:57:53.935] data/spells/scripts/monster/the flaming orchid paralyze.lua
    [18:57:53.937] Description:
    [18:57:53.941] ...ells/scripts/monster/the flaming orchid paralyze.lua:1: attemp
    t to call global 'Combat' (a nil value)
    [18:57:53.944] [Error - Event::checkScript] Cannot load script (data/spells/scri
    pts/monster/the flaming orchid paralyze.lua)


    [18:57:53.977] [Error - Test Interface]
    [18:57:53.981] data/spells/scripts/monster/the flaming orchid fire.lua
    [18:57:53.983] Description:
    [18:57:53.985] ...a/spells/scripts/monster/the flaming orchid fire.lua:1: attemp
    t to call global 'Combat' (a nil value)
    [18:57:53.988] [Error - Event::checkScript] Cannot load script (data/spells/scri
    pts/monster/the flaming orchid fire.lua)


    [18:57:54.026] [Error - Test Interface]
    [18:57:54.028] data/spells/scripts/monster/dawnfire asura reducer magic.lua
    [18:57:54.030] Description:
    [18:57:54.032] ...lls/scripts/monster/dawnfire asura reducer magic.lua:1: attemp
    t to call global 'Combat' (a nil value)
    [18:57:54.035] [Error - Event::checkScript] Cannot load script (data/spells/scri
    pts/monster/dawnfire asura reducer magic.lua)


    [18:57:54.071] [Error - Test Interface]
    [18:57:54.073] data/spells/scripts/monster/dawnfire asura fire.lua
    [18:57:54.075] Description:
    [18:57:54.078] data/spells/scripts/monster/dawnfire asura fire.lua:1: attempt to
     call global 'Combat' (a nil value)
    [18:57:54.081] [Error - Event::checkScript] Cannot load script (data/spells/scri
    pts/monster/dawnfire asura fire.lua)

     

     

     

     



    [18:58:43.814] [Error - Monsters::deserializeSpell] The Flaming Orchid - Unknown
     spell name: the flaming orchid fire
    [18:58:43.815] [Warning - Monsters::loadMonster] Cant load spell (data/monster/p
    bot/the flaming orchid.xml).
    [18:58:43.817] [Error - Monsters::deserializeSpell] The Flaming Orchid - Unknown
     spell name: the flaming orchid paralyze
    [18:58:43.818] [Warning - Monsters::loadMonster] Cant load spell (data/monster/p
    bot/the flaming orchid.xml).
    [18:58:43.821] [Error - Monsters::deserializeSpell] Dawnfire Asura - Unknown spe
    ll name: dawnfire asura fire
    [18:58:43.821] [Warning - Monsters::loadMonster] Cant load spell (data/monster/p
    bot/Dawnfire Asura.xml).
    [18:58:43.824] [Error - Monsters::deserializeSpell] Dawnfire Asura - Unknown spe
    ll name: dawnfire asura reducer magic
    [18:58:43.824] [Warning - Monsters::loadMonster] Cant load spell (data/monster/p
    bot/Dawnfire Asura.xml).

     

     

     

     

     

     



     <instant name="mons_the flaming orchid paralyze" words="###195" aggressive="1" blockwalls="1" needtarget="1" needlearn="1" script="monster/the flaming orchid paralyze.lua" /> 
     <instant name="the flaming orchid fire" words="###196" aggressive="1" blockwalls="1" needtarget="1" needlearn="1" script="monster/the flaming orchid fire.lua" />
        
     <instant name="dawnfire asura reducer magic" words="###179" aggressive="1" blockwalls="1" needtarget="1" needlearn="1" script="monster/dawnfire asura reducer magic.lua" />
     <instant name="dawnfire asura fire" words="###180" aggressive="1" blockwalls="1" needtarget="1" needlearn="1" script="monster/dawnfire asura fire.lua" />
        

     

     

    Spells de Monsters > dawnfire asura fire

     

     



    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)

    local condition = Condition(CONDITION_FIRE)
    condition:setParameter(CONDITION_PARAM_DELAYED, 1)
    condition:addDamage(20, 10000, -10)
    combat:setCondition(condition)

    arr = {
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}
    }

    local area = createCombatArea(arr)
    combat:setArea(area)
    combat:setCondition(condition)


    function onCastSpell(creature, var)
    return combat:execute(creature, var)
    end

     

     

     

     

    Spells de Monsters > dawnfire asura reducer magic

     

     



     

    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

    local condition = Condition(CONDITION_ATTRIBUTES)
    condition:setParameter(CONDITION_PARAM_TICKS, 10000)
    condition:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, -1)

    local area = createCombatArea({
    {0, 0, 0, 0, 0},
    {0, 1, 1, 1, 0},
    {0, 1, 3, 1, 0},
    {0, 1, 1, 1, 0},
    {0, 0, 0, 0, 0}

    })
    combat:setArea(area)
    combat:setCondition(condition)

    function onCastSpell(creature, var)
    return combat:execute(creature, var)
    end

     

     

     

     

     

    Spells de Monsters > the flaming orchid fire

     

     



    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
    combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)

    local condition = Condition(CONDITION_FIRE)
    condition:setParameter(CONDITION_PARAM_DELAYED, 1)
    condition:addDamage(20, 10000, -10)
    combat:setCondition(condition)

    arr = {
    {3}
    }

    local area = createCombatArea(arr)
    combat:setArea(area)
    combat:setCondition(condition)


    function onCastSpell(creature, var)
    return combat:execute(creature, var)
    end

     

     

     

     

    Spells de Monsters > the flaming orchid paralyze

     

     



    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)

    local condition = Condition(CONDITION_PARALYZE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(condition, -0.8, 0, -0.9, 0)
    setCombatCondition(combat, condition)

    local area = createCombatArea({
    {0, 0, 0, 0, 0, 0, 0}, 
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 1, 1, 1, 1, 0},
    {0, 1, 1, 3, 1, 1, 0}, 
    {0, 1, 1, 1, 1, 1, 0}, 
    {0, 0, 1, 1, 1, 0, 0}, 
    {0, 0, 0, 0, 0, 0, 0} 

    })
    combat:setArea(area)
    combat:setCondition(condition)

    function onCastSpell(creature, var)
    return combat:execute(creature, var)
    end

     

     

     

    Bom isso e tudo, agradeço desde já a quem puder ajudar e REP+

  4. Realmente amigo esta apresentando o probblema que informa pontos nao selecionados.. tentei mexer ake so que nao consegui resultados..

     

    axo que o problema esta nesta parte ake

     

     

     

    if ($action == "transfersuccess"){#if (!$name){header ("location: index.php?subtopic=transferpoints&action=transfersuccess&name=".$name."&quant_transf=".$quant_transf."");}if (!$quant_transf) {echo '<script>alert("Quantidade nao foi informada."); location.href=\'index.php?subtopic=transferpoints&action=transfer\'</script>';}if (!$name) {echo '<script>alert("Jogador nao foi informado."); location.href=\'index.php?subtopic=transferpoints&action=transfer\'</script>';}$name = stripslashes(ucwords(strtolower(trim($_REQUEST['name']))));if(check_name($name)) {$player = $ots->createObject('Player');$player->find($name);if($player->isLoaded()) {$transfer_ss = $SQL->query ("UPDATE `accounts` SET  `premium_points` =  `premium_points` + ".$quant_transf." WHERE  `accounts`.`id` = ".$player->getCustomField('account_id')." LIMIT 1 ;");$transfer_s = $SQL->query ("UPDATE `accounts` SET  `premium_points` =  `premium_points` - ".$quant_transf." WHERE  `accounts`.`id` = ".$account_logged->getCustomField('id')." LIMIT 1 ;");$main_content .='<center><input type="button" class="btn btn-success" value="Foram transferidos '.$quant_transf.' pontos para '.$name.' com sucesso!" onclick="location.href=\'index.php?subtopic=accountmanagement\'"/></center>';}else$main_content .= '<center><span class="red btn btn-danger" onclick="location.href=\'index.php?subtopic=transferpoints&action=transfer\'"><b>Player name <b>'.$name.'</b> dont exist.</b></span></center>';$transfer_ss;$transfer_s;}}}?>

     

     

    Repare que a 2ª linha e a única que tem  #  no inicio, eu tentei retira-lo pois achei que poderia ser algo que foi digitado sem querer porem a paina da um erro inormando que a pagina seguinte na foi encontrada ou  algo d tipo.. nao da nenhum erro de php porem da um erro como se nao tivesse iinternet no pc a pagina fica branca.....

    se alguem ae souber ajudar porfavor estamos precisando..

     

  5. Luanmax21 poeria me dizer como esta usando esse sistema ?

    pois eu adiciconei ele em meu site e adicionei uma aba na coluna  shop.. ae quando  o player clika nela ele esta sendo direcionado para uma pagina onde so mostra quantos points ele tem mas nada...

    se voce tiver mais alguma parte dese script e puder me dizer como esta instalado no seu site talves eu consigo arruma-lo e entao poder-mos usalo..

    Tipo essa pagiina de php que se postou ae ele e todo junto assim ou em partes ? me fale em quais paginas do site em algo relacionado com esse script e se tiver outras partes post para eu poder entender melhor o sisterma..

  6. como eu faco para determinar um numero exato de monstros dentro de uma task  de grupo EX: uma task onde o player tenha que mata dragon lord, dragon e demodras. Gostaria de saber  como colocar para que ele tenha que matar 650 dragon lord + 500 dragon + 200 demodras.. e assim sucessivamente. tem como ?

  7. como eu faco para que em alguns monsters seja task em grupo

    vou dar um exemplo : eu queroo que em uma task especifica o player tenha quematar um total de 1000 monsters porem tem que ser especificamente uma certa quantidade de cada EX: 200 dragon lord + 120 dragon + 190 demon ... e assim por diante a mesma coisa com outros monsters tem como /

  8. Omega tenho uma duvida como eu faço para que tenha task em grupo..

    EX :se eu quizer que o player tenha que matar especificamente 200 dragon + 200 dragon lord + 200 demodras.... tipo um total de monsters 600 porem tem que ser uma quantidade certa de cada tem como ?

  9. Ola galera preciso de uma ajuda no meu script de task. TFS .0.4

    ele e por mod..

    eu gostaria que ele funcionasse da seguinte forma. task de apenas 1 monster e tambem task de grupo de bixos.

    EX DE TASK EM GRUPO : DEATH TASK, FIRE TASK, WATER TASK, EARTH TASK.

    ae no caso nessa task de death o player teria que matar um total de 2000 monsters sendo 1000 grim reaper + 500 lost soul + 500 ... para poder completar a task..

    segue abaixo meu script.ele funciona normal a task de 1 monster. Porem na task de grupo e monster se o player matar 2000 grim reaper ao inves de 1000 + 500 lost + 500... ele ganha a task. se alguem pude arrumar pra mim.

     

    MOD

     

     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Simple Task" version="3.0" author="Vodkart" contact="xtibia.com" enabled="yes">
    <config name="task_func"><![CDATA[
    tasktabble = {
    ["grim reaper"] = {monster_race={"grim reaper"}, storage_start = 200201, storage = 91001,count = 7000,exp = 38500000,money = 200000},
    ["frost dragon"] = {monster_race={"frost dragon"}, storage_start = 200202, storage = 91002,count = 6000,exp = 13800000,money = 100000},
    ["dragon lord"] = {monster_race={"dragon lord"}, storage_start = 200203, storage = 91003,count = 6500,exp = 13650000,money = 150000},
    ["sea serpent"] = {monster_race={"sea serpent"}, storage_start = 200204, storage = 91004,count = 5000,exp = 15000000,money = 200000},
    ["behemoth"] = {monster_race={"behemoth"}, storage_start = 200205, storage = 91005,count = 8000,exp = 20000000,money = 120000},
    ["hydra"] = {monster_race={"hydra"}, storage_start = 200206, storage = 91006,count = 7000,exp = 14700000,money = 220000},
    ["earth elemental"] = {monster_race={"earth elemental"}, storage_start = 200207, storage = 91007,count = 8500,exp = 4675000,money = 350000},
    ["demon"] = {monster_race={"demon"}, storage_start = 200208, storage = 91008,count = 6000,exp = 42000000,money = 200000},
    ["bog raider"] = {monster_race={"bog raider"}, storage_start = 200209, storage = 91009,count = 7500,exp = 6000000,money = 210000},
    ["fire task"] = {monster_race={"demon","hellfire fighter","fury"}, storage_start = 200210, storage = 91010,count= 1700,exp = 7000000,money = 500000},
    ["water task"] = {monster_race={"quara pincher","quara predator","quara hydromancer"}, storage_start = 200211, storage = 91011,count= 5000, exp = 5000000,money = 300000},
    ["earth task"] = {monster_race={"juggernaut","plaguesmith","defiler"}, storage_start = 200212, storage = 91012,count= 1200, exp = 7000000,money = 350000},
    ["death task"] = {monster_race={"grim reaper","lost soul","Blightwalker"}, storage_start = 200213, storage = 91013,count= 2050, exp = 7000000,money = 400000},
    }
    configbosses_task = {
    {race = "minotaur",Playerpos = {x = 189, y = 57, z = 7}, FromPosToPos = {{x = 186, y = 54, z = 7},{x = 193, y = 60, z = 7}},time = 5},
    {race = "necromancer",Playerpos = {x = 196, y = 39, z = 7}, FromPosToPos = {{x = 195, y = 37, z = 7},{x = 198, y = 41, z = 7}}, time = 5},
    {race = "dragon",Playerpos = {x = 208, y = 59, z = 7}, FromPosToPos = {{x = 206, y = 56, z = 7},{x = 209, y = 65, z = 7}}, time = 5}
    }
    function CheckTask(cid)
    for k, v in pairs(tasktabble) do
    if getPlayerStorageValue(cid,v.storage_start) >= 1 then return true end
    end
    return false
    end
    function finisheAllTask(cid)
    local config = {
    exp = {true,100000},
    money = {true,200000},
    items ={false,{{2124,2},{2173,1}}},
    premium ={true,5}
    }
    local x = true
    for k, v in pairs(tasktabble) do
    if tonumber(getPlayerStorageValue(cid,v.storage)) then
    x = false
    end
    end
    if x == true then
    setPlayerStorageValue(cid, 521456, 0)
    local b = getGlobalStorageValue(63005) if b == -1 then b = 1 end
    if b < 11 then
    setGlobalStorageValue(63005,b+1)
    doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' was the '..b..' to finish the task!.')
    doPlayerAddPremiumDays(cid, config.premium[1] == true and config.premium[2] or 0)
    doPlayerAddExp(cid, config.exp[1] == true and config.exp[2] or 0)
    doPlayerAddMoney(cid, config.money[1] == true and config.money[2] or 0)
    if config.items[1] == true then doAddItemsFromList(cid,config.items[2]) end
    doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy "..getCreatureName(cid).." completed all the task.")
    end
    end
    end
    function HavePlayerPosition(cid, from, to)
    return isInRange(getPlayerPosition(cid), from, to) and true or false
    end
    function getRankStorage(cid, value, max, RankName) -- by vodka
    local str =""
    str = "--[".. (RankName == nil and "RANK STORAGE" or ""..RankName.."") .."]--\n\n"
    local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;")
    if (query:getID() ~= -1) then k = 1 repeat if k > max then break end
    str = str .. "\n " .. k .. ". "..getPlayerNameByGUID(query:getDataString("player_id")).." - [" .. query:getDataInt("value") .. "]"
    k = k + 1 until not query:next() end return doShowTextDialog(cid, 2529, str)
    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)
    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 getItemsFromList(items) -- by vodka
    local str = ''
    if table.maxn(items) > 0 then
    for i = 1, table.maxn(items) do
    str = str .. items[2] .. ' ' .. getItemNameById(items[1])
    if i ~= table.maxn(items) then str = str .. ', ' end end end
    return str
    end
    function doAddItemsFromList(cid,items) -- by vodka
    if table.maxn(items) > 0 then
    for i = 1, table.maxn(items) do
    local count = items[2]
    while count > 0 do
    if isItemStackable(items[1]) then
    doPlayerAddItemStacking(cid, items[1], 1)
    else
    doPlayerAddItem(cid, items[1],1)
    end
    count = count - 1
    end
    end
    end
    end
    function pairsByKeys(t, f)
    local a = {}
    for n in pairs(t) do table.insert(a, n) end
    table.sort(a, f)
    local i = 0
    local iter = function ()
    i = i + 1
    if a == nil then return nil
    else return a, t[a]
    end
    end
    return iter
    end
    ]]></config>
    <event type="login" name="TaskLogin" event="script"><![CDATA[
    function onLogin(cid)
    registerCreatureEvent(cid, "KillTask")
    return true
    end]]></event>
    <talkaction words="/task;!task" event="buffer"><![CDATA[
    domodlib('task_func')
    local param = string.lower(param)
    if param == "rank" then
    getRankStorage(cid, 521456, 20, "Task Rank Finalizadas") return true
    end
    local str = ""
    str = str .. "Task Completed :\n\n"
    for k, v in pairsByKeys(tasktabble) do
    local contagem = getPlayerStorageValue(cid, v.storage)
    if (contagem == -1) then contagem = 1 end
    str = str..k.." = ".. (not tonumber(contagem) and "["..contagem.."]" or "["..((contagem)-1).."/"..v.count.."]") .."\n"
    end
    str = str .. ""
    return doShowTextDialog(cid, 8983, str)
    ]]></talkaction>
    <event type="kill" name="KillTask" event="script"><![CDATA[
    domodlib('task_func')
    function onKill(cid, target, lastHit)
    if(isMonster(target) == true) then
    local n = string.lower(getCreatureName(target))
    for race, mob in pairs(tasktabble) do
    if getPlayerStorageValue(cid,mob .storage_start) >= 1 then
    for i = 1,#mob.monster_race do
    if n == mob.monster_race then
    local contagem = getPlayerStorageValue(cid, mob.storage)
    if (contagem == -1) then contagem = 1 end
    if not tonumber(contagem) then return true end
    if contagem > mob.count then return true end
    if contagem > mob.count then return true end
    setPlayerStorageValue(cid, mob.storage, contagem+1)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == mob.count and "Congratulations! You finished the task of "..race.."." or "[Exp Task] killed " .. race .. " [" .. contagem .. "/" .. mob.count .. "].").."")
    end
    end
    end
    end
    end
    return true
    end]]></event>
    </mod>

     

     


    up

  10. Olhei la ta assim

    <img class="Title" src="headline.php?text=<?php echo $topic ?>" alt="Contentbox headline" />

     

    ae olhei no meu htdocs e a tem oo headline.php e nele esta assim

     

     

    <?php
    $text = $_GET['txt'];
    $text = strtoupper($text[0]).substr($text,1,strlen($text));
    $size = 18;
    $sizex = 280;
    $sizey = 28;
    $x = 4;
    $y = 20;
    $color = 'efcfa4';
    $red = (int)hexdec(substr($color,0,2));
    $green = (int)hexdec(substr($color,2,2));
    $blue = (int)hexdec(substr($color,4,2));
    $img = imagecreatetruecolor($sizex,$sizey);
    ImageColorTransparent($img, ImageColorAllocate($img,0,0,0));
    imagefttext($img, $size, 0, $x, $y, ImageColorAllocate($img,$red,$green,$blue), './images/headline.ttf', $text);
    header('Content-type: image/png');
    imagepng($img);
    imagedestroy($img);
    ?>

     

     

    agora nao sei oq faco pois ja tentei muudar varias coisas alguem ajuda ae plixx

     

    OBS : PODE DEXAR CONSEGUIR RESOLVER SHuhsUSH MAIS GRAÇAS A SUA AJUDA E TAMBEM ME VIREI AQUE FUTICANDO VLWW PODEM MOVER

  11. Galera boa noite estou precisando de uma ajudinha pois nao consegui arrumar.. ja tentei tudo mais n sei o lugar certo.

    meu gesior fica com subtopic bugado nao esta aparecendo os nomes em nunhum topic.

    abaixo esta imagem par explicar melhor

     

    post-384783-0-41843000-1459737543_thumb.png

  12. Ola galera eu tenho este evento nomeu servidor porem tenho que ficar entrando no Gm todo dia para abrilo-lo e acaba sendo cansativo... eu gostaria de saber se alguem poderia criar um script de globalevent para que ele seja aberto automaticamente todos os dias a X horario e fechado 2 horas depois que iniciou..

    Pq ser fechado 2 horas depois de iniciado ?

    pq este é um evento onde os players entram numa arena eao se matarem ganham XP..

    entao gostaria quue fosse aberto X hora e fechasse depois de x horas que abriu..

    atualmente os players entram no evento atraves de um npc que so os teletransporta quando o evento e aberto pelo GM atraves do comando /fps open..

     

    segue abaixo tudo que foi instalado no servidor a respeito deste evento.. TFS 0.4

     


     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Jogos Vorazes System" version="1.0" enabled="yes">
    <config name="battle-config"><![CDATA[
    function msgForOthers(mensagem, classe)
    if (not classe) then
    classe = MSG_WHITE
    end
    for _, pid in ipairs(getPlayersOnline()) do
    if (getPlayerStorageValue(pid, 5602) == 1) then
    doPlayerSendChannelMessage(pid, "", mensagem, classe, FPS_CHANNEL)
    end
    end
    return true
    end
    function doPlayerRemoveLethalConditions(cid) -- function by Rush Event.
    local tmp = {1, 2, 4, 16, 32, 65, 128, 256, 512, 1024, 2048, 4096, 8192, 32768, 65536}
    for i = 1, #tmp do
    if (hasCondition(cid, tmp)) then
    doRemoveCondition(cid, tmp)
    end
    end
    return true
    end
    function closeEvent(cid)
    setGlobalStorageValue(5600, -1)
    setGlobalStorageValue(5601, -1)
    for _, pid in ipairs(getPlayersOnline()) do
    doPlayerSendChannelMessage(pid, "", ""..FPS_EVENTNAME.." foi fechado.", MSG_WHITE, FPS_CHANNEL)
    if (getPlayerStorageValue(pid, 5602) == 1) then
    doSendMagicEffect(getThingPos(pid), CONST_ME_POFF)
    doTeleportThing(pid, getTownTemplePosition(getPlayerTown(cid)))
    doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
    doCreatureAddHealth(pid, getCreatureMaxHealth(pid), false)
    doCreatureAddMana(pid, getCreatureMaxMana(pid), false)
    setPlayerStorageValue(pid, 5601, 0)
    setPlayerStorageValue(pid, 5602, 0)
    setPlayerStorageValue(pid, 5603, 0)
    doPlayerSave(pid)
    end
    end
    setGlobalStorageValue(5602, -1)
    return true
    end
    MSG_WHITE = TALKTYPE_CHANNEL_MANAGEMENT or TALKTYPE_CHANNEL_W
    MSG_RED = TALKTYPE_GAMEMASTER_CHANNEL or TALKTYPE_CHANNEL_RN
    MSG_ORANGE = TALKTYPE_CHANNEL_ORANGE or TALKTYPE_CHANNEL_O
    ]]></config>
    <talkaction log="yes" words="/fps" event="script"><![CDATA[
    domodlib('battle-config')
    function onSay(cid, words, param, channel)
    if (param == "") then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error, comando inválido.")
    end
    if (getPlayerAccess(cid) >= 3) then
    if (string.lower(param) == "open") then
    if (getGlobalStorageValue(5600) ~= 1) then
    setGlobalStorageValue(5600, 1)
    if (getGlobalStorageValue(5600) == 1) then
    setGlobalStorageValue(5602, 0)
    doBroadcastMessage(""..FPS_EVENTNAME.." foi aberto, fale com o NPC 'Jogos Vorazes Manager, Localizado no subsolo do dp de Thais'.", 22)
    end
    else
    return true
    end
    return true
    end
    if (string.lower(param) == "close") then
    if (getGlobalStorageValue(5600) ~= -1 and getGlobalStorageValue(5601) ~= 1) then
    setGlobalStorageValue(5601, 1)
    setPlayerStorageValue(cid, 5605, 1)
    msgForOthers(""..FPS_FINISHTIME.." segundos restantes.")
    addEvent(setPlayerStorageValue, FPS_FINISHTIME * 1000, cid, 5605, -1)
    addEvent(closeEvent, FPS_FINISHTIME * 1000, cid)
    else
    doPlayerPopupFYI(cid, "AVISO :\n"..getCreatureName(cid)..", o portal encontra-se fechado atualmente.\nimpossivel fecha-lo duas vezes.")
    return true
    end
    return true
    end
    local t = string.explode(param, ",")
    local pid = getPlayerByName(t[2])
    if (string.lower(t[1]) == "ban") then
    if (not t[2] or tonumber(t[2])) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
    return true
    end
    if (not isPlayer(pid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
    return true
    end
    if (getPlayerStorageValue(pid, 5604) ~= 1) then
    if (getPlayerStorageValue(pid, 5602) == 1) then
    doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
    doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
    setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
    end
    setPlayerStorageValue(pid, 5601, 0)
    setPlayerStorageValue(pid, 5602, 0)
    setPlayerStorageValue(pid, 5604, 1) -- blocked.
    msgForOthers(""..t[2].." foi bloqueado(a).")
    local ba_banr = "Admininstrador"
    if (FPS_REVEALEDAFTERBANPLAYER) then
    ba_banr = ""..getCreatureName(cid)..""
    end
    doPlayerPopupFYI(pid, "AVISO :\n O "..ba_banr.." bloqueou você.\nvocê está temporariamente bloqueado(a) de participar.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você bloqueou "..t[2]..".")
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi bloqueado(a).")
    return true
    end
    return true
    end
    if (string.lower(t[1]) == "unban") then
    if (not t[2] or tonumber(t[2])) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
    return true
    end
    if (not isPlayer(pid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
    return true
    end
    if (getPlayerStorageValue(pid, 5604) == 1) then
    setPlayerStorageValue(pid, 5604, 0) -- unblocked.
    msgForOthers(""..t[2].." foi desbloqueado(a).")
    doPlayerPopupFYI(pid, "AVISO :\nVocê foi desbloqueado(a).\nparticipe do "..FPS_EVENTNAME.." quando o mesmo estiver disponível.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou "..t[2]..".")
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi desbloqueado(a).")
    return true
    end
    return true
    end
    end
    local ba_players = "Indisponível"
    if (getGlobalStorageValue(5602) ~= -1) then
    ba_players = tostring(getGlobalStorageValue(5602))
    end
    local limiteplayers = ""..ba_players.."/"..FPS_LIMITEPLAYERS..""
    if (getGlobalStorageValue(5602) >= FPS_LIMITEPLAYERS) then
    limiteplayers = "FULL/"..FPS_LIMITEPLAYERS..""
    end
    if (string.lower(param) == "status") then
    local status = ""..FPS_EVENTNAME.." Status :\nOla "..getCreatureName(cid)..",\nveja algumas informações sobre o(a) "..FPS_EVENTNAME.."."
    doShowTextDialog(cid, 2395, ""..status.."\n\nPontos : ("..getPlayerStorageValue(cid, 5601)..")\nJogadores : ["..limiteplayers.."]")
    return true
    end
    return true
    end
    ]]></talkaction>
    <event type="preparedeath" name="FPSprepare" event="script"><![CDATA[
    domodlib('battle-config')
    function onPrepareDeath(cid, deathList)
    local target = deathList[1]
    if (getGlobalStorageValue(5600) == 1 and getPlayerStorageValue(cid, 5602) == 1) then
    local i = 10
    doPlayerOpenChannel(cid, FPS_CHANNEL)
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)
    doCreatureAddMana(cid, getCreatureMaxMana(cid))
    doTeleportThing(cid, FPS_SPAWNPLAYER[math.random(1, #FPS_SPAWNPLAYER)])
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    doPlayerRemoveLethalConditions(cid)
    if (isMonster(target)) then
    addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." matou você.", MSG_RED, FPS_CHANNEL)
    setPlayerStorageValue(cid, 5602, 0)
    msgForOthers(""..getCreatureName(target).." matou "..getCreatureName(cid)..".")
    setPlayerStorageValue(cid, 5602, 1)
    setPlayerStorageValue(cid, 5601, 0)
    return false
    end
    if (not isCreature(target)) then
    addEvent(doPlayerSendChannelMessage, i, cid, "", "Voce cometeu suicídio.", MSG_RED, FPS_CHANNEL)
    setPlayerStorageValue(cid, 5602, 0)
    msgForOthers(""..getCreatureName(cid).." cometeu suicídio.")
    setPlayerStorageValue(cid, 5602, 1)
    setPlayerStorageValue(cid, 5601, 0)
    return false
    end
    doPlayerOpenChannel(target, FPS_CHANNEL)
    setPlayerStorageValue(target, 5601, getPlayerStorageValue(target, 5601)+1)
    setPlayerStorageValue(cid, 5602, 0)
    setPlayerStorageValue(target, 5602, 0)
    msgForOthers(""..getCreatureName(target).." derrotou "..getCreatureName(cid)..".")
    setPlayerStorageValue(target, 5602, 1)
    setPlayerStorageValue(cid, 5602, 1)
    addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." derrotou você.", MSG_RED, FPS_CHANNEL)
    addEvent(doPlayerSendChannelMessage, i, target, "", "Você derrotou "..getCreatureName(cid)..".", MSG_ORANGE, FPS_CHANNEL)
    dofile("config.lua")
    local EXP = 0
    if (FPS_ENABLEEXPERIENCE) then
    EXP = rateExperience * getPlayerLevel(cid)
    doPlayerAddExperience(target, EXP)
    end
    doSendAnimatedText(getThingPos(target), tostring(EXP), gainExperienceColor)
    doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, "Você ganhou "..EXP.." ponto(s) de experiência.")
    setPlayerStorageValue(cid, 5601, 0)
    return false
    end
    return true
    end
    ]]></event>
    <event type="logout" name="FPSlogout" event="script"><![CDATA[
    domodlib('battle-config')
    function onLogout(cid)
    if (getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(cid, 5602) == 1 or getPlayerStorageValue(cid, 5605) == 1) then
    doPlayerSendCancel(cid, "Aguarde "..FPS_FINISHTIME.." segundo(s).")
    return false
    end
    if(getPlayerStorageValue(cid, 5602) == 1) then
    setPlayerStorageValue(cid, 5601, 0)
    setPlayerStorageValue(cid, 5602, 0)
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    doPlayerSendChannelMessage(cid, "", "Você saiu do jogo.", MSG_WHITE, FPS_CHANNEL)
    doPlayerRemoveLethalConditions(cid)
    doPlayerSave(cid)
    if (getPlayerAccess(cid) < 3) then
    setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
    msgForOthers(""..getCreatureName(cid).." saiu do jogo.")
    end
    return false
    end
    return true
    end
    ]]></event>
    <event type="combat" name="FPScombat" event="script"><![CDATA[
    function onCombat(cid, target)
    if(FPS_BLOCKIP) then
    if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
    end
    for _, pid in ipairs(getPlayersOnline()) do
    if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
    return false
    end
    end
    return true
    end
    ]]></event>
    <event type="attack" name="FPSattack" event="script"><![CDATA[
    function onAttack(cid, target)
    if(FPS_BLOCKIP) then
    if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
    end
    for _, pid in ipairs(getPlayersOnline()) do
    if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
    return false
    end
    end
    return true
    end
    ]]></event>
    <event type="login" name="FPSlogin" event="buffer"><![CDATA[
    if (getPlayerStorageValue(cid, 5601) == -1) then
    setPlayerStorageValue(cid, 5601, 0)
    end
    registerCreatureEvent(cid, "FPSprepare")
    registerCreatureEvent(cid, "FPSlogout")
    registerCreatureEvent(cid, "FPScombat")
    registerCreatureEvent(cid, "PFSattack")
    registerCreatureEvent(cid, "PFScast")
    ]]></event>
    <globalevent name="FPS tips" interval="600000" event="script"><![CDATA[
    domodlib('battle-config')
    function onThink(interval)
    local FPS_tips = {
    "Atualmente existem "..getGlobalStorageValue(5602).." player(s) lutando, não deixe de participar.",
    "Com o canal fechado, você não recebe informações dentro do jogo. deixe-o sempre aberto.",
    "Cuidado ao ofender um jogador, você corre o risco de ser bloqueado(a).",
    "Aperte 'CTRL + Q' caso você queira sair do jogo, você precisa está em protection zone.",
    "Chame seus amigos e venha jogar, porquê aqui a diversão nunca acaba.",
    "Dica : configure o comando '/fps status' como hotkey. Assim você poderá checar suas informações com facilidade."
    }
    if (getGlobalStorageValue(5600) == 1) then
    msgForOthers(FPS_tips[math.random(1, #FPS_tips)])
    end
    return true
    end
    ]]></globalevent>
    </mod>

     

     

     

    data/Lib

     

     

     

    --[[
    'Jogos Vorazes' desenvolvido por Bruninho.
    ]]
    FPS_EVENTNAME = "Jogos Vorazes" -- Nome do evento.
    FPS_FINISHTIME = 1 -- Dentro do evento, jogadores não poderão atacar uns aos outros enquanto esse tempo não esgotar após o comando /fps close ser executado.
    FPS_LIMITEPLAYERS = 26 -- Limite de jogadores.
    FPS_SHOWGODNAMEAFTERBAN = false -- true = Mostra o nome do GM na mensagem do banido; false = Mostra o nome 'Admininstrador'.
    FPS_ENABLEEXPERIENCE = true -- true = Habilita a experiência; false = Desabilita.
    FPS_BLOCKIP = false -- true = Jogadores que tentarem usar MC pra ganhar exp fácil, não conseguirão atacar seus próprios chars; false = permite isso.
    FPS_CHANNEL = 15 -- ID do Battle Arena Channel.
    FPS_SPAWNPLAYER = {
    {x = 32145, y = 32127, z = 6},
    {x = 32133, y = 32115, z = 6},
    {x = 32156, y = 32116, z = 6},
    {x = 32145, y = 32155, z = 6},
    {x = 32136, y = 32149, z = 6},
    {x = 32154, y = 32149, z = 6},
    {x = 32144, y = 32103, z = 6}
    }

     

     

     

    Data/Npc.xml

     

     

     

    <?xml version="1.0"?>
    <npc name="Jogos Vorazes Manager" floorchange="0" walkinterval="2000">
    <health now="150" max="150"/>
    <look type="266"/>
    <interaction range="3" idletime="30" idleinterval="1500" defaultpublic="0">
    <interact keywords="hi" focus="1">
    <action name="script" value="hello"/>
    <response><action name="script"><![CDATA[
    local str = "Olá "..getCreatureName(cid)..""
    if (getGlobalStorageValue(5600) ~= 1) then
    selfSay(""..str..", infelizmente estamos indisponível. {bye}!", cid)
    else
    selfSay("Tem "..getGlobalStorageValue(5602).." player(s) lá dentro, deseja {Participar}?", cid)
    return true
    end
    ]]></action>
    <interact keywords="participar">
    <action name="script" value="join"/>
    <response><action name="script"><![CDATA[
    if (getGlobalStorageValue(5600) ~= 1) then
    return true
    end
    if (getPlayerStorageValue(cid, 5604) == 1) then
    selfSay("Sinto muito, você está temporariamente bloqueado(a).", cid)
    return true
    end
    doPlayerOpenChannel(cid, FPS_CHANNEL)
    selfSay("Confirme : {Ok} ou {Cancelar}?", cid)
    ]]></action>
    <interact keywords="ok">
    <action name="script" value="ok"/>
    <response><action name="script"><![CDATA[
    if (getGlobalStorageValue(5600) ~= 1) then
    return true
    end
    if (getGlobalStorageValue(5601) == 1) then
    selfSay("Já iremos fechar, volte outro dia!", cid)
    return true
    end
    if (getGlobalStorageValue(5602) >= FPS_LIMITEPLAYERS and getPlayerAccess(cid) < 3) then
    selfSay("Limite de jogadores alcançado, aguarde até que alguém saia.", cid)
    return true
    end
    selfSay("Boa sorte!", cid)
    if (getPlayerStorageValue(cid, 5602) ~= 1) then
    domodlib('battle-config')
    doPlayerSendChannelMessage(cid,"", "Você está participando do jogo.", MSG_WHITE, FPS_CHANNEL)
    if (getPlayerAccess(cid) < 3) then
    setGlobalStorageValue(5602, getGlobalStorageValue(5602)+1)
    msgForOthers(""..getCreatureName(cid).." está participando do jogo.")
    end
    setPlayerStorageValue(cid, 5602, 1)
    end
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doTeleportThing(cid, FPS_SPAWNPLAYER[math.random(1, #FPS_SPAWNPLAYER)])
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    doPlayerOpenChannel(cid, FPS_CHANNEL)
    ]]></action></response>
    </interact>
    <interact keywords="cancelar" focus="0">
    <response text="Okay {|NAME|}, volte quando puder!"/>
    </interact>
    </response>
    </interact>
    <interact keywords="bye" focus="0">
    <response text="Tchau, até breve!"/>
    </interact>
    </response>
    </interact>
    <interact event="onPlayerLeave" focus="0">
    <response text="How rude!" public="1"/>
    </interact>
    </interaction>
    </npc>

     

     

     

    Data / Xml / Channels

     

     

     

    <channel id="15" name="Battle Arena Channel"/>

     

     

     

  13. Funcionou o noDamageToSameLookfeet = false ..

     

    so tem um problema agora a parte de abrir e fecha o evento pelo gm.. ficar entrando tod dia pra abrir o evento e canssativo.

     

    se souber como fazer o script globalevent pra abrir toda dia em x Horario e fechar depois de x Tempo depois que foi aberto..

     

    ake esta tudo que foi instalado no servdor a respeito deste evento.

     

    creio que essa seja a parte principal

     

    Mods

     

     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Jogos Vorazes System" version="1.0" enabled="yes">
    <config name="battle-config"><![CDATA[
    function msgForOthers(mensagem, classe)
    if (not classe) then
    classe = MSG_WHITE
    end
    for _, pid in ipairs(getPlayersOnline()) do
    if (getPlayerStorageValue(pid, 5602) == 1) then
    doPlayerSendChannelMessage(pid, "", mensagem, classe, FPS_CHANNEL)
    end
    end
    return true
    end
    function doPlayerRemoveLethalConditions(cid) -- function by Rush Event.
    local tmp = {1, 2, 4, 16, 32, 65, 128, 256, 512, 1024, 2048, 4096, 8192, 32768, 65536}
    for i = 1, #tmp do
    if (hasCondition(cid, tmp)) then
    doRemoveCondition(cid, tmp)
    end
    end
    return true
    end
    function closeEvent(cid)
    setGlobalStorageValue(5600, -1)
    setGlobalStorageValue(5601, -1)
    for _, pid in ipairs(getPlayersOnline()) do
    doPlayerSendChannelMessage(pid, "", ""..FPS_EVENTNAME.." foi fechado.", MSG_WHITE, FPS_CHANNEL)
    if (getPlayerStorageValue(pid, 5602) == 1) then
    doSendMagicEffect(getThingPos(pid), CONST_ME_POFF)
    doTeleportThing(pid, getTownTemplePosition(getPlayerTown(cid)))
    doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
    doCreatureAddHealth(pid, getCreatureMaxHealth(pid), false)
    doCreatureAddMana(pid, getCreatureMaxMana(pid), false)
    setPlayerStorageValue(pid, 5601, 0)
    setPlayerStorageValue(pid, 5602, 0)
    setPlayerStorageValue(pid, 5603, 0)
    doPlayerSave(pid)
    end
    end
    setGlobalStorageValue(5602, -1)
    return true
    end
    MSG_WHITE = TALKTYPE_CHANNEL_MANAGEMENT or TALKTYPE_CHANNEL_W
    MSG_RED = TALKTYPE_GAMEMASTER_CHANNEL or TALKTYPE_CHANNEL_RN
    MSG_ORANGE = TALKTYPE_CHANNEL_ORANGE or TALKTYPE_CHANNEL_O
    ]]></config>
    <talkaction log="yes" words="/fps" event="script"><![CDATA[
    domodlib('battle-config')
    function onSay(cid, words, param, channel)
    if (param == "") then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error, comando inválido.")
    end
    if (getPlayerAccess(cid) >= 3) then
    if (string.lower(param) == "open") then
    if (getGlobalStorageValue(5600) ~= 1) then
    setGlobalStorageValue(5600, 1)
    if (getGlobalStorageValue(5600) == 1) then
    setGlobalStorageValue(5602, 0)
    doBroadcastMessage(""..FPS_EVENTNAME.." foi aberto, fale com o NPC 'Jogos Vorazes Manager, Localizado no subsolo do dp de Thais'.", 22)
    end
    else
    return true
    end
    return true
    end
    if (string.lower(param) == "close") then
    if (getGlobalStorageValue(5600) ~= -1 and getGlobalStorageValue(5601) ~= 1) then
    setGlobalStorageValue(5601, 1)
    setPlayerStorageValue(cid, 5605, 1)
    msgForOthers(""..FPS_FINISHTIME.." segundos restantes.")
    addEvent(setPlayerStorageValue, FPS_FINISHTIME * 1000, cid, 5605, -1)
    addEvent(closeEvent, FPS_FINISHTIME * 1000, cid)
    else
    doPlayerPopupFYI(cid, "AVISO :\n"..getCreatureName(cid)..", o portal encontra-se fechado atualmente.\nimpossivel fecha-lo duas vezes.")
    return true
    end
    return true
    end
    local t = string.explode(param, ",")
    local pid = getPlayerByName(t[2])
    if (string.lower(t[1]) == "ban") then
    if (not t[2] or tonumber(t[2])) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
    return true
    end
    if (not isPlayer(pid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
    return true
    end
    if (getPlayerStorageValue(pid, 5604) ~= 1) then
    if (getPlayerStorageValue(pid, 5602) == 1) then
    doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)))
    doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT)
    setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
    end
    setPlayerStorageValue(pid, 5601, 0)
    setPlayerStorageValue(pid, 5602, 0)
    setPlayerStorageValue(pid, 5604, 1) -- blocked.
    msgForOthers(""..t[2].." foi bloqueado(a).")
    local ba_banr = "Admininstrador"
    if (FPS_REVEALEDAFTERBANPLAYER) then
    ba_banr = ""..getCreatureName(cid)..""
    end
    doPlayerPopupFYI(pid, "AVISO :\n O "..ba_banr.." bloqueou você.\nvocê está temporariamente bloqueado(a) de participar.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você bloqueou "..t[2]..".")
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi bloqueado(a).")
    return true
    end
    return true
    end
    if (string.lower(t[1]) == "unban") then
    if (not t[2] or tonumber(t[2])) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, digite o nome do jogador.")
    return true
    end
    if (not isPlayer(pid)) then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." não existe ou encontra-se off-line.")
    return true
    end
    if (getPlayerStorageValue(pid, 5604) == 1) then
    setPlayerStorageValue(pid, 5604, 0) -- unblocked.
    msgForOthers(""..t[2].." foi desbloqueado(a).")
    doPlayerPopupFYI(pid, "AVISO :\nVocê foi desbloqueado(a).\nparticipe do "..FPS_EVENTNAME.." quando o mesmo estiver disponível.")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desbloqueou "..t[2]..".")
    else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..t[2].." já foi desbloqueado(a).")
    return true
    end
    return true
    end
    end
    local ba_players = "Indisponível"
    if (getGlobalStorageValue(5602) ~= -1) then
    ba_players = tostring(getGlobalStorageValue(5602))
    end
    local limiteplayers = ""..ba_players.."/"..FPS_LIMITEPLAYERS..""
    if (getGlobalStorageValue(5602) >= FPS_LIMITEPLAYERS) then
    limiteplayers = "FULL/"..FPS_LIMITEPLAYERS..""
    end
    if (string.lower(param) == "status") then
    local status = ""..FPS_EVENTNAME.." Status :\nOla "..getCreatureName(cid)..",\nveja algumas informações sobre o(a) "..FPS_EVENTNAME.."."
    doShowTextDialog(cid, 2395, ""..status.."\n\nPontos : ("..getPlayerStorageValue(cid, 5601)..")\nJogadores : ["..limiteplayers.."]")
    return true
    end
    return true
    end
    ]]></talkaction>
    <event type="preparedeath" name="FPSprepare" event="script"><![CDATA[
    domodlib('battle-config')
    function onPrepareDeath(cid, deathList)
    local target = deathList[1]
    if (getGlobalStorageValue(5600) == 1 and getPlayerStorageValue(cid, 5602) == 1) then
    local i = 10
    doPlayerOpenChannel(cid, FPS_CHANNEL)
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true)
    doCreatureAddMana(cid, getCreatureMaxMana(cid))
    doTeleportThing(cid, FPS_SPAWNPLAYER[math.random(1, #FPS_SPAWNPLAYER)])
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    doPlayerRemoveLethalConditions(cid)
    if (isMonster(target)) then
    addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." matou você.", MSG_RED, FPS_CHANNEL)
    setPlayerStorageValue(cid, 5602, 0)
    msgForOthers(""..getCreatureName(target).." matou "..getCreatureName(cid)..".")
    setPlayerStorageValue(cid, 5602, 1)
    setPlayerStorageValue(cid, 5601, 0)
    return false
    end
    if (not isCreature(target)) then
    addEvent(doPlayerSendChannelMessage, i, cid, "", "Voce cometeu suicídio.", MSG_RED, FPS_CHANNEL)
    setPlayerStorageValue(cid, 5602, 0)
    msgForOthers(""..getCreatureName(cid).." cometeu suicídio.")
    setPlayerStorageValue(cid, 5602, 1)
    setPlayerStorageValue(cid, 5601, 0)
    return false
    end
    doPlayerOpenChannel(target, FPS_CHANNEL)
    setPlayerStorageValue(target, 5601, getPlayerStorageValue(target, 5601)+1)
    setPlayerStorageValue(cid, 5602, 0)
    setPlayerStorageValue(target, 5602, 0)
    msgForOthers(""..getCreatureName(target).." derrotou "..getCreatureName(cid)..".")
    setPlayerStorageValue(target, 5602, 1)
    setPlayerStorageValue(cid, 5602, 1)
    addEvent(doPlayerSendChannelMessage, i, cid, "", ""..getCreatureName(target).." derrotou você.", MSG_RED, FPS_CHANNEL)
    addEvent(doPlayerSendChannelMessage, i, target, "", "Você derrotou "..getCreatureName(cid)..".", MSG_ORANGE, FPS_CHANNEL)
    dofile("config.lua")
    local EXP = 0
    if (FPS_ENABLEEXPERIENCE) then
    EXP = rateExperience * getPlayerLevel(cid)
    doPlayerAddExperience(target, EXP)
    end
    doSendAnimatedText(getThingPos(target), tostring(EXP), gainExperienceColor)
    doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, "Você ganhou "..EXP.." ponto(s) de experiência.")
    setPlayerStorageValue(cid, 5601, 0)
    return false
    end
    return true
    end
    ]]></event>
    <event type="logout" name="FPSlogout" event="script"><![CDATA[
    domodlib('battle-config')
    function onLogout(cid)
    if (getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(cid, 5602) == 1 or getPlayerStorageValue(cid, 5605) == 1) then
    doPlayerSendCancel(cid, "Aguarde "..FPS_FINISHTIME.." segundo(s).")
    return false
    end
    if(getPlayerStorageValue(cid, 5602) == 1) then
    setPlayerStorageValue(cid, 5601, 0)
    setPlayerStorageValue(cid, 5602, 0)
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    doPlayerSendChannelMessage(cid, "", "Você saiu do jogo.", MSG_WHITE, FPS_CHANNEL)
    doPlayerRemoveLethalConditions(cid)
    doPlayerSave(cid)
    if (getPlayerAccess(cid) < 3) then
    setGlobalStorageValue(5602, getGlobalStorageValue(5602)-1)
    msgForOthers(""..getCreatureName(cid).." saiu do jogo.")
    end
    return false
    end
    return true
    end
    ]]></event>
    <event type="combat" name="FPScombat" event="script"><![CDATA[
    function onCombat(cid, target)
    if(FPS_BLOCKIP) then
    if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
    end
    for _, pid in ipairs(getPlayersOnline()) do
    if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
    return false
    end
    end
    return true
    end
    ]]></event>
    <event type="attack" name="FPSattack" event="script"><![CDATA[
    function onAttack(cid, target)
    if(FPS_BLOCKIP) then
    if (getPlayerIp(cid) == getPlayerIp(target)) then return false end
    end
    for _, pid in ipairs(getPlayersOnline()) do
    if (getGlobalStorageValue(5600) == 1 and getGlobalStorageValue(5601) == 1 and getPlayerStorageValue(pid, 5602) == 1) then
    return false
    end
    end
    return true
    end
    ]]></event>
    <event type="login" name="FPSlogin" event="buffer"><![CDATA[
    if (getPlayerStorageValue(cid, 5601) == -1) then
    setPlayerStorageValue(cid, 5601, 0)
    end
    registerCreatureEvent(cid, "FPSprepare")
    registerCreatureEvent(cid, "FPSlogout")
    registerCreatureEvent(cid, "FPScombat")
    registerCreatureEvent(cid, "PFSattack")
    registerCreatureEvent(cid, "PFScast")
    ]]></event>
    <globalevent name="FPS tips" interval="600000" event="script"><![CDATA[
    domodlib('battle-config')
    function onThink(interval)
    local FPS_tips = {
    "Atualmente existem "..getGlobalStorageValue(5602).." player(s) lutando, não deixe de participar.",
    "Com o canal fechado, você não recebe informações dentro do jogo. deixe-o sempre aberto.",
    "Cuidado ao ofender um jogador, você corre o risco de ser bloqueado(a).",
    "Aperte 'CTRL + Q' caso você queira sair do jogo, você precisa está em protection zone.",
    "Chame seus amigos e venha jogar, porquê aqui a diversão nunca acaba.",
    "Dica : configure o comando '/fps status' como hotkey. Assim você poderá checar suas informações com facilidade."
    }
    if (getGlobalStorageValue(5600) == 1) then
    msgForOthers(FPS_tips[math.random(1, #FPS_tips)])
    end
    return true
    end
    ]]></globalevent>
    </mod>

     

     

     

    data/Lib

     

     

     

    --[[
    'Jogos Vorazes' desenvolvido por Bruninho.
    ]]
    FPS_EVENTNAME = "Jogos Vorazes" -- Nome do evento.
    FPS_FINISHTIME = 1 -- Dentro do evento, jogadores não poderão atacar uns aos outros enquanto esse tempo não esgotar após o comando /fps close ser executado.
    FPS_LIMITEPLAYERS = 26 -- Limite de jogadores.
    FPS_SHOWGODNAMEAFTERBAN = false -- true = Mostra o nome do GM na mensagem do banido; false = Mostra o nome 'Admininstrador'.
    FPS_ENABLEEXPERIENCE = true -- true = Habilita a experiência; false = Desabilita.
    FPS_BLOCKIP = false -- true = Jogadores que tentarem usar MC pra ganhar exp fácil, não conseguirão atacar seus próprios chars; false = permite isso.
    FPS_CHANNEL = 15 -- ID do Battle Arena Channel.
    FPS_SPAWNPLAYER = {
    {x = 32145, y = 32127, z = 6},
    {x = 32133, y = 32115, z = 6},
    {x = 32156, y = 32116, z = 6},
    {x = 32145, y = 32155, z = 6},
    {x = 32136, y = 32149, z = 6},
    {x = 32154, y = 32149, z = 6},
    {x = 32144, y = 32103, z = 6}
    }

     

     

     

    Data/Npc.xml

     

     

     

    <?xml version="1.0"?>
    <npc name="Jogos Vorazes Manager" floorchange="0" walkinterval="2000">
    <health now="150" max="150"/>
    <look type="266"/>
    <interaction range="3" idletime="30" idleinterval="1500" defaultpublic="0">
    <interact keywords="hi" focus="1">
    <action name="script" value="hello"/>
    <response><action name="script"><![CDATA[
    local str = "Olá "..getCreatureName(cid)..""
    if (getGlobalStorageValue(5600) ~= 1) then
    selfSay(""..str..", infelizmente estamos indisponível. {bye}!", cid)
    else
    selfSay("Tem "..getGlobalStorageValue(5602).." player(s) lá dentro, deseja {Participar}?", cid)
    return true
    end
    ]]></action>
    <interact keywords="participar">
    <action name="script" value="join"/>
    <response><action name="script"><![CDATA[
    if (getGlobalStorageValue(5600) ~= 1) then
    return true
    end
    if (getPlayerStorageValue(cid, 5604) == 1) then
    selfSay("Sinto muito, você está temporariamente bloqueado(a).", cid)
    return true
    end
    doPlayerOpenChannel(cid, FPS_CHANNEL)
    selfSay("Confirme : {Ok} ou {Cancelar}?", cid)
    ]]></action>
    <interact keywords="ok">
    <action name="script" value="ok"/>
    <response><action name="script"><![CDATA[
    if (getGlobalStorageValue(5600) ~= 1) then
    return true
    end
    if (getGlobalStorageValue(5601) == 1) then
    selfSay("Já iremos fechar, volte outro dia!", cid)
    return true
    end
    if (getGlobalStorageValue(5602) >= FPS_LIMITEPLAYERS and getPlayerAccess(cid) < 3) then
    selfSay("Limite de jogadores alcançado, aguarde até que alguém saia.", cid)
    return true
    end
    selfSay("Boa sorte!", cid)
    if (getPlayerStorageValue(cid, 5602) ~= 1) then
    domodlib('battle-config')
    doPlayerSendChannelMessage(cid,"", "Você está participando do jogo.", MSG_WHITE, FPS_CHANNEL)
    if (getPlayerAccess(cid) < 3) then
    setGlobalStorageValue(5602, getGlobalStorageValue(5602)+1)
    msgForOthers(""..getCreatureName(cid).." está participando do jogo.")
    end
    setPlayerStorageValue(cid, 5602, 1)
    end
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    doTeleportThing(cid, FPS_SPAWNPLAYER[math.random(1, #FPS_SPAWNPLAYER)])
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    doPlayerOpenChannel(cid, FPS_CHANNEL)
    ]]></action></response>
    </interact>
    <interact keywords="cancelar" focus="0">
    <response text="Okay {|NAME|}, volte quando puder!"/>
    </interact>
    </response>
    </interact>
    <interact keywords="bye" focus="0">
    <response text="Tchau, até breve!"/>
    </interact>
    </response>
    </interact>
    <interact event="onPlayerLeave" focus="0">
    <response text="How rude!" public="1"/>
    </interact>
    </interaction>
    </npc>

     

     

     

    Data / Xml / Channels

     

     

     

    <channel id="15" name="Battle Arena Channel"/>

     

     

     

    bom e isso tudo sHSuhSUHS..desculpa encomodar vc pois n tenho a quem recorrer amigo

     

     

     

  14. entao mais nao sei mexer nas sources mano n sei nem como abrir elas e nem onde ficam..

     

    o outro prolema e o segunte este evento nao é automatico e eu gostaria que fosse ..

    porem nao sei como criar um script de global events para abri-lo pois este evento e aberto e fechado pelo GM pelo comando /fps open e /fps close..

    e esta parte fica em MODS e nao sei como encaixar um script de globalevents la pra abrir e fecha o evento entendeu..me ajuda porfavor mano..

  • Quem Está Navegando   0 membros estão online

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