Ir para conteúdo
Banner com Efeitos

warotserv

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    warotserv recebeu reputação de carlos2608 em [CreatureEvent] Anti Fast-attack Elf Bot   
    Bom... decidi postar agora o script que eu fiz para barrar os botters de fast attack.

    Primeiro, crie um arquivo chamado "antiBot.lua" em "data\creaturescripts\scripts" e nele adicione o seguinte conteúdo:
    -- counts physicals, casts .... [player name : creature cid] playerAttacksMade = {} playerActivateTime = {} playerBlocked = {} function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function onLogin(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Loading Anti Bot... done.' ) playerAttacksMade[cid] = {} playerActivateTime[cid] = {} playerBlocked[cid] = false end return true end function onLogout(cid) if isPlayer(cid) then playerAttacksMade[cid] = nil playerActivateTime[cid] = nil playerBlocked[cid] = nil end return true end function onStatsChange(cid, attacker, type, combat, value) local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } if not type == STATSCHANGE_HEALTHLOSS or not isPlayer(attacker) then return true end if value <= 0 then return true end if playerAttacksMade[attacker][cid] == nil then playerAttacksMade[attacker][cid] = 0 playerActivateTime[attacker][cid] = os.time() end local currentTime = os.time() --TESTE --doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_ORANGE, playerAttacksMade[attacker][cid] .. '________' .. attacker .. '_____' .. cid .. '______' .. currentTime .. '_______' .. playerActivateTime[attacker][cid] ) if currentTime >= playerActivateTime[attacker][cid] then playerActivateTime[attacker][cid] = currentTime + 1 playerAttacksMade[attacker][cid] = 0 else playerAttacksMade[attacker][cid] = playerAttacksMade[attacker][cid] + 1 end if playerAttacksMade[attacker][cid] > maxAttacks[getPlayerVocation(attacker)] then playerBlocked[attacker] = true doBroadcastMessage('O player ' .. getPlayerName(attacker) .. ' esta usando bot de fast attack. O seu ataque foi travado ate que ele relogue.', 21) doShowTextDialog(attacker,1952,"PARE DE USAR ELFBOT! Seu ataque foi bloqueado. Para destravar basta relogar. Obrigado. (Sistema exclusivo do ot)") return FALSE end return TRUE end function onCombat(cid, target) if isPlayer(cid) then if not playerBlocked[cid] then registerCreatureEvent(target, "AntiBot2") else return false end end return true end function onCast(cid, target) if isPlayer(cid) then if playerBlocked[cid] then return false end end return true end e em "creaturescripts.xml", encontrado em "data\creaturescripts" adicione:
    <event type="combat" name="AntiBot1" event="script" value="antiBot.lua"/> <event type="statschange" name="AntiBot2" event="script" value="antiBot.lua"/> <event type="login" name="AntiBot3" event="script" value="antiBot.lua"/> <event type="logout" name="AntiBot4" event="script" value="antiBot.lua"/> <event type="cast" name="AntiBot5" event="script" value="antiBot.lua"/> Agora vou explicar a parte configurável:

     
    local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } Aqui você vai modificar qual o número máximo de ações de combate (que dão dano) que certa vocação poderá dar. Posição 1 é Sorcerer, 2 é Druid, 3 é Paladin, 4 é Knight e assim por diante....
    Escolha bem esses números! Caso você erre, ele irá ficar detectando erradamente.
     
    Por exemplo,vamos supor que o knight tenha o fastAttack em 500ms (logo ele executará 2 ataques por segundo) e que sua magia de dano de menor exhaust tenha um exhaust de apenas 600ms, logo o numero maximo de ataques dele por segundo será 4 (cuidado quando spells de dano diferentes puderem ser usadas ao mesmo tempo, daí você terá de acrescentar mais 1 ao número de ataques por segundo.
     
    Por favor, testem e me falem o que acharam.
     
     
    Espero que ajude a tirar os botters de seu server.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums. É bom espalhar esse script uma vez que botters nos servers 8.6 é muito comum.
     
  2. Gostei
    warotserv recebeu reputação de Infused em [Movement] Tile Trainer   
    Outro script que fiz e estou disponibilizando: Tile Trainer

    O que ele faz? Enquanto o player estiver em um tile que possui determinada action id, ele vai ficar treinando suas habilidades.
     
    Primeiro, em "movements\scripts" crie um arquivo chamado "skill.lua". Feito isso, coloque em seu conteúdo o seguinte texto:
    local delay = 200 local FIST = 0 local CLUB = 1 local SWORD = 2 local AXE = 3 local DISTANCE = 4 local SHIELDING = 5 local FISHING = 6 function samePos(pos1, pos2) if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then return true else return false end end function addSkillFunction(cid, item, position) if not isPlayer(cid) == TRUE then return FALSE end local playerPos = getCreaturePosition(cid) if not samePos(position,playerPos) then return FALSE end if (isKnight(cid) == TRUE) then doPlayerAddSkillTry(cid, FIST, 1) doPlayerAddSkillTry(cid, CLUB, 1) doPlayerAddSkillTry(cid, SWORD, 1) doPlayerAddSkillTry(cid, AXE, 1) doPlayerAddSkillTry(cid, SHIELDING, 1) doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) doSendMagicEffect(position, 2) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end if (isPaladin(cid) == TRUE) then doPlayerAddSkillTry(cid, DISTANCE, 1) doPlayerAddSkillTry(cid, SHIELDING, 1) doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) doSendMagicEffect(position, 5) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end if (isSorcerer(cid) == TRUE or isDruid(cid)) then doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end return FALSE end function onStepIn(cid, item, position) if isPlayer(cid) then local playerPos = getCreaturePosition(cid) addEvent(addSkillFunction,delay,cid, item, position) doPlayerSendTextMessage(cid, 25, "TREINANDO") end return true end depois, em "movements.xml" adicione a seguinte linha:

     
    <movevent type="StepIn" actionid="8585" script="skill.lua"/> Bom, é isso. Acho que não precisa explicar, está bem fácil de entender e alterar o código.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  3. Gostei
    warotserv recebeu reputação de Magalhaes92 em [CreatureEvent] Anti Fast-attack Elf Bot   
    Bom... decidi postar agora o script que eu fiz para barrar os botters de fast attack.

    Primeiro, crie um arquivo chamado "antiBot.lua" em "data\creaturescripts\scripts" e nele adicione o seguinte conteúdo:
    -- counts physicals, casts .... [player name : creature cid] playerAttacksMade = {} playerActivateTime = {} playerBlocked = {} function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function onLogin(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Loading Anti Bot... done.' ) playerAttacksMade[cid] = {} playerActivateTime[cid] = {} playerBlocked[cid] = false end return true end function onLogout(cid) if isPlayer(cid) then playerAttacksMade[cid] = nil playerActivateTime[cid] = nil playerBlocked[cid] = nil end return true end function onStatsChange(cid, attacker, type, combat, value) local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } if not type == STATSCHANGE_HEALTHLOSS or not isPlayer(attacker) then return true end if value <= 0 then return true end if playerAttacksMade[attacker][cid] == nil then playerAttacksMade[attacker][cid] = 0 playerActivateTime[attacker][cid] = os.time() end local currentTime = os.time() --TESTE --doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_ORANGE, playerAttacksMade[attacker][cid] .. '________' .. attacker .. '_____' .. cid .. '______' .. currentTime .. '_______' .. playerActivateTime[attacker][cid] ) if currentTime >= playerActivateTime[attacker][cid] then playerActivateTime[attacker][cid] = currentTime + 1 playerAttacksMade[attacker][cid] = 0 else playerAttacksMade[attacker][cid] = playerAttacksMade[attacker][cid] + 1 end if playerAttacksMade[attacker][cid] > maxAttacks[getPlayerVocation(attacker)] then playerBlocked[attacker] = true doBroadcastMessage('O player ' .. getPlayerName(attacker) .. ' esta usando bot de fast attack. O seu ataque foi travado ate que ele relogue.', 21) doShowTextDialog(attacker,1952,"PARE DE USAR ELFBOT! Seu ataque foi bloqueado. Para destravar basta relogar. Obrigado. (Sistema exclusivo do ot)") return FALSE end return TRUE end function onCombat(cid, target) if isPlayer(cid) then if not playerBlocked[cid] then registerCreatureEvent(target, "AntiBot2") else return false end end return true end function onCast(cid, target) if isPlayer(cid) then if playerBlocked[cid] then return false end end return true end e em "creaturescripts.xml", encontrado em "data\creaturescripts" adicione:
    <event type="combat" name="AntiBot1" event="script" value="antiBot.lua"/> <event type="statschange" name="AntiBot2" event="script" value="antiBot.lua"/> <event type="login" name="AntiBot3" event="script" value="antiBot.lua"/> <event type="logout" name="AntiBot4" event="script" value="antiBot.lua"/> <event type="cast" name="AntiBot5" event="script" value="antiBot.lua"/> Agora vou explicar a parte configurável:

     
    local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } Aqui você vai modificar qual o número máximo de ações de combate (que dão dano) que certa vocação poderá dar. Posição 1 é Sorcerer, 2 é Druid, 3 é Paladin, 4 é Knight e assim por diante....
    Escolha bem esses números! Caso você erre, ele irá ficar detectando erradamente.
     
    Por exemplo,vamos supor que o knight tenha o fastAttack em 500ms (logo ele executará 2 ataques por segundo) e que sua magia de dano de menor exhaust tenha um exhaust de apenas 600ms, logo o numero maximo de ataques dele por segundo será 4 (cuidado quando spells de dano diferentes puderem ser usadas ao mesmo tempo, daí você terá de acrescentar mais 1 ao número de ataques por segundo.
     
    Por favor, testem e me falem o que acharam.
     
     
    Espero que ajude a tirar os botters de seu server.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums. É bom espalhar esse script uma vez que botters nos servers 8.6 é muito comum.
     
  4. Gostei
    warotserv recebeu reputação de hubulufuss em [CreatureEvent] Anti Fast-attack Elf Bot   
    Bom... decidi postar agora o script que eu fiz para barrar os botters de fast attack.

    Primeiro, crie um arquivo chamado "antiBot.lua" em "data\creaturescripts\scripts" e nele adicione o seguinte conteúdo:
    -- counts physicals, casts .... [player name : creature cid] playerAttacksMade = {} playerActivateTime = {} playerBlocked = {} function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function onLogin(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Loading Anti Bot... done.' ) playerAttacksMade[cid] = {} playerActivateTime[cid] = {} playerBlocked[cid] = false end return true end function onLogout(cid) if isPlayer(cid) then playerAttacksMade[cid] = nil playerActivateTime[cid] = nil playerBlocked[cid] = nil end return true end function onStatsChange(cid, attacker, type, combat, value) local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } if not type == STATSCHANGE_HEALTHLOSS or not isPlayer(attacker) then return true end if value <= 0 then return true end if playerAttacksMade[attacker][cid] == nil then playerAttacksMade[attacker][cid] = 0 playerActivateTime[attacker][cid] = os.time() end local currentTime = os.time() --TESTE --doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_ORANGE, playerAttacksMade[attacker][cid] .. '________' .. attacker .. '_____' .. cid .. '______' .. currentTime .. '_______' .. playerActivateTime[attacker][cid] ) if currentTime >= playerActivateTime[attacker][cid] then playerActivateTime[attacker][cid] = currentTime + 1 playerAttacksMade[attacker][cid] = 0 else playerAttacksMade[attacker][cid] = playerAttacksMade[attacker][cid] + 1 end if playerAttacksMade[attacker][cid] > maxAttacks[getPlayerVocation(attacker)] then playerBlocked[attacker] = true doBroadcastMessage('O player ' .. getPlayerName(attacker) .. ' esta usando bot de fast attack. O seu ataque foi travado ate que ele relogue.', 21) doShowTextDialog(attacker,1952,"PARE DE USAR ELFBOT! Seu ataque foi bloqueado. Para destravar basta relogar. Obrigado. (Sistema exclusivo do ot)") return FALSE end return TRUE end function onCombat(cid, target) if isPlayer(cid) then if not playerBlocked[cid] then registerCreatureEvent(target, "AntiBot2") else return false end end return true end function onCast(cid, target) if isPlayer(cid) then if playerBlocked[cid] then return false end end return true end e em "creaturescripts.xml", encontrado em "data\creaturescripts" adicione:
    <event type="combat" name="AntiBot1" event="script" value="antiBot.lua"/> <event type="statschange" name="AntiBot2" event="script" value="antiBot.lua"/> <event type="login" name="AntiBot3" event="script" value="antiBot.lua"/> <event type="logout" name="AntiBot4" event="script" value="antiBot.lua"/> <event type="cast" name="AntiBot5" event="script" value="antiBot.lua"/> Agora vou explicar a parte configurável:

     
    local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } Aqui você vai modificar qual o número máximo de ações de combate (que dão dano) que certa vocação poderá dar. Posição 1 é Sorcerer, 2 é Druid, 3 é Paladin, 4 é Knight e assim por diante....
    Escolha bem esses números! Caso você erre, ele irá ficar detectando erradamente.
     
    Por exemplo,vamos supor que o knight tenha o fastAttack em 500ms (logo ele executará 2 ataques por segundo) e que sua magia de dano de menor exhaust tenha um exhaust de apenas 600ms, logo o numero maximo de ataques dele por segundo será 4 (cuidado quando spells de dano diferentes puderem ser usadas ao mesmo tempo, daí você terá de acrescentar mais 1 ao número de ataques por segundo.
     
    Por favor, testem e me falem o que acharam.
     
     
    Espero que ajude a tirar os botters de seu server.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums. É bom espalhar esse script uma vez que botters nos servers 8.6 é muito comum.
     
  5. Gostei
    warotserv recebeu reputação de Vodkart em [CreatureEvent] Anti Fast-attack Elf Bot   
    Bom... decidi postar agora o script que eu fiz para barrar os botters de fast attack.

    Primeiro, crie um arquivo chamado "antiBot.lua" em "data\creaturescripts\scripts" e nele adicione o seguinte conteúdo:
    -- counts physicals, casts .... [player name : creature cid] playerAttacksMade = {} playerActivateTime = {} playerBlocked = {} function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function onLogin(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Loading Anti Bot... done.' ) playerAttacksMade[cid] = {} playerActivateTime[cid] = {} playerBlocked[cid] = false end return true end function onLogout(cid) if isPlayer(cid) then playerAttacksMade[cid] = nil playerActivateTime[cid] = nil playerBlocked[cid] = nil end return true end function onStatsChange(cid, attacker, type, combat, value) local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } if not type == STATSCHANGE_HEALTHLOSS or not isPlayer(attacker) then return true end if value <= 0 then return true end if playerAttacksMade[attacker][cid] == nil then playerAttacksMade[attacker][cid] = 0 playerActivateTime[attacker][cid] = os.time() end local currentTime = os.time() --TESTE --doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_ORANGE, playerAttacksMade[attacker][cid] .. '________' .. attacker .. '_____' .. cid .. '______' .. currentTime .. '_______' .. playerActivateTime[attacker][cid] ) if currentTime >= playerActivateTime[attacker][cid] then playerActivateTime[attacker][cid] = currentTime + 1 playerAttacksMade[attacker][cid] = 0 else playerAttacksMade[attacker][cid] = playerAttacksMade[attacker][cid] + 1 end if playerAttacksMade[attacker][cid] > maxAttacks[getPlayerVocation(attacker)] then playerBlocked[attacker] = true doBroadcastMessage('O player ' .. getPlayerName(attacker) .. ' esta usando bot de fast attack. O seu ataque foi travado ate que ele relogue.', 21) doShowTextDialog(attacker,1952,"PARE DE USAR ELFBOT! Seu ataque foi bloqueado. Para destravar basta relogar. Obrigado. (Sistema exclusivo do ot)") return FALSE end return TRUE end function onCombat(cid, target) if isPlayer(cid) then if not playerBlocked[cid] then registerCreatureEvent(target, "AntiBot2") else return false end end return true end function onCast(cid, target) if isPlayer(cid) then if playerBlocked[cid] then return false end end return true end e em "creaturescripts.xml", encontrado em "data\creaturescripts" adicione:
    <event type="combat" name="AntiBot1" event="script" value="antiBot.lua"/> <event type="statschange" name="AntiBot2" event="script" value="antiBot.lua"/> <event type="login" name="AntiBot3" event="script" value="antiBot.lua"/> <event type="logout" name="AntiBot4" event="script" value="antiBot.lua"/> <event type="cast" name="AntiBot5" event="script" value="antiBot.lua"/> Agora vou explicar a parte configurável:

     
    local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } Aqui você vai modificar qual o número máximo de ações de combate (que dão dano) que certa vocação poderá dar. Posição 1 é Sorcerer, 2 é Druid, 3 é Paladin, 4 é Knight e assim por diante....
    Escolha bem esses números! Caso você erre, ele irá ficar detectando erradamente.
     
    Por exemplo,vamos supor que o knight tenha o fastAttack em 500ms (logo ele executará 2 ataques por segundo) e que sua magia de dano de menor exhaust tenha um exhaust de apenas 600ms, logo o numero maximo de ataques dele por segundo será 4 (cuidado quando spells de dano diferentes puderem ser usadas ao mesmo tempo, daí você terá de acrescentar mais 1 ao número de ataques por segundo.
     
    Por favor, testem e me falem o que acharam.
     
     
    Espero que ajude a tirar os botters de seu server.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums. É bom espalhar esse script uma vez que botters nos servers 8.6 é muito comum.
     
  6. Gostei
    warotserv recebeu reputação de Bruno Carvalho em [Movement] Tile Teleporter (random)   
    Boa noite novamente, agora vou postar outro script que fiz que faz com que, quando um player pisar em um tile com determinada action ID, seja teletransportado para uma lugar randômico.
     
    Primeiramente, crie um arquivo em "data\movements\scripts" chamado "tileTeleporter.lua" e copie o seguinte conteúdo para dentro dele
    local teleportPoints = { [ 0] = {x = 210, y = 190, z = 7}, [ 1] = {x = 233, y = 196, z = 7}, [ 2] = {x = 243, y = 188, z = 7}, [ 3] = {x = 254, y = 180, z = 7}, [ 4] = {x = 231, y = 160, z = 7}, [ 5] = {x = 212, y = 158, z = 7}, [ 6] = {x = 212, y = 170, z = 7}, [ 7] = {x = 227, y = 171, z = 7}, [ 8] = {x = 266, y = 149, z = 7}, [ 9] = {x = 234, y = 140, z = 7}, [10] = {x = 205, y = 143, z = 7}, [11] = {x = 177, y = 126, z = 7}, [12] = {x = 290, y = 177, z = 6}, [13] = {x = 219, y = 185, z = 6}, [14] = {x = 261, y = 167, z = 6}, [15] = {x = 270, y = 167, z = 8} } function onStepIn(cid, item, position) if isPlayer(cid) then local position = teleportPoints[math.random(0,15)] doTeleportThing(cid, position) end return true end agora, em "movements.xml" cole a seguinte linha de código
    <movevent type="StepIn" actionid="8586" script="tileTeleporter.lua"/> Bom, é isso. Acho que não precisa explicar, está bem fácil de entender e alterar o código.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  7. Gostei
    warotserv recebeu reputação de dyroz em [Movement] Tile Trainer   
    Outro script que fiz e estou disponibilizando: Tile Trainer

    O que ele faz? Enquanto o player estiver em um tile que possui determinada action id, ele vai ficar treinando suas habilidades.
     
    Primeiro, em "movements\scripts" crie um arquivo chamado "skill.lua". Feito isso, coloque em seu conteúdo o seguinte texto:
    local delay = 200 local FIST = 0 local CLUB = 1 local SWORD = 2 local AXE = 3 local DISTANCE = 4 local SHIELDING = 5 local FISHING = 6 function samePos(pos1, pos2) if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then return true else return false end end function addSkillFunction(cid, item, position) if not isPlayer(cid) == TRUE then return FALSE end local playerPos = getCreaturePosition(cid) if not samePos(position,playerPos) then return FALSE end if (isKnight(cid) == TRUE) then doPlayerAddSkillTry(cid, FIST, 1) doPlayerAddSkillTry(cid, CLUB, 1) doPlayerAddSkillTry(cid, SWORD, 1) doPlayerAddSkillTry(cid, AXE, 1) doPlayerAddSkillTry(cid, SHIELDING, 1) doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) doSendMagicEffect(position, 2) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end if (isPaladin(cid) == TRUE) then doPlayerAddSkillTry(cid, DISTANCE, 1) doPlayerAddSkillTry(cid, SHIELDING, 1) doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) doSendMagicEffect(position, 5) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end if (isSorcerer(cid) == TRUE or isDruid(cid)) then doPlayerAddMana(cid,80) doPlayerAddSpentMana(cid, 80) addEvent(addSkillFunction,delay,cid, item, position) return TRUE end return FALSE end function onStepIn(cid, item, position) if isPlayer(cid) then local playerPos = getCreaturePosition(cid) addEvent(addSkillFunction,delay,cid, item, position) doPlayerSendTextMessage(cid, 25, "TREINANDO") end return true end depois, em "movements.xml" adicione a seguinte linha:

     
    <movevent type="StepIn" actionid="8585" script="skill.lua"/> Bom, é isso. Acho que não precisa explicar, está bem fácil de entender e alterar o código.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  8. Gostei
    warotserv recebeu reputação de Chiitus em [CreatureEvent] Anti Fast-attack Elf Bot   
    Bom... decidi postar agora o script que eu fiz para barrar os botters de fast attack.

    Primeiro, crie um arquivo chamado "antiBot.lua" em "data\creaturescripts\scripts" e nele adicione o seguinte conteúdo:
    -- counts physicals, casts .... [player name : creature cid] playerAttacksMade = {} playerActivateTime = {} playerBlocked = {} function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function onLogin(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Loading Anti Bot... done.' ) playerAttacksMade[cid] = {} playerActivateTime[cid] = {} playerBlocked[cid] = false end return true end function onLogout(cid) if isPlayer(cid) then playerAttacksMade[cid] = nil playerActivateTime[cid] = nil playerBlocked[cid] = nil end return true end function onStatsChange(cid, attacker, type, combat, value) local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } if not type == STATSCHANGE_HEALTHLOSS or not isPlayer(attacker) then return true end if value <= 0 then return true end if playerAttacksMade[attacker][cid] == nil then playerAttacksMade[attacker][cid] = 0 playerActivateTime[attacker][cid] = os.time() end local currentTime = os.time() --TESTE --doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_ORANGE, playerAttacksMade[attacker][cid] .. '________' .. attacker .. '_____' .. cid .. '______' .. currentTime .. '_______' .. playerActivateTime[attacker][cid] ) if currentTime >= playerActivateTime[attacker][cid] then playerActivateTime[attacker][cid] = currentTime + 1 playerAttacksMade[attacker][cid] = 0 else playerAttacksMade[attacker][cid] = playerAttacksMade[attacker][cid] + 1 end if playerAttacksMade[attacker][cid] > maxAttacks[getPlayerVocation(attacker)] then playerBlocked[attacker] = true doBroadcastMessage('O player ' .. getPlayerName(attacker) .. ' esta usando bot de fast attack. O seu ataque foi travado ate que ele relogue.', 21) doShowTextDialog(attacker,1952,"PARE DE USAR ELFBOT! Seu ataque foi bloqueado. Para destravar basta relogar. Obrigado. (Sistema exclusivo do ot)") return FALSE end return TRUE end function onCombat(cid, target) if isPlayer(cid) then if not playerBlocked[cid] then registerCreatureEvent(target, "AntiBot2") else return false end end return true end function onCast(cid, target) if isPlayer(cid) then if playerBlocked[cid] then return false end end return true end e em "creaturescripts.xml", encontrado em "data\creaturescripts" adicione:
    <event type="combat" name="AntiBot1" event="script" value="antiBot.lua"/> <event type="statschange" name="AntiBot2" event="script" value="antiBot.lua"/> <event type="login" name="AntiBot3" event="script" value="antiBot.lua"/> <event type="logout" name="AntiBot4" event="script" value="antiBot.lua"/> <event type="cast" name="AntiBot5" event="script" value="antiBot.lua"/> Agora vou explicar a parte configurável:

     
    local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } Aqui você vai modificar qual o número máximo de ações de combate (que dão dano) que certa vocação poderá dar. Posição 1 é Sorcerer, 2 é Druid, 3 é Paladin, 4 é Knight e assim por diante....
    Escolha bem esses números! Caso você erre, ele irá ficar detectando erradamente.
     
    Por exemplo,vamos supor que o knight tenha o fastAttack em 500ms (logo ele executará 2 ataques por segundo) e que sua magia de dano de menor exhaust tenha um exhaust de apenas 600ms, logo o numero maximo de ataques dele por segundo será 4 (cuidado quando spells de dano diferentes puderem ser usadas ao mesmo tempo, daí você terá de acrescentar mais 1 ao número de ataques por segundo.
     
    Por favor, testem e me falem o que acharam.
     
     
    Espero que ajude a tirar os botters de seu server.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums. É bom espalhar esse script uma vez que botters nos servers 8.6 é muito comum.
     
  9. Gostei
    warotserv recebeu reputação de Cat em [FCTF] Flexible Capture The Flag   
    Nome: FCTF (Ou o que você escolher  
    Versão: 8.60
    Banco de Dados: MySQL
    Créditos: À quem fez o Warots (por ter sido apenas a base). - não quero créditos pelo o que eu fiz.
    _______________________________________________________________________________________
     
    Qual a diferença do FCTF para o CTF?
    O FCTF, ao contrário do CTF, é flexível em relação à quantidade de times.
     
    Posso configurar alguma coisa nesse ot?
    Sim.
     
    Onde posso configurar?
    Em "mods/ctf.xml".
     
    O que posso configurar?
    Segue abaixo, comentado.
    -- initial level INITIAL_LEVEL = 450 __________________________________________________________________ -- initial items sorcereritems = { 2520, -- demon shield 2187, -- wand of inferno 8871, -- blue robe 7730, -- blue legs 2323, -- magician hat 2195 -- boots of haste } druiditems = { 2520, -- demon shield 2183, -- hailstorm rod 8871, -- blue robe 7730, -- blue legs 2323, -- magician hat 2195 -- boots of haste } paladinitems = { 2520, -- demon shield 7368, -- assassin star 2492, -- golden armor 7730, -- golden legs 2498, -- golden helme 2195 -- boots of haste } knightitems = { 2520, -- demon shield 2421, -- thunder hammer 2492, -- golden armor 7730, -- golden legs 2498, -- golden helmet 2195 -- boots of haste } __________________________________________________________________ SCORE_BY_DELIVER = 5 -- when a team delivers an opponent flag SCORE_LOSS_BY_HAVE_FLAG_DELIVERED = 2 -- when a team has it flags delivered by an opponent team __________________________________________________________________ -- by default, the map will change after 900 SECONDS TIME_TO_CHANGE_MAP = 900 -- 15 minutes __________________________________________________________________ -- at each map, which teams will participate? teamsPerMap = { [MAP_1] = {[0] = TEAM_1, [1] = TEAM_2}, [MAP_2] = {[0] = TEAM_1, [1] = TEAM_2}, [MAP_3] = {[0] = TEAM_1, [1] = TEAM_2}, [MAP_4] = {[0] = TEAM_1, [1] = TEAM_2, [2] = TEAM_3, [3] = TEAM_4}, [MAP_5] = {[0] = TEAM_1, [1] = TEAM_2, [2] = TEAM_3, [3] = TEAM_4}, [MAP_6] = {[0] = TEAM_1, [1] = TEAM_2, [2] = TEAM_3, [3] = TEAM_4} } __________________________________________________________________ -- name of teams teamName = { [TEAM_1] = "A", [TEAM_2] = "B", [TEAM_3] = "C", [TEAM_4] = "D" } __________________________________________________________________ -- id of flags flagItem = { [TEAM_1] = 1860, -- green [TEAM_2] = 1863, -- yellow [TEAM_3] = 1872, -- blue [TEAM_4] = 1880 -- white } __________________________________________________________________ -- DO NOT CHANGE IF YOU DON'T KNOW WHAT ARE YOU DOING! flagUID = { [TEAM_1] = 50000, [TEAM_2] = 50001, [TEAM_3] = 50002, [TEAM_4] = 50003 } __________________________________________________________________ -- DO NOT CHANGE IF YOU DON'T KNOW WHAT ARE YOU DOING! flagCoverUID = { [TEAM_1] = 50020, [TEAM_2] = 50021, [TEAM_3] = 50022, [TEAM_4] = 50023 } __________________________________________________________________ -- flag positions per MAP flagPosition = { [MAP_1] = { [TEAM_1] = {x = 289, y = 514, z = 4}, [TEAM_2] = {x = 404, y = 513, z = 4} }, [MAP_2] = { [TEAM_1] = {x = 267, y = 329, z = 4}, [TEAM_2] = {x = 333, y = 329, z = 4} }, [MAP_3] = { [TEAM_1] = {x = 241, y = 100, z = 6}, [TEAM_2] = {x = 307, y = 101, z = 6} }, [MAP_4] = { [TEAM_1] = {x = 88, y = 134, z = 5}, [TEAM_2] = {x = 125, y = 174, z = 6}, [TEAM_3] = {x = 151, y = 139, z = 5}, [TEAM_4] = {x = 123, y = 115, z = 5} }, [MAP_5] = { [TEAM_1] = {x = 106, y = 315, z = 6}, [TEAM_2] = {x = 162, y = 382, z = 6}, [TEAM_3] = {x = 215, y = 325, z = 6}, [TEAM_4] = {x = 163, y = 287, z = 6} }, [MAP_6] = { [TEAM_1] = {x = 102, y = 538, z = 7}, [TEAM_2] = {x = 182, y = 534, z = 7}, [TEAM_3] = {x = 181, y = 467, z = 7}, [TEAM_4] = {x = 99, y = 465, z = 7} } } __________________________________________________________________ -- outfit of teams teamLook = { [TEAM_1] = { [V_S] = {lookType = 130, lookHead = 81, lookBody = 81, lookLegs = 81, lookFeet = 81, lookTypeEx = 0, lookAddons = 3}, [V_D] = {lookType = 144, lookHead = 81, lookBody = 81, lookLegs = 81, lookFeet = 81, lookTypeEx = 0, lookAddons = 3}, [V_P] = {lookType = 129, lookHead = 81, lookBody = 81, lookLegs = 81, lookFeet = 81, lookTypeEx = 0, lookAddons = 3}, [V_K] = {lookType = 131, lookHead = 81, lookBody = 81, lookLegs = 81, lookFeet = 81, lookTypeEx = 0, lookAddons = 3} }, [TEAM_2] = { [V_S] = {lookType = 130, lookHead = 79, lookBody = 79, lookLegs = 79, lookFeet = 79, lookTypeEx = 0, lookAddons = 3}, [V_D] = {lookType = 144, lookHead = 79, lookBody = 79, lookLegs = 79, lookFeet = 79, lookTypeEx = 0, lookAddons = 3}, [V_P] = {lookType = 129, lookHead = 79, lookBody = 79, lookLegs = 79, lookFeet = 79, lookTypeEx = 0, lookAddons = 3}, [V_K] = {lookType = 131, lookHead = 79, lookBody = 79, lookLegs = 79, lookFeet = 79, lookTypeEx = 0, lookAddons = 3} }, [TEAM_3] = { [V_S] = {lookType = 130, lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3}, [V_D] = {lookType = 144, lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3}, [V_P] = {lookType = 129, lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3}, [V_K] = {lookType = 131, lookHead = 88, lookBody = 88, lookLegs = 88, lookFeet = 88, lookTypeEx = 0, lookAddons = 3} }, [TEAM_4] = { [V_S] = {lookType = 130, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}, [V_D] = {lookType = 144, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}, [V_P] = {lookType = 129, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3}, [V_K] = {lookType = 131, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} } } __________________________________________________________________ -- teams spawns points per map spawnPoints = { [MAP_1] = { [TEAM_1] = {x = 288, y = 521, z = 6}, [TEAM_2] = {x = 400, y = 515, z = 6} }, [MAP_2] = { [TEAM_1] = {x = 267, y = 329, z = 3}, [TEAM_2] = {x = 333, y = 329, z = 3} }, [MAP_3] = { [TEAM_1] = {x = 242, y = 100, z = 7}, [TEAM_2] = {x = 306, y = 101, z = 7} }, [MAP_4] = { [TEAM_1] = {x = 82, y = 137, z = 6}, [TEAM_2] = {x = 125, y = 170, z = 5}, [TEAM_3] = {x = 138, y = 137, z = 4}, [TEAM_4] = {x = 117, y = 118, z = 6} }, [MAP_5] = { [TEAM_1] = {x = 103, y = 322, z = 7}, [TEAM_2] = {x = 155, y = 384, z = 7}, [TEAM_3] = {x = 217, y = 332, z = 7}, [TEAM_4] = {x = 170, y = 285, z = 7} }, [MAP_6] = { [TEAM_1] = {x = 141, y = 505, z = 7}, [TEAM_2] = {x = 147, y = 505, z = 7}, [TEAM_3] = {x = 147, y = 499, z = 7}, [TEAM_4] = {x = 141, y = 499, z = 7} } } __________________________________________________________________ -- sorcerer initial skills V_S_SKILLS = { ML = '118', SHIELDING = '50' } __________________________________________________________________ -- druid initial skills V_D_SKILLS = { ML = '118', SHIELDING = '50' } __________________________________________________________________ -- paladin initial skills V_P_SKILLS = { ML = '30', DISTANCE = '136', SHIELDING = '125' } __________________________________________________________________ -- knight initial skills V_K_SKILLS = { ML = '10', CLUB = '125', SWORD = '125', AXE = '125', SHIELDING = '125' } Onde posso fazer o download do servidor?
    Em: http://www.4shared.com/zip/lITbrSUj/CTF.html
     
    Onde posso visualizar o scan do arquivo?
    Em: https://www.virustotal.com/pt/file/256a6bb1db2d6ce3fbe27faf88a9e1c4a11f4c66f006bf547b7f7eaa32159139/analysis/1380406216/
     
    Até.
  10. Gostei
    warotserv recebeu reputação de Alienbear em [Resolvido] Codigo Porcentagem   
    Se eu não me engano, unit_16 é um unsigned integer de 16 bits, cujos valores variam de 0 a 65535. tente trocar para uint_32 ou uint_64.
  11. Gostei
    warotserv recebeu reputação de Alienbear em [Resolvido] Codigo Porcentagem   
    Na verdade ele fica com "slots extras" de hp/mana. Está tudo normal
     
    Creio que para mostrar a quantidade correta de mana/hp somente mexendo no client.
  12. Gostei
    warotserv recebeu reputação de Chiitus em [CreatureEvent] PvP Team   
    Este sistema faz com que o server seja divido em 2 times, o time vermelho e o time azul.
     
    em "data\creaturescripts\scripts" crie um arquivo chamado "pvpTeam.lua" e cole o seguinte código
    redTeamSpawn = { x = 218, y = 172, z = 7} -- red team spawn position blueTeamSpawn = { x = 218, y = 170, z = 7} -- blue team spawn position redTeamParticipants = {} blueTeamParticipants = {} function teamLength(team) -- return the number of players in team local count = 0 for _ in pairs(team) do count = count + 1 end return count end function playerJoin(cid) -- try to join player in event if ableToJoin(cid) then redTeamParticipantsLength = teamLength(redTeamParticipants) blueTeamParticipantsLength = teamLength(blueTeamParticipants) if redTeamParticipantsLength <= blueTeamParticipantsLength then redTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time vermelho.") doTeleportThing(cid, redTeamSpawn) else blueTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time azul.") doTeleportThing(cid, blueTeamSpawn) end return TRUE else return FALSE end end function playerRemove(cid) -- remove player from event (if its participating) if isParticipating(cid) then if redTeamParticipants[cid] == true then redTeamParticipants[cid] = nil else blueTeamParticipants[cid] = nil end return TRUE else return FALSE end end function isParticipating (cid) -- verify if player is participating of the event if blueTeamParticipants[cid] == true or redTeamParticipants[cid] == true then return TRUE else return FALSE end end function ableToJoin (cid) -- checks if players are able to join if isPlayer(cid) and not isParticipating(cid) then return TRUE else return FALSE end end function arePlayersOfSameTeam (cid1, cid2) -- checks if the players are of the same team if ((blueTeamParticipants[cid1] == true and blueTeamParticipants[cid2] == true) or (redTeamParticipants[cid1] and redTeamParticipants[cid2])) then return TRUE else return FALSE end end function onLogin(cid) -- checks if it's really a player and if it's only if isPlayer(cid) then if isParticipating(cid) == true then return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong else if playerJoin(cid) == true then return TRUE -- everything gone as expected else return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong end end else return TRUE end end function onLogout(cid) -- this function is essential to not unbalance the teams if isParticipating (cid) then return playerRemove(cid) end return TRUE end function onAttack(cid, attacker) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- are those players participating of the event? if not isParticipating(cid) or not isParticipating (attacker) then return TRUE end if arePlayersOfSameTeam(cid, attacker) then -- a player of the same team cannot attack the other!! return FALSE else return TRUE end end function onStatsChange(cid, attacker, t, combat, value) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- verify if both are participating of PVP if isParticipating(cid) and isParticipating(attacker) then -- both are participating of event -- verify if both are of the same team if arePlayersOfSameTeam(cid, attacker) then -- they're of the same team. Only heals are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return TRUE else return FALSE end else -- they're not of the same team. Only damages are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return FALSE else return TRUE end end else -- one or both are not participating of event return TRUE end -- getting local player1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if player1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end agora, em "creaturescripts.xml" adicione o seguinte
    <event type="attack" name="PvpTeam1" event="script" value="pvpTeam.lua"/> <event type="statschange" name="PvpTeam2" event="script" value="pvpTeam.lua"/> <event type="login" name="PvpTeam3" event="script" value="pvpTeam.lua"/> <event type="logout" name="PvpTeam4" event="script" value="pvpTeam.lua"/> depois, no arquivo "login.lua" que se encontra em "data\creaturescripts\scripts" adicione
    registerCreatureEvent(cid, "PvpTeam1") registerCreatureEvent(cid, "PvpTeam2") registerCreatureEvent(cid, "PvpTeam3") registerCreatureEvent(cid, "PvpTeam4") Bom, é isso.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  13. Gostei
    warotserv recebeu reputação de Chiitus em [CreatureEvent] Monsters Team   
    Bom, o sistema que se segue eu criei com o intuito de não permitir que determinados monstros deem dano em outros.
     
    Primeiramente, crie um arquivo em "data\creaturescripts\scripts" chamado "monstersTeam.lua" e cole o seguinte conteúdo nele
    monstersTeam = { -- team 1 ["Dragon Hatchling" ] = 1, ["Dragon Lord Hatchling" ] = 1, ["Dragon Lord" ] = 1, ["Dragon" ] = 1, ["Frost Dragon" ] = 1, -- team 2 ["Dwarf Geomancer" ] = 2, ["Dwarf Guard" ] = 2, ["Dwarf Soldier" ] = 2, ["Dwarf" ] = 2 } function onStatsChange(cid, attacker, t, combat, value) if t == STATSCHANGE_HEALTHGAIN then return TRUE end -- getting monster being attacked team local monster1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if monster1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end Depois, em "creaturescripts.xml" adicione a seguinte linha de código
    <event type="statschange" name="MonstersTeam" event="script" value="monstersTeam.lua"/> Em seguida, em todos os monstros que você adicionar ao sistema, em seu arquivo .xml, após a tag de <loot>, adicione o seguinte código
    <script> <event name="MonstersTeam" /> </script> Bom, é isso.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  14. Gostei
    warotserv deu reputação a Jamison Collins em The Forgotten Server 8.6   
    Irei postar um TFS 0.3.7 REV melhor editado sem bugs com suporte para 8.6, com um tutorial de compiling mais fácil.
    Aguarde...
  15. Gostei
    warotserv deu reputação a Cat em [Resolvido] [Dúvida] Dois players em um mesmo char   
    Dúvida sanada, tag adicionada.
    Tópico movido!
  16. Gostei
    warotserv deu reputação a Rodrigo Augusto em [Resolvido] [Dúvida] Dois players em um mesmo char   
    Config.lua
    allowClones = 1
    *Clona 1 ves o mesmo char ao logar ficando dois char com o mesmo nome
    onePlayerOnlinePerAccount = false
    varios players online na mesma conta
  17. Gostei
    warotserv recebeu reputação de Kuchiki Kenpachi em [Resolvido] [Pedido] Sistema de Times para PVP   
    Pronto, sistema testado e funcionando.

    em "data\creaturescripts\scripts" crie um arquivo chamado "pvpTeam.lua" e cole o seguinte código
    redTeamSpawn = { x = 100, y = 100, z = 7} -- red team spawn position blueTeamSpawn = { x = 200, y = 200, z = 7} -- blue team spawn position redTeamParticipants = {} blueTeamParticipants = {} function teamLength(team) -- return the number of players in team local count = 0 for _ in pairs(team) do count = count + 1 end return count end function playerJoin(cid) -- try to join player in event if ableToJoin(cid) then redTeamParticipantsLength = teamLength(redTeamParticipants) blueTeamParticipantsLength = teamLength(blueTeamParticipants) if redTeamParticipantsLength <= blueTeamParticipantsLength then redTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time vermelho.") else blueTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time azul.") end return TRUE else return FALSE end end function playerRemove(cid) -- remove player from event (if its participating) if isParticipating(cid) then if redTeamParticipants[cid] == true then redTeamParticipants[cid] = nil else blueTeamParticipants[cid] = nil end return TRUE else return FALSE end end function isParticipating (cid) -- verify if player is participating of the event if blueTeamParticipants[cid] == true or redTeamParticipants[cid] == true then return TRUE else return FALSE end end function ableToJoin (cid) -- checks if players are able to join if isPlayer(cid) and not isParticipating(cid) then return TRUE else return FALSE end end function arePlayersOfSameTeam (cid1, cid2) -- checks if the players are of the same team if ((blueTeamParticipants[cid1] == true and blueTeamParticipants[cid2] == true) or (redTeamParticipants[cid1] and redTeamParticipants[cid2])) then return TRUE else return FALSE end end function onLogin(cid) -- checks if it's really a player and if it's only if isPlayer(cid) then if isParticipating(cid) == true then return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong else if playerJoin(cid) == true then return TRUE -- everything gone as expected else return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong end end else return TRUE end end function onLogout(cid) -- this function is essential to not unbalance the teams if isParticipating (cid) then return playerRemove(cid) end return TRUE end function onAttack(cid, attacker) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- are those players participating of the event? if not isParticipating(cid) or not isParticipating (attacker) then return TRUE end if arePlayersOfSameTeam(cid, attacker) then -- a player of the same team cannot attack the other!! return FALSE else return TRUE end end function onStatsChange(cid, attacker, t, combat, value) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- verify if both are participating of PVP if isParticipating(cid) and isParticipating(attacker) then -- both are participating of event -- verify if both are of the same team if arePlayersOfSameTeam(cid, attacker) then -- they're of the same team. Only heals are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return TRUE else return FALSE end else -- they're not of the same team. Only damages are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return FALSE else return TRUE end end else -- one or both are not participating of event return TRUE end -- getting local player1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if player1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end agora, em "creaturescripts.xml" adicione o seguinte
    <event type="attack" name="PvpTeam1" event="script" value="pvpTeam.lua"/> <event type="statschange" name="PvpTeam2" event="script" value="pvpTeam.lua"/> <event type="login" name="PvpTeam3" event="script" value="pvpTeam.lua"/> <event type="logout" name="PvpTeam4" event="script" value="pvpTeam.lua"/>  depois, no arquivo "login.lua" que se encontra em "data\creaturescripts\scripts" adicione
    registerCreatureEvent(cid, "PvpTeam1") registerCreatureEvent(cid, "PvpTeam2") registerCreatureEvent(cid, "PvpTeam3") registerCreatureEvent(cid, "PvpTeam4")  Obs: use os spawn points apenas se desejar.
     
    Bom, é isso.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  18. Gostei
    warotserv deu reputação a Cat em OTAvatar Voltou!   
    É Isso mesmo galera, o Avatar (OTAvatar) está de volta, com novidades e novas espectativas.
    Para quem não sabe da história, tudo iniciou com a criação do OTAvatar, onde foram reunidas várias doações de sprites de outros servidores que não deram certo. Gustavo Ferreira começou patrocinando o OTAvatar, dentre toda a história e o inicio do projeto se destacaram algumas figuras de ambos os fóruns,
    Infelizmente, por conta de problemas pessoais o projeto teve que ser cancelado, o site foi fechado, e o projeto arquivado. Agora nos reerguemos, uma equipe antes com mentes fortes se transformou apenas em um projeto antigo tentando voltar a ser o que era quando estava crescendo.
     
    AGRADECIMENTOS
     
    Agradecimentos especiais ao Gustavo e ao Rafael, que foram a base do projeto, pois eu não teria começado sem eles. Também ao Vodkart, ao Comedinhass e ao Insaend, que ajudaram muito a consertar sistemas complicados e essenciais pro servidor.
     
    • • •• • •
     
    Apresentação Geral
     
    O servidor avatar terá 80% das sprites editadas, possivelmente passando para 90%. Dessas, grande parte são doações,  (gostaria que se alguém reconhecesse algum trabalho doado comentasse no tópico para eu adicionar os créditos.). O servidor se baseia no desenho Avatar - A lenda de Aang, pretendemos criar um servidor 100% RPG e diferente que agrade o público.
     
    Equipe Avatar
    • Daniel  (Administrador, RPG Maker, Mapper)
    • Jamison (Administrador, Mapper, Scripter)
    • Ozai (Coadministrador, Designer, Spriter, Scripter)
    • Warotserv (Programador, Scripter)
    • Avuenja (Webmaster)
    • Fawz (Mapper)
     
    Sprites e Mapa
     

     

     

     

     

     

     
    Outfits: Waterbender, Firebender, Earthbender, Airbender e Warrior e Bender;
    Magias: pelo menos 5 sprites de efeitos novos adicionados;
    Sprites de sistemas: Sprite do APA, que foi feita exclusivamente por Insaend entre outras.
     
     
    • •
     

     
    • •
     
    Sistemas
     
    Fly: Dobradores de ar podem voar pelo mapa utilizando um sistema muito criativo;
    Apa: Temos o apa como meio de transporte
    Kyoshi: Os jogadores iniciantes começam na ilha kyoshi e aprendem suas dobras, há muitas quests e RPG;
    Spirit On: Jogadores experientes podem ter acesso ao mundo espiritual, incluindo novas outfits e magias;
    Guerra de Nações: é um evento onde as nações guerreiam, uma quest que todos os jogadores devem fazer, invadir nações inimigas e capturar recompensas.
    Controle de magias: As vocações só poderão usar magia se tiver o elemento por perto, um jarro da água e um lago permitem um waterbender usar a magia como exemplo.
     
    Vocações
     
    Chi Blocker
    Warrior
    Waterbender
    Firebender
    Earthbender
    Airbender
     
    VAGAS
     
    Spriter (com experiência em outfits, magia e itens em geral) (1 vaga)
    Client Maker (Experiente em mexer com client de tibia) (1 vaga)
     
    Em breve mais atualizações.
  19. Gostei
    warotserv recebeu reputação de Jamison Collins em [CreatureEvent] PvP Team   
    Este sistema faz com que o server seja divido em 2 times, o time vermelho e o time azul.
     
    em "data\creaturescripts\scripts" crie um arquivo chamado "pvpTeam.lua" e cole o seguinte código
    redTeamSpawn = { x = 218, y = 172, z = 7} -- red team spawn position blueTeamSpawn = { x = 218, y = 170, z = 7} -- blue team spawn position redTeamParticipants = {} blueTeamParticipants = {} function teamLength(team) -- return the number of players in team local count = 0 for _ in pairs(team) do count = count + 1 end return count end function playerJoin(cid) -- try to join player in event if ableToJoin(cid) then redTeamParticipantsLength = teamLength(redTeamParticipants) blueTeamParticipantsLength = teamLength(blueTeamParticipants) if redTeamParticipantsLength <= blueTeamParticipantsLength then redTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time vermelho.") doTeleportThing(cid, redTeamSpawn) else blueTeamParticipants[cid] = true doPlayerSendTextMessage(cid,22,"Voce foi escolhido para ser do time azul.") doTeleportThing(cid, blueTeamSpawn) end return TRUE else return FALSE end end function playerRemove(cid) -- remove player from event (if its participating) if isParticipating(cid) then if redTeamParticipants[cid] == true then redTeamParticipants[cid] = nil else blueTeamParticipants[cid] = nil end return TRUE else return FALSE end end function isParticipating (cid) -- verify if player is participating of the event if blueTeamParticipants[cid] == true or redTeamParticipants[cid] == true then return TRUE else return FALSE end end function ableToJoin (cid) -- checks if players are able to join if isPlayer(cid) and not isParticipating(cid) then return TRUE else return FALSE end end function arePlayersOfSameTeam (cid1, cid2) -- checks if the players are of the same team if ((blueTeamParticipants[cid1] == true and blueTeamParticipants[cid2] == true) or (redTeamParticipants[cid1] and redTeamParticipants[cid2])) then return TRUE else return FALSE end end function onLogin(cid) -- checks if it's really a player and if it's only if isPlayer(cid) then if isParticipating(cid) == true then return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong else if playerJoin(cid) == true then return TRUE -- everything gone as expected else return FALSE -- Ooops! If the script reachs here, we gotta verify what's going wrong end end else return TRUE end end function onLogout(cid) -- this function is essential to not unbalance the teams if isParticipating (cid) then return playerRemove(cid) end return TRUE end function onAttack(cid, attacker) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- are those players participating of the event? if not isParticipating(cid) or not isParticipating (attacker) then return TRUE end if arePlayersOfSameTeam(cid, attacker) then -- a player of the same team cannot attack the other!! return FALSE else return TRUE end end function onStatsChange(cid, attacker, t, combat, value) -- verify if both are players if not isPlayer(cid) or not isPlayer(attacker) then return TRUE end -- verify if both are participating of PVP if isParticipating(cid) and isParticipating(attacker) then -- both are participating of event -- verify if both are of the same team if arePlayersOfSameTeam(cid, attacker) then -- they're of the same team. Only heals are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return TRUE else return FALSE end else -- they're not of the same team. Only damages are acceptable if t == STATSCHANGE_HEALTHGAIN or t == STATSCHANGE_MANAGAIN then return FALSE else return TRUE end end else -- one or both are not participating of event return TRUE end -- getting local player1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if player1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end agora, em "creaturescripts.xml" adicione o seguinte
    <event type="attack" name="PvpTeam1" event="script" value="pvpTeam.lua"/> <event type="statschange" name="PvpTeam2" event="script" value="pvpTeam.lua"/> <event type="login" name="PvpTeam3" event="script" value="pvpTeam.lua"/> <event type="logout" name="PvpTeam4" event="script" value="pvpTeam.lua"/> depois, no arquivo "login.lua" que se encontra em "data\creaturescripts\scripts" adicione
    registerCreatureEvent(cid, "PvpTeam1") registerCreatureEvent(cid, "PvpTeam2") registerCreatureEvent(cid, "PvpTeam3") registerCreatureEvent(cid, "PvpTeam4") Bom, é isso.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  20. Gostei
    warotserv recebeu reputação de Cat em [CreatureEvent] Monsters Team   
    Bom, o sistema que se segue eu criei com o intuito de não permitir que determinados monstros deem dano em outros.
     
    Primeiramente, crie um arquivo em "data\creaturescripts\scripts" chamado "monstersTeam.lua" e cole o seguinte conteúdo nele
    monstersTeam = { -- team 1 ["Dragon Hatchling" ] = 1, ["Dragon Lord Hatchling" ] = 1, ["Dragon Lord" ] = 1, ["Dragon" ] = 1, ["Frost Dragon" ] = 1, -- team 2 ["Dwarf Geomancer" ] = 2, ["Dwarf Guard" ] = 2, ["Dwarf Soldier" ] = 2, ["Dwarf" ] = 2 } function onStatsChange(cid, attacker, t, combat, value) if t == STATSCHANGE_HEALTHGAIN then return TRUE end -- getting monster being attacked team local monster1Team = monstersTeam[getCreatureName(cid)] -- return if it has no team if monster1Team == nil then return TRUE end -- getting monster that is attacking team local monster2Team = monstersTeam[getCreatureName(attacker)] -- return if it has no team if monster2Team == nil then return TRUE end -- check if they're of the same team if monster1Team == monster2Team then -- if they're of the same team, returning false will not allow the damage to be done to its partner return FALSE else return TRUE end return TRUE end Depois, em "creaturescripts.xml" adicione a seguinte linha de código
    <event type="statschange" name="MonstersTeam" event="script" value="monstersTeam.lua"/> Em seguida, em todos os monstros que você adicionar ao sistema, em seu arquivo .xml, após a tag de <loot>, adicione o seguinte código
    <script> <event name="MonstersTeam" /> </script> Bom, é isso.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  21. Gostei
    warotserv recebeu reputação de Cat em [CreatureEvent] Anti Fast-attack Elf Bot   
    Bom... decidi postar agora o script que eu fiz para barrar os botters de fast attack.

    Primeiro, crie um arquivo chamado "antiBot.lua" em "data\creaturescripts\scripts" e nele adicione o seguinte conteúdo:
    -- counts physicals, casts .... [player name : creature cid] playerAttacksMade = {} playerActivateTime = {} playerBlocked = {} function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function onLogin(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Loading Anti Bot... done.' ) playerAttacksMade[cid] = {} playerActivateTime[cid] = {} playerBlocked[cid] = false end return true end function onLogout(cid) if isPlayer(cid) then playerAttacksMade[cid] = nil playerActivateTime[cid] = nil playerBlocked[cid] = nil end return true end function onStatsChange(cid, attacker, type, combat, value) local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } if not type == STATSCHANGE_HEALTHLOSS or not isPlayer(attacker) then return true end if value <= 0 then return true end if playerAttacksMade[attacker][cid] == nil then playerAttacksMade[attacker][cid] = 0 playerActivateTime[attacker][cid] = os.time() end local currentTime = os.time() --TESTE --doPlayerSendTextMessage(attacker, MESSAGE_STATUS_CONSOLE_ORANGE, playerAttacksMade[attacker][cid] .. '________' .. attacker .. '_____' .. cid .. '______' .. currentTime .. '_______' .. playerActivateTime[attacker][cid] ) if currentTime >= playerActivateTime[attacker][cid] then playerActivateTime[attacker][cid] = currentTime + 1 playerAttacksMade[attacker][cid] = 0 else playerAttacksMade[attacker][cid] = playerAttacksMade[attacker][cid] + 1 end if playerAttacksMade[attacker][cid] > maxAttacks[getPlayerVocation(attacker)] then playerBlocked[attacker] = true doBroadcastMessage('O player ' .. getPlayerName(attacker) .. ' esta usando bot de fast attack. O seu ataque foi travado ate que ele relogue.', 21) doShowTextDialog(attacker,1952,"PARE DE USAR ELFBOT! Seu ataque foi bloqueado. Para destravar basta relogar. Obrigado. (Sistema exclusivo do ot)") return FALSE end return TRUE end function onCombat(cid, target) if isPlayer(cid) then if not playerBlocked[cid] then registerCreatureEvent(target, "AntiBot2") else return false end end return true end function onCast(cid, target) if isPlayer(cid) then if playerBlocked[cid] then return false end end return true end e em "creaturescripts.xml", encontrado em "data\creaturescripts" adicione:
    <event type="combat" name="AntiBot1" event="script" value="antiBot.lua"/> <event type="statschange" name="AntiBot2" event="script" value="antiBot.lua"/> <event type="login" name="AntiBot3" event="script" value="antiBot.lua"/> <event type="logout" name="AntiBot4" event="script" value="antiBot.lua"/> <event type="cast" name="AntiBot5" event="script" value="antiBot.lua"/> Agora vou explicar a parte configurável:

     
    local maxAttacks = { 6, --pos 1 6, --pos 2 6, --pos 3 6, --pos 4 7, --pos 5 7, --pos 6 7, --pos 7 7, --pos 8 } Aqui você vai modificar qual o número máximo de ações de combate (que dão dano) que certa vocação poderá dar. Posição 1 é Sorcerer, 2 é Druid, 3 é Paladin, 4 é Knight e assim por diante....
    Escolha bem esses números! Caso você erre, ele irá ficar detectando erradamente.
     
    Por exemplo,vamos supor que o knight tenha o fastAttack em 500ms (logo ele executará 2 ataques por segundo) e que sua magia de dano de menor exhaust tenha um exhaust de apenas 600ms, logo o numero maximo de ataques dele por segundo será 4 (cuidado quando spells de dano diferentes puderem ser usadas ao mesmo tempo, daí você terá de acrescentar mais 1 ao número de ataques por segundo.
     
    Por favor, testem e me falem o que acharam.
     
     
    Espero que ajude a tirar os botters de seu server.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums. É bom espalhar esse script uma vez que botters nos servers 8.6 é muito comum.
     
  22. Gostei
    warotserv recebeu reputação de Cat em [Actions] Sistema anti-pega-e-corre (quest)   
    Boa noite. Como muitos devem saber a prática de se completar uma quest de baú e depois sair correndo (sem matar os monstros por perto) é muito comum. Com isso, decidi implementar um sistema simples de impedir que isso aconteça.
     
    Primeiramente, darei uma visão geral do que é verificado para que o player tenha sucesso na quest. O player não poderá estar a X SQM de distância do baú de quest. O player não poderá estar em uma andar diferente do baú de quest.
     
    Agora explicando o que deve ser feito.

    No arquivo de sua quest, cole o seguinte código
    -- this table will store the players who are on delay to have their quest completed (successfully or not) playersCompletingQuests = {} local checkingEventDelay = 250 local checkingEventTimes = 60 local maxDistanceToBeCompleted = 7 -- SQM function getDistance (pos1, pos2) -- get distance between two positions (using tibia formula) local difX = pos1.x - pos2.x local difY = pos1.y - pos2.y local difZ = pos1.z - pos2.z -- math.abs() of difs if difX < 0 then difX = -difX end if difY < 0 then difY = -difY end if difZ < 0 then difZ = -difZ end -- using tibia formula local maxDif = difX if maxDif < difY then maxDif = difY end if maxDif < difZ then maxDif = difZ end -- return the result return maxDif end -- To be completed, it's essential that player stays nearby the chest AND at the same floor. function canBeCompleted(cid, item, topos) -- checks if player respected the delay and distance -- check if player is on-line or if it died during the delay time if not isPlayer(cid) then return false end -- store player position in a variable local playerPos = getCreaturePosition(cid) -- check if the distance between player and chest is below the maximum allowed if getDistance(playerPos, topos) > maxDistanceToBeCompleted then return false end -- check same floor condition if playerPos.z ~= topos.z then return false end -- reach here means the player can receive its awards return true end function completeQuest(cid, item, topos) --Event will call this -- remove the player from playersCompletingQuests playersCompletingQuests[cid] = nil -- give player it's awards!!! --double checking if the player hasn't done the quest yet if not questAlreadyCompleted(cid, item) then doCreatureSay(cid, "COMPLETEI UMA QUEST!!", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid,22,"Voce completou a quest, parabens!") -- AQUI VOCÊ IMPLEMENTARÁ A PARTE DE ENTREGAR O PRÊMIO AO PLAYER -- AQUI VOCÊ IMPLEMENTARÁ A PARTE DE ACRESCENTAR A STORAGE AO PLAYER else doPlayerSendTextMessage(cid,22,"Voce ja completou essa quest.") end end function checkingEvent(cid, item, topos, checkingsLeft) if checkingsLeft <= 0 then completeQuest(cid, item, topos) else if canBeCompleted(cid, item, topos) then doCreatureSay(cid, checkingsLeft, TALKTYPE_ORANGE_1) addEvent(checkingEvent, checkingEventDelay, cid, item, topos, checkingsLeft-1) else -- cannot be completed if isPlayer(cid) then -- is player online? doCreatureSay(cid, "fail", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid,22,"Voce falhou em completar a quest. tente novamente!") end -- remove the player from playersCompletingQuests playersCompletingQuests[cid] = nil end end end function questAlreadyCompleted(cid, item) local queststatus = getPlayerStorageValue(cid,STORAGE_NUMBER) -- COLOQUE O STORAGE NUMBER DA QUEST AQUI!!!!!! if queststatus == -1 then return false else return true end end function isOnAnotherQuest(cid) if playersCompletingQuests[cid] == true then return true else return false end end function onUse(cid, item, frompos, item2, topos) if questAlreadyCompleted(cid, item) then doPlayerSendTextMessage(cid,22,"Voce ja completou essa quest.") elseif isOnAnotherQuest(cid) then doPlayerSendTextMessage(cid,22,"Voce ja esta tentando completar uma outra quest. Aguarde!") else playersCompletingQuests[cid] = true -- player is now trying to achieve success in a quest addEvent(checkingEvent, 0, cid, item, topos, checkingEventTimes) end return true end Agora, faça as devidas mudanças, para se adaptar à sua quest,
    em:
     
    faça o que se pede.     Agora, explicando o que pode ser configurado: checkingEventDelay  representa de quanto em quanto tempo (em milissegundos) a função "checkingEvent" será chamada.
     
    checkingEventTimes  representa quantas vezes a função "checkingEvent" será chamada.
     
    maxDistanceToBeCompleted  representa qual é a distancia máxima que o player pode se distanciar do baú, para que a quest não falhe.
     
    Bom, é isso.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.
  23. Gostei
    warotserv deu reputação a Cat em [Movement] Tile Trainer   
    só estando em cima do tile? Oo, criativo, rep+
  24. Gostei
    warotserv deu reputação a Cat em [Movement] Tile Teleporter (random)   
    bastante útil, obrigado por estar contribuindo cara (: rep+
  25. Gostei
    warotserv recebeu reputação de Cat em [Movement] Tile Teleporter (random)   
    Boa noite novamente, agora vou postar outro script que fiz que faz com que, quando um player pisar em um tile com determinada action ID, seja teletransportado para uma lugar randômico.
     
    Primeiramente, crie um arquivo em "data\movements\scripts" chamado "tileTeleporter.lua" e copie o seguinte conteúdo para dentro dele
    local teleportPoints = { [ 0] = {x = 210, y = 190, z = 7}, [ 1] = {x = 233, y = 196, z = 7}, [ 2] = {x = 243, y = 188, z = 7}, [ 3] = {x = 254, y = 180, z = 7}, [ 4] = {x = 231, y = 160, z = 7}, [ 5] = {x = 212, y = 158, z = 7}, [ 6] = {x = 212, y = 170, z = 7}, [ 7] = {x = 227, y = 171, z = 7}, [ 8] = {x = 266, y = 149, z = 7}, [ 9] = {x = 234, y = 140, z = 7}, [10] = {x = 205, y = 143, z = 7}, [11] = {x = 177, y = 126, z = 7}, [12] = {x = 290, y = 177, z = 6}, [13] = {x = 219, y = 185, z = 6}, [14] = {x = 261, y = 167, z = 6}, [15] = {x = 270, y = 167, z = 8} } function onStepIn(cid, item, position) if isPlayer(cid) then local position = teleportPoints[math.random(0,15)] doTeleportThing(cid, position) end return true end agora, em "movements.xml" cole a seguinte linha de código
    <movevent type="StepIn" actionid="8586" script="tileTeleporter.lua"/> Bom, é isso. Acho que não precisa explicar, está bem fácil de entender e alterar o código.
     
    Espero ter ajudado.
     
    P.S.: Não me importo que roubem meus créditos e/ou postem em outros fórums.

Informação Importante

Confirmação de Termo