Ir para conteúdo
  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo

Fóruns

  • Portal Tibiaking
    • Portal
    • Server Oficial TibiaKing
    • Sobre o Fórum
    • Projetos Open Source
    • Regras
  • OTServer Tibia & Derivados
    • Suporte & Pedidos
    • OTServer Downloads
    • OTServer Scripts
    • Ferramentas OpenTibia
    • Linguagens de Programação
    • Mapas
    • Websites
    • Show Off
    • Gráficos e Design
    • Divulgações
  • Tibia e Bots
    • Tibia
    • Bots & Macro
  • Diversos
    • Playground (Off-topic)

Calendários

  • Calendário Oficial
  • Calendário de OTServs
  • Calendários Diversos

Categorias

  • Oficial TibiaKing
    • Premium Forgottenserver
  • Conteúdo da Comunidade
    • Sprites

Categorias

  • Articles

Blogs

Não há resultados

Product Groups

  • Advertisement

Encontrar resultados em...

Encontrar resultados que contenham...

Data de Criação

  • Início

    FIM

Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Encontrado 31 registros

  1. Olá Camaradagem do TK. Venho disponibilizar um sistema muito útil para servidores fiéis ao Tibia(CipSoft). Ele consiste em não atacar membros da party, ótimo para quest, pvp e hunt's. Não posso afirmar se funcionará em todos os servidores, testado somente em 10.1. config.lua noDamageToPartyMembers = true data/creaturescripts/creaturescripts.xml <event type="combat" name="partyAndGuildProtection" event="script" value="partyAndGuildProtection.lua"/> data/creaturescripts/scripts/partyAndGuildProtection.lua function onCombat(cid, target) if(isInParty(target)) then if(getConfigValue("noDamageToPartyMembers")) then if(isInParty(cid)) then return false end end end return true end data/creaturescripts/scripts/login.lua registerCreatureEvent(cid, "partyAndGuildProtection") Créditos ao Global 10.1 por conter partyAndGuildProtection.lua, porém contia bugs e não atacava nem player. Créditos a mim por fixar esse problema e disponibilizar. partyAndGuildProtection.lua bugado do servidor.
  2. Bom galera com muita gente quer o tal cast tv está ai, LEMBRADO É SISTEMA REPLICA DO PARAGUAI , ENTÃO BOM USO Versão testada: TFS 8.6 0.4 e TFS 0.3.6 8.6 Comandos utilizados in-game: !cast on -- Ativa o seu Cast System, e permite os outros jogadores te assistirem; !cast off -- Desativa o seu Cast System; !cast exit -- Você sai do Cast no qual está assistindo; !cast NAME -- Começa a assistir um jogador (NAME). Instalação Vá em data/talkactions/scripts crie um arquivo chamado castSys.lua e adicione o seguinte código dentro do mesmo: --[[ Perfect Cast System 1.0 by Roksas ]]-- function onSay(cid, words, param) local player = getPlayerByName(param) if not isInArray({"list", "exit", "off", "on"}, param) and not param or param == "" then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Enter the name of the player, which you want to cast in parameters.") return true end if param == "on" then if getPlayerStorageValue(cid, 10359) >= 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Your Cast System is already running ONLINE!") return true end castOn(cid) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You have activated your Cast System, now others can cast you, to disable this feature, use the parameter '!cast off'.") return true end if param == "off" then if getPlayerStorageValue(cid, 10359) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Your Cast System is already OFFLINE!") return true end castOff(cid) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You have disabled your Cast System, from now on no one can watch you, unless you turn on the Cast, using the parameter '!cast on'.") return true end if param == "exit" then if getPlayerStorageValue(cid, 12269) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "You no are casting players.") return true end cancelCast(cid) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You stopped casting, use the parameter '!cast list' to see who can be casted.") return true end if param == "list" then if #whoCasted() < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "At this time, no player can be casted, try again later.") return true end doPlayerSendTextMessage(cid, 20, "Players can be casteds:\n\n") for k, v in ipairs(whoCasted()) do doPlayerSendTextMessage(cid, 20, " - "..getCreatureName(v).."") end return true end if not isPlayer(player) then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "This player is offline or does not exist. Use the parameter '!cast list' to see who can be casted.") return true end if getPlayerStorageValue(player, 10359) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "You can only cast one person with the Cast System is activated, use the parameter '!cast list' to see who can be assisted.") return true end if getPlayerStorageValue(cid, 10359) >= 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "To cast a player, you must first disable your Cast System using the parameter '!cast off'.") return true end if not getTileInfo(getThingPos(cid)).protection then return doPlayerSendTextMessage(cid, 20, "You need enter in Protection Zone to use the Cast System.") and true end setPlayerStorageValue(cid, 12269, 1) castPlayer(cid, player) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You are casting the player "..getCreatureName(player)..", to exit just use the command '!cast exit'.") doPlayerSendTextMessage(player, 20, "You are casted by "..getCreatureName(cid).." player to disable your Cast, simply use the parameter '!cast off'.") return true end function cancelCast(uid) mayNotMove(uid, false) doCreatureSetHideHealth(uid, false) setPlayerStorageValue(uid, 12269, -1) doRemoveCondition(uid, CONDITION_OUTFIT) return doTeleportThing(uid, getTownTemplePosition(getPlayerTown(uid))) or doTeleportThing(uid, getPlayerMasterPos(uid)) and true end function castOn(uid) return setPlayerStorageValue(uid, 10359, 1) and true end function castOff(uid) return setPlayerStorageValue(uid, 10359, -1) and true end function castPlayer(uid, player) if not isPlayer(player) then cancelCast(uid) return true end if getPlayerStorageValue(player, 10359) < 1 then cancelCast(uid) return true end if getPlayerStorageValue(uid, 12269) < 1 then cancelCast(uid) return true end mayNotMove(uid, true) doSetItemOutfit(uid, 1934, -1) doCreatureSetHideHealth(uid, true) doTeleportThing(uid, getThingPos(player)) return addEvent(castPlayer, 1 * 1000, uid, player) and true end function whoCasted() local casteds = {} for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, 10359) >= 1 then table.insert(casteds, pid) end end return #casteds > 0 and casteds or {} end Volte uma pasta (data/talkaction) abra com algum editor de texto o arquivo talkactions.xml e adicione essa tag em qualquer lugar: <talkaction words="!cast;/cast" event="script" value="castSys.lua"/> Muito bem, após isso siga para a pasta data/creaturescripts/scripts, faça o mesmo, crie um arquivo chamado castSys.lua e adicione isso function onLogout(cid) if getPlayerStorageValue(cid, 12269) > 0 then doPlayerSendCancel(cid, "To logout, you need to exit the Cast System first. Use the parameter '!cast exit'.") return false end setPlayerStorageValue(cid, 10359, -1) return true end function onStatsChange(cid, attacker, type, combat, value) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 12269) >= 1 and isMonster(attacker) or isPlayer(attacker) then return false end return true end function onAttack(cid, target) if not isPlayer(cid) or not isPlayer(target) then return true end if getPlayerStorageValue(cid, 12269) > 0 then doRemoveCondition(cid, CONDITION_INFIGHT) return false end return true end Já no arquivo creaturescripts.xml, você vai adicionar essa tag: <event type="attack" name="castAttack" event="script" value="castSys.lua"/> <event type="statschange" name="castHits" event="script" value="castSys.lua"/> <event type="logout" name="castLogout" event="script" value="castSys.lua"/> E no arquivo login.lua você vai adicionar essas 3 linhas: registerCreatureEvent(cid, "castAttack") registerCreatureEvent(cid, "castHits") registerCreatureEvent(cid, "castLogout") Para que o player que está assitindo ao outro não use magias enquanto está assistindo, coloque essas linhas abaixo dentro de cada script das magias, debaixo da linha: function onCastSpell(cid, var) Coloque: if getPlayerStorageValue(cid, 12269) >= 1 then return false end Prontinho galera, basta reiniciar o servidor e usar, é isto por hoje, espero que tenham gostado, ideias/sugestões para futuras versões, bugs ou críticas sobre o sistema, basta deixar um simples comentário aí no tópico, estarei aqui para atendê-los.
  3. Script/Tutorial+ Php +Map +Talkaction +Portal. Ps: Antes de falar q o topico já existe no forum teste os outros scripts Então começando por informações basícas : Para abrir o evento : /zombiestart numero de players . exemplo : /zombiestart 2 Para Iniciar o evento sem o numero maximo de players: /zombiestart force. Apos aberto sempre q um player ente no portal do evento e avisado por broadcast quem entrou na arena e o numero de players restantes para o evento ser iniciado. Apos o evento ser iniciado um zombie e sumonado a cada 20 segundos, o player que for infectado e teleportado para o templo vence o ultimo player restante na arena. Ao terminar o evento e anuciado por broadcast o nome do player vencedor tempo q durou na arena e por quantos zombies ele sobreviveu, entrega de premio automatica, premio configuravel. Garantia de funcionabilidade perfeita em TFS 0.4 se configurado corretamente, não testado em outras versões de distros. Creditos: Me .. não criei mais montei peguei de varios servers/topicos e corigi os varios bugs de distro colocaria os creditos de onde peguei a maioria do script mais foi de um server sem creditos q nem era pra ter sido postado. Enfim Vamos ao Evento ! Primeiro vou estar postando a pagina classica do Zombie event no Gesior que seria a parte PHP para informar os players sobre o evento. Pagina PHP + Tutorial de como implementar ela no seu site. Agora alguns mapas para o zombie event: Então Agora vamos ao script ! data\creaturescripts\scripts\zombie – A pasta ‘zombie’ deve ser criada no diretorio citado. \data\creaturescripts\scripts\Zombie\onattack.lua function loseOnZombieArena(cid) kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then doPlayerAddItem(winner, 2157, 5, true) doPlayerAddItem(winner, 6119, 1, true) doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.") doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!") end doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1 local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1 local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z} for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do centerPos.z = z for i, uid in pairs(getSpectators(centerPos, width, height, false)) do if(isMonster(uid)) then doRemoveCreature(uid) end end end end end function onStatsChange(target, cid, changetype, combat, value) if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then doCreatureAddHealth(target, getCreatureMaxHealth(target)) loseOnZombieArena(target) return false end return true end \data\creaturescripts\scripts\Zombie\ondeath.lua function onDeath(cid) setZombiesToSpawnCount(getZombiesToSpawnCount() + 2) doCreatureSay(cid, "I'll be back!", 19) return true end \data\creaturescripts\scripts\Zombie\onthink.lua function onThink(cid) local target = getCreatureTarget(cid) if(target ~= 0 and not isPlayer(target)) then doRemoveCreature(target) end return true end \data\globalevents\scripts\zombie\ onstartup.lua function onstartup() db.executeQuery("UPDATE `player_storage` SET `value` = 0 WHERE `key` = " .. ZE_isOnZombieArea .. ";") doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) addZombiesEventBlockEnterPosition() return true end \data\globalevents\scripts\zombie\onthink.lua function onThink(interval, lastExecution, thinkInterval) if(getStorage(ZE_STATUS) == 2) then setZombiesToSpawnCount(getZombiesToSpawnCount()+1) local players = getZombiesEventPlayers() for i=1, getZombiesToSpawnCount() * 2 do if(getZombiesToSpawnCount() > 0 and spawnNewZombie()) then setZombiesToSpawnCount(getZombiesToSpawnCount()-1) end end end return true end \data\lib\zombie_event.lua -- CONFIG ZE_DEFAULT_NUMBER_OF_PLAYERS = 20 ZE_ACCESS_TO_IGNORE_ARENA = 4 -- POSITIONS ZE_blockEnterItemPosition = {x=32341, y=32213, z=7} -- onde nasce o teleport? ZE_enterPosition = {x=32154, y=32578, z=7} -- onde os players nascem dentro da arena zombie? ZE_kickPosition = {x=32368, y=32241, z=7} -- quando morre vai para onde? ZE_spawnFromPosition = {x=32140,y=32566,z=7} -- para sumonar zombie (de) ZE_spawnToPosition = {x=32168,y=32590,z=7} -- para sumonar zombie (ate) -- ITEM IDS --ZE_blockEnterItemID = 2700 ZE_blockEnterItemID = 1387 -- STORAGES -- - player ZE_isOnZombieArea = 34370 -- - global ZE_STATUS = 34370 -- =< 0 - off, 1 - waiting for players, 2 - is running ZE_PLAYERS_NUMBER = 34371 ZE_ZOMBIES_TO_SPAWN = 34372 ZE_ZOMBIES_SPAWNED = 34373 -- FUNCTION function setZombiesEventPlayersLimit(value) doSetStorage(ZE_PLAYERS_NUMBER, value) end function getZombiesEventPlayersLimit() return getStorage(ZE_PLAYERS_NUMBER) end function addPlayerToZombiesArea(cid) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) doTeleportThing(cid, ZE_enterPosition, true) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) if(getPlayerAccess(cid) < ZE_ACCESS_TO_IGNORE_ARENA) then setPlayerZombiesEventStatus(cid, os.time()) end end function kickPlayerFromZombiesArea(cid) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) doTeleportThing(cid, ZE_kickPosition, true) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) setPlayerZombiesEventStatus(cid, 0) end function getPlayerZombiesEventStatus(cid) return getCreatureStorage(cid, ZE_isOnZombieArea) end function setPlayerZombiesEventStatus(cid, value) doCreatureSetStorage(cid, ZE_isOnZombieArea, value) end function getZombiesEventPlayers() local players = {} for i, cid in pairs(getPlayersOnline()) do if(getPlayerZombiesEventStatus(cid) > 0) then table.insert(players, cid) end end return players end function getZombiesCount() return getStorage(ZE_ZOMBIES_SPAWNED) end function addZombiesCount() doSetStorage(ZE_ZOMBIES_SPAWNED, getStorage(ZE_ZOMBIES_SPAWNED)+1) end function resetZombiesCount() doSetStorage(ZE_ZOMBIES_SPAWNED, 0) end function getZombiesToSpawnCount() return getStorage(ZE_ZOMBIES_TO_SPAWN) end function setZombiesToSpawnCount(count) doSetStorage(ZE_ZOMBIES_TO_SPAWN, count) end function addZombiesEventBlockEnterPosition() -- remove tp -- remove o TP local item = getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID) if(item.uid ~= 0) then doRemoveItem(item.uid) end --doRemoveItem(getThingFromPos(Castle.desde).uid) --[[ if(getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID).uid == 0) then doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition) end ]]-- end function removeZombiesEventBlockEnterPosition() -- add tp if(getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID).uid == 0) then --doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition) local tp = doCreateTeleport(ZE_blockEnterItemID, ZE_enterPosition, ZE_blockEnterItemPosition) doItemSetAttribute(tp, "aid", "5555") end --[[ local item = getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID) if(item.uid ~= 0) then doRemoveItem(item.uid) end ]]-- end function spawnNewZombie() local posx = {} local posy = {} local posz = {} local pir = {} for i=1, 5 do local posx_tmp = math.random(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x) local posy_tmp = math.random(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y) local posz_tmp = math.random(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z) local pir_tmp = 0 local spec = getSpectators({x=posx_tmp, y=posy_tmp, z=posz_tmp}, 3, 3, false) if(spec and #spec > 0) then for z, pid in pairs(spec) do if(isPlayer(pid)) then pir_tmp = pir_tmp + 1 end end end posx[i] = posx_tmp posy[i] = posy_tmp posz[i] = posz_tmp pir[i] = pir_tmp end local lowest_i = 1 for i=2, 5 do if(pir[i] < pir[lowest_i]) then lowest_i = i end end local ret = doCreateMonster("Zombie Event", {x=posx[lowest_i], y=posy[lowest_i], z=posz[lowest_i]}, false) if type(ret) == "number" then addZombiesCount() setGlobalStorageValue(201201051801, ret) end return type(ret) == "number" end \data\movements\scripts\zombie\ onenter.lua function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if(not isPlayer(cid)) then return true end if(getPlayerAccess(cid) >= ZE_ACCESS_TO_IGNORE_ARENA) then addPlayerToZombiesArea(cid) elseif(#getZombiesEventPlayers() < getZombiesEventPlayersLimit() and getStorage(ZE_STATUS) == 1) then addPlayerToZombiesArea(cid) local players_on_arena_count = #getZombiesEventPlayers() if(players_on_arena_count == getZombiesEventPlayersLimit()) then addZombiesEventBlockEnterPosition() -- removeTP doSetStorage(ZE_STATUS, 2) doBroadcastMessage("Zombie Arena Event started.") else doBroadcastMessage(getCreatureName(cid) .. " has entered a Zombie Arena. We still need " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players.") end else doTeleportThing(cid, fromPosition, true) addZombiesEventBlockEnterPosition() end return true end \data\talkactions\scripts\zombie\ onsay.lua function onSay(cid, words, param, channel) if(getStorage(ZE_STATUS) ~= 2) then local players_on_arena_count = #getZombiesEventPlayers() if(param == 'force') then if(players_on_arena_count > 0) then setZombiesEventPlayersLimit(players_on_arena_count ) addZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 2) doBroadcastMessage("Zombie Arena Event started.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event started.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot start Zombies event. There is no players on arena.") end else if(param ~= '' and tonumber(param) > 0) then setZombiesEventPlayersLimit(tonumber(param)) end removeZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Event started.") doPlayerBroadcastMessage(cid, "Zombie Arena Event teleport is opened. We are waiting for " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players to start.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event is already running.") end return true end data\monster\zombie_event.xml <monster name="Zombie Event" nameDescription="an event zombie" race="undead" experience="480" speed="170" manacost="0"> <health now="20000" max="20000"/> <look type="311" corpse="9875"/> <targetchange interval="5000" chance="50"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="1000" min="-1500" max="-2350"/> </attacks> <defenses armor="0" defense="0"/> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> <immunity fire="1"/> <immunity energy="1"/> <immunity poison="1"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="You wont last long!"/> <voice sentence="Mmmmh.. braains!"/> </voices> <script> <event name="ZombieThink"/> <event name="ZombieDeath"/> </script> <loot> </loot> </monster> Agora as Tags nos xml’s . /data/creaturescripts/creaturescripts.xml <event type="think" name="ZombieThink" event="script" value="zombie/onthink.lua"/> <event type="statschange" name="ZombieAttack" event="script" value="zombie/onattack.lua"/> <event type="death" name="ZombieDeath" event="script" value="zombie/ondeath.lua"/> /data/globalevents/globalevents.xml <globalevent name="ZombieGlobalThink" interval="5000" event="script" value="zombie/onthink.lua"/> <globalevent name="ZombieGlobalStartup" type="start" event="script" value="zombie/onstartup.lua"/> /data/movements/movements.xml <movevent type="StepIn" actionid="5555" event="script" value="zombie/onenter.lua"/> /data/talkactions/talkactions.xml <talkaction log="yes" words="/zombiestart" access="4" event="script" value="zombie/onsay.lua"/> /data/monster/monsters.xml <monster name="Zombie Event" file="zombie_event.xml"/> Script Terminado ! Next: Tutorial de como configurar o zombie event ! Estarei postando apenas as partes q podem ou devem ser editadas em cada script. data\creaturescripts\scripts\zombiez\onattack.lua Next: \data\lib\zombie_event.lua Então galera eh isso ai .-. meu primeiro post não mim crucifiquem k Duvidas, reclamações elogios chigamentos u.u só comentar como dizia o mestre o topico ta explicado nos minimos detalhes e ''de forma bem entendida'' (entendedoresentenderam) então eh isso vlw ai a todos q mim ajudaram nisso e nem sabem ?
  4. Esse sistema usa premium points, bom para otserv que nao tem site baiak, mapa proprio daria pra usar com global tambem fica a escolha de quem usar. Testado em: TFS 0.3 e 0.4 Vamos instalar o sistema, primeiro entre em data/libs e abra o arquivo 050-function.lua e adicione: depois de ter feito isso vamos criar a talkactions que comprará o item e removerá os pontos da conta, entre em data/talkactions/scripts e crie o arquivo vipsword.lua e adicione: function onSay(cid, words, param) if ChecarPontos(cid) >= 2 then doPlayerAddItem(cid,2400,1) RemoverPontos(cid, 2) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce compro uma vip sword por 2 pontos!") else doPlayerSendCancel(cid, "Voce nao tem pontos suficiente!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return TRUE end Configurando: ChecarPontos(cid) >= 2 doPlayerAddItem(cid,2400,1) RemoverPontos(cid, 2) No Verde e Laranja coloca quantos pontos quer remover da conta. No Azul id do item. No Vermelho quantidade do item. apos te configurado abra o talkactions.xml e adicione a seguinte linha: <talkaction words="!vipsword" event="script" value="vipsword.lua"/> para cada item que vc quizer adiciona basta crar um novo arquivo lua por o script e editar com o items desejado e adicionando em talkactions.xml. Os adms que quizerem por os pontos para vender por crystal coin o script e esse abaixo, entre em data/talkactions/scripts e crie o arquivo buypontos.lua e adicione: function onSay(cid, words, param) if getPlayerItemCount(cid, 2160) >= 10 then doPlayerRemoveItem(cid, 2160, 10) AddPontos(cid, 5) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce comprou 10 pontos") else doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente para comprar pontos!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end return TRUE end Configurando: getPlayerItemCount(cid, 2160) >= 10 then doPlayerRemoveItem(cid, 2160, 10) AddPontos(cid, 5) No Marron coloca quantos crystal coin quer remover do player No Rosa quantidade de pontos para adicionar ao player. apos te configurado abra o talkactions.xml e adicione a seguinte linha: <talkaction words="!buypontos" event="script" value="buypontos.lua"/> para funcionar perfeitamente execute no mysql:
  5. Fala galera do TK, hoje vim compartilhar com vocês um sistema que eu comecei a fazer com a ajuda de um amigo ... Bem, ele é viciado em Skyrim e esses dias a gente ficou quase 10 horas sem internet , e foi nesse meio tempo de tédio que eu decidi fazer um sistema baseado nas Bold Weapons do Skyrim e ele foi me dando uns toques pra eu poder melhorar o script. Se você nunca jogou Skyrim ou não se lembra eu vou explicar oque é: ​ Um sistema que você conjura uma arma feita de magia referente a sua classe mas se vc tentar tirar ela da mão, ela some. O Script em si é bem simpleszinho mas vc tem que fazer diversas alterações no server pra que ele fique 100% então aqui vamos nós: Antes de tudo eu gostaria de dizer que eu altamente recomendo que você crie novos itens no seu Item Editor pra evitar problemas futuros mas use as sprites dos itens que eu irei passar aqui nesse tópico. Abra seu weapons.xml e adicione as seguintes linhas (note que vc deve procurar os id's antes pra ver se já não existe ele declarado, caso haja, delete as linhas antigas e adicione as novas): <!-- AURA ITEMS --> <movevent type="DeEquip" itemid="7773" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7774" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="8854" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7775" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7766" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7772" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7424" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7451" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="8858" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7450" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7407" slot="right-hand" event="script" value="item.lua"/> <movevent type="DeEquip" itemid="7455" slot="right-hand" event="script" value="item.lua"/> aqui temos todos os ids dos items e o slot da função como sendo a mão esquerda (direita da tela >>) eu fiz utilizando esse slot porque os itens são criados lá diretamente e evita erros na distro ​ e na pasta movements\scripts adicione o arquivo item.lua que deverá conter o seguinte: ​ <instant name="Weapon Aura" words="Aurum" lvl="100" manapercent="60" aggressive="0" exhaustion="2000" needlearn="0" event="script" value="especiais/weaponaura.lua"> </instant> aqui vc vai configurar a palavra que vc diz pra conjurar a magia, o level dela e a porcentagem de mana que vai consumir ao usar a spell. Ainda na pasta spells vá em scripts e crie uma nova pasta chamada especiais e crie um arquivo chamado weaponaura.lua que deverá conter o seguinte: ​ Agora você tem que garantir que o player não irá dar trade nos itens, para isso vá em creaturescripts\scripts e crie um arquivo chamado untrade.lua e coloque isso dentro dele: ​ Feito isso você deve ir no creaturescripts.xml e adicionar essa linha aqui: <event type="traderequest" name="UntradeAura" event="script" value="untrade.lua"/> agora abra o login.lua que fica em creaturescripts\scripts e antes do ultimo return true adicione isso daqui: ---- AURA ITENS ---- registerCreatureEvent(cid, "UntradeAura") ______________________________________________________________________ Se você conseguiu fazer tudo até agora isso significa que você sabe ler. Se alguma coisa deu merda volte ao início e releia tudo com atenção! _______________________________________________________________________ Eu pessoalmente achei o sistema super bacana, ainda mais pra servidores sérios.. Testei aqui no meu TFS 0.3.6 (Crying Damson) e rodou tudo perfeitamente... quaisquer erros poste aqui no tópico que eu tento ajudar a resolver, mas é claro que na medida do possível, to sem tempo pra viver então não me peça pra adaptar o script pra sua versão 7.6 ou 10.1... ele foi feito pra 8.54! Espero que pelo menos alguém use esse sistema pq deu uma trabalheira danada pra fazer, e claro, se te ajudei, fortaleça com um REP que eu vou saber que você gostou do sistema. Grato. Mais uma coisa e talvez a mais importante do tópico: Esse script foi feito por mim, Night Wolf ou White Wolf (como vcs preferirem), e é conteudo >>> EXCLUSIVO <<<< do TIBIA KING. Não postem sem minha permissão que eu prometo continuar fazendo coisas legais pra vocês :angry2:. Abraço do Night. PS: Pra que o sistema funcione vc deve deixar as duas mãos vazias e falar Aurum, o script vai checar sua classe e te dar a weapon referente, caso vc seja Knight ele vai te dar a arma do tipo cujo sua proficiência seja a melhor.. (Em outras palavras: pegar a sua maior skill, se for sword vai te dar sword e assim por diante.. No caso de empate ele vai te dar sword e no caso de empate entre axe e club ele vai te dar club.) Note que não vai ser possível remover o item nem pra BP nem pra outro slot e nem pro chão... e também não é possível dar trade no item. Vou anexar umas imagens aqui pro pessoal ver melhor:
  6. Este script dá double exp à todos os player que estiverem online ou entrarem durante o tempo especificado no dia X. Pra quem não sabe, apenas crie um arquivo "QUALQUER-NOME.xml" na pasta "mods" (mesmo lugar do executável do servidor), cole isso dentro e salve: É isso aí galera, caso tenha dúvidas poste aqui. Créditos: Script: Tomek Xevis Tópico: Eu '-'
  7. Testado nas versões 8.60 - 9.43. Na pasta data/lib/pets.lua: --Circles AREA_CIRCLE2X2 = { {0, 1, 1, 1, 0}, {1, 1, 1, 1, 1}, {1, 1, 3, 1, 1}, {1, 1, 1, 1, 1}, {0, 1, 1, 1, 0} } AREA_CIRCLE3X3 = { {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 3, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0} } -- Crosses AREA_CROSS1X1 = { {0, 1, 0}, {1, 3, 1}, {0, 1, 0} } AREA_CROSS5X5 = { {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0} } AREA_CROSS6X6 = { {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0} } --Squares AREA_SQUARE1X1 = { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } -- Walls AREA_WALLFIELD = { {1, 1, 3, 1, 1} } AREADIAGONAL_WALLFIELD = { {0, 0, 0, 0, 1}, {0, 0, 0, 1, 1}, {0, 1, 3, 1, 0}, {1, 1, 0, 0, 0}, {1, 0, 0, 0, 0}, } TYPE_NEAR = 1 TYPE_DISTANCE = 2 petExhaust = 3 --in seconds petSayExhaust = 3 --in seconds petGainTicks = { health = {func = doCreatureAddHealth, time = 3000, count = 1}, mana = {func = doCreatureAddMana, time = 3000, count = 2} } petGainHealth = 30 petGainMana = 30 petExpRate = 1.3 carryItems = 10 petItemsBase = 1250 petItems = {} blockedItems = {6132, 2195} for i = 1, carryItems do table.insert(petItems, petItemsBase + i) end petBase = 61200 petStorages = { pet = petBase + 1, level = petBase + 2, exp = petBase + 3, items = petBase + 4, isPet = petBase + 5, isDead = petBase + 6, exhaust = petBase + 7, sayExhaust = petBase + 8, moveExhaust = petBase + 9, health = petBase + 10, mana = petBase + 11 } reviveCost = 1000 pets = { [1] = { monster = "orc spearman", vocations = {1, 2, 3, 4}, level = 30, attacks = { [1] = {name = "", level = 30, petLevel = 30, mana = 50, type = TYPE_DISTANCE, range = 10, combat = COMBAT_PHYSICALDAMAGE, effect = CONST_ME_NONE, distEffect = CONST_ANI_SPEAR, damageMin = 0.7, damageMax = 1.0} } }, [2] = { monster = "fire devil", vocations = {1, 2}, level = 60, attacks = { [1] = {name = "Fire Strike", level = 60, petLevel = 60, mana = 100, type = TYPE_DISTANCE, combat = COMBAT_FIREDAMAGE, effect = CONST_ME_FIREDAMAGE, distEffect = CONST_ANI_FIRE, damageMin = 1.5, damageMax = 2.0} } }, [3] = { monster = "minotaur guard", vocations = {3, 4}, level = 60, attacks = { [1] = {name = "Punch", level = 60, petLevel = 60, mana = 55, type = TYPE_NEAR, combat = COMBAT_PHYSICALDAMAGE, effect = CONST_ME_BLOOD, distEffect = CONST_ANI_NONE, damageMin = 1.5, damageMax = 2.0} } }, [4] = { monster = "water elemental", vocations = {2}, level = 95, attacks = { [1] = {name = "Ice Bomb", level = 100, petLevel = 100, mana = 250, type = TYPE_DISTANCE, range = 3, combat = COMBAT_ICEDAMAGE, effect = CONST_ME_ICEAREA, distEffect = CONST_ANI_ICE, damageMin = 1.5, damageMax = 2.0, area = {{0, 0, 1, 0, 0}, {0, 1, 3, 1, 0}, {0, 0, 1, 0, 0}}}, [2] = {name = "Poison Strike", level = 95, petLevel = 95, mana = 80, type = TYPE_DISTANCE, range = 8, combat = COMBAT_EARTHDAMAGE, effect = CONST_ME_GREENRINGS, distEffect = CONST_ANI_POISON, damageMin = 1.2, damageMax = 1.8} } }, [5] = { monster = "fire elemental", vocations = {1}, level = 95, attacks = { [1] = {name = "Fire Bomb", level = 100, petLevel = 100, mana = 250, type = TYPE_DISTANCE, range = 3, combat = COMBAT_FIREDAMAGE, effect = CONST_ME_FIREDAMAGE, distEffect = CONST_ANI_FIRE, damageMin = 1.5, damageMax = 2.0, area = {{0, 0, 1, 0, 0}, {0, 1, 3, 1, 0}, {0, 0, 1, 0, 0}}}, [2] = {name = "Fire Strike", level = 95, petLevel = 95, mana = 80, type = TYPE_DISTANCE, range = 3, combat = COMBAT_FIREDAMAGE, effect = CONST_ME_FIREDAMAGE, distEffect = CONST_ANI_FIRE, damageMin = 1.2, damageMax = 1.8} } }, [6] = { monster = "orc warlord", vocations = {4}, level = 95, attacks = { [1] = {name = "Throw Knife", level = 95, petLevel = 95, mana = 80, type = TYPE_DISTANCE, combat = COMBAT_PHYSICALDAMAGE, effect = CONST_ME_BLOOD, distEffect = CONST_ANI_THROWINGKNIFE, damageMin = 1.5, damageMax = 2.0} } }, [7] = { monster = "golem", vocations = {3}, level = 95, attacks = { [1] = {name = "Throw Stone", level = 95, petLevel = 95, mana = 80, type = TYPE_DISTANCE, combat = COMBAT_PHYSICALDAMAGE, effect = CONST_ME_BLOOD, distEffect = CONST_ANI_LARGEROCK, damageMin = 1.5, damageMax = 2.0} } }, [8] = { monster = "wyrm", vocations = {1, 2, 3, 4}, level = 135 }, [9] = { monster = "dragon lord", vocations = {1, 2, 3, 4}, level = 200, attacks = { [1] = {name = "Fire Bomb", level = 200, petLevel = 200, mana = 300, type = TYPE_DISTANCE, range = 3, combat = COMBAT_FIREDAMAGE, effect = CONST_ME_FIREAREA, distEffect = CONST_ANI_FIRE, damageMin = 1.5, damageMax = 2.0, area = AREA_CROSS1X1}, [2] = {name = "Fire Storm", level = 205, petLevel = 220, mana = 700, type = TYPE_NEAR, range = 8, combat = COMBAT_FIREDAMAGE, effect = CONST_ME_FIREAREA, distEffect = CONST_ANI_FIRE, damageMin = 1.8, damageMax = 2.5, area = AREA_CROSS5X5}, [3] = {name = "Fire Explosion", level = 203, petLevel = 210, mana = 450, type = TYPE_DISTANCE, range = 6, combat = COMBAT_FIREDAMAGE, effect = CONST_ME_EXPLOSIONHIT, distEffect = CONST_ANI_FIRE, damageMin = 1.5, damageMax = 2.1, area = AREA_CIRCLE2X2}, [4] = {name = "Scratch", level = 201, petLevel = 205, mana = 150, type = TYPE_NEAR, range = 1, combat = COMBAT_PHYSICALDAMAGE, effect = CONST_ME_HITAREA, distEffect = CONST_ANI_FIRE, damageMin = 1.3, damageMax = 1.8}, [5] = {name = "Fire Strike", level = 203, petLevel = 210, mana = 100, type = TYPE_DISTANCE, range = 3, combat = COMBAT_FIREDAMAGE, effect = CONST_ME_EXPLOSIONAREA, distEffect = CONST_ANI_FIRE, damageMin = 1.8, damageMax = 1.9} } } } function gainStat(pid, stat) if pid and pid > 0 and isMonster(pid) then stat.func(pid, stat.count) end addEvent(gainStat, stat.time, pid, stat) end function getLevelByExp(exp) return math.floor((math.sqrt(3) * math.sqrt(243*(exp+1)^2-48600*(exp+1)+3680000)+27 * (exp+1)-2700)^(1/3)/30^(2/3)-(5*10^(2/3))/(3^(1/3)*(math.sqrt(3)*math.sqrt(243*(exp+1)^2-48600*(exp+1)+3680000)+27*(exp+1)-2700)^(1/3))+2) end function getPetInfo(pet) if isNumber(pet) then return pets[pet] or false else for _, v in pairs(pets) do if pet:lower() == v.monster then return v end end end return false end function getPetByLevel(cid) local level = getPlayerLevel(cid) local pet for i = 1, #pets do v = pets[i] if level >= v.level and isInArray(v.vocations, getPlayerVocation(cid)) then pet = v end end return (pet ~= nil and pet or false) end function getAttackFormula(pid, attack) return { min = ((getPetLevel(pid) * 2) * (1 + attack.damageMin) + getPetLevel(pid)) / 2.5, max = ((getPetLevel(pid) * 3) * (1 + attack.damageMax) + getPetLevel(pid)) / 2.5 } end function doAttack(pid, target, param) local pet = getPetInfo(getCreatureName(pid)) if pet then if pet.attacks and pet.attacks[param] then local attack = pet.attacks[param] if target > 0 and attack.type and attack.type == TYPE_DISTANCE and getDistanceBetween(getCreaturePosition(pid), getCreaturePosition(target)) > (attack.range or 3) or attack.type == TYPE_NEAR and target > 0 and getDistanceBetween(getCreaturePosition(pid), getCreaturePosition(target)) > attack.range then return doPlayerSendCancel(getCreatureMaster(pid), "Target is too far.") and doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) end if target > 0 and not isSightClear(getCreaturePosition(pid), getCreaturePosition(target), true) then return doPlayerSendCancel(getCreatureMaster(pid), "There is not enough room.") and doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) end if target == 0 then return doPlayerSendCancel(getCreatureMaster(pid), "Please select a target first.") and doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) end if getPlayerLevel(getCreatureMaster(pid)) < attack.level then return doPlayerSendCancel(getCreatureMaster(pid), "You need level " .. attack.level .. " or higher to use this attack.") and doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) end if getPetLevel(pid) < attack.petLevel then return doPlayerSendCancel(getCreatureMaster(pid), "Your pet needs level " .. attack.petLevel .. " or higher to use this attack.") and doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) end if attack.mana and getCreatureMana(pid) < attack.mana then return doPlayerSendCancel(getCreatureMaster(pid), "Your pet does not have enough mana.") and doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) end if attack.area then doCastAreaAttack(pid, target, attack.area, attack) else doTargetCombatHealth(pid, target, attack.combat, -getAttackFormula(pid, attack).min, -getAttackFormula(pid, attack).max, attack.effect) end doCreatureAddMana(pid, -attack.mana) return doSendDistanceShoot(getCreaturePosition(pid), (attack.type == TYPE_DISTANCE and getCreaturePosition(target) or getCreaturePosition(pid)), attack.distEffect) and doCreatureSay(pid, attack.name, TALKTYPE_MONSTER) else return doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) end else return doSendMagicEffect(getCreaturePosition(pid), CONST_ME_POFF) and doPlayerSendCancel(getCreatureMaster(pid), "There is a tecnical problem, please contact a gamemaster.") end end function callPet(cid) for i = 1, #petStorages do if getCreatureStorage(cid, petStorages[i]) < 0 then doCreatureSetStorage(cid, petStorages[i], 0) end end local pet = getPetByLevel(cid) if not pet then return doPlayerSendCancel(cid, "You do not have enough level to call a pet.") end local ret = doCreateMonster(pet.monster, getCreaturePosition(cid)) if getCreatureStorage(cid, petStorages.level) < 1 then doCreatureSetStorage(cid, petStorages.level, pet.level) end if getCreatureStorage(cid, petStorages.exp) < 1 then doCreatureSetStorage(cid, petStorages.exp, getExperienceForLevel(pet.level)) end if getCreatureStorage(cid, petStorages.level) < pet.level then doCreatureSetStorage(cid, petStorages.level, pet.level) elseif getPlayerLevel(cid) * 3 < getCreatureStorage(cid, petStorages.level) then doCreatureSetStorage(cid, petStorages.level, (getPetByLevel(cid).level or 0)) doCreatureSetStorage(cid, petStorages.exp, getExperienceForLevel((getPetByLevel(cid).level or 0))) end if getLevelByExp(getCreatureStorage(cid, petStorages.exp)) < getCreatureStorage(cid, petStorages.level) then doCreatureSetStorage(cid, petStorages.exp, getExperienceForLevel(getCreatureStorage(cid, petStorages.level))) end if getCreatureStorage(cid, petStorages.health) < 1 then doCreatureSetStorage(cid, petStorages.health, getCreatureStorage(cid, petStorages.level) * petGainHealth) end if getCreatureStorage(cid, petStorages.mana) < 1 then doCreatureSetStorage(cid, petStorages.mana, getCreatureStorage(cid, petStorages.level) * petGainMana) end doCreatureSetStorage(ret, petStorages.level, getCreatureStorage(cid, petStorages.level)) doCreatureSetStorage(ret, petStorages.exp, getCreatureStorage(cid, petStorages.exp)) doConvinceCreature(cid, ret) doCreatureSetStorage(ret, petStorages.isPet, 1) doSendMagicEffect(getCreaturePosition(ret), CONST_ME_TELEPORT) setCreatureMaxHealth(ret, getPetLevel(ret) * petGainHealth) doCreatureAddHealth(ret, -getCreatureHealth(ret) + getCreatureStorage(cid, petStorages.health)) setCreatureMaxMana(ret, getPetLevel(ret) * petGainMana) doCreatureAddMana(ret, -getCreatureMana(ret) + getCreatureStorage(cid, petStorages.mana)) for _, v in pairs(petGainTicks) do gainStat(ret, v) end return doCreatureSay(cid, "Go pet!", TALKTYPE_SAY) end function doCastAreaAttack(pid, target, area, attack) local center = {} local areaxx = {} center.y = math.floor(#area/2)+1 for y = 1, #area do for x = 1, #area[y] do local number = area[y][x] if number > 0 then center.x = math.floor(table.getn(area[y])/2)+1 if attack.type == TYPE_DISTANCE then table.insert(areaxx, {x = getCreaturePosition(target).x + x - center.x, y = getCreaturePosition(target).y + y - center.y, z = getCreaturePosition(target).z}) else table.insert(areaxx, {x = getCreaturePosition(pid).x + x - center.x, y = getCreaturePosition(pid).y + y - center.y, z = getCreaturePosition(pid).z}) end end end end for i = 1, #areaxx do doAreaCombatHealth(pid, attack.combat, areaxx[i], 0, -getAttackFormula(pid, attack).min, -getAttackFormula(pid, attack).max, attack.effect) end end function isPet(pid) return getCreatureStorage(pid, petStorages.isPet) > 0 and true or false end function doPetAddExperience(pid, exp) doCreatureSetStorage(pid, petStorages.exp, getCreatureStorage(pid, petStorages.exp) + exp) doCreatureSetStorage(getCreatureMaster(pid), petStorages.exp, getPetExperience(pid)) doSendAnimatedText(getCreaturePosition(pid), exp, getConfigValue("gainExperienceColor")) return true end function getPetExperience(pid) return getCreatureStorage(pid, petStorages.exp) end function getPetLevel(pid) return getCreatureStorage(pid, petStorages.level) end function doPetSetLevel(pid, level) doCreatureSetStorage(pid, petStorages.level, level) doCreatureSetStorage(getCreatureMaster(pid), petStorages.level, level) setCreatureMaxHealth(pid, getPetLevel(pid) * petGainHealth) setCreatureMaxMana(pid, getPetLevel(pid) * petGainMana) return true end function getPlayerPet(cid) local pet if #getCreatureSummons(cid) < 1 then pet = false end for _, it in ipairs(getCreatureSummons(cid)) do if isPet(it) then pet = it break end end return pet end function getTopItem(p) p.stackpos = 0 local v = getThingFromPos(p) repeat p.stackpos = p.stackpos + 1 v = getThingFromPos(p) until v.itemid == 0 p.stackpos = p.stackpos - 1 return getThingFromPos(p) end Pasta data/creaturescripts/scripts/petdeath.lua: function onDeath(cid, corpse, deathList) if not isMonster(cid) or not isPet(cid) then return true end doCreatureSetStorage(getCreatureMaster(cid), petStorages.isDead, 1) doPlayerSendTextMessage(getCreatureMaster(cid), MESSAGE_STATUS_CONSOLE_BLUE, "Your pet is dead.") return true end Pasta data/creaturescripts/scripts/petstats.lua: function onStatsChange(cid, attacker, type, combat, value) if getPlayerPet(cid) and getPlayerPet(cid) == attacker then return false end return true end Pasta data/creaturescripts/scripts/petkill.lua: function onKill(cid, target, lastHit) if not isMonster(target) or getConfigValue("rateExperience") < 0.1 or getMonsterInfo(getCreatureName(target)) and getMonsterInfo(getCreatureName(target)).experience < 1 then return true end local pet = getPlayerPet(cid) if pet then doPetAddExperience(pet, getMonsterInfo(getCreatureName(target)).experience * petExpRate) if getLevelByExp(getPetExperience(pet)) > getPetLevel(pet) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Your pet advanced from level " .. getPetLevel(pet) .. " to level " .. getLevelByExp(getPetExperience(pet)) .. ".") doPetSetLevel(pet, getLevelByExp(getPetExperience(pet))) end end return true end Adicione no data/creaturescripts/scripts/login.lua: registerCreatureEvent(cid, "petKill") registerCreatureEvent(cid, "petDeath") registerCreatureEvent(cid, "petSta") Adicione na data/creaturescripts/creaturescripts.xml: <event type="kill" name="petKill" event="script" value="petkill.lua"/> <event type="death" name="petDeath" event="script" value="petdeath.lua"/> <event type="statschange" name="petStats" event="script" value="petstats.lua"/> Na pasta talkactions/scripts/pet.lua: local l = { ["north"] = NORTH, ["east"] = EAST, ["south"] = SOUTH, ["west"] = WEST, ["southwest"] = SOUTHWEST, ["southeast"] = SOUTHEAST, ["northwest"] = NORTHWEST, ["northeast"] = NORTHEAST } --fixed by falcon-- function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if param:lower() == "call" then if getCreatureStorage(cid, petStorages.isDead) > 0 then return doPlayerSendCancel(cid, "You need to revive your pet first.") end if getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "You cannot call your pet in protection zone.") end local pet = getPlayerPet(cid) if not pet then return callPet(cid) else doCreatureSetStorage(cid, petStorages.health, getCreatureHealth(pet)) doCreatureSetStorage(cid, petStorages.mana, getCreatureMana(pet)) doSendMagicEffect(getCreaturePosition(pet), CONST_ME_POFF) doRemoveCreature(pet) return doCreatureSay(cid, "It's enough!", TALKTYPE_SAY) end elseif param:lower() == "info" then local pet = getPlayerPet(cid) if pet then local pet_ = getPetInfo(getCreatureName(pet)) local attacks = "" if pet_.attacks and #pet_.attacks > 0 then for i = 1, #pet_.attacks do attacks = attacks .. "Attack ID: " .. i .. "\n" .. (pet_.attacks[i].name ~= "" and " Name: " .. pet_.attacks[i].name .. "\n" or "") .. " Level: " .. pet_.attacks[i].level .. "\n Pet level: " .. pet_.attacks[i].petLevel .. "\n Pet mana: " .. pet_.attacks[i].mana .. "\n" end end return doShowTextDialog(cid, 1948, "Here is your pet info:\n" .. "\nName: " .. getCreatureName(pet) .. "\nHealth: " .. getCreatureHealth(pet) .. "-" .. getCreatureMaxHealth(pet) .. "\nMana: " .. getCreatureMana(pet) .. "-" .. getCreatureMaxMana(pet) .. "\nLevel: " .. getPetLevel(pet) .. "\nExperience: " .. getPetExperience(pet) .. "\n-----Attacks-----\n" .. (attacks ~= "" and attacks or "No attacks")) else return doPlayerSendCancel(cid, "Please call your pet first.") end elseif param:lower() == "take" then local pet = getPlayerPet(cid) if not pet then return doPlayerSendCancel(cid, "Please call your pet first.") end local slot = 0 for i = 1, carryItems do if getCreatureStorage(cid, petItems[i]) < 1 then slot = i break end end if slot == 0 then return doPlayerSendCancel(cid, "You only can carry " .. carryItems .. " items.") end local item = getTopItem(getCreaturePosition(pet)) if getItemWeightById(item.itemid, 1) and getItemWeightById(item.itemid, 1) < 1 then return doPlayerSendCancel(cid, "There is no item to carry.") end if isInArray(blockedItems, item.itemid) then return doPlayerSendCancel(cid, "You cannot carry this item.") end doCreatureSetStorage(cid, petItems[slot], item.itemid * 1000 + (item.type > 0 and item.type or 1)) doRemoveItem(item.uid) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You take an item.") return true elseif param:lower() == "items" then local list = "Here is the list of items:\n" for i = 1, carryItems do if getCreatureStorage(cid, petItems[i]) < 1 then list = list .. "\n" .. i .. ". Empty." else local thing = getCreatureStorage(cid, petItems[i]) local item = math.floor(thing / 1000) local count = thing - item * 1000 list = list .. "\n" .. i .. ". x" .. count .. " " .. getItemNameById(item) .. "." end end return doShowTextDialog(cid, 1948, list) else param = string.explode(param, ":") if param[1]:lower() == "attack" then local pet = getPlayerPet(cid) if not pet then return doPlayerSendCancel(cid, "Please call your pet first.") end if not param[2] or not isNumber(param[2]) or tonumber(param[2]) < 1 then return doPlayerSendCancel(cid, "No attack index specified.") end if exhaustion.get(cid, petStorages.exhaust) then return doPlayerSendCancel(cid, "You are exhausted.") and doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), CONST_ME_POFF) end doAttack(pet, getCreatureTarget(cid), tonumber(param[2])) exhaustion.set(cid, petStorages.exhaust, petExhaust) elseif param[1]:lower() == "give" then local pet = getPlayerPet(cid) if not pet then return doPlayerSendCancel(cid, "Please call your pet first.") end if not param[2] or not isNumber(param[2]) or tonumber(param[2]) < 1 then return doPlayerSendCancel(cid, "No slot specified.") end if getCreatureStorage(cid, petItems[tonumber(param[2])]) > 0 then local thing = getCreatureStorage(cid, petItems[tonumber(param[2])]) local item = math.floor(thing/1000) local count = thing-item*1000 doPlayerAddItem(cid, item, count) doCreatureSetStorage(cid, petItems[tonumber(param[2])], 0) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You get an item.") else return doPlayerSendCancel(cid, "This slot is empty.") end elseif param[1]:lower() == "say" then local pet = getPlayerPet(cid) if not pet then return doPlayerSendCancel(cid, "Please call your pet first.") end if not param[2] or param[2] == "" then return doPlayerSendCancel(cid, "Command param required.") end if exhaustion.get(cid, petStorages.sayExhaust) then return doPlayerSendCancel(cid, "You are exhausted.") and doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), CONST_ME_POFF) end doCreatureSay(pet, param[2], TALKTYPE_MONSTER) exhaustion.set(cid, petStorages.sayExhaust, petExhaust) elseif param[1]:lower() == "move" then local pet = getPlayerPet(cid) if not pet then return doPlayerSendCancel(cid, "Please call your pet first.") end if not param[2] or param[2] == "" then return doPlayerSendCancel(cid, "Command param required.") end if exhaustion.get(cid, petStorages.moveExhaust) then return doPlayerSendCancel(cid, "You are exhausted.") and doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), CONST_ME_POFF) end local dir if l[param[2]:lower()] then dir = l[param[2]:lower()] local toPos = getPosByDir(getCreaturePosition(pet), dir, 1) local ret = queryTileAddThing(pet, toPos) if ret == RETURNVALUE_NOERROR then doMoveCreature(pet, dir) exhaustion.set(cid, petStorages.moveExhaust, petExhaust) else return doPlayerSendCancel(cid, "There is not enough room.") and doSendMagicEffect(getCreaturePosition(pet), CONST_ME_POFF) end else return doPlayerSendCancel(cid, "No direction specified.") end elseif isInArray({"mana", "health"}, param[1]:lower()) then if getPlayerGroupId(cid) < 3 then return false end local pet = getPlayerPet(cid) if not pet then return doPlayerSendCancel(cid, "Please call your pet first.") end if not param[2] or not isNumber(param[2]) then return doPlayerSendCancel(cid, "Command param required.") end if param[1]:lower() == "health" then doCreatureAddHealth(pet, tonumber(param[2])) elseif param[1]:lower() == "mana" then doCreatureAddMana(pet, tonumber(param[2])) end return doSendMagicEffect(getCreaturePosition(pet), (param[1]:lower() == "health" and CONST_ME_MAGIC_RED or CONST_ME_MAGIC_BLUE)) end end return true end Talkactions.xml: <talkaction words="!pet" event="script" value="pet.lua"/> Screen's: Comandos: !pet call !pet take !pet items !pet attack !pet give !pet say !pet move !pet mana Créditos: Falcon
  8. Sistema de Pet V1.0 E ai Galera, suave? Hoje venho trazer pra vocês, meu sistema de pet. É bem do tipo pokemon, mas tenho certeza que irão gostar. Vou liberá-lo porque gosto de compartilhar as coisas, e sei que alguém esta querendo um sistema desses. Assim como eu quis um dia e nunca encontrei um que funcionasse. O sistema está na versão 1.0, mas em em breve trarei um npc para healar o pet e algumas talks para o pet soltar spells. Vamos lá! Primeiramente, vá em data/action/scripts, crie um arquivo com o nome de CatchPet.lua e adicione: local mtrs = { ["Rat"] = {hp = 1000, maxhp = 1000, corpse = 2813, chance = 100}, ["Rotworm"] = {hp = 1000, maxhp = 1000, corpse = 5967, chance = 100}, ["Skeleton"] = {hp = 1000, maxhp = 1000, corpse = 5972, chance = 100}, ["Dragon"] = {hp = 1000, maxhp = 1000, corpse = 3104, chance = 100}, ["Dragon Lord"] = {hp = 1000, maxhp = 1000, corpse = 5984, chance = 100}, } function onUse(cid, item, frompos, item2, topos) for pet_name, v in pairs(mtrs) do if item2.itemid == v.corpse then if math.random(0,100) <= v.chance then doPlayerSendTextMessage(cid, 27, "Você capturou um ".. pet_name .. ".") doRemoveItem(item2.uid, 1) doRemoveItem(item.uid, 1) local itemcatch = doPlayerAddItem(cid, 7632, 1) doItemSetAttribute(itemcatch, "namepet", pet_name) doItemSetAttribute(itemcatch, "description", "Contém um ".. pet_name ..".") doItemSetAttribute(itemcatch, "lifepet", v.hp) doItemSetAttribute(itemcatch, "maxlifepet", v.maxhp) else doPlayerSendTextMessage(cid, 27, "Falhou.") end end end return true end Em seguida, duplique o arquivo, renomeie para VaiVolta e adicione: function onUse(cid, item, frompos, item2, topos) local health = tonumber(getItemAttribute(item.uid, "lifepet")) local mhp = tonumber(getItemAttribute(item.uid, "maxlifepet")) if health <= 0 then return doPlayerSendCancel(cid, "Esse pet esta morto.") end local pet_name = getItemAttribute(item.uid, "namepet") if item.itemid == 7632 then if not getTilePzInfo(getPlayerPosition(cid)) then if #getCreatureSummons(cid) < 1 then doTransformItem(item.uid, 7633) local summon = doSummonCreature(pet_name, getThingPos(cid)) doConvinceCreature(cid, summon) setCreatureMaxHealth(summon, mhp) doCreatureAddHealth(summon, mhp) doCreatureAddHealth(summon, health - mhp) doSendMagicEffect(getCreaturePosition(summon), 67) doCreatureSay(cid, "Vai, ".. pet_name .. "!", TALKTYPE_SAY) else doPlayerSendCancel(cid, "Você já sumonou um Pet.") end else doPlayerSendCancel(cid, "Você não pode estar em Protection Zone para sumonar seu Pet.") end elseif item.itemid == 7633 then local hp, maxhp = getCreatureHealth(getCreatureSummons(cid)[1]), getCreatureMaxHealth(getCreatureSummons(cid)[1]) if #getCreatureSummons(cid) >= 1 then doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 67) doRemoveCreature(getCreatureSummons(cid)[1]) doTransformItem(item.uid, 7632) doItemSetAttribute(item.uid, "lifepet", hp) doItemSetAttribute(item.uid, "maxlifepet", maxhp) doCreatureSay(cid, "Volta, " .. pet_name .. ".", TALKTYPE_SAY) end end return true end Agora em Actions.xml, adicione as tags: <action itemid="2149" event="script" value="CatchPet.lua"/> <action itemid="7632;7633" event="script" value="VaiVolta.lua"/> Configurando Nesta parte você irá editar: Quote ["Rat"] = {hp = 1000, maxhp = 1000, corpse = 2813, chance = 100}, ["Rotworm"] = {hp = 1000, maxhp = 1000, corpse = 5967, chance = 100}, ["Skeleton"] = {hp = 1000, maxhp = 1000, corpse = 5972, chance = 100}, ["Dragon"] = {hp = 1000, maxhp = 1000, corpse = 3104, chance = 100}, ["Dragon Lord"] = {hp = 1000, maxhp = 1000, corpse = 5984, chance = 100}, NOME DO PET / HP / HP MÁXIMO / CORPSE ID ( AQUELE QUE FICA QUANDO O MONSTRO MORRE) / CHANCE DE CAPTURA DO PET. Esse são os id's das "pokeballs": Caso queira mudar, troque no script e na tag no actions.xml. Este é o item de captura: <action itemid="2149" event="script" value="CatchPet.lua"/> Bom, é isso galera, espero que gostem e que façam um bom uso do sistema! Aproveitem! Dúvidas? Sugestões? Criticas? Comentem!!
  9. Nome: Sistema de Colisão de Magias V. 1.0 Autor: Ramza (Ricardo Ianelli) Versão Testada: TFS 0.3.6PL1 (8.54) "PODERÁ FUNCIONA EM VERSÃO 8.54+ FAÇA O TESTE" Introdução video: Funcionamento Do ponto de vista do jogador: O jogador usa uma magia, digamos, exori frigo. No mesmo momento, o inimigo usa um exori vis por exemplo. As magias voam, e se colidem no ar. Do ponto de vista do scripter: Toda magia antes de ser lançada, salva um storage value, e checa se o inimigo tem o mesmo storage. Caso tenha, ao invés de mandar a magia, manda os efeitos pra uma posição calculada entre os dois pontos, e um efeito de colisão. Caso o criador queira melhorar ainda a função (pra ficar como na versão 2.0 do sistema), pode-se fazer uma checagem de força pra saber qual das duas 'vence', fazendo com que ela atinja o oponente. Para melhores resultados, magias usando addEvent são mais usadas, por isso usarei um exemplo dessa forma aqui no tutorial. Instalação Na pasta Data, crie um arquivo chamado colisionLIB.lua. Dentro dele, cole isto: function checkColision(cid) -- Function by Ramza (Ricardo Ianelli) if getCreatureTarget(cid) ~= 0 then setPlayerStorageValue(cid, 9001, 'casting') local ppos, enemy = getCreaturePosition(cid), getCreatureTarget(cid) local epos = getCreaturePosition(enemy) if getPlayerStorageValue(enemy, 9001) == 'casting' and getCreatureTarget(enemy) == cid then setPlayerStorageValue(enemy, 9001, 'colision') setPlayerStorageValue(cid, 9001, 'colision') if ppos.x > epos.x and ppos.y > epos.y then cpos = {x = ppos.x - ((ppos.x - epos.x) / 2), y = ppos.y - ((ppos.y - epos.y) / 2), z = ppos.z} elseif ppos.x > epos.x and ppos.y < epos.y then cpos = {x = ppos.x - ((ppos.x - epos.x) / 2), y = epos.y - ((epos.y - ppos.y) / 2), z = ppos.z} elseif ppos.x < epos.x and ppos.y < epos.y then cpos = {x = epos.x - ((epos.x - ppos.x) / 2), y = epos.y - ((epos.y - ppos.y) / 2), z = ppos.z} elseif ppos.x < epos.x and ppos.y > epos.y then cpos = {x = epos.x - ((epos.x - ppos.x) / 2), y = ppos.y - ((ppos.y - epos.y) / 2), z = ppos.z} end doSendDistanceShoot(ppos, cpos, CONST_ANI_ENERGY) doSendDistanceShoot(epos, cpos, CONST_ANI_ENERGYBALL) local value = math.random(1, 3) doSendMagicEffect(cpos, 27+value) return true else return false end end end Agora vamos pegar uma magia bem básica como exemplo para teste. Vamos usar a magia energy strike. Abra o arquivo da magia, estará mais ou menos assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Vamos modificar um pouco para o nosso sistema. Deixe-a assim: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1) local function spell(cid, var) if getPlayerStorageValue(cid, 9001) ~= 'colision' then doCreatureSay(cid, 'Strike!', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, 9001, nil) return doCombat(cid, combat, var) end end function onCastSpell(cid, var) checkColision(cid) doCreatureSay(cid, 'Energy...', TALKTYPE_ORANGE_1) addEvent(spell, 2000, cid, var) end Agora adiciona essa função em todas as magias que você deseja a colisão. function onCastSpell(cid, var) checkColision(cid) doCreatureSay(cid, 'Energy...', TALKTYPE_ORANGE_1) addEvent(spell, 2000, cid, var) end Hora de testar, a hora mais difícil! Bem, pra testar esse sistema você precisa de um amigo pra te ajudar, ou de ferramentas ilegais e agilidade. Vamos tomar como exemplo caso você fosse com um amigo testar. Simplesmente usem exori vis um no outro, e vejam o que acontece Comentários Quem já é mais experiente já deve ter sacado o tanto de possibilidades que isso abre, como fazer com magias mais avançadas, comparar magic level, fazer com que caso o ML de um seja maior que o do outro, ela anule a do inimigo mas a sua ainda acerte, fazer sistemas no estilo 'disputa de kame-hame-has' usando spriters sem ser as do tibia, e muitas outras coisas, só vai depender de você usar a sua CRIATIVIDADE. Esse sistema, apesar de simples, é considerado pra mim um dos meus sistemas mais avançados, pois como dizia o sábio programador: "O verdadeiro gênio não é aquele que usa pilhas, ponteiros, matrizes ou funções complexas, e sim aquele que usa a criatividade." Muita gente ofereceu grana preta nesse sistema já, mas eu postei aqui pra lembrar à todos vocês que o que faz um grande programador não é o quão complexas são as funções que você usa e os codes que você faz, e sim, o quão criativas einovadoras são suas criações. É isso ai galera, deixo meu abraço pra todos vocês, qualquer dúvida é só me perguntar, e eu quero que vocês lembrem que o melhor code é sempre, de longe, aquele mais criativo, não importa se tenha 3, 100 ou 10.000 linhas. Lembrem-se disso, sempre.
  10. Bom galera, estou começando minha carreira na área de scripts, e estou fazendo o possível para postar 1 por semana. Semana passada eu postei o Sistema de Fome E hoje estou postando o Woodcutting Sistem na versão 1.0, em breve updates. Então, vamos lá! Em data/actions/scripts, crie um arquivo.lua com o nome de wood e coloque isso: function onUse(cid, item, frompos, item2, topos) local chance = 70 -- chance de cortar local madeiras = {5941, 5901} -- item que o player irá ganhar local premio = madeiras[math.random(1, #madeiras)] local transformItem = 8786 local texts = {"Tuc", "Toc", "Trec"} local random = texts[math.random(1,#texts)] local vocationUse = 2 local time = 2 -- Minutos para crescer novamente if getPlayerVocation(cid) ~= vocationUse then doPlayerSendTextMessage(cid,22,"Você não tem a vocação necessária para cortar.") return true end if item2.itemid == 2708 or item2.itemid == 2700 or item2.itemid == 6218 or item2.itemid == 2701 or item2.itemid == 2707 then if math.random(1,100) >= chance then doPlayerAddItem(cid,premio, math.random(1, 2)) doTransformItem(item2.uid, transformItem) doSendMagicEffect(topos, 16) doPlayerSendTextMessage(cid,22,"Você cortou uma madeira.") doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_GREEN) doDecayItem(item2.uid) addEvent(doCreateItem, time*60*1000, item2.itemid, 1, getThingPos(item2.uid)) else doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_GREEN) doPlayerSendTextMessage(cid,22,"Você não conseguiu cortar.") end end return true end Em data/actions/actions.xml adicione a tag: <action itemid="4874" event="script" value="wood.lua"/> 4874 é o ID do Dwarven Pickaxe. Imagens: É isso ai galera. Obrigado!
  11. Looking at You Fala galera do TK, faz tempo que não posto nada, aí vou postar um sistema simples aqui, que ainda não tem no fórum e vejo membros procurando. DESCRIÇÃO DO SISTEMA: Quando um player der look em você aparecerá em branco uma mensagem no canto inferior da tela: "Nome do Player" is looking at you. 1° - Acesse a pasta MODS e crie um arquivo chamado lookingatyou.xml, coloque isso dentro do arquivo: <?xml version="1.0" encoding="UTF-8"?> <mod name="peeper" version="1.0" author="" contact="" enabled="yes"> <config name="peeper-config"><![CDATA[ -- anonymously or display peeper name? anonymous = "no" -- ignore players with access (will not show message when they look on someone) hiddenAccess = 3 -- message color (type) messageType = MESSAGE_STATUS_DEFAULT ]]></config> <event type="look" name="peeper-event" event="script"><![CDATA[ domodlib('peeper-config') local config = { anonymous = getBooleanFromString(anonymous), hiddenAccess = hiddenAccess, messageType = messageType } function onLook(cid, thing, position, lookDistance) if(isPlayer(thing.uid) and getPlayerAccess(cid) < config.hiddenAccess) then doPlayerSendTextMessage(thing.uid, config.messageType, (config.anonymous and "Someone" or getPlayerName(cid)) .. " is looking at you.") end return true end ]]></event> <event type="login" name="peeper-login" event="buffer"><![CDATA[ registerCreatureEvent(cid, "peeper-event") _result = true ]]></event> </mod> Bom galera este é o sistema. Créditos: EddyHavoc Slawkens Testado e funcionando 100%
  12. Fala pessoal do Tibiaking, bom hoje vim postar um sistema bem interessante, que não é da minha autoria porém no final tem os creditos, como eu tinha falado em outro tópico eu tinha servidor em mente, tinha feito algumas coisa e tal, e tinha uma quest que para chegar no npc você tinha que cruzar o mar, então depois de procurar um pouco achei esse sistema e coloquei no meu OTserv achei bem legal, decidir compartilhar com vocês . Informação basica : É um MOD que apesar de ser um script básico ele tem um efeito bastante legal e consiste em um barco onde você irá escolher qual caminho ele fará, mas será definido no arquivo XML não por o player tendeu ? Bom primeiramente nós iremos na pasta mod e criar um arquivo xml chamado boatsystem e coloque o seguinte dentro : Configurar o Script : Toda a configuração dele está aqui ( para que não sabe meche com script, só mecha nessa parte ) local t = {4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2} local postart = {x=968, y=1001, z=7, stackpos=1} local posback = {x=994, y=978, z=7, stackpos=1} local delay = 350 LOCAL T : são todas as direções que o barco vai andar, em sentido horário. 1 = norte 2 = leste 3 = sul 4 = oeste LOCAL POSTART : é a posição que o meio do barco vai estar quando ele estiver indo para algum lugar. LOCAL POSBACK : é a posição que o meio do barco vai estar quando ele estiver voltando. LOCAL DELAY : O delay é o tempo em mile segundos que demora pra o barco andar. Adicionando no Map editor: Faça 3 sqms do id 4820. Adicione o actionid 6617 nesses sqms. Faça 3 ids de barco, voce escolhe se eh o virado para cima ou para o lado. Bote o actionid 6616 no meio do barco. Nessa forma : O vermemlho indica que tem o id 4820 e o actionid 6617. O verde indica o actionid 6616 Aqui temos um video demostrativo do autor do MOD onde veremos o resultado Observações : -Na pos que ele vai chegar só faça o negocio na aguá, não precisa fazer outro bote. - Coloque Ant-logout nos SQM's da rota que segundo o autor vai dar bug caso alguém deslogue no barco. Todos os créditos : - MatheusMkalo
  13. Olá, como percebi que muitos usuários estavam com problemas em copilar a versão do Jamilson Collins http://www.tibiaking.com/forum/topic/27617-cast-system-tfs-04-86/), Eu resolvi, editar a sourcer, colocando para ser compatível com linux e windows. Tinha alguns códigos mal "formulados" gerando os possíveis crashs. O que vem no conteúdo a seguir contem os seguintes items : Sourcers com o Cast System(Linux/Windows) Código MySQL para você por na sua database. Talkaction para o player poder executar o comando. Cast.php, que é a página do Cast System com comandos e outros (Compatível com o gesior e em português). Adicione enableCast = "true" (no seu config.lua) Estarei tirando dúvidas em relação as minhas modificações. Link Copilado 32Bits(Windows) http://www.mediafire.com/?166i4wg4q3te4uc Scan: https://www.virustotal.com/pt/file/7020fa7a169a390cf5fabaca8a8edbcbe4e4f119e99c7d9dd66c2741227dd293/analysis/1383447449/ OBS> no scan acusou um virus, se alguém duvida de algo, baixe a source e copile por si. Link Source: http://www.mediafire.com/?w19t81fgivm6j06 Scan: https://www.virustotal.com/pt/file/2f8b21c37316415e5175afaa12d73c43e4c5cfa8dba206cf5a144b2f909aefa7/analysis/1383448112/ Créditos: Summ, Jamilson Collins, Eu por ter modificado é claro =D Aproveitem, deu um pouco de trabalho para corrigir os problemas.
  14. Obrigado a Todos... <?xml version="1.0" encoding="UTF-8"?> <mod name="teleport rune" version="1.0" author="Snokiuthu" contact="mar_cos75" enabled="yes"> <action itemid="2357" event="script" override="yes"><![CDATA[ function onUse(cid, item, frompos, item2, topos) local storage = 11548 -- n mexa local exhausted = 250 -- tempo em segundos if (getPlayerStorageValue(cid, storage) >= os.time()) then return doPlayerSendCancel(cid, "Você tem que esperar " .. getPlayerStorageValue(cid, storage) - os.time() .. " segundos para usar novamente.") end local effect = 10 local message = "You were teleported to "..getTownName(getPlayerTown(cid)).." town." local errormessage = "Sorry, you cannot use this scroll in a battle." local town = local town = {x=xxxx, y=xxxx, z=x} --- if getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, errormessage) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, message) doTeleportThing(cid,town) doSendMagicEffect(town,effect) setPlayerStorageValue(cid,storage,os.time()+exhausted) return end ]]></action> </mod> local exhausted = 250 -- tempo em segundos local town = local town = {x=xxxx, y=xxxx, z=x} local do teleport
  15. Galera, eu estava passeando pela OTLand, então achei este MOD, procurei ele pelo forum aqui e não encontrei, então decidi postar para vocês. Como o próprio nome diz, é um anel de loot, que aumenta a chance de Loot para quem está o usando. Bora lá, como é MOD, então é muito fácil, acesse sua pasta mods, geralmente situada na pasta onde fica o Launcher.exe. Crie um arquivo.xml, no exemplo iremos usar o "lootring.xml" e deixe somente o código abaixo dentro do arquivo. Agora vá no seu config.lua, procure por "monsterLootMessage" e altera seu valor para "0", ficando como o abaixo: monsterLootMessage = 0 Well done. #Caso seu OTServ não possua a pasta MOD, faça os passos do Spoiler abaixo: Salve e feche-o. Está pronto seu script, e como pode ver, no início do script lootring.lua tem as opções de configuração caso queira mudar o item especial ou a porcentagem de loot. OBS: Se seu Servidor possui o Evento WoE (War of Emperium), clique no spoiler abaixo: Script's testados em: TFS 0.3.6 e Alissow 0.4.1. Funciona perfeitamente em OTServ 8.60. #Créditos¹: Cykotitan que é de outro forum e criou o script em CreatureScripts. ##Créditos²: Collz que é de outro forum, editou o script e também o transformou em MOD.
  16. É um sistema do tipo Ragnarok em que ao usar a talk, o player ficará imóvel e seu life e mana irão subir. Vamos ao script! Em data/talkactions/scripts, crie um arquivo com o nome de sentar.lua e adicione: local sentar = {health = 5, mana = 5} local storage = 12345 function onSay(cid, words) if getTilePzInfo(getPlayerPosition(cid)) then if getPlayerStorageValue(cid, 12345) == -1 then doCreatureSay(cid, "Ahh, vou descansar...", TALKTYPE_MONSTER) doSendMagicEffect(getCreaturePosition(cid), 1) doPlayerAddHpManaSentar(cid, sentar) doCreatureSetNoMove(cid, true) setPlayerStorageValue(cid, 12345, 1) else setPlayerStorageValue(cid, 12345, -1) doCreatureSetNoMove(cid, false) doCreatureSay(cid, "Já descansei.", TALKTYPE_MONSTER) stopEvent(hpmana) end end return true end function doPlayerAddHpManaSentar(cid, formula) if not isCreature(cid) then return true end doCreatureAddHealth(cid, formula.health) doCreatureAddMana(cid, formula.mana) hpmana = addEvent(doPlayerAddHpManaSentar, 5000, cid, formula) end Agora em talkactions.xml adicione a tag: <talkaction words="!sentar" event="script" value="sentar.lua"/>
  17. Olá, galerinha. Hoje estou trazendo a vocês um modo, ao meu ver, mais prático e organizado de configurar e gerenciar os logs de quest do seu servidor. Eu sempre gostei de RPG e tudo que fosse relacionado a ele, quests bem elaboradas com npcs, desafios e coisas do tipo sempre me atraíram muito, e ai que entra o questlog, quando você tem várias missões é bom dar uma orientação pro player do que ele tem que fazer(mas não spoilers, isso tira toda a graça da missão), o questlog é uma ferramenta bem bacana que pode servir para dar essa orientação ao player e lembrar a ele que ele tem algumas missões ou etapa de missão, que não foi concluída e que ele pode fazer para receber alguma recompensa. Por padrão os servidores já vêm com um único arquivo que tem a responsabilidade de guardar as informações sobre as missões, só que eu sempre achei que ter várias informações em um único arquivo tornava tudo muito desorganizado, uma bagunça. Então tive a ideia de fazer uma pasta e colocar lá dentro arquivos com informações sobre as missões, e logo quando o servidor estivesse sendo iniciado um script simples iria transformar esses arquivos Lua, em um quest.xml prontinho para ser usado, bem vamos deixar de papo-furado e botar a mão na massa. Em primeiro lugar é bom você fazer um backup do seu quest.xml antigo, só pra ter guardadinho caso tenha necessidade de usar depois. Em segundo, você deve baixar o arquivo abaixo, descompactar ele e jogar no diretório raiz do seu OTServer. Lua quest log.rar Pra configurar é simples, você vai na pasta questlog que fica dentro da pasta data do seu servidor e adiciona os arquivos lua lá com as configurações da sua quest. Tem um arquivo de exemplo lá na pasta já, é só baixar e ler, o arquivo está todo comentado é só ler e aprender , o nome da quest vai ser igual ao nome do arquivo(não pode usar acentos no nome da missão). Essa é a quest de exemplo que vem na pasta questlog, quando você baixar o arquivo anexado: -- Lua quest log -- by Maxwell Alcantara[MaXwEllDeN] -- [email protected] local geral = { storage_id = 30031, -- Storage value da quest startstorage = 1, -- Valor inicial da storage(Só vai aparecer no quest log do player quando a storage 30031 tiver o id 1) missions = { ["The head of Kiper"] = { -- Nome da missão 1 storageid = 1001, -- Storage value da missão start_value = 1, -- valor inicial da storage end_value = 3, -- valor final da storage states = { [1] = "Kill Kiper!", -- Descrição do state 1 [2] = "Give his head to Talaturen!", -- Descrição do state 2 [3] = "Take the medal you got from Talaturen to Ruly!", -- Descrição do state 3 } }, ["Ruly's Revenge"] = { -- Nome da missão 2 storageid = 30031, -- Storage value da missão start_value = 4, -- valor inicial da storage end_value = 6, -- valor final da storage states = { [4] = "You received a document with instructions from Ruly, follow them.", -- Descrição do state 4 [5] = "Go back to Ruly and tell him that you followed his instructions to the end.", -- Descrição do state 5 [6] = "You got a reward from Ruly, he was very thankful with that you helped him to take his revenge.", -- descrição do state 6 } }, } } É só isso pessoal, até a próxima .
  18. <p>wand multi elemento ao fala !arma hielo ou !arma death etc troka o elemento va em seu serve/mods copei e colo um arquivo .xml coloke o nome de multielementos e apage oq tem dentro e cole isso <?xml version="1.0" encoding="UTF-8"?> <mod name="Weapons Multi Elements" version="1.0" author="Angelshitho" contact="GamesOnCheats.net" enabled="yes"> <config name="config"><![CDATA[ config = { min1 = 0.2, -- multiplicador de tu ml min2 = 100, -- minimo de dano max1 = 1.2, -- multiplicador de tu lvl max2 = 300, -- maximo de dano stwea = 6998, -- storage value of Weapon stele = 6999, -- Storage value of Element bowid = 8858 -- Bow ID } wea = { ["sword"] = {vl = 1, id = 8931}, ["axe"] = {vl = 2, id = 8926}, ["hammer"] = {vl = 3, id = 8929}, ["arrow"] = {vl = 4, id = 2352}, ["wand"] = {vl = 5, id = 7451} } ele = { ["tera"] = {vl = 1, effect = CONST_ME_CARNIPHILA}, ["flam"] = {vl = 2, effect = CONST_ME_HITBYFIRE}, ["energy"] = {vl = 3, effect = CONST_ME_PURPLEENERGY}, ["holy"] = {vl = 4, effect = CONST_ME_HOLYDAMAGE}, ["mort"] = {vl = 5, effect = CONST_ME_MORTAREA}, ["frigo"] = {vl = 6, effect = CONST_ME_ICEATTACK}, ["drown"] = {vl = 7, effect = CONST_ME_LOSEENERGY}, ["fisico"] = {vl = 8, effect = CONST_ME_BLOCKHIT}, ["random"] = {vl = 9, effect = CONST_ME_CRAPS} } ]]></config> <talkaction words="!arma" event="script"><![CDATA[ domodlib('config') function onSay(cid, words, param, channel) local t = string.explode(param, ",") -- DONT TOUCH local weapon = wea[t[1]] -- DONT TOUCH local element = ele[t[2]] -- DONT TOUCH if element and weapon then if getPlayerItemCount(cid, weapon.id) == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Necesitas el ".. t[1].." para aplicar el elemento.") elseif getPlayerItemCount(cid, 2352) >= 1 and getPlayerItemCount(cid, config.bowid) == 0 then doPlayerSendCancel(cid, "Necesitas el Arco para poder usar la Arrow Multi Elementos") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) elseif getPlayerItemCount(cid, weapon.id) >= 1 then setPlayerStorageValue(cid, config.stele, element.vl) doSendMagicEffect(getCreaturePosition(cid), element.effect) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Tu ".. t[1] .." Esta usando un daño de ".. t[2] .."!.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "los comandos son tera, flam, energy, holy, mort, frigo, drown, fisico y random.") end end return true end ]]></talkaction> <wand id="7451" level="1" mana="2" event="script"><![CDATA[ domodlib('config') local tierra = createCombatObject() -- 1 setCombatParam(tierra, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(tierra, COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) setCombatParam(tierra, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISON) setCombatFormula(tierra, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fuego = createCombatObject() -- 2 setCombatParam(fuego, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(fuego, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatParam(fuego, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) setCombatFormula(fuego, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local energy = createCombatObject() -- 3 setCombatParam(energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatParam(energy, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatFormula(energy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local holy = createCombatObject() -- 4 setCombatParam(holy, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(holy, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatParam(holy, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY) setCombatFormula(holy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local death = createCombatObject() -- 5 setCombatParam(death, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(death, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(death, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH) setCombatFormula(death, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local hielo = createCombatObject() -- 6 setCombatParam(hielo, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(hielo, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatParam(hielo, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE) setCombatFormula(hielo, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local drown = createCombatObject() -- 7 setCombatParam(drown, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE) setCombatParam(drown, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatParam(drown, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL) setCombatFormula(drown, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fisico = createCombatObject() -- 8 setCombatParam(fisico, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(fisico, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) setCombatParam(fisico, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WHIRLWINDSWORD) setCombatFormula(fisico, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) function onUseWeapon(cid, var) local valor = getPlayerStorageValue(cid, config.stele) local lucky = math.random(1, 8) if valor == 9 then if lucky == 1 then doCombat(cid, tierra, var) elseif lucky == 2 then doCombat(cid, fuego, var) elseif lucky == 3 then doCombat(cid, energy, var) elseif lucky == 4 then doCombat(cid, holy, var) elseif lucky == 5 then doCombat(cid, death, var) elseif lucky == 6 then doCombat(cid, hielo, var) elseif lucky == 7 then doCombat(cid, drown, var) elseif lucky == 8 then doCombat(cid, fisico, var) end else doCombat(cid, valor == 1 and tierra or valor == 2 and fuego or valor == 3 and energy or valor == 4 and holy or valor == 5 and death or valor == 6 and hielo or valor == 7 and drown or fisico, var) end return true end ]]> <vocation id="1"/> <vocation id="2"/> </wand> <distance id="2352" event="script"><![CDATA[ domodlib('config') local tierra = createCombatObject() -- 1 setCombatParam(tierra, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(tierra, COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) setCombatParam(tierra, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISON) setCombatFormula(tierra, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fuego = createCombatObject() -- 2 setCombatParam(fuego, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(fuego, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatParam(fuego, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) setCombatFormula(fuego, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local energy = createCombatObject() -- 3 setCombatParam(energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatParam(energy, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatFormula(energy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local holy = createCombatObject() -- 4 setCombatParam(holy, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(holy, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatParam(holy, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY) setCombatFormula(holy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local death = createCombatObject() -- 5 setCombatParam(death, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(death, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(death, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH) setCombatFormula(death, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local hielo = createCombatObject() -- 6 setCombatParam(hielo, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(hielo, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatParam(hielo, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE) setCombatFormula(hielo, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local drown = createCombatObject() -- 7 setCombatParam(drown, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE) setCombatParam(drown, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatParam(drown, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL) setCombatFormula(drown, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fisico = createCombatObject() -- 8 setCombatParam(fisico, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(fisico, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) setCombatParam(fisico, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR) setCombatFormula(fisico, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) function onUseWeapon(cid, var) local valor = getPlayerStorageValue(cid, config.stele) local lucky = math.random(1, 8) if valor == 9 then if lucky == 1 then doCombat(cid, tierra, var) elseif lucky == 2 then doCombat(cid, fuego, var) elseif lucky == 3 then doCombat(cid, energy, var) elseif lucky == 4 then doCombat(cid, holy, var) elseif lucky == 5 then doCombat(cid, death, var) elseif lucky == 6 then doCombat(cid, hielo, var) elseif lucky == 7 then doCombat(cid, drown, var) elseif lucky == 8 then doCombat(cid, fisico, var) end else doCombat(cid, valor == 1 and tierra or valor == 2 and fuego or valor == 3 and energy or valor == 4 and holy or valor == 5 and death or valor == 6 and hielo or valor == 7 and drown or fisico, var) end return true end ]]> <vocation id="3"/> </distance> <melee id="8931" unproperly="1" event="script"><![CDATA[ domodlib('config') local tierra = createCombatObject() -- 1 setCombatParam(tierra, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(tierra, COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) setCombatFormula(tierra, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fuego = createCombatObject() -- 2 setCombatParam(fuego, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(fuego, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatFormula(fuego, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local energy = createCombatObject() -- 3 setCombatParam(energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatFormula(energy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local holy = createCombatObject() -- 4 setCombatParam(holy, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(holy, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatFormula(holy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local death = createCombatObject() -- 5 setCombatParam(death, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(death, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(death, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local hielo = createCombatObject() -- 6 setCombatParam(hielo, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(hielo, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatFormula(hielo, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local drown = createCombatObject() -- 7 setCombatParam(drown, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE) setCombatParam(drown, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatFormula(drown, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fisico = createCombatObject() -- 8 setCombatParam(fisico, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(fisico, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) setCombatFormula(fisico, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) function onUseWeapon(cid, var) local valor = getPlayerStorageValue(cid, config.stele) local lucky = math.random(1, 8) if valor == 9 then if lucky == 1 then doCombat(cid, tierra, var) elseif lucky == 2 then doCombat(cid, fuego, var) elseif lucky == 3 then doCombat(cid, energy, var) elseif lucky == 4 then doCombat(cid, holy, var) elseif lucky == 5 then doCombat(cid, death, var) elseif lucky == 6 then doCombat(cid, hielo, var) elseif lucky == 7 then doCombat(cid, drown, var) elseif lucky == 8 then doCombat(cid, fisico, var) end else doCombat(cid, valor == 1 and tierra or valor == 2 and fuego or valor == 3 and energy or valor == 4 and holy or valor == 5 and death or valor == 6 and hielo or valor == 7 and drown or fisico, var) end return true end ]]> <vocation id="4"/> </melee> <melee id="8926" unproperly="1" event="script"><![CDATA[ domodlib('config') local tierra = createCombatObject() -- 1 setCombatParam(tierra, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(tierra, COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) setCombatFormula(tierra, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fuego = createCombatObject() -- 2 setCombatParam(fuego, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(fuego, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatFormula(fuego, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local energy = createCombatObject() -- 3 setCombatParam(energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatFormula(energy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local holy = createCombatObject() -- 4 setCombatParam(holy, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(holy, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatFormula(holy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local death = createCombatObject() -- 5 setCombatParam(death, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(death, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(death, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local hielo = createCombatObject() -- 6 setCombatParam(hielo, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(hielo, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatFormula(hielo, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local drown = createCombatObject() -- 7 setCombatParam(drown, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE) setCombatParam(drown, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatFormula(drown, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fisico = createCombatObject() -- 8 setCombatParam(fisico, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(fisico, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) setCombatFormula(fisico, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) function onUseWeapon(cid, var) local valor = getPlayerStorageValue(cid, config.stele) local lucky = math.random(1, 8) if valor == 9 then if lucky == 1 then doCombat(cid, tierra, var) elseif lucky == 2 then doCombat(cid, fuego, var) elseif lucky == 3 then doCombat(cid, energy, var) elseif lucky == 4 then doCombat(cid, holy, var) elseif lucky == 5 then doCombat(cid, death, var) elseif lucky == 6 then doCombat(cid, hielo, var) elseif lucky == 7 then doCombat(cid, drown, var) elseif lucky == 8 then doCombat(cid, fisico, var) end else doCombat(cid, valor == 1 and tierra or valor == 2 and fuego or valor == 3 and energy or valor == 4 and holy or valor == 5 and death or valor == 6 and hielo or valor == 7 and drown or fisico, var) end return true end ]]> <vocation id="4"/> </melee> <melee id="8929" unproperly="1" event="script"><![CDATA[ domodlib('config') local tierra = createCombatObject() -- 1 setCombatParam(tierra, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) setCombatParam(tierra, COMBAT_PARAM_EFFECT, CONST_ME_HITBYPOISON) setCombatFormula(tierra, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fuego = createCombatObject() -- 2 setCombatParam(fuego, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(fuego, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE) setCombatFormula(fuego, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local energy = createCombatObject() -- 3 setCombatParam(energy, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(energy, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT) setCombatFormula(energy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local holy = createCombatObject() -- 4 setCombatParam(holy, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE) setCombatParam(holy, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE) setCombatFormula(holy, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local death = createCombatObject() -- 5 setCombatParam(death, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE) setCombatParam(death, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatFormula(death, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local hielo = createCombatObject() -- 6 setCombatParam(hielo, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(hielo, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK) setCombatFormula(hielo, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local drown = createCombatObject() -- 7 setCombatParam(drown, COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE) setCombatParam(drown, COMBAT_PARAM_EFFECT, CONST_ME_LOSEENERGY) setCombatFormula(drown, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) local fisico = createCombatObject() -- 8 setCombatParam(fisico, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(fisico, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD) setCombatFormula(fisico, COMBAT_FORMULA_LEVELMAGIC, -config.min1, -config.min2, -config.max1, -config.max2) function onUseWeapon(cid, var) local valor = getPlayerStorageValue(cid, config.stele) local lucky = math.random(1, 8) if valor == 9 then if lucky == 1 then doCombat(cid, tierra, var) elseif lucky == 2 then doCombat(cid, fuego, var) elseif lucky == 3 then doCombat(cid, energy, var) elseif lucky == 4 then doCombat(cid, holy, var) elseif lucky == 5 then doCombat(cid, death, var) elseif lucky == 6 then doCombat(cid, hielo, var) elseif lucky == 7 then doCombat(cid, drown, var) elseif lucky == 8 then doCombat(cid, fisico, var) end else doCombat(cid, valor == 1 and tierra or valor == 2 and fuego or valor == 3 and energy or valor == 4 and holy or valor == 5 and death or valor == 6 and hielo or valor == 7 and drown or fisico, var) end return true end ]]> <vocation id="4"/> </melee> </mod>
  19. Sistema de Teleport por Item E ai galera, Suave? Hoje vim trazer um sistema bem legal pra vocês, dessa vez demorei um pouco, pois tive dificuldade com uma parte do script. Mas vamos lá! Primeiramente, adicione essas duas funções na lib. Vá em data/lib, abra o arquivo functions.lua, e cole no final dele estas duas funções: function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end function getMarkPos(cid) return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)} end Agora vamos ao script! Em data/actions/scripts, copie um arquivo .lua e renomeie para estatue.lua e coloque isso dentro: function onUse(cid, item, frompos, item2, topos) local pos = getCreaturePosition(cid) if item.actionid == 3030 then if getPlayerStorageValue(cid, 12345) == -1 then if getMarkPos(cid).x < 1 then doMarkPos(cid, pos.x, pos.y, pos.z) itemv = doPlayerAddItem(cid, 4863, 1) doSetItemActionId(itemv, 3032) doItemSetAttribute(itemv, "description", "Recipiente Vazio") doPlayerSendTextMessage(cid, 22, "Posição salva") setPlayerStorageValue(cid, 12345, 1) else doPlayerSendTextMessage(cid, 22, "Você já tem uma posição salva") end end end if item.actionid == 3032 then doPlayerSendTextMessage(cid, 22,'Para você ser teleportado, você presisa carregar isto com magia') end if item.actionid == 3031 then setPlayerStorageValue(cid, 12345, -1) setPlayerStorageValue(cid, 12346, -1) doPlayerRemoveItem(cid, 4864, 1) doTeleportThing(cid, getMarkPos(cid)) doSendMagicEffect(getMarkPos(cid),10) doMarkPos(cid, 0, 0, 0) doPlayerSendTextMessage(cid, 22,'Você foi teleportado') end return true end Em actions.xml adicione as tags: <action actionid="3032" event="script" value="estatue.lua"/> <action actionid="3031" event="script" value="estatue.lua"/> <action actionid="3030" event="script" value="estatue.lua"/> 3030 é o action id, que você irá colocar na estatua pelo map editor. Agora em data/talkactions/scripts, copie um arquivo .lua e renomeie para encherrecipiente.lua e coloque isso dentro: function onSay(cid, words, param) posp = getCreaturePosition(cid) mana = getCreatureMana(cid) if getPlayerStorageValue(cid, 12345) == 1 then if getPlayerStorageValue(cid, 12346) == -1 then if getPlayerItemCount(cid,4863) > 0 then if mana >= 300 then local itemv = doPlayerAddItem(cid, 4864,1) doSetItemActionId(itemv, 3031) doItemSetAttribute(itemv, "description", "Recipiente Cheio") doPlayerAddMana(cid, -mana) doPlayerRemoveItem(cid, 4863,1) doPlayerSendTextMessage(cid, 22,'Você carregou o recipiente de magia') doSendMagicEffect(posp,29) doSendMagicEffect(posp,17) setPlayerStorageValue(cid, 12346, 1) else doPlayerSendTextMessage(cid, 22, 'Você não tem mana suficiente para carregar o recipiente de magia') end else doPlayerSendTextMessage(cid, 22,'Você precisa de um recipiente de magia vazio') end else doPlayerSendTextMessage(cid, 22,'Você ja encheu o recipiente com magia') end end end Em talkactions.xml adicione a tag: <talkaction words="!carregarfonte" event="script" value="encherrecipiente.lua"/> Imagens: É isso galera, espero que tenham gostado e que possa servir pra alguém! Abraços e até a próxima!
  20. Fala galerinha do TK, irei postar para vocês um sistema que ajuda e muito servidores que estão começando. O SHOP GUILD facilita o acesso dos players a itens que muitas vezes só têm no SHOP ONLINE do site. Uma coisa muito importante que tenho a dizer a vocês é que esse sistema, é um pouco diferenciado, pois o lider da guild não precisará que todos os players estejam online, basta apenas ele estar online para executar o comando !guildpoints , que todos os membros da guild receberão os pontos. Não tenho muito o que explicar, a maioria de vocês já conhece esse sistema, só não achou um que funcione 100%, e eu vim aqui trazê-lo para vocês. Deixando a apresentação de lado, vamos direto a ponto: Em talkactions.xml, adicione a tag abaixo: Na pasta talkactions/scripts cria um arquivo guildpoints.lua e adicione o seguinte script: Explicações do script: ExecuteIntervalHours = 24, ( Intervalo para execução do comando, ae está de 24 em 24hrs) NeedPlayersOnline = 10, (Quantos players é preciso está online para poder executar o comando.) NeedDiferentIps = 6, (Quantos IPS diferentes são necessários para executar o comando no exemplo ae tem 6.) MinLevel = 80, (Aqui adicione o level minimo, é necessário que todos os player da guild tenha o level pedido para o lider executar o comando.) AddPointsForAcc = 9, (Aqui é q quantidade de pontos para adicionar em cada player da guild.) OBS: Não mecha no restante do script! A parte do servidor já está feita, iremos partir para o site, execute as seguintes querys em seu phpmyadmin: Estamos quase terminando o tutorial. Para facilitar, duplique o seu shopsystem.php e renomeie para shopguild.php e faça as seguintes modificações nas linhas a seguir: shop_system para shopguild_system premium_points para guild_points z_shop_offer para z_shopguild_offer shopsystem para shopguild z_shop_history_pacc para z_shopguild_history_pacc z_shop_history_item para z_shopguild_history_item Feito isso, a parte mais trabalhosa já foi feita, iremos agora, adicionar as linhas na pasta do site para que TAG do SHOP GUILD apareça no site: Vá em index.php e adicione: Vá em config.php e adicione: Vá em layouts.php e adicione abaixo de Shopsystem: É isso pessoal, única coisa que falta é você importar a parte dos itens do shopguild e adicionar o comando em seu phpmyadmin. Esse tutorial eu trouxe de outro fórum, então deixarei os devidos créditos dos autores do sistema. Créditos: Natanael Beckman LukeSkywalker (Raphael Luiz)
  21. KekezitoLHP postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    ┌──────────────────────────────────────────────────┐ │Nome: Sign of Zodiac │Versão do script: 1.0.0 │Tipo do script: Sistema (Creature Script, Talkaction e Lib) │Servidor Testado: The Forgotten Server 0.4.0 Doomed Elderberry │Autor: Lwkass └──────────────────────────────────────────────────┘ - Características: ~ Bônus em experiencia (Todos recebem 10% a mais) ~ Bônus na defesa contra elemento (Todos absorvem 5%) ~ Cada signo possui um elemento (Fire, Ice, Lighting ou Earth) ~ Signos de Fogo: Aries, Leo e Sagittarius ~ Signos da Terra: Taurus, Virgo e Capricorn ~ Signos da Eletricidade (Ar): Gemini, Libra e Aquarius ~ Signos de Agua: Cancer, Scorpio e Pisces - Explicando: Para escolher o signo o player deve colocar o dia e o mês do aniversário e o sistema automaticamente coloca o signo, comando: !zodiac dia/mês Só para deixar claro como o sistema funciona, usando de exemplo o signo de Leão (Leo) que é do elemento Fire: * Se receber um dano do elemento Fire, absorve 5% (modificável) do dano total, ou seja, o dano seria igual a 95% do que seria (dano absorvido indicado por animatedText). * Se matar um monstro que tenha uma defesa contra Fire maior que 0% ganha bônus de 10% (modificável) da exp total, ou seja, ganha-se 110% (exp extra indicada por animatedText). Se o signo fosse do elemento Earth, então seria a mesma coisa só que com o elemento Earth, se fosse Ice ou Lighting a mesma coisa. Pode-se usar o comando !zodiac info para informações. - Script: Primeiro, na pasta data/lib (caso a pasta não exista, crie) do seu servidor crie um arquivo Lua com o nome zodiac-Lib.lua (Lib com maiúscula) e salve com isso dentro: --[[ Sign of Zodiac System v1.0.0 by: Lwkass ([email protected]) ]] Zodiac = { constant = { OPTION_PERCENT_BLOCK = 5, -- In Percent OPTION_EXTRA_EXP_RATE = 10, -- In Percent STORAGE_SIGN = 16161, elements = { ["Fire"] = { combat = COMBAT_FIREDAMAGE, color = COLOR_ORANGE }, ["Earth"] = { combat = COMBAT_EARTHDAMAGE, color = COLOR_LIGHTGREEN }, ["Lighting"] = { combat = COMBAT_ENERGYDAMAGE, color = COLOR_TEAL }, ["Ice"] = { combat = COMBAT_ICEDAMAGE, color = COLOR_LIGHTBLUE } } }, signs = { ["Aries"] = { date = {"21/03", "20/04"}, element = "Fire" }, ["Taurus"] = { date = {"21/04", "20/05"}, element = "Earth" }, ["Gemini"] = { date = {"21/05", "20/06"}, element = "Lighting" }, ["Cancer"] = { date = {"21/06", "21/07"}, element = "Ice" }, ["Leo"] = { date = {"22/07", "22/08"}, element = "Fire" }, ["Virgo"] = { date = {"23/08", "22/09"}, element = "Earth" }, ["Libra"] = { date = {"23/09", "22/10"}, element = "Lighting" }, ["Scorpio"] = { date = {"23/10", "21/11"}, element = "Ice" }, ["Sagittarius"] = { date = {"22/11", "21/12"}, element = "Fire" }, ["Capricorn"] = { date = {"22/12", "20/01"}, element = "Earth" }, ["Aquarius"] = { date = {"21/01", "19/02"}, element = "Lighting" }, ["Pisces"] = { date = {"20/02", "20/03"}, element = "Ice" } }, getSignInfo = function (signName) return Zodiac.signs[signName] end, set = function (cid, signName) setPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN, signName) end, get = function (cid) return getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN), Zodiac.getSignInfo(getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN)) or 0 end, getElement = function (cid) return Zodiac.getSignInfo(getPlayerStorageValue(cid, Zodiac.constant.STORAGE_SIGN)).element end, getSign = function (cid, day, month) for sign, info in pairs(Zodiac.signs) do _, _, beginDay, beginMonth = info.date[1]:find("(%d+)/(%d+)") _, _, endDay, endMonth = info.date[2]:find("(%d+)/(%d+)") beginDay, beginMonth, endDay, endMonth = tonumber(beginDay), tonumber(beginMonth), tonumber(endDay), tonumber(endMonth) if ((month == beginMonth and day >= beginDay) or (month == endMonth and day <= endDay)) then return sign, info end end end } Agora na pasta data/creaturescripts/scripts: No arquivo login.lua adicione isso antes do return: -- Zodiac registerCreatureEvent(cid, "zodiacKill") registerCreatureEvent(cid, "zodiacStats") if (getPlayerLastLogin(cid) <= 0 or getPlayerStorageValue(cid, 16160) == 1) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Please, when is your birthday date ? (Example: !zodiac day/month = !zodiac 1/2, !zodiac 23/7,...)") setPlayerStorageValue(cid, 16160, 1) -- Talk state else doPlayerSetSpecialDescription(cid, ", sign of " .. getPlayerStorageValue(cid, 16161)) end E crie esses arquivos: zodiacKill.lua dofile('data/lib/zodiac-Lib.lua') function getMonsterPath(monstername) f = io.open ("data/monster/monsters.xml", 'r') for line in f:lines() do _, _, name, path, file_name = string.find(line, '<monster name="(.+)" file="(.+)/(.+).xml"/>') if (name and path and file_name and name:lower() == monstername:lower()) then f:close() return path .. "/" .. file_name .. ".xml" end end end function getMonsterElementDefense(monstername, element) f = io.open ("data/monster/" .. getMonsterPath(monstername), 'r') for line in f:lines() do if (string.find(line, '</elements>')) then break end _, _, n = string.find(line, '<element '.. element:lower() ..'Percent="([-%d]+)"/>') if (n) then f:close() return tonumber(n) end end f:close() return 0 end ------- function onKill(cid, target, lastHit) if (isMonster(target) and getMonsterElementDefense(getCreatureName(target), (Zodiac.getElement(cid) == "Lighting" and "Energy" or Zodiac.getElement(cid))) > 0) then local exp_bonus = math.ceil(getMonsterInfo(getCreatureName(target)).experience * (Zodiac.constant.OPTION_EXTRA_EXP_RATE/100)) doSendAnimatedText(getThingPos(cid), exp_bonus, COLOR_GREY) doPlayerAddExperience(cid, exp_bonus) end return true end zodiacStats.lua dofile('data/lib/zodiac-Lib.lua') function onStatsChange(cid, attacker, type, combat, value) playerSign = Zodiac.get(cid) if (combat == Zodiac.constant.elements[Zodiac.getElement(cid)].combat) then valuem = math.ceil(value*(Zodiac.constant.OPTION_PERCENT_BLOCK/100)) doCreatureAddHealth(cid, valuem) doSendAnimatedText(getThingPos(cid), "+"..valuem, Zodiac.constant.elements[Zodiac.getElement(cid)].color) end return true end Certo, agora no arquivo data/creaturescripts/creaturescripts.xml, adicione isso: <event type="statschange" name="zodiacStats" event="script" value="zodiacStats.lua"/> <event type="kill" name="zodiacKill" event="script" value="zodiacKill.lua"/> Na pasta data/talkactions/scripts, adicione um arquivo Lua com o nome de zodiacTalk.lua: dofile('data/lib/zodiac-Lib.lua') function onSay(cid, words, param, channel) if (param:len() == 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can use '!zodiac day/month' or '!zodiac info'") return true end playerSign, Info = Zodiac.get(cid) if (type(playerSign) == "string" and param:lower() == "info") then doPlayerPopupFYI(cid, [[ Zodiac Informations ~ ------------------------------- * Sign: ]] .. playerSign .. [[ * Element: ]] .. Info.element .. [[ * Bonus: +]] .. Zodiac.constant.OPTION_EXTRA_EXP_RATE .. [[% experience of ]] .. Zodiac.getElement(cid) .. [[ monsters +]] .. Zodiac.constant.OPTION_PERCENT_BLOCK .. [[% of defense in attacks with ]] .. Zodiac.getElement(cid) .. [[ element ]]) elseif (getPlayerStorageValue(cid, 16160) == 1) then _, _, day, month = string.find(param, "(%d+)/(%d+)") day, month = tonumber(day), tonumber(month) if (day and month and day > 0 and day <= 31 and month > 0 and month <= 12) then Zodiac.set(cid, Zodiac.getSign(cid, day, month)) playerSign = Zodiac.get(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param) doSendMagicEffect(getThingPos(cid), math.random(28, 30)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You sign of zodiac is " .. playerSign .. " which is of element " .. Zodiac.getElement(cid) .. " !") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can see more information saying '!zodiac info', remember this...") setPlayerStorageValue(cid, 16160, -1) else doPlayerSendCancel(cid, "You put a invalid date.") end end return true end Coloque essa tag no arquivo data/talkactions/talkactions.xml <talkaction words="!zodiac" event="script" value="zodiacTalk.lua"/>
  22. Vá em data/lib, crie um arquivo .lua com o nome de 130-newquestsystem.lua e adicione isso - Como usar? Criar qualquer action, creatureevent ou o que você quiser para recompensas. Exemplo de código: local reward = { { id = 2400, count = 1, actionid = 1234, description = "holy sword" }, { id = 2160, count = 10 }, { container = 1988, items = { { id = 2400, count = 1, actionid = 1234, description = "holy sword" }, { id = 2160, count = 10 }, { container = 1988, items = { { id = 2400, count = 1, actionid = 1234, description = "holy sword" }, { id = 2160, count = 10 } } } } } } local storage = 1234 local container = 1988 -- main container function onUse(cid, item, fromPosition, itemEx, toPosition) doPlayerAddQuest(cid, reward, storage, container) end Créditos - averatec
  23. http://img507.images...493/sokegif.gif Basta ir na pasta Mods, criar um arquivo .xml e adicionar o seguinte código - <?xml version="1.0" encoding="UTF-8"?> <mod name="SMOKE SYSTEM" version="2.0" author="Amy Azzkaban" contact="email" enabled="yes"> <description> ## SMOKE SYSTEM ## </description> <movevent type="StepIn" itemid="1505" event="script"><![CDATA[ local condition = createConditionObject(CONDITION_CURSED) setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -20) setConditionParam(condition, CONDITION_PARAM_TICKS, -1) setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 5) function onStepIn(cid, item, pos) if isPlayer(cid) == TRUE then doAddCondition(cid, condition) end end ]]></movevent> <movevent type="StepOut" itemid="1505" event="script"><![CDATA[ function onStepOut(cid, item, pos) doRemoveCondition(cid, CONDITION_CURSED) end ]]></movevent> </mod> Créditos - Amy Azzkaban

Informação Importante

Confirmação de Termo