Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Olá pessoal, fiz uma pvp arena para meu servidor (alunia) e resolvi postar aqui ... é aquena arena rustica, onde qualquer um entra, e podem se matar lá dentro que não perde nada!

5973ee4a5b686_Semttulo2.thumb.png.5738fa250c35209d9c016fafd399a508.png

Creaturescript: 

Spoiler

--	<!-- PVP Arena -->
--	<event type="login" name="Arena-Login" script="pvp_arena.lua"/>
--	<event type="logout" name="Arena-Logout" script="pvp_arena.lua"/>
--	<event type="preparedeath" name="Arena-Death" script="pvp_arena.lua"/>

local exit = Position(125, 31, 9)
local storage = 7000

function onLogin(player)
	if player:getStorageValue(storage) > 0 then
		player:setStorageValue(storage, 0)
	end
	return true
end

function onLogout(player)
	if player:getStorageValue(storage) > 0 then
		player:sendCancelMessage("You can not logout now!")
		return false
	end
	return true
end

function onPrepareDeath(player, killer)
	if player:getStorageValue(storage) > 0 and killer:getStorageValue(storage) > 0 then
		player:removeCondition(CONDITION_INFIGHT)
		player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are dead in PVP Arena!")
		player:addHealth(player:getMaxHealth())
		player:addMana(player:getMaxMana())
		player:setStorageValue(storage, 0)
		player:unregisterEvent("Arena-Death")
		player:teleportTo(exit)
		killer:getPosition():sendMagicEffect(CONST_ME_GROUNDSHAKER)
		return false
	end
end

Basta configurar:
local exit = Position(125, 31, 9)
local storage = 7000

 

Movements: 

Spoiler

--	<movevent event="StepIn" actionid="2035" script="pvp_arena.lua" />
--	<movevent event="StepIn" actionid="2036" script="pvp_arena.lua" />

local storage = 7000

function onStepIn(creature, item, position, fromPosition)	
	if not creature:isPlayer() then
		return false
	end
	
	if item.actionid == 2035 then
		creature:setStorageValue(storage, 1)
		creature:sendTextMessage(MESSAGE_INFO_DESCR, "You entered PVP Arena.")
		creature:registerEvent("Arena-Death")

	elseif item.actionid == 2036 then
		creature:setStorageValue(storage, 0)
		creature:sendTextMessage(MESSAGE_INFO_DESCR, "You left PVP Arena.")
		creature:removeCondition(CONDITION_INFIGHT)
		creature:addHealth(creature:getMaxHealth())
		creature:addMana(creature:getMaxMana())
		creature:unregisterEvent("Arena-Death")
	end

	return true
end

Basta configurar:
local storage = 7000


Editar Mapa: onde esta 1 na foto coloque actionId = 2035 e 2 coloque actionId = 2036, e não esqueça de colocar o tile pvp pelo map editor nos tile da arena.

Valeu, até mais.

Editado por luanluciano93 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites
  • 1 month later...

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Mask Ghoul
      Olá Tibiaking
      Hoje vim trazer como aumentar Efeitos / Missile na source TFS e OTX 1.3 Utilize 8.60 OLDCLIENT estendida unit16
      então resolvi eu mesmo mexer e consegui achar e estou trazendo para vocês!

      Esse Tópico é especifico para TFS E OTX 1.3, para que assim você possa aumentar o limite de efeitos no Client, e usar mais de 2k efeitos, e mais de 500 efeitos em Distância.  Vale lembra também que você não é obrigado a mudar em ambos, se você quiser apenas aumentar o Limite de Efeitos para mais de 2k, então mude apenas ele, caso queria aumentar apenas os Efeitos que são lançados a distância(ShootEffects ou DistanceEffect), caso queria os dois, use ambos. 
       
      Vamos começar em Magic Effects e DistanceShoot:
       
      Boa sorte vcs ?
      Recompila Source LINUX / Windows TFS E OTX 1.3

       
      Então é isso ae, qualquer erro só comentar para que eu possar tentar ajudar.
       
      Tópico exclusivo do Tibaking, proibido posta em outro site, blog ou fórum! 
    • Por luanluciano93
      Olá pessoal, estou desenvolvendo esse sistema vip para TFS 1.x, se precisarem de alguma função nova é só comentar, criei para usar em um servidor meu e resolvi postar, bom proveito a todos.
       
      É só ir no arquivo data/lib/core/player.lua e adicionar esse código no começo do script:
      -- ALTER TABLE `accounts` ADD `vip_time` BIGINT(20) NOT NULL DEFAULT 0; -- player:getVipTime() function Player.getVipTime(self) local resultId = db.storeQuery("SELECT `vip_time` FROM `accounts` WHERE `id` = '".. self:getAccountId() .."';") local time = resultId ~= false and result.getNumber(resultId, "vip_time") or 0 result.free(resultId) return time end -- player:isVip() function Player.isVip(self) return self:getVipTime() > os.time() and true or false end -- player:addVipDays(days) function Player.addVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVipDays(days) function Player.removeVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:setVipDays(days) function Player.setVipDays(self, days) return db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVip() function Player.removeVip(self) db.query("UPDATE `accounts` SET `vip_time` = '0' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:sendVipDaysMessage() function Player.sendVipDaysMessage(self) if self:isVip() then local vipTime = self:getVipTime() - os.time() local vipDays = 1 + (math.floor(vipTime / 86400)) return self:getVipTime() ~= false and self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You have '.. vipDays .. ' vip day(s) in your account.') end end -- player:checkVipLogin() function Player.checkVipLogin(self) if self:getVipTime() > 0 and not self:isVip() then return self:removeVip() and self:teleportTo(self:getTown():getTemplePosition()) end end  
       
      As funções são:
      • player:getVipTime() - Retorna o valor da tabela vip_time (igual esta na database).
      • player:isVip() - Retorna se o player é vip ou não.
      • player:addVipDays(days) - Usa-se em algum script para para adicionar dias de vip ao player (parâmetro de entrada "days").
      • player:removeVipDays(days) - Usa-se em algum script para para remover dias de vip do player (parâmetro de entrada "days").
      • player:setVipDays(days) - Usa-se em algum script para para mudar os dias de vip do player (parâmetro de entrada "days").
      • player:removeVip() - Usa-se em algum script para para remover todo tempo de vip do player.
      • player:sendVipDaysMessage() - Retorna uma mensagem no player mostrando os dias de vip que ainda restam ao player.
      • player:checkVipLogin() - Checa se a vip do player acabou, se sim teleporta ele para o templo.
       

      Qualquer dúvida ou erro/bug poste aqui.
    • Por Erimyth
      Este script funciona perfeitamente qual quer problema comente no topico.
      basta ser adicionado em action.xml com um action e adicionado ao mapa.
      local t = { players = { -- posições que os players devem ficar ao puxar a alavanca [1] = Position(33395,32661,6), [2] = Position(33394,32662,6), [3] = Position(33395,32662,6), [4] = Position(33395,32663,6), [5] = Position(33396,32662,6) }, boss = {name = "Scarlett Etzel", create_pos = Position(33396,32642,6)}, destination = Position(33395,32656,6), -- posição para qual os players serão teleportados cooldown = {0, "sec"}, -- tempo para ser teleportado novamente. Ex.: {2, "sec"}, {5, "min"}, {10, "hour"}, {3, "day"} storage = 56482 -- storage não utilizado no seu servidor } function onUse(player, item, fromPosition, target, toPosition, isHotkey) local players, tab = {}, t.players for i = 1, #tab do local tile = Tile(tab) if tile then local p = Player(tile:getTopCreature()) if p then if p:getStorageValue(t.storage) <= os.time() then players[#players + 1] = p:getId() end end end end if #players == 0 then player:sendCancelMessage("One or all players did not wait " .. getStrTime(t.cooldown) .. " to go again.") return true end for i = 1, #tab do local playerTile = Tile(tab) local playerToGo = Player(playerTile:getTopCreature()) if playerToGo then if isInArray(players, playerToGo:getId()) then playerToGo:setStorageValue(t.storage, mathtime(t.cooldown) + os.time()) playerTile:relocateTo(t.destination) tab:sendMagicEffect(CONST_ME_POFF) end end end t.destination:sendMagicEffect(CONST_ME_TELEPORT) Game.createMonster(t.boss.name, t.boss.create_pos) item:transform(item.itemid == 36319 or 1946 or 1945) return true end local boss_room = {fromPos = Position(33386, 32639, 6), toPos = Position(33405, 32659, 6)} local bossplayer = Player(cid) local exit = Position(33395, 32659, 6) if bossplayer and isInRange(bossplayer:getPosition(), boss_room.fromPos, boss_room.toPos) then bossplayer:teleportTo(exit) end function mathtime(table) -- by dwarfer local unit = {"sec", "min", "hour", "day"} for i, v in pairs(unit) do if v == table[2] then return table[1](60^(v == unit[4] and 2 or i-1))(v == unit[4] and 24 or 1) end end return error("Bad declaration in mathtime function.") end function getStrTime(table) -- by dwarfer local unit = {["sec"] = "second",["min"] = "minute",["hour"] = "hour",["day"] = "day"} return tostring(table[1].." "..unit[table[2]]..(table[1] > 1 and "s" or "")) end
      ? Crédito total ao Desenvolvedor que disponibilizou para toda nossa comunidade: @Underewar
      Obrigado pela Contribuição!
    • Por Killua
      Como funciona?
      A cada monstro que vc mata, seus itens equipados ganham 1 de exp. Quando seus itens chegarem às quantidades de exp definidas, eles upam e ficam com o nome assim: Demon Helmet + 1. Helmets, armors, legs, e boots recebem 1 de arm a cada vez que upam. Armas recebem 1 de ataque e escudos 1 de defesa.
       
      Para o monstro contar, ele deve dar um mínimo de exp (definido no script). O número de exp a que me refiro é aquele um presente no arquivo .xml.
       
      Para instalar, crie Killua Items Upgrade.lua em data/creaturescripts/scripts e coloque:
        Em data/creaturescripts/creaturescripts.xml coloque essas duas tags:
      <event type="kill" name="Item level" event="script" value="Killua Items Upgrade.lua"/> <event type="login" name="Item levell" event="script" value="Killua Items Upgrade.lua"/> Configurando: Na tabela table_of_slots, coloque em quais slots os itens upam.
      min_exp é a experiência mínima que o monstro deve ter para contar exp para o item. Se vc colocar 500, somente os monstros que tem exp igual ou superior a 500 no arquivo.xml vão valer.
      exp_levels são os valores de exp que os itens devem atingir para upar. No meu caso, quando o item alcançar 50 de exp, ele upa para o level 1. Quando alcançar 50 de exp, upa para o level 2 e assim por diante.
    • Por Codex NG
      Not tested but I wrote them anyway... this is a means of adding the missing stat information in TFS 1.3 & OTX 3 for 10.98 & up.
       
      This is the previous code protocolgame.cpp in TFS 1.3
      void ProtocolGame::AddPlayerStats(NetworkMessage& msg) { msg.addByte(0xA0); msg.add<uint16_t>(std::min<int32_t>(player->getHealth(), std::numeric_limits<uint16_t>::max())); msg.add<uint16_t>(std::min<int32_t>(player->getMaxHealth(), std::numeric_limits<uint16_t>::max())); msg.add<uint32_t>(player->getFreeCapacity()); msg.add<uint32_t>(player->getCapacity()); msg.add<uint64_t>(player->getExperience()); msg.add<uint16_t>(player->getLevel()); msg.addByte(player->getLevelPercent()); msg.add<uint16_t>(100); // base xp gain rate msg.add<uint16_t>(0); // xp voucher msg.add<uint16_t>(0); // low level bonus msg.add<uint16_t>(0); // xp boost msg.add<uint16_t>(100); // stamina multiplier (100 = x1.0) msg.add<uint16_t>(std::min<int32_t>(player->getMana(), std::numeric_limits<uint16_t>::max())); msg.add<uint16_t>(std::min<int32_t>(player->getMaxMana(), std::numeric_limits<uint16_t>::max())); msg.addByte(std::min<uint32_t>(player->getMagicLevel(), std::numeric_limits<uint8_t>::max())); msg.addByte(std::min<uint32_t>(player->getBaseMagicLevel(), std::numeric_limits<uint8_t>::max())); msg.addByte(player->getMagicLevelPercent()); msg.addByte(player->getSoul()); msg.add<uint16_t>(player->getStaminaMinutes()); msg.add<uint16_t>(player->getBaseSpeed() / 2); Condition* condition = player->getCondition(CONDITION_REGENERATION); msg.add<uint16_t>(condition ? condition->getTicks() / 1000 : 0x00); msg.add<uint16_t>(player->getOfflineTrainingTime() / 60 / 1000); msg.add<uint16_t>(0); // xp boost time (seconds) msg.addByte(0); // enables exp boost in the store } The focus of what we want to change here is this
      msg.add<uint16_t>(100); // base xp gain rate msg.add<uint16_t>(0); // xp voucher msg.add<uint16_t>(0); // low level bonus msg.add<uint16_t>(0); // xp boost msg.add<uint16_t>(100); // stamina multiplier (100 = x1.0) and this
      msg.add<uint16_t>(0); // xp boost time (seconds) msg.addByte(0); // enables exp boost in the store  
       
      To do this we'll use storage values that are referenced via methods of the player class.
      Our new code will look something like this.
      // base xp gain rate msg.add<uint16_t>(player->getBaseXpGain()); // xp voucher msg.add<uint16_t>(player->getVoucherXpBoost()); // low level bonus msg.add<uint16_t>(player->getGrindingXpBoost()); // xp boost msg.add<uint16_t>(player->getStoreXpBoost()); // stamina multiplier (100 = x1.0) msg.add<uint16_t>(player->getStaminaXpBoost()); and this
      // xp boost time (seconds) msg.add<uint16_t>(player->getExpBoostStamina()); // enables exp boost in the store msg.addByte(1);  
      In player.h
      Under
      #include "mounts.h" place this
      #include "configmanager.h"  
       
      Under
      class Guild; place this
      extern ConfigManager g_config;  
       
      Under
      bool hasLearnedInstantSpell(const std::string& spellName) const; place this
      uint16_t getBaseXpGain() const { uint32_t key = g_config.getNumber(ConfigManager::BASEXPGAIN_STORAGE); int32_t value; getStorageValue(key, value); return (value < 0 ? 100 : (uint16_t)value); } uint16_t getVoucherXpBoost() const { uint32_t key = g_config.getNumber(ConfigManager::VOUCHERXPBOOST_STORAGE); int32_t value; getStorageValue(key, value); return (value < 0 ? 100 : (uint16_t)value); } uint16_t getGrindingXpBoost() const { uint32_t key = g_config.getNumber(ConfigManager::GRINDINGXPBOOST_STORAGE); int32_t value; getStorageValue(key, value); return (value < 0 ? 100 : (uint16_t)value); } uint16_t getStoreXpBoost() const { uint32_t key = g_config.getNumber(ConfigManager::STOREXPBOOST_STORAGE); int32_t value; getStorageValue(key, value); return (value < 0 ? 100 : (uint16_t)value); } uint16_t getStaminaXpBoost() const { uint32_t key = g_config.getNumber(ConfigManager::STATMINAXPBOOST_STORAGE); int32_t value; getStorageValue(key, value); return (value < 0 ? 100 : (uint16_t)value); } uint16_t getExpBoostStamina() { uint32_t key = g_config.getNumber(ConfigManager::EXPBOOSTSTAMINA_STORAGE); int32_t value; getStorageValue(key, value); return (value < 0 ? 100 : (uint16_t)value); }  
       
      Next we'll go into configmanger.cpp and find
      integer[MAX_PACKETS_PER_SECOND] = getGlobalNumber(L, "maxPacketsPerSecond", 25); and place this under it
      integer[BASEXPGAIN_STORAGE] = getGlobalNumber(L, "baseXpGain", 18000); integer[VOUCHERXPBOOST_STORAGE] = getGlobalNumber(L, "voucherXpBoost", 18001); integer[GRINDINGXPBOOST_STORAGE] = getGlobalNumber(L, "grindingXpBoost", 18002); integer[STOREXPBOOST_STORAGE] = getGlobalNumber(L, "storeXpBoost", 18003); integer[STATMINAXPBOOST_STORAGE] = getGlobalNumber(L, "staminaXpBoost", 18004); integer[EXPBOOSTSTAMINA_STORAGE] = getGlobalNumber(L, "expBoostStamina", 18005);  
      Then open up configmanager.h and find
      MAX_PACKETS_PER_SECOND, and place these under it
      BASEXPGAIN_STORAGE, VOUCHERXPBOOST_STORAGE, GRINDINGXPBOOST_STORAGE, STOREXPBOOST_STORAGE, STATMINAXPBOOST_STORAGE, EXPBOOSTSTAMINA_STORAGE,  
      Then add this to your config.lua
      -- storages for player stats baseXpGain = 18000 voucherXpBoost = 18001 grindingXpBoost = 18002 storeXpBoost = 18003 staminaXpBoost = 18004 expBoostStamina = 18005  
      Since it is just storage values then its just a matter of setting the correct storages to set the bonuses. if no value is set then it is set to a default of 100.
      Here is a screen shot to show you that this works

       
      This code is incomplete I will update it when I have time. :)
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo