Ir para conteúdo

mkbrabsolute

Banidos
  • Total de itens

    455
  • Registro em

  • Última visita

  • Dias Ganhos

    1

Histórico de Reputação

  1. Upvote
    mkbrabsolute recebeu reputação de fksobral em Background Seven Wars (Preferência MKBRABSOLUTE)   
    Se você tiver a capacidade de ler: OBS: Preferência MKBRABSOLUTE.
     
    No entanto informei a ele que iria fazer para evitar que outros designer realizem a "arte" atôa como disse nosso amigo Bennyyyw.
     
    Leia mais as regras e acompanhe o fórum antes de sim sair fazendo um SPAM.
    Boa Noite ADM Supremus.
  2. Upvote
    mkbrabsolute recebeu reputação de RigBy em [TFS 1.0] Battlefield Event - NEW 100%   
    O Evento Battlefield há para TFS 1.1, 1.2. Portanto, este é o ÚNICO E EXCLUSIVO evento para o TFS 1.0 que a maioria usa.

    O Que há nele?
    Neste tópico encontraremos os scripts do evento, mapa e arquivo da source.

    Há necessidade de alterar o arquivo game.cpp da source e recompilar o TFS para que o evento funcione perfeitamente.
    Vamos ao que interessa!
     
    Em data/creaturescripts/scripts crie um arquivo com o nome de BATTLEFIELD_creaturescript.lua com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function getWinnersBattle(storage) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(storage) > 0 then online:teleportTo(online:getTown():getTemplePosition()) online:sendTextMessage(MESSAGE_INFO_DESCR, msg) online:setStorageValue(storage, 0) online:addItem(bf.rewardWin[1], bf.rewardWin[2]) online:unregisterEvent("BattleTeamLife") online:unregisterEvent("BattleTeamMana") online:unregisterEvent("BattleDeath") online:addHealth(online:getMaxHealth()) online:addMana(online:getMaxMana()) online:removeCondition(CONDITION_OUTFIT) if online:isPzLocked() then online:remove() end end end end if storage == bf.teamOne.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamOne.name .." win.", MESSAGE_STATUS_WARNING) elseif storage == bf.teamTwo.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamTwo.name .." win.", MESSAGE_STATUS_WARNING) end checkGate() print("> BattleField Event was finished.") end function onLogin(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:setStorageValue(bf.teamOne.storage, 0) player:setStorageValue(bf.teamTwo.storage, 0) player:removeCondition(CONDITION_OUTFIT) player:teleportTo(player:getTown():getTemplePosition()) player:unregisterEvent("BattleTeamLife") player:unregisterEvent("BattleTeamMana") player:unregisterEvent("BattleDeath") end return true end function onLogout(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can not logout now.") return false end return true end function onChangeHealth(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local player = Player(creature) local enemy = Player(attacker) if enemy then if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) and (primaryDamage > 0) then return false end end return primaryDamage, primaryType, secondaryDamage, secondaryType end function onChangeMana(cid, attacker, manaChange) local player = Player(cid) local enemy = Player(attacker) if enemy then player:sendTextMessage(MESSAGE_INFO_DESCR, enemy) if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) then return false end end return manaChange end function onPrepareDeath(cid, killer) local creature = Player(cid) if creature:getStorageValue(bf.teamOne.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) - 1) creature:setStorageValue(bf.teamOne.storage, 0) elseif creature:getStorageValue(bf.teamTwo.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) creature:setStorageValue(bf.teamTwo.storage, 0) end if Game.getStorageValue(bf.teamOne.storage) == 0 then getWinnersBattle(bf.teamTwo.storage) elseif Game.getStorageValue(bf.teamTwo.storage) == 0 then getWinnersBattle(bf.teamOne.storage) end if Game.getStorageValue(bf.teamOne.storage) > 0 and Game.getStorageValue(bf.teamTwo.storage) > 0 then doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) end if creature:isPzLocked() then creature:remove() end return false end Em data/creaturescripts/creaturescripts.xml adicione as seguintes linhas:
    <event type="login" name="BattleLogin" script="BATTLEFIELD_creaturescript.lua"/> <event type="logout" name="BattleLogout" script="BATTLEFIELD_creaturescript.lua"/> <event type="preparedeath" name="BattleDeath" script="BATTLEFIELD_creaturescript.lua"/> <event type="changehealth" name="BattleTeamLife" script="BATTLEFIELD_creaturescript.lua"/> <event type="changemana" name="BattleTeamMana" script="BATTLEFIELD_creaturescript.lua"/> Em data/globalevents/script, crie um arquivo com o nome de BATTLEFIELD_globalevents.lua e adicione o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function teleportCheck() local tile = Tile(bf.teleportPosition) if tile then local item = tile:getItemById(1387) if item then item:remove() broadcastMessage("The BattleField Event was start in ".. bf.timeOpenGate .." minutes.", MESSAGE_STATUS_WARNING) local team1 = Game.getStorageValue(bf.teamOne.storage) local team2 = Game.getStorageValue(bf.teamTwo.storage) if (team1 + team2) % 2 ~= 0 then local playerLeave = Player(Game.getStorageValue(bf.namePlayer)) playerLeave:teleportTo(playerLeave:getTown():getTemplePosition()) playerLeave:removeCondition(CONDITION_OUTFIT) playerLeave:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are dead!") playerLeave:addHealth(playerLeave:getMaxHealth()) playerLeave:addMana(playerLeave:getMaxMana()) playerLeave:unregisterEvent("BattleTeamLife") playerLeave:unregisterEvent("BattleTeamMana") playerLeave:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) playerLeave:setStorageValue(bf.teamTwo.storage, 0) end addEvent(checkGate, bf.timeOpenGate * 60 * 1000) else broadcastMessage("The BattleField Event was opened and will close in ".. bf.timeCloseTeleport .." minutes.", MESSAGE_STATUS_WARNING) Game.setStorageValue(bf.teamOne.storage, 0) Game.setStorageValue(bf.teamTwo.storage, 0) Game.setStorageValue(bf.namePlayer, 0) print("> BattleField Event was opened.") local teleport = Game.createItem(1387, 1, bf.teleportPosition) if teleport then teleport:setActionId(47000) end end end end function onTime(interval) teleportCheck() addEvent(teleportCheck, bf.timeCloseTeleport * 60 * 1000) return true end Em data/globalevents/globalevents.xml adicione:
    <globalevent name="BattleField" time="20:55:00" script="BATTLEFIELD_globalevents.lua" /> Em data/libs crie um arquivo com o nome de BATTLEFIELD_lib com o conteúdo:
    -
    -[[ LIB BATTLEFIELD TFS 1.0 Arquivos além desta lib: - BATTLEFIELD_globalevents.lua - BATTLEFIELD_movements.lua - BATTLEFIELD_creaturescript.lua - spell invisible.lua -- alterar UTANA VID e STEALTH RING ]]-- bf = { rewardWin = {2160, 10}, teamOne = {name = "Black Assassins", storage = 140120, pos = {x=1006,y=994,z=6}}, teamTwo = {name = "Red Barbarians", storage = 140121, pos = {x=1032,y=994,z=6}}, timeCloseTeleport = 1, timeOpenGate = 1, teleportPosition = {x=1019, y=1016, z=7}, namePlayer = 18400, levelToEvent = 7, itemGate = 3517 } function checkGate() local wall = { {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, } broadcastMessage("The BattleEvent Event will begin now!", MESSAGE_STATUS_WARNING) doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) print("> BattleField Event will begin now.") for i = 1, #wall do local tile = Tile(wall[i]) if tile then local item = tile:getItemById(bf.itemGate) if item then item:remove() else Game.createItem(bf.itemGate, 1, wall[i]) end end end end function doMsgBattlefield(msg) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(bf.teamOne.storage) > 0 or online:getStorageValue(bf.teamTwo.storage) > 0 then online:sendTextMessage(MESSAGE_INFO_DESCR, msg) end end end end Em data/movements/scripts crie um arquivo com o nome de BATTLEFIELD_movements com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local conditionBlack = Condition(CONDITION_OUTFIT) conditionBlack:setTicks(120 * 60 * 1000) conditionBlack:addOutfit({lookType = 134, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) local conditionRed = Condition(CONDITION_OUTFIT) conditionRed:setTicks(120 * 60 * 1000) conditionRed:addOutfit({lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function onStepIn(cid, item, position, fromPosition) local player = Player(cid) if player:getLevel() < bf.levelToEvent then player:sendTextMessage(MESSAGE_INFO_DESCR, "You need level " .. bf.levelToEvent .. " to enter in event.") player:teleportTo(fromPosition) return false end if player:getItemCount(2165) >= 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You can not enter stealth ring in the event.") player:teleportTo(fromPosition) return false end if Game.getStorageValue(bf.teamOne.storage) < Game.getStorageValue(bf.teamTwo.storage) then Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) + 1) player:addCondition(conditionBlack) player:setStorageValue(bf.teamOne.storage, 1) player:setStorageValue(bf.teamTwo.storage, 0) player:teleportTo(bf.teamOne.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamOne.name .. ".") else Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) + 1) player:addCondition(conditionRed) player:setStorageValue(bf.teamTwo.storage, 1) player:setStorageValue(bf.teamOne.storage, 0) player:teleportTo(bf.teamTwo.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamTwo.name .. ".") Game.setStorageValue(bf.namePlayer, cid) end player:addHealth(player:getMaxHealth()) player:addMana(player:getMaxMana()) player:registerEvent("BattleTeamLife") player:registerEvent("BattleTeamMana") player:registerEvent("BattleDeath") return true end Em data/movements/movements.xml adicione:
    <movevent event="StepIn" actionid="47000" script="BATTLEFIELD_movements.lua"/> Em data/spells/scripts/support abra o arquivo invisible.lua, apague tudo e coloque:
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) setCombatCondition(combat, condition) dofile('data/lib/BATTLEFIELD_lib.lua') function onCastSpell(cid, var) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then return false else return doCombat(cid, combat, var) end end Conforme avisado, no TFS 1.0 há necessidade de alterar alguns códigos nas fontes, portanto estou disponibilizando o arquivo game.cpp, basta substituir em sua basta e recompila-lo.
    Download game.cpp: https://www.sendspace.com/file/vqs5u4

    Download Map tradicional: https://www.sendspace.com/file/f5tjhg
     

    Imagem do mapa:



    Para configurar, basta ver os arquivos e configurar horário, dias e posições do mapa!


    SCRIPT 100% TESTADO, O MESMO É VENDIDO PELO MODERADOR DO OUTRO FÓRUM! PORTANTO SEM ESSA, MODIFICAMOS E, IT'S FREEEEEEEE!

     
    Créditos:
    Absolute
    Vodkart
    Luan Luciano
    Markin


    Bom Proveito a todos, até o próximo!





    FAVOR MOVER O TÓPICO PRA SEÇÃO SCRIPTING > SISTEMAS E MODS, QUE TÁ FOD* CRIAR LÁ....
  3. Upvote
    mkbrabsolute recebeu reputação de Avronex em [CSF ANTI DDOS] Config Absolute   
    Olá galera do XTIBIA, para quem não conhece CSF é um script instalado no linux que ajuda a proteger sua máquina contra floods.
    Deixo bem claro que o script não faz milagres, mas poderá prevenir sua máquina de pequenos e bobos ataques.

    Este CSF foi configurado para rede de segurança em OPEN TIBIA, os direitos autorais são totalmente da desenvolvedora do script, apenas por conhecimento editei e adaptei-o para as portas e regras do open tibia.


    Como instalar:
     
    Acesse sua máquina via ssh (putty) e digite:
    wget http://www.configserver.com/free/csf.tgz Você fez o download do CSF, agora vamos descompactar o arquivo com o comando:
    tar -xzf csf.tgz Então vamos entrar no diretório:
    cd csf Agora vamos instalar o script na máquina:
    sh install.sh Agora via FTP (FILEZILLA/WINSCP) vamos enviar o arquivo modificado e configurado por mim.
    Vá até a pasta /etc/csf
    Abra o arquivo csf.conf e altere tudo para o arquivo que estou disponibilizado:
    http://hastebin.com/ajaqotawos.coffee
     
    Agora voltando no putty (SSH), vamos abrir um background para deixar o arquivo rodando mesmo que você encerre a conexão direta com o putty, digite:
    screen -S firewall Então por fim vamos ligar o firewall:
    Digite:

    csf -u;csf -r Feito, você está protegido!



    VALE LEMBRAR QUE NÃO AUTORIZO A POSTAGEM DESTE TÓPICO/ARQUIVO EM QUALQUER OUTRO FÓRUM BRASILEIRO, CASO SEJA POSTADO, SERÁ DENUNCIADO.


    Até o próximo sistema babyes!
  4. Upvote
    mkbrabsolute deu reputação a Bruno em [CSF ANTI DDOS] Config Absolute   
    É um conteúdo bem interessante e útil,
    Obrigado por compartilhar conosco!
     
    Aprovado, movido e reputado!
  5. Upvote
    mkbrabsolute recebeu reputação de Bruno em [CSF ANTI DDOS] Config Absolute   
    Olá galera do XTIBIA, para quem não conhece CSF é um script instalado no linux que ajuda a proteger sua máquina contra floods.
    Deixo bem claro que o script não faz milagres, mas poderá prevenir sua máquina de pequenos e bobos ataques.

    Este CSF foi configurado para rede de segurança em OPEN TIBIA, os direitos autorais são totalmente da desenvolvedora do script, apenas por conhecimento editei e adaptei-o para as portas e regras do open tibia.


    Como instalar:
     
    Acesse sua máquina via ssh (putty) e digite:
    wget http://www.configserver.com/free/csf.tgz Você fez o download do CSF, agora vamos descompactar o arquivo com o comando:
    tar -xzf csf.tgz Então vamos entrar no diretório:
    cd csf Agora vamos instalar o script na máquina:
    sh install.sh Agora via FTP (FILEZILLA/WINSCP) vamos enviar o arquivo modificado e configurado por mim.
    Vá até a pasta /etc/csf
    Abra o arquivo csf.conf e altere tudo para o arquivo que estou disponibilizado:
    http://hastebin.com/ajaqotawos.coffee
     
    Agora voltando no putty (SSH), vamos abrir um background para deixar o arquivo rodando mesmo que você encerre a conexão direta com o putty, digite:
    screen -S firewall Então por fim vamos ligar o firewall:
    Digite:

    csf -u;csf -r Feito, você está protegido!



    VALE LEMBRAR QUE NÃO AUTORIZO A POSTAGEM DESTE TÓPICO/ARQUIVO EM QUALQUER OUTRO FÓRUM BRASILEIRO, CASO SEJA POSTADO, SERÁ DENUNCIADO.


    Até o próximo sistema babyes!
  6. Upvote
    mkbrabsolute recebeu reputação de jvcasarin em [PEDIDO] Compilar TFS 0.4   
    Este erro é porque o código foi implementado errado, sugiro que refaça.
  7. Upvote
    mkbrabsolute recebeu reputação de JonatasLucasf em [TFS 1.0] Battlefield Event - NEW 100%   
    O Evento Battlefield há para TFS 1.1, 1.2. Portanto, este é o ÚNICO E EXCLUSIVO evento para o TFS 1.0 que a maioria usa.

    O Que há nele?
    Neste tópico encontraremos os scripts do evento, mapa e arquivo da source.

    Há necessidade de alterar o arquivo game.cpp da source e recompilar o TFS para que o evento funcione perfeitamente.
    Vamos ao que interessa!
     
    Em data/creaturescripts/scripts crie um arquivo com o nome de BATTLEFIELD_creaturescript.lua com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function getWinnersBattle(storage) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(storage) > 0 then online:teleportTo(online:getTown():getTemplePosition()) online:sendTextMessage(MESSAGE_INFO_DESCR, msg) online:setStorageValue(storage, 0) online:addItem(bf.rewardWin[1], bf.rewardWin[2]) online:unregisterEvent("BattleTeamLife") online:unregisterEvent("BattleTeamMana") online:unregisterEvent("BattleDeath") online:addHealth(online:getMaxHealth()) online:addMana(online:getMaxMana()) online:removeCondition(CONDITION_OUTFIT) if online:isPzLocked() then online:remove() end end end end if storage == bf.teamOne.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamOne.name .." win.", MESSAGE_STATUS_WARNING) elseif storage == bf.teamTwo.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamTwo.name .." win.", MESSAGE_STATUS_WARNING) end checkGate() print("> BattleField Event was finished.") end function onLogin(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:setStorageValue(bf.teamOne.storage, 0) player:setStorageValue(bf.teamTwo.storage, 0) player:removeCondition(CONDITION_OUTFIT) player:teleportTo(player:getTown():getTemplePosition()) player:unregisterEvent("BattleTeamLife") player:unregisterEvent("BattleTeamMana") player:unregisterEvent("BattleDeath") end return true end function onLogout(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can not logout now.") return false end return true end function onChangeHealth(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local player = Player(creature) local enemy = Player(attacker) if enemy then if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) and (primaryDamage > 0) then return false end end return primaryDamage, primaryType, secondaryDamage, secondaryType end function onChangeMana(cid, attacker, manaChange) local player = Player(cid) local enemy = Player(attacker) if enemy then player:sendTextMessage(MESSAGE_INFO_DESCR, enemy) if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) then return false end end return manaChange end function onPrepareDeath(cid, killer) local creature = Player(cid) if creature:getStorageValue(bf.teamOne.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) - 1) creature:setStorageValue(bf.teamOne.storage, 0) elseif creature:getStorageValue(bf.teamTwo.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) creature:setStorageValue(bf.teamTwo.storage, 0) end if Game.getStorageValue(bf.teamOne.storage) == 0 then getWinnersBattle(bf.teamTwo.storage) elseif Game.getStorageValue(bf.teamTwo.storage) == 0 then getWinnersBattle(bf.teamOne.storage) end if Game.getStorageValue(bf.teamOne.storage) > 0 and Game.getStorageValue(bf.teamTwo.storage) > 0 then doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) end if creature:isPzLocked() then creature:remove() end return false end Em data/creaturescripts/creaturescripts.xml adicione as seguintes linhas:
    <event type="login" name="BattleLogin" script="BATTLEFIELD_creaturescript.lua"/> <event type="logout" name="BattleLogout" script="BATTLEFIELD_creaturescript.lua"/> <event type="preparedeath" name="BattleDeath" script="BATTLEFIELD_creaturescript.lua"/> <event type="changehealth" name="BattleTeamLife" script="BATTLEFIELD_creaturescript.lua"/> <event type="changemana" name="BattleTeamMana" script="BATTLEFIELD_creaturescript.lua"/> Em data/globalevents/script, crie um arquivo com o nome de BATTLEFIELD_globalevents.lua e adicione o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function teleportCheck() local tile = Tile(bf.teleportPosition) if tile then local item = tile:getItemById(1387) if item then item:remove() broadcastMessage("The BattleField Event was start in ".. bf.timeOpenGate .." minutes.", MESSAGE_STATUS_WARNING) local team1 = Game.getStorageValue(bf.teamOne.storage) local team2 = Game.getStorageValue(bf.teamTwo.storage) if (team1 + team2) % 2 ~= 0 then local playerLeave = Player(Game.getStorageValue(bf.namePlayer)) playerLeave:teleportTo(playerLeave:getTown():getTemplePosition()) playerLeave:removeCondition(CONDITION_OUTFIT) playerLeave:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are dead!") playerLeave:addHealth(playerLeave:getMaxHealth()) playerLeave:addMana(playerLeave:getMaxMana()) playerLeave:unregisterEvent("BattleTeamLife") playerLeave:unregisterEvent("BattleTeamMana") playerLeave:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) playerLeave:setStorageValue(bf.teamTwo.storage, 0) end addEvent(checkGate, bf.timeOpenGate * 60 * 1000) else broadcastMessage("The BattleField Event was opened and will close in ".. bf.timeCloseTeleport .." minutes.", MESSAGE_STATUS_WARNING) Game.setStorageValue(bf.teamOne.storage, 0) Game.setStorageValue(bf.teamTwo.storage, 0) Game.setStorageValue(bf.namePlayer, 0) print("> BattleField Event was opened.") local teleport = Game.createItem(1387, 1, bf.teleportPosition) if teleport then teleport:setActionId(47000) end end end end function onTime(interval) teleportCheck() addEvent(teleportCheck, bf.timeCloseTeleport * 60 * 1000) return true end Em data/globalevents/globalevents.xml adicione:
    <globalevent name="BattleField" time="20:55:00" script="BATTLEFIELD_globalevents.lua" /> Em data/libs crie um arquivo com o nome de BATTLEFIELD_lib com o conteúdo:
    -
    -[[ LIB BATTLEFIELD TFS 1.0 Arquivos além desta lib: - BATTLEFIELD_globalevents.lua - BATTLEFIELD_movements.lua - BATTLEFIELD_creaturescript.lua - spell invisible.lua -- alterar UTANA VID e STEALTH RING ]]-- bf = { rewardWin = {2160, 10}, teamOne = {name = "Black Assassins", storage = 140120, pos = {x=1006,y=994,z=6}}, teamTwo = {name = "Red Barbarians", storage = 140121, pos = {x=1032,y=994,z=6}}, timeCloseTeleport = 1, timeOpenGate = 1, teleportPosition = {x=1019, y=1016, z=7}, namePlayer = 18400, levelToEvent = 7, itemGate = 3517 } function checkGate() local wall = { {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, } broadcastMessage("The BattleEvent Event will begin now!", MESSAGE_STATUS_WARNING) doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) print("> BattleField Event will begin now.") for i = 1, #wall do local tile = Tile(wall[i]) if tile then local item = tile:getItemById(bf.itemGate) if item then item:remove() else Game.createItem(bf.itemGate, 1, wall[i]) end end end end function doMsgBattlefield(msg) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(bf.teamOne.storage) > 0 or online:getStorageValue(bf.teamTwo.storage) > 0 then online:sendTextMessage(MESSAGE_INFO_DESCR, msg) end end end end Em data/movements/scripts crie um arquivo com o nome de BATTLEFIELD_movements com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local conditionBlack = Condition(CONDITION_OUTFIT) conditionBlack:setTicks(120 * 60 * 1000) conditionBlack:addOutfit({lookType = 134, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) local conditionRed = Condition(CONDITION_OUTFIT) conditionRed:setTicks(120 * 60 * 1000) conditionRed:addOutfit({lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function onStepIn(cid, item, position, fromPosition) local player = Player(cid) if player:getLevel() < bf.levelToEvent then player:sendTextMessage(MESSAGE_INFO_DESCR, "You need level " .. bf.levelToEvent .. " to enter in event.") player:teleportTo(fromPosition) return false end if player:getItemCount(2165) >= 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You can not enter stealth ring in the event.") player:teleportTo(fromPosition) return false end if Game.getStorageValue(bf.teamOne.storage) < Game.getStorageValue(bf.teamTwo.storage) then Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) + 1) player:addCondition(conditionBlack) player:setStorageValue(bf.teamOne.storage, 1) player:setStorageValue(bf.teamTwo.storage, 0) player:teleportTo(bf.teamOne.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamOne.name .. ".") else Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) + 1) player:addCondition(conditionRed) player:setStorageValue(bf.teamTwo.storage, 1) player:setStorageValue(bf.teamOne.storage, 0) player:teleportTo(bf.teamTwo.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamTwo.name .. ".") Game.setStorageValue(bf.namePlayer, cid) end player:addHealth(player:getMaxHealth()) player:addMana(player:getMaxMana()) player:registerEvent("BattleTeamLife") player:registerEvent("BattleTeamMana") player:registerEvent("BattleDeath") return true end Em data/movements/movements.xml adicione:
    <movevent event="StepIn" actionid="47000" script="BATTLEFIELD_movements.lua"/> Em data/spells/scripts/support abra o arquivo invisible.lua, apague tudo e coloque:
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) setCombatCondition(combat, condition) dofile('data/lib/BATTLEFIELD_lib.lua') function onCastSpell(cid, var) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then return false else return doCombat(cid, combat, var) end end Conforme avisado, no TFS 1.0 há necessidade de alterar alguns códigos nas fontes, portanto estou disponibilizando o arquivo game.cpp, basta substituir em sua basta e recompila-lo.
    Download game.cpp: https://www.sendspace.com/file/vqs5u4

    Download Map tradicional: https://www.sendspace.com/file/f5tjhg
     

    Imagem do mapa:



    Para configurar, basta ver os arquivos e configurar horário, dias e posições do mapa!


    SCRIPT 100% TESTADO, O MESMO É VENDIDO PELO MODERADOR DO OUTRO FÓRUM! PORTANTO SEM ESSA, MODIFICAMOS E, IT'S FREEEEEEEE!

     
    Créditos:
    Absolute
    Vodkart
    Luan Luciano
    Markin


    Bom Proveito a todos, até o próximo!





    FAVOR MOVER O TÓPICO PRA SEÇÃO SCRIPTING > SISTEMAS E MODS, QUE TÁ FOD* CRIAR LÁ....
  8. Upvote
    mkbrabsolute recebeu reputação de Vodkart em [TFS 1.0] Battlefield Event - NEW 100%   
    O Evento Battlefield há para TFS 1.1, 1.2. Portanto, este é o ÚNICO E EXCLUSIVO evento para o TFS 1.0 que a maioria usa.

    O Que há nele?
    Neste tópico encontraremos os scripts do evento, mapa e arquivo da source.

    Há necessidade de alterar o arquivo game.cpp da source e recompilar o TFS para que o evento funcione perfeitamente.
    Vamos ao que interessa!
     
    Em data/creaturescripts/scripts crie um arquivo com o nome de BATTLEFIELD_creaturescript.lua com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function getWinnersBattle(storage) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(storage) > 0 then online:teleportTo(online:getTown():getTemplePosition()) online:sendTextMessage(MESSAGE_INFO_DESCR, msg) online:setStorageValue(storage, 0) online:addItem(bf.rewardWin[1], bf.rewardWin[2]) online:unregisterEvent("BattleTeamLife") online:unregisterEvent("BattleTeamMana") online:unregisterEvent("BattleDeath") online:addHealth(online:getMaxHealth()) online:addMana(online:getMaxMana()) online:removeCondition(CONDITION_OUTFIT) if online:isPzLocked() then online:remove() end end end end if storage == bf.teamOne.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamOne.name .." win.", MESSAGE_STATUS_WARNING) elseif storage == bf.teamTwo.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamTwo.name .." win.", MESSAGE_STATUS_WARNING) end checkGate() print("> BattleField Event was finished.") end function onLogin(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:setStorageValue(bf.teamOne.storage, 0) player:setStorageValue(bf.teamTwo.storage, 0) player:removeCondition(CONDITION_OUTFIT) player:teleportTo(player:getTown():getTemplePosition()) player:unregisterEvent("BattleTeamLife") player:unregisterEvent("BattleTeamMana") player:unregisterEvent("BattleDeath") end return true end function onLogout(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can not logout now.") return false end return true end function onChangeHealth(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local player = Player(creature) local enemy = Player(attacker) if enemy then if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) and (primaryDamage > 0) then return false end end return primaryDamage, primaryType, secondaryDamage, secondaryType end function onChangeMana(cid, attacker, manaChange) local player = Player(cid) local enemy = Player(attacker) if enemy then player:sendTextMessage(MESSAGE_INFO_DESCR, enemy) if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) then return false end end return manaChange end function onPrepareDeath(cid, killer) local creature = Player(cid) if creature:getStorageValue(bf.teamOne.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) - 1) creature:setStorageValue(bf.teamOne.storage, 0) elseif creature:getStorageValue(bf.teamTwo.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) creature:setStorageValue(bf.teamTwo.storage, 0) end if Game.getStorageValue(bf.teamOne.storage) == 0 then getWinnersBattle(bf.teamTwo.storage) elseif Game.getStorageValue(bf.teamTwo.storage) == 0 then getWinnersBattle(bf.teamOne.storage) end if Game.getStorageValue(bf.teamOne.storage) > 0 and Game.getStorageValue(bf.teamTwo.storage) > 0 then doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) end if creature:isPzLocked() then creature:remove() end return false end Em data/creaturescripts/creaturescripts.xml adicione as seguintes linhas:
    <event type="login" name="BattleLogin" script="BATTLEFIELD_creaturescript.lua"/> <event type="logout" name="BattleLogout" script="BATTLEFIELD_creaturescript.lua"/> <event type="preparedeath" name="BattleDeath" script="BATTLEFIELD_creaturescript.lua"/> <event type="changehealth" name="BattleTeamLife" script="BATTLEFIELD_creaturescript.lua"/> <event type="changemana" name="BattleTeamMana" script="BATTLEFIELD_creaturescript.lua"/> Em data/globalevents/script, crie um arquivo com o nome de BATTLEFIELD_globalevents.lua e adicione o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function teleportCheck() local tile = Tile(bf.teleportPosition) if tile then local item = tile:getItemById(1387) if item then item:remove() broadcastMessage("The BattleField Event was start in ".. bf.timeOpenGate .." minutes.", MESSAGE_STATUS_WARNING) local team1 = Game.getStorageValue(bf.teamOne.storage) local team2 = Game.getStorageValue(bf.teamTwo.storage) if (team1 + team2) % 2 ~= 0 then local playerLeave = Player(Game.getStorageValue(bf.namePlayer)) playerLeave:teleportTo(playerLeave:getTown():getTemplePosition()) playerLeave:removeCondition(CONDITION_OUTFIT) playerLeave:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are dead!") playerLeave:addHealth(playerLeave:getMaxHealth()) playerLeave:addMana(playerLeave:getMaxMana()) playerLeave:unregisterEvent("BattleTeamLife") playerLeave:unregisterEvent("BattleTeamMana") playerLeave:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) playerLeave:setStorageValue(bf.teamTwo.storage, 0) end addEvent(checkGate, bf.timeOpenGate * 60 * 1000) else broadcastMessage("The BattleField Event was opened and will close in ".. bf.timeCloseTeleport .." minutes.", MESSAGE_STATUS_WARNING) Game.setStorageValue(bf.teamOne.storage, 0) Game.setStorageValue(bf.teamTwo.storage, 0) Game.setStorageValue(bf.namePlayer, 0) print("> BattleField Event was opened.") local teleport = Game.createItem(1387, 1, bf.teleportPosition) if teleport then teleport:setActionId(47000) end end end end function onTime(interval) teleportCheck() addEvent(teleportCheck, bf.timeCloseTeleport * 60 * 1000) return true end Em data/globalevents/globalevents.xml adicione:
    <globalevent name="BattleField" time="20:55:00" script="BATTLEFIELD_globalevents.lua" /> Em data/libs crie um arquivo com o nome de BATTLEFIELD_lib com o conteúdo:
    -
    -[[ LIB BATTLEFIELD TFS 1.0 Arquivos além desta lib: - BATTLEFIELD_globalevents.lua - BATTLEFIELD_movements.lua - BATTLEFIELD_creaturescript.lua - spell invisible.lua -- alterar UTANA VID e STEALTH RING ]]-- bf = { rewardWin = {2160, 10}, teamOne = {name = "Black Assassins", storage = 140120, pos = {x=1006,y=994,z=6}}, teamTwo = {name = "Red Barbarians", storage = 140121, pos = {x=1032,y=994,z=6}}, timeCloseTeleport = 1, timeOpenGate = 1, teleportPosition = {x=1019, y=1016, z=7}, namePlayer = 18400, levelToEvent = 7, itemGate = 3517 } function checkGate() local wall = { {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, } broadcastMessage("The BattleEvent Event will begin now!", MESSAGE_STATUS_WARNING) doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) print("> BattleField Event will begin now.") for i = 1, #wall do local tile = Tile(wall[i]) if tile then local item = tile:getItemById(bf.itemGate) if item then item:remove() else Game.createItem(bf.itemGate, 1, wall[i]) end end end end function doMsgBattlefield(msg) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(bf.teamOne.storage) > 0 or online:getStorageValue(bf.teamTwo.storage) > 0 then online:sendTextMessage(MESSAGE_INFO_DESCR, msg) end end end end Em data/movements/scripts crie um arquivo com o nome de BATTLEFIELD_movements com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local conditionBlack = Condition(CONDITION_OUTFIT) conditionBlack:setTicks(120 * 60 * 1000) conditionBlack:addOutfit({lookType = 134, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) local conditionRed = Condition(CONDITION_OUTFIT) conditionRed:setTicks(120 * 60 * 1000) conditionRed:addOutfit({lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function onStepIn(cid, item, position, fromPosition) local player = Player(cid) if player:getLevel() < bf.levelToEvent then player:sendTextMessage(MESSAGE_INFO_DESCR, "You need level " .. bf.levelToEvent .. " to enter in event.") player:teleportTo(fromPosition) return false end if player:getItemCount(2165) >= 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You can not enter stealth ring in the event.") player:teleportTo(fromPosition) return false end if Game.getStorageValue(bf.teamOne.storage) < Game.getStorageValue(bf.teamTwo.storage) then Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) + 1) player:addCondition(conditionBlack) player:setStorageValue(bf.teamOne.storage, 1) player:setStorageValue(bf.teamTwo.storage, 0) player:teleportTo(bf.teamOne.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamOne.name .. ".") else Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) + 1) player:addCondition(conditionRed) player:setStorageValue(bf.teamTwo.storage, 1) player:setStorageValue(bf.teamOne.storage, 0) player:teleportTo(bf.teamTwo.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamTwo.name .. ".") Game.setStorageValue(bf.namePlayer, cid) end player:addHealth(player:getMaxHealth()) player:addMana(player:getMaxMana()) player:registerEvent("BattleTeamLife") player:registerEvent("BattleTeamMana") player:registerEvent("BattleDeath") return true end Em data/movements/movements.xml adicione:
    <movevent event="StepIn" actionid="47000" script="BATTLEFIELD_movements.lua"/> Em data/spells/scripts/support abra o arquivo invisible.lua, apague tudo e coloque:
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) setCombatCondition(combat, condition) dofile('data/lib/BATTLEFIELD_lib.lua') function onCastSpell(cid, var) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then return false else return doCombat(cid, combat, var) end end Conforme avisado, no TFS 1.0 há necessidade de alterar alguns códigos nas fontes, portanto estou disponibilizando o arquivo game.cpp, basta substituir em sua basta e recompila-lo.
    Download game.cpp: https://www.sendspace.com/file/vqs5u4

    Download Map tradicional: https://www.sendspace.com/file/f5tjhg
     

    Imagem do mapa:



    Para configurar, basta ver os arquivos e configurar horário, dias e posições do mapa!


    SCRIPT 100% TESTADO, O MESMO É VENDIDO PELO MODERADOR DO OUTRO FÓRUM! PORTANTO SEM ESSA, MODIFICAMOS E, IT'S FREEEEEEEE!

     
    Créditos:
    Absolute
    Vodkart
    Luan Luciano
    Markin


    Bom Proveito a todos, até o próximo!





    FAVOR MOVER O TÓPICO PRA SEÇÃO SCRIPTING > SISTEMAS E MODS, QUE TÁ FOD* CRIAR LÁ....
  9. Upvote
    mkbrabsolute recebeu reputação de DeCarvalho em [TFS 1.0] Battlefield Event - NEW 100%   
    O Evento Battlefield há para TFS 1.1, 1.2. Portanto, este é o ÚNICO E EXCLUSIVO evento para o TFS 1.0 que a maioria usa.

    O Que há nele?
    Neste tópico encontraremos os scripts do evento, mapa e arquivo da source.

    Há necessidade de alterar o arquivo game.cpp da source e recompilar o TFS para que o evento funcione perfeitamente.
    Vamos ao que interessa!
     
    Em data/creaturescripts/scripts crie um arquivo com o nome de BATTLEFIELD_creaturescript.lua com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function getWinnersBattle(storage) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(storage) > 0 then online:teleportTo(online:getTown():getTemplePosition()) online:sendTextMessage(MESSAGE_INFO_DESCR, msg) online:setStorageValue(storage, 0) online:addItem(bf.rewardWin[1], bf.rewardWin[2]) online:unregisterEvent("BattleTeamLife") online:unregisterEvent("BattleTeamMana") online:unregisterEvent("BattleDeath") online:addHealth(online:getMaxHealth()) online:addMana(online:getMaxMana()) online:removeCondition(CONDITION_OUTFIT) if online:isPzLocked() then online:remove() end end end end if storage == bf.teamOne.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamOne.name .." win.", MESSAGE_STATUS_WARNING) elseif storage == bf.teamTwo.storage then broadcastMessage("The BattleEvent is finish, team ".. bf.teamTwo.name .." win.", MESSAGE_STATUS_WARNING) end checkGate() print("> BattleField Event was finished.") end function onLogin(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:setStorageValue(bf.teamOne.storage, 0) player:setStorageValue(bf.teamTwo.storage, 0) player:removeCondition(CONDITION_OUTFIT) player:teleportTo(player:getTown():getTemplePosition()) player:unregisterEvent("BattleTeamLife") player:unregisterEvent("BattleTeamMana") player:unregisterEvent("BattleDeath") end return true end function onLogout(cid) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can not logout now.") return false end return true end function onChangeHealth(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) local player = Player(creature) local enemy = Player(attacker) if enemy then if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) and (primaryDamage > 0) then return false end end return primaryDamage, primaryType, secondaryDamage, secondaryType end function onChangeMana(cid, attacker, manaChange) local player = Player(cid) local enemy = Player(attacker) if enemy then player:sendTextMessage(MESSAGE_INFO_DESCR, enemy) if (player:getStorageValue(bf.teamOne.storage) > 0 and enemy:getStorageValue(bf.teamOne.storage) > 0) or (player:getStorageValue(bf.teamTwo.storage) > 0 and enemy:getStorageValue(bf.teamTwo.storage) > 0) or (enemy:isMonster()) then return false end end return manaChange end function onPrepareDeath(cid, killer) local creature = Player(cid) if creature:getStorageValue(bf.teamOne.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) - 1) creature:setStorageValue(bf.teamOne.storage, 0) elseif creature:getStorageValue(bf.teamTwo.storage) > 0 then creature:removeCondition(CONDITION_OUTFIT) creature:sendTextMessage(MESSAGE_INFO_DESCR, "You are dead!") creature:teleportTo(creature:getTown():getTemplePosition()) creature:addHealth(creature:getMaxHealth()) creature:addMana(creature:getMaxMana()) creature:unregisterEvent("BattleTeamLife") creature:unregisterEvent("BattleTeamMana") creature:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) creature:setStorageValue(bf.teamTwo.storage, 0) end if Game.getStorageValue(bf.teamOne.storage) == 0 then getWinnersBattle(bf.teamTwo.storage) elseif Game.getStorageValue(bf.teamTwo.storage) == 0 then getWinnersBattle(bf.teamOne.storage) end if Game.getStorageValue(bf.teamOne.storage) > 0 and Game.getStorageValue(bf.teamTwo.storage) > 0 then doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) end if creature:isPzLocked() then creature:remove() end return false end Em data/creaturescripts/creaturescripts.xml adicione as seguintes linhas:
    <event type="login" name="BattleLogin" script="BATTLEFIELD_creaturescript.lua"/> <event type="logout" name="BattleLogout" script="BATTLEFIELD_creaturescript.lua"/> <event type="preparedeath" name="BattleDeath" script="BATTLEFIELD_creaturescript.lua"/> <event type="changehealth" name="BattleTeamLife" script="BATTLEFIELD_creaturescript.lua"/> <event type="changemana" name="BattleTeamMana" script="BATTLEFIELD_creaturescript.lua"/> Em data/globalevents/script, crie um arquivo com o nome de BATTLEFIELD_globalevents.lua e adicione o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local function teleportCheck() local tile = Tile(bf.teleportPosition) if tile then local item = tile:getItemById(1387) if item then item:remove() broadcastMessage("The BattleField Event was start in ".. bf.timeOpenGate .." minutes.", MESSAGE_STATUS_WARNING) local team1 = Game.getStorageValue(bf.teamOne.storage) local team2 = Game.getStorageValue(bf.teamTwo.storage) if (team1 + team2) % 2 ~= 0 then local playerLeave = Player(Game.getStorageValue(bf.namePlayer)) playerLeave:teleportTo(playerLeave:getTown():getTemplePosition()) playerLeave:removeCondition(CONDITION_OUTFIT) playerLeave:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are dead!") playerLeave:addHealth(playerLeave:getMaxHealth()) playerLeave:addMana(playerLeave:getMaxMana()) playerLeave:unregisterEvent("BattleTeamLife") playerLeave:unregisterEvent("BattleTeamMana") playerLeave:unregisterEvent("BattleDeath") Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) - 1) playerLeave:setStorageValue(bf.teamTwo.storage, 0) end addEvent(checkGate, bf.timeOpenGate * 60 * 1000) else broadcastMessage("The BattleField Event was opened and will close in ".. bf.timeCloseTeleport .." minutes.", MESSAGE_STATUS_WARNING) Game.setStorageValue(bf.teamOne.storage, 0) Game.setStorageValue(bf.teamTwo.storage, 0) Game.setStorageValue(bf.namePlayer, 0) print("> BattleField Event was opened.") local teleport = Game.createItem(1387, 1, bf.teleportPosition) if teleport then teleport:setActionId(47000) end end end end function onTime(interval) teleportCheck() addEvent(teleportCheck, bf.timeCloseTeleport * 60 * 1000) return true end Em data/globalevents/globalevents.xml adicione:
    <globalevent name="BattleField" time="20:55:00" script="BATTLEFIELD_globalevents.lua" /> Em data/libs crie um arquivo com o nome de BATTLEFIELD_lib com o conteúdo:
    -
    -[[ LIB BATTLEFIELD TFS 1.0 Arquivos além desta lib: - BATTLEFIELD_globalevents.lua - BATTLEFIELD_movements.lua - BATTLEFIELD_creaturescript.lua - spell invisible.lua -- alterar UTANA VID e STEALTH RING ]]-- bf = { rewardWin = {2160, 10}, teamOne = {name = "Black Assassins", storage = 140120, pos = {x=1006,y=994,z=6}}, teamTwo = {name = "Red Barbarians", storage = 140121, pos = {x=1032,y=994,z=6}}, timeCloseTeleport = 1, timeOpenGate = 1, teleportPosition = {x=1019, y=1016, z=7}, namePlayer = 18400, levelToEvent = 7, itemGate = 3517 } function checkGate() local wall = { {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, {x=1019, y=994, z=6}, } broadcastMessage("The BattleEvent Event will begin now!", MESSAGE_STATUS_WARNING) doMsgBattlefield("[BattleField] "..bf.teamOne.name.." "..Game.getStorageValue(bf.teamOne.storage).." VS "..Game.getStorageValue(bf.teamTwo.storage).." " ..bf.teamTwo.name) print("> BattleField Event will begin now.") for i = 1, #wall do local tile = Tile(wall[i]) if tile then local item = tile:getItemById(bf.itemGate) if item then item:remove() else Game.createItem(bf.itemGate, 1, wall[i]) end end end end function doMsgBattlefield(msg) for _, online in ipairs(Game.getPlayers()) do if online:isPlayer() then if online:getStorageValue(bf.teamOne.storage) > 0 or online:getStorageValue(bf.teamTwo.storage) > 0 then online:sendTextMessage(MESSAGE_INFO_DESCR, msg) end end end end Em data/movements/scripts crie um arquivo com o nome de BATTLEFIELD_movements com o conteúdo:
    dofile('data/lib/BATTLEFIELD_lib.lua') local conditionBlack = Condition(CONDITION_OUTFIT) conditionBlack:setTicks(120 * 60 * 1000) conditionBlack:addOutfit({lookType = 134, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) local conditionRed = Condition(CONDITION_OUTFIT) conditionRed:setTicks(120 * 60 * 1000) conditionRed:addOutfit({lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function onStepIn(cid, item, position, fromPosition) local player = Player(cid) if player:getLevel() < bf.levelToEvent then player:sendTextMessage(MESSAGE_INFO_DESCR, "You need level " .. bf.levelToEvent .. " to enter in event.") player:teleportTo(fromPosition) return false end if player:getItemCount(2165) >= 1 then player:sendTextMessage(MESSAGE_INFO_DESCR, "You can not enter stealth ring in the event.") player:teleportTo(fromPosition) return false end if Game.getStorageValue(bf.teamOne.storage) < Game.getStorageValue(bf.teamTwo.storage) then Game.setStorageValue(bf.teamOne.storage, Game.getStorageValue(bf.teamOne.storage) + 1) player:addCondition(conditionBlack) player:setStorageValue(bf.teamOne.storage, 1) player:setStorageValue(bf.teamTwo.storage, 0) player:teleportTo(bf.teamOne.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamOne.name .. ".") else Game.setStorageValue(bf.teamTwo.storage, Game.getStorageValue(bf.teamTwo.storage) + 1) player:addCondition(conditionRed) player:setStorageValue(bf.teamTwo.storage, 1) player:setStorageValue(bf.teamOne.storage, 0) player:teleportTo(bf.teamTwo.pos) player:sendTextMessage(MESSAGE_INFO_DESCR, "You will join the team " .. bf.teamTwo.name .. ".") Game.setStorageValue(bf.namePlayer, cid) end player:addHealth(player:getMaxHealth()) player:addMana(player:getMaxMana()) player:registerEvent("BattleTeamLife") player:registerEvent("BattleTeamMana") player:registerEvent("BattleDeath") return true end Em data/movements/movements.xml adicione:
    <movevent event="StepIn" actionid="47000" script="BATTLEFIELD_movements.lua"/> Em data/spells/scripts/support abra o arquivo invisible.lua, apague tudo e coloque:
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) setCombatCondition(combat, condition) dofile('data/lib/BATTLEFIELD_lib.lua') function onCastSpell(cid, var) local player = Player(cid) if player:getStorageValue(bf.teamOne.storage) > 0 or player:getStorageValue(bf.teamTwo.storage) > 0 then return false else return doCombat(cid, combat, var) end end Conforme avisado, no TFS 1.0 há necessidade de alterar alguns códigos nas fontes, portanto estou disponibilizando o arquivo game.cpp, basta substituir em sua basta e recompila-lo.
    Download game.cpp: https://www.sendspace.com/file/vqs5u4

    Download Map tradicional: https://www.sendspace.com/file/f5tjhg
     

    Imagem do mapa:



    Para configurar, basta ver os arquivos e configurar horário, dias e posições do mapa!


    SCRIPT 100% TESTADO, O MESMO É VENDIDO PELO MODERADOR DO OUTRO FÓRUM! PORTANTO SEM ESSA, MODIFICAMOS E, IT'S FREEEEEEEE!

     
    Créditos:
    Absolute
    Vodkart
    Luan Luciano
    Markin


    Bom Proveito a todos, até o próximo!





    FAVOR MOVER O TÓPICO PRA SEÇÃO SCRIPTING > SISTEMAS E MODS, QUE TÁ FOD* CRIAR LÁ....
  10. Upvote
    mkbrabsolute recebeu reputação de Night Wolf em [AJUDA] Spell Que Precisa de Permissão   
    Perdão, erros da matina hudshudsuhdshuds
    Try now:
    local config = { velocidade = 350, -- intervalo entre os giros (quanto menor, mais rapido) hits = 24, -- quantos hits vai dar msg = "Frozen Orb", -- msg ao soltar a spell storage = {99998}, key = 13871, -- storage que sera utilizado pro cooldown cooldown = 3, -- tempo em segundos de cooldown entre um uso da spell e outro. effect1 = 36, -- efeito de distancia que vai ficar rodando effect3 = 37, -- efeito ao castar a spell effect4 = 43 -- efeito ao acertar a roda no player } --[[Note que a velocidade multiplicada pelo numero de hits deve dar algo proximo de 8550 pra que a magia nao fique ruim ou um efeito acabe antes do outro. Nos valores que eu utilizei eles dao 8400, oque ja eh considerado perto pois temos 200 milisegundos iniciais, 8550 eh o tempo que o item sera removido e coincide com o tempo de duracao do efeito 56 (config.effect2)]] local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 255) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) function onTargetCreature(cid, target) doSendMagicEffect(getCreaturePosition(target), config.effect4) end setCombatCallback(combat, 4, "onTargetCreature") local arr = { {1, 1, 1}, {1, 3, 1}, -- area que vai acertar a spell enquanto estiver rodando {1, 1, 1}, } local area = createCombatArea(arr) setCombatArea(combat, area) function initEffect(position) for i = 0, 3 do local pos = {x = position.x, y = position.y, z = position.z} local dir = getPosByDir(pos, i) doSendDistanceShoot(position, dir, config.effect1) end return true end function middleEffect(uid, param, lim, count) n = count or 0 if isCreature(uid) and n < lim then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local pos2 = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) local dir2 = getPosByDir(pos2, i + 1 <= 3 and i + 1 or 0) doSendDistanceShoot(dir, dir2, config.effect1) end doCombat(uid, combat, { pos = getCreaturePosition(uid), type = 2 }) addEvent(middleEffect, config.velocidade, uid, param, lim, n + 1) end return true end function endEffect(uid) if isCreature(uid) then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) doSendDistanceShoot(dir, getCreaturePosition(uid), config.effect1) end end return true end function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage[1]) >= 1 then setPlayerStorageValue(cid, config.key, os.time() + config.cooldown) local position = getCreaturePosition(cid) doCreatureSay(cid, config.msg, 20) addEvent(endEffect, 8.55 * 1000, uid) doSendMagicEffect(position, config.effect3) initEffect(position) addEvent(middleEffect, 200, cid, var, config.hits) else doPlayerSendCancel(cid, "Desculpe,Você tem que comprar a permissao para usar está magia.") end return true end
  11. Upvote
    mkbrabsolute recebeu reputação de Night Wolf em [AJUDA] Spell Que Precisa de Permissão   
    @Edit, vamos lá, leia com atenção a explicação!
     
    Em data/actions/scripts crie um arquivo com o nome de frozenorb.lua e adicione:
    function onUse(cid, item, frompos, item2, topos) spellName = "SUA SPELL" -- Nome da spell if getPlayerStorageValue(cid, 99998) <= 0 then setPlayerStorageValue(cid, 99998, 1) doPlayerSendTextMessage(cid, 20, "You received permission to use the ".. spellName ..".") else doPlayerSendTextMessage(cid, 20, "You already have permission to use the ".. spellName .." spell.") end return TRUE end Em data/actions/actions.xml adicione:
    <action actionid="SUA ACTION" event="script" value="frozenorb.lua"/> A Spell ficará assim:

    local config = { velocidade = 350, -- intervalo entre os giros (quanto menor, mais rapido) hits = 24, -- quantos hits vai dar msg = "Frozen Orb", -- msg ao soltar a spell storage = {99998}, key = 13871, -- storage que sera utilizado pro cooldown cooldown = 3, -- tempo em segundos de cooldown entre um uso da spell e outro. effect1 = 36, -- efeito de distancia que vai ficar rodando effect3 = 37, -- efeito ao castar a spell effect4 = 43 -- efeito ao acertar a roda no player } --[[Note que a velocidade multiplicada pelo numero de hits deve dar algo proximo de 8550 pra que a magia nao fique ruim ou um efeito acabe antes do outro. Nos valores que eu utilizei eles dao 8400, oque ja eh considerado perto pois temos 200 milisegundos iniciais, 8550 eh o tempo que o item sera removido e coincide com o tempo de duracao do efeito 56 (config.effect2)]] local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 255) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) function onTargetCreature(cid, target) doSendMagicEffect(getCreaturePosition(target), config.effect4) end setCombatCallback(combat, 4, "onTargetCreature") local arr = { {1, 1, 1}, {1, 3, 1}, -- area que vai acertar a spell enquanto estiver rodando {1, 1, 1}, } local area = createCombatArea(arr) setCombatArea(combat, area) function initEffect(position) for i = 0, 3 do local pos = {x = position.x, y = position.y, z = position.z} local dir = getPosByDir(pos, i) doSendDistanceShoot(position, dir, config.effect1) end return true end function middleEffect(uid, param, lim, count) n = count or 0 if isCreature(uid) and n < lim then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local pos2 = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) local dir2 = getPosByDir(pos2, i + 1 <= 3 and i + 1 or 0) doSendDistanceShoot(dir, dir2, config.effect1) end doCombat(uid, combat, { pos = getCreaturePosition(uid), type = 2 }) addEvent(middleEffect, config.velocidade, uid, param, lim, n + 1) end return true end function endEffect(uid) if isCreature(uid) then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) doSendDistanceShoot(dir, getCreaturePosition(uid), config.effect1) end end return true end function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage[1]) >= 1 then setPlayerStorageValue(cid, config.key, os.time() + config.cooldown) local position = getCreaturePosition(cid) doCreatureSay(cid, config.msg, 20) addEvent(endEffect, 8.55 * 1000, uid) doSendMagicEffect(position, config.effect3) initEffect(position) addEvent(middleEffect, 200, cid, var, config.hits) else doPlayerSendCancel(cid, "Desculpe,Você tem que comprar a permissao para usar está magia.") end return true end ATENÇÃO:
    no frozenorb.lua note que há: spellName = "SUA SPELL" -- Nome da spell
    Onde está SUA SPELL, você procura a spell no spells.xml e veja o nome dela em: <instant name="AQUI VAI ESTAR O NOME DELA".

    Agora na linha do actions.xml em "SUA ACTION" é a ACTIONID que você colocará no baú que o player irá dar use (pelo remeres).

    A Spell, basta edita-la conforme postei.


    Conforme pedido, EXPLICAÇÃO:
    O Que foi alterado?
    No local da spell foi acionado o storage = {99998}, Este local foi feito para que quando o player executar a ação (soltar a spell) haverá uma função buscando o storage para checar se o player possui a mesma ou não.
    A função que irá verificar foi adicionada, é á: if getPlayerStorageValue(cid, config.storage) >= 1 then
    Caso o player não tenha a storage irá retornar com a função adicionada: doPlayerSendCancel(cid, "Sorry, you have to buy permission to use this.")
    No seu caso eu adicionei a storage em local, pois não havia, mas caso for fazer em outra é houver já o storage, você irá acrescentar a storage na local/variavel e na hora de fazer o check storage você irá identifica-las na storage como: storage[1], storage[2], storage[3] e assim sucessivamente...
    E então na hora de verificar você irá fazer o check normal, setando a creature com cid e irá identificar como [1], ficando assim:
    cid, storage[1]
    cid, storage[2]
    cid, storage[3]


    Bom, é isso aí, teste ai e tente fazer a próxima.
    Desculpe pelo português ou qualquer erro, são 06h da manhã minha cabeça não funciona perfeitamente dshuhusdhusduhsd.
    Obrigado, abraços.


    Obs: Havia postado a spell do outro, como disse são 06hrs dbhsshduhuds, postei a sua, normalizado.
     
     
     
     
  12. Upvote
    mkbrabsolute recebeu reputação de jvcasarin em [AJUDA] Spell Que Precisa de Permissão   
    Perdão, erros da matina hudshudsuhdshuds
    Try now:
    local config = { velocidade = 350, -- intervalo entre os giros (quanto menor, mais rapido) hits = 24, -- quantos hits vai dar msg = "Frozen Orb", -- msg ao soltar a spell storage = {99998}, key = 13871, -- storage que sera utilizado pro cooldown cooldown = 3, -- tempo em segundos de cooldown entre um uso da spell e outro. effect1 = 36, -- efeito de distancia que vai ficar rodando effect3 = 37, -- efeito ao castar a spell effect4 = 43 -- efeito ao acertar a roda no player } --[[Note que a velocidade multiplicada pelo numero de hits deve dar algo proximo de 8550 pra que a magia nao fique ruim ou um efeito acabe antes do outro. Nos valores que eu utilizei eles dao 8400, oque ja eh considerado perto pois temos 200 milisegundos iniciais, 8550 eh o tempo que o item sera removido e coincide com o tempo de duracao do efeito 56 (config.effect2)]] local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 255) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) function onTargetCreature(cid, target) doSendMagicEffect(getCreaturePosition(target), config.effect4) end setCombatCallback(combat, 4, "onTargetCreature") local arr = { {1, 1, 1}, {1, 3, 1}, -- area que vai acertar a spell enquanto estiver rodando {1, 1, 1}, } local area = createCombatArea(arr) setCombatArea(combat, area) function initEffect(position) for i = 0, 3 do local pos = {x = position.x, y = position.y, z = position.z} local dir = getPosByDir(pos, i) doSendDistanceShoot(position, dir, config.effect1) end return true end function middleEffect(uid, param, lim, count) n = count or 0 if isCreature(uid) and n < lim then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local pos2 = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) local dir2 = getPosByDir(pos2, i + 1 <= 3 and i + 1 or 0) doSendDistanceShoot(dir, dir2, config.effect1) end doCombat(uid, combat, { pos = getCreaturePosition(uid), type = 2 }) addEvent(middleEffect, config.velocidade, uid, param, lim, n + 1) end return true end function endEffect(uid) if isCreature(uid) then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) doSendDistanceShoot(dir, getCreaturePosition(uid), config.effect1) end end return true end function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage[1]) >= 1 then setPlayerStorageValue(cid, config.key, os.time() + config.cooldown) local position = getCreaturePosition(cid) doCreatureSay(cid, config.msg, 20) addEvent(endEffect, 8.55 * 1000, uid) doSendMagicEffect(position, config.effect3) initEffect(position) addEvent(middleEffect, 200, cid, var, config.hits) else doPlayerSendCancel(cid, "Desculpe,Você tem que comprar a permissao para usar está magia.") end return true end
  13. Upvote
    mkbrabsolute recebeu reputação de jvcasarin em [AJUDA] Spell Que Precisa de Permissão   
    @Edit, vamos lá, leia com atenção a explicação!
     
    Em data/actions/scripts crie um arquivo com o nome de frozenorb.lua e adicione:
    function onUse(cid, item, frompos, item2, topos) spellName = "SUA SPELL" -- Nome da spell if getPlayerStorageValue(cid, 99998) <= 0 then setPlayerStorageValue(cid, 99998, 1) doPlayerSendTextMessage(cid, 20, "You received permission to use the ".. spellName ..".") else doPlayerSendTextMessage(cid, 20, "You already have permission to use the ".. spellName .." spell.") end return TRUE end Em data/actions/actions.xml adicione:
    <action actionid="SUA ACTION" event="script" value="frozenorb.lua"/> A Spell ficará assim:

    local config = { velocidade = 350, -- intervalo entre os giros (quanto menor, mais rapido) hits = 24, -- quantos hits vai dar msg = "Frozen Orb", -- msg ao soltar a spell storage = {99998}, key = 13871, -- storage que sera utilizado pro cooldown cooldown = 3, -- tempo em segundos de cooldown entre um uso da spell e outro. effect1 = 36, -- efeito de distancia que vai ficar rodando effect3 = 37, -- efeito ao castar a spell effect4 = 43 -- efeito ao acertar a roda no player } --[[Note que a velocidade multiplicada pelo numero de hits deve dar algo proximo de 8550 pra que a magia nao fique ruim ou um efeito acabe antes do outro. Nos valores que eu utilizei eles dao 8400, oque ja eh considerado perto pois temos 200 milisegundos iniciais, 8550 eh o tempo que o item sera removido e coincide com o tempo de duracao do efeito 56 (config.effect2)]] local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, 255) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) function onTargetCreature(cid, target) doSendMagicEffect(getCreaturePosition(target), config.effect4) end setCombatCallback(combat, 4, "onTargetCreature") local arr = { {1, 1, 1}, {1, 3, 1}, -- area que vai acertar a spell enquanto estiver rodando {1, 1, 1}, } local area = createCombatArea(arr) setCombatArea(combat, area) function initEffect(position) for i = 0, 3 do local pos = {x = position.x, y = position.y, z = position.z} local dir = getPosByDir(pos, i) doSendDistanceShoot(position, dir, config.effect1) end return true end function middleEffect(uid, param, lim, count) n = count or 0 if isCreature(uid) and n < lim then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local pos2 = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) local dir2 = getPosByDir(pos2, i + 1 <= 3 and i + 1 or 0) doSendDistanceShoot(dir, dir2, config.effect1) end doCombat(uid, combat, { pos = getCreaturePosition(uid), type = 2 }) addEvent(middleEffect, config.velocidade, uid, param, lim, n + 1) end return true end function endEffect(uid) if isCreature(uid) then for i = 0, 3 do local pos = {x = getCreaturePosition(uid).x, y = getCreaturePosition(uid).y, z = getCreaturePosition(uid).z} local dir = getPosByDir(pos, i) doSendDistanceShoot(dir, getCreaturePosition(uid), config.effect1) end end return true end function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage[1]) >= 1 then setPlayerStorageValue(cid, config.key, os.time() + config.cooldown) local position = getCreaturePosition(cid) doCreatureSay(cid, config.msg, 20) addEvent(endEffect, 8.55 * 1000, uid) doSendMagicEffect(position, config.effect3) initEffect(position) addEvent(middleEffect, 200, cid, var, config.hits) else doPlayerSendCancel(cid, "Desculpe,Você tem que comprar a permissao para usar está magia.") end return true end ATENÇÃO:
    no frozenorb.lua note que há: spellName = "SUA SPELL" -- Nome da spell
    Onde está SUA SPELL, você procura a spell no spells.xml e veja o nome dela em: <instant name="AQUI VAI ESTAR O NOME DELA".

    Agora na linha do actions.xml em "SUA ACTION" é a ACTIONID que você colocará no baú que o player irá dar use (pelo remeres).

    A Spell, basta edita-la conforme postei.


    Conforme pedido, EXPLICAÇÃO:
    O Que foi alterado?
    No local da spell foi acionado o storage = {99998}, Este local foi feito para que quando o player executar a ação (soltar a spell) haverá uma função buscando o storage para checar se o player possui a mesma ou não.
    A função que irá verificar foi adicionada, é á: if getPlayerStorageValue(cid, config.storage) >= 1 then
    Caso o player não tenha a storage irá retornar com a função adicionada: doPlayerSendCancel(cid, "Sorry, you have to buy permission to use this.")
    No seu caso eu adicionei a storage em local, pois não havia, mas caso for fazer em outra é houver já o storage, você irá acrescentar a storage na local/variavel e na hora de fazer o check storage você irá identifica-las na storage como: storage[1], storage[2], storage[3] e assim sucessivamente...
    E então na hora de verificar você irá fazer o check normal, setando a creature com cid e irá identificar como [1], ficando assim:
    cid, storage[1]
    cid, storage[2]
    cid, storage[3]


    Bom, é isso aí, teste ai e tente fazer a próxima.
    Desculpe pelo português ou qualquer erro, são 06h da manhã minha cabeça não funciona perfeitamente dshuhusdhusduhsd.
    Obrigado, abraços.


    Obs: Havia postado a spell do outro, como disse são 06hrs dbhsshduhuds, postei a sua, normalizado.
     
     
     
     
  14. Upvote
    mkbrabsolute recebeu reputação de Administrador em Global Reward System   
    Os codes são os códigos que colocamos na source.
    Esse reward está totalmente pra tfs 1.2, pois ele tem as novas funções.
    Os scripts há como passar pra funcionar no 1.0, mas estou fazendo um baseado nos bosses da warzone reconhecendo os danos aderidos dos jogadores, fica mais fácil, não fica 100% global mas acho mais prático e sem intervenções nas sources.
  15. Upvote
    mkbrabsolute deu reputação a Ciroc em NOVO! Baiak Hatera - O Melhor! - Com Woe,dota, Coliseum,war System,Melhor Mapa,+50 quests Novas!   
    O Melhor Baiak 8.6 com mapa de cara nova, totalmente reformulado!
    Este é um projeto antigo meu que venho trazer agora para o xtibia, todo montado e configurado por min, livre de bugs e realmente muito inovador, espero que gostem.
     
    Mapa com cara totalmente Nova!
    War Of Emperium Event!
    DotA Event!
    Castle 24 Horas Event!
    50+ Quests todas novas!
    5+ Cidades!
    3 Vips sendo 2 free e 1 Donate!
    Sistemas de brincadeiras!
    Totalmente Sem Bugs!
    Novos Bosses e Novos Teleportes!
    Pronto para Rodar em Linux e Windows sem bugs, porem esta com as sources windows.
     
    - Com TFS 0.4 REV 3884 - O MELHOR PARA WINDOWS
    Senha do God:
    god/god
    Templo:
     
     
     
     
     
    Cidade:
     
     
     
    Teleports e Quests:
     
     
     
     
     
     
     
    Download/Scan:
    http://www.4shared.com/zip/1QlvsWJVce/Hatera_Baiak.html

    https://www.virustotal.com/pt/url/71a15da95cb759baa7204553c711a487d4806fb54a14c3e0c9645bf235722eb3/analysis/1435225611/

    Créditos:
     
  16. Upvote
    mkbrabsolute recebeu reputação de Ciroc em Global 10/11.5 + OtherWorld + Hearth of Destruction Quest+ Eventos   
    tudo na vida é possível rs.
    único problema é que você vai estar tentando alcançar um camaro com um chevete, é um servidor grande, algo que realmente seria mais do que necessário usar o sistema de 64bits.
    quanto a compilação, baixa o devcpp as libs que precisa e sucesso
  17. Upvote
    mkbrabsolute recebeu reputação de VictorWEBMaster em xTibia - Shadowcores Website   
    Boa @@VictorWEBMaster, parabéns pela atitude.
     
    Quanto ao membro que criou o site, sem o que falar, o coordenadorzinho vendedor do outro fórum, difícil, precário, nojento.
  18. Upvote
    mkbrabsolute recebeu reputação de Administrador em xTibia - Shadowcores Website   
    Boa @@VictorWEBMaster, parabéns pela atitude.
     
    Quanto ao membro que criou o site, sem o que falar, o coordenadorzinho vendedor do outro fórum, difícil, precário, nojento.
  19. Upvote
    mkbrabsolute recebeu reputação de Ciroc em Global Reward System   
    Pra revs anteriores da 1.0 é complicado brother, muda praticamente todas as funções lua e os meta-métodos da source.
  20. Upvote
    mkbrabsolute recebeu reputação de Ciroc em Global Reward System   
    Você ja adicionou nas sources os codes?
  21. Upvote
    mkbrabsolute recebeu reputação de Ciroc em Global Reward System   
    Certo, poste os códigos aqui da source que ai irei ajeitar o script
  22. Upvote
    mkbrabsolute recebeu reputação de Ciroc em Global Reward System   
    Altera seu creature pra este pra nós testarmos:
    REWARD_CHEST = { BOSSES = {"Bibby Bloodbath", "Chizzoron the Distorter", "Ferumbras", "Furyosa", "Gaz'haragoth", "Ghazbaran", "Hirintror", "Jaul", "Mad Mage", "Mawhawk", "Morgaroth", "Obujos", "Ocyakao", "Omrafir", "Orshabaal", "Raging Mage", "Tanjis", "The Mutated Pumpkin", "The Pale Count", "The Welter", "Tyrn", "White Pale", "Zulazza the Corruptor", "Zushuka"}, LOOT = {}, DECAY = {}, DEPOT_ID = 99, CONTAINER = 21518, EXPIRE = 7*24*60*60, --days to erase stored rewards STORAGE = 18394, --player storage for chest exhaustion EXHAUST = 5*60, --time allowed to use again the chest } function table.find(t, value, sensitive) local sensitive = sensitive or true if(not sensitive and type(value) == 'string') then for i, v in pairs(t) do if(type(v) == 'string') then if(v:lower() == value:lower()) then return i end end end return nil end for i, v in pairs(t) do if(v == value) then return i end end return nil end function table.serialize(x, recur) local t = type(x) recur = recur or {} if(t == nil) then return "nil" elseif(t == "string") then return string.format("%q", x) elseif(t == "number") then return tostring(x) elseif(t == "boolean") then return x and "true" or "false" elseif(getmetatable(x)) then error("Can not serialize a table that has a metatable associated with it.") elseif(t == "table") then if(table.find(recur, x)) then error("Can not serialize recursive tables.") end table.insert(recur, x) local s = "{" for k, v in pairs(x) do s = s .. "[" .. table.serialize(k, recur) .. "]" .. " = " .. table.serialize(v, recur) .. ", " end return s:sub(0, s:len() - 2) .. "}" end error("Can not serialize value of type '" .. t .. "'.") end function table.unserialize(str) return loadstring('return ' .. str)() end function addContainerItems(container, items) for k, v in pairs(items) do if ItemType(k):isContainer() then local newBag = Container(doCreateItemEx(k, 1)) addContainerItems(newBag, v) container:addItemEx(newBag) else container:addItem(v[1], v[2]) end end end function MonsterType.createLootItem(self, lootBlock, chance) local lootTable, itemCount = {}, 0 local randvalue = math.random(0, 100000) / (getConfigInfo("rateLoot") * chance) if randvalue < lootBlock.chance then if (ItemType(lootBlock.itemId):isStackable()) then itemCount = randvalue % lootBlock.maxCount + 1 else itemCount = 1 end end while itemCount > 0 do local n = math.min(itemCount, 100) itemCount = itemCount - n table.insert(lootTable, {lootBlock.itemId, n}) end return lootTable end function MonsterType.getBossReward(self, chance) local result = {} if getConfigInfo("rateLoot") > 0 then for _, loot in pairs(self:getLoot()) do local itemList = self:createLootItem(loot, chance) if itemList then for _, item in ipairs(itemList) do table.insert(result, item) end end end end return result end function getDecayTime(id) local decayTime = 0 do local o = io.open('data/items/items.xml','r') file = o:read('*a') o:close() end local function sumDecayTime(corpse) for attr in file:gmatch('<item.-id="' .. corpse ..'"(.-)</item>') do local decayTo = attr:match('<attribute.-key="decayTo".-value="(.-)".-/>') local duration = attr:match('<attribute.-key="duration".-value="(.-)".-/>') decayTime = decayTime + duration if tonumber(decayTo) > 0 then sumDecayTime(decayTo) end break end end sumDecayTime(id) return decayTime end function loadCorpses() for _, name in ipairs(REWARD_CHEST.BOSSES) do if MonsterType(name) ~= nil then REWARD_CHEST.DECAY[name] = getDecayTime(MonsterType(name):getCorpseId()) end end end addEvent(loadCorpses, 0) function getPlayerByGUID(guid) for _, player in ipairs(Game.getPlayers()) do if guid == player:getGuid() then return player end end return nil end function Player.addReward(self, reward, time, id) local LootBag = Container(doCreateItemEx(REWARD_CHEST.CONTAINER, 1)) LootBag:setAttribute('text', time) addContainerItems(LootBag, reward) if id then db.query('DELETE FROM player_rewardchest WHERE id = ' .. id .. ';') end return self:getDepotChest(REWARD_CHEST.DEPOT_ID, true):addItemEx(LootBag) end function doSaveReward(uid, name) for GUID, items in pairs(REWARD_CHEST.LOOT[uid]) do local player = getPlayerByGUID(GUID) if player ~= nil then player:addReward(items, os.time()) player:sendTextMessage(MESSAGE_INFO_DESCR, 'Your reward container from ' .. name .. ' was moved to your reward chest.') else db.query('INSERT INTO player_rewardchest VALUES (NULL, ' .. GUID ..', "' .. table.serialize(items) ..'", ' .. os.time() ..');') end end REWARD_CHEST.LOOT[uid] = nil end function Player.updateRewardChest(self) db.query('DELETE FROM player_rewardchest WHERE TIME_TO_SEC(TIMEDIFF(NOW(), FROM_UNIXTIME(date))) >= '.. REWARD_CHEST.EXPIRE ..';') local Query = db.storeQuery('SELECT id, reward, date FROM player_rewardchest WHERE player_id = '.. self:getGuid() ..';') if Query ~= false then repeat local rewardBag = table.unserialize(result.getDataString(Query, 'reward')) self:addReward(rewardBag, result.getDataInt(Query, 'date'), result.getDataInt(Query, 'id')) until not result.next(Query) result.free(Query) end local depotChest = self:getDepotChest(REWARD_CHEST.DEPOT_ID, true) for index = (depotChest:getSize() - 1), 0, -1 do local container = depotChest:getItem(index) if (container:getAttribute('text') ~= nil) and (tonumber(container:getAttribute('text')) + REWARD_CHEST.EXPIRE < os.time()) then container:remove() end end return self:setExhaustion(REWARD_CHEST.STORAGE, REWARD_CHEST.EXHAUST) end function string.diff(self) local format = { {'day', self / 60 / 60 / 24}, {'hour', self / 60 / 60 % 24}, {'minute', self / 60 % 60}, {'second', self % 60} } local out = {} for k, t in ipairs(format) do local v = math.floor(t[2]) if(v > 0) then table.insert(out, (k < #format and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or '')) end end local ret = table.concat(out) if ret:len() < 16 and ret:find('second') then local a, b = ret:find(' and ') ret = ret:sub(b+1) end return ret end function doBossReward(monster, corpse) REWARD_CHEST.LOOT[corpse:getUniqueId()] = {} corpse:setAttribute('aid', 21584) corpse:setAttribute('text', corpse:getUniqueId()) for killer, damage in pairs(monster:getDamageMap()) do local player, str = Player(killer), 'Loot of ' .. MonsterType(monster:getName()):getNameDescription() .. ': ' if player ~= nil then local rewardBag = doCreateItemEx(REWARD_CHEST.CONTAINER) if player:getStamina() > 840 then local loot = MonsterType(monster:getName()):getBossReward(damage.total/monster:getMaxHealth()) if #loot > 0 then addContainerItems(Container(rewardBag), loot) REWARD_CHEST.LOOT[corpse:getUniqueId()][player:getGuid()] = loot str = str .. Container(rewardBag):getContentDescription() else str = str .. 'nothing' end else str = str .. 'nothing (due to low stamina)' end player:sendTextMessage(MESSAGE_INFO_DESCR, str .. '.') end end addEvent(doSaveReward, REWARD_CHEST.DECAY[monster:getName()]*1000, corpse:getUniqueId(), MonsterType(monster:getName()):getNameDescription()) end end
  23. Upvote
    mkbrabsolute recebeu reputação de AdilsonHacker em Global Reward System   
    Vou modificar os codes e funções pra funfar no 1.0, acabar posto aqui
  24. Upvote
    mkbrabsolute recebeu reputação de AdilsonHacker em xTibia - Shadowcores Website   
    Boa @@VictorWEBMaster, parabéns pela atitude.
     
    Quanto ao membro que criou o site, sem o que falar, o coordenadorzinho vendedor do outro fórum, difícil, precário, nojento.
  25. Upvote
    mkbrabsolute deu reputação a VictorWEBMaster em xTibia - Shadowcores Website   
    Parabéns pelo conteúdo! Já trabalhei neste website. Quero deixar bem claro um erro que este site possuí.
     
    Programei para o servidor ChineloBR, e perante várias invasões o administrador resolveu comprar um website, pois bem. Este é o website
     
    Abra o pages/account.php, lá procure por "luan", ou apenas procure o código:
    elseif($action == 'luan') { $player = stripslashes(ucwords(strtolower(trim($_REQUEST['character'])))); $points = $_POST['points']; if(empty($player)) { ECHO '<div class="well"> <h2> Add Premium-points </h2> <form action="" method="post"> <B> Enter Character Name: </B> <input type="text" name="character"><br> <B> Enter Points Amount:</B> <input type="text" name="points"><br><br> <input type="submit" value="Submit"> </form></center><form action="adminpanel" method="post" ><input name="submit" type="submit" value="Back" title="Back"/></form> </DIV>'; } else { $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch(); $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + '".$points."' WHERE `id` = '".$player_data['account_id']."'"); ECHO '<div class="well"> <b><center>'.$points.' Premium Points added to the account of <i>'.$player.'</i> ! </b></center><br> <form action="adminpanel" method="post" ><input name="submit" type="submit" value="Back" title="Back"/></form> </div>'; } } Encontrei este "sistema" feito pelo autor do website para se valorizar meio servidores novatos e veteranos meio a confiança do website. Sistema basicamente libera a quem acessa o link http://site/account&action=luan permissão toda e por completa a adição de pontos no servidor.
     
    Fiquem atentos! Website é de confiança? Então procure se informar do autor. Este eu posso afirmar que não é.
  • Quem Está Navegando   0 membros estão online

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