Ir para conteúdo

Featured Replies

Postado

Boa noite galera do TK. to aki so pra pedir pra voces me ajudarem a "implementar" um upgrade no meu system.

bom, como eu disse ali em cima eu ja tenho um systema de upgrade , que peguei aki mesmo no tk e que aproposito e muito bom. mas eu gostaria de implementar para que quando desse upgrade na arma aumentasse nao so o Armor,Def e Atck mas sim MagicLevel e Distance tbm. REP+ quem puder me ajudar ai.


abraço , to na espera.


obs: esse e o upgrade system q estou usando.

 

Postado
1 hora atrás, brendoonh disse:

Todos nós queremos isto, porém, ninguém se dispõe a ajudar!  :facepalm::'(

na internet ta cheio cara, tem q pesquisar antes de chorar, slot system, tem para várias versões, inclusive veio no servidor que eu baixei aqui no tibiaking

Toda terça-feira um tópico novo:

Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/

Peça sua spell (Suporte):                https://tibiaking.com/forums/topic/84162-peça-sua-spell/                        

Chuva de flechas (Spell):                https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/

Doom (Spell):                                https://tibiaking.com/forums/topic/51622-doom-spell/

Utilização do VS Code (Infra)       https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/

SD com Combo (Spell):                 https://tibiaking.com/forums/topic/94520-sd-modificada/

Alteração attack speed (C++):        https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/  

Bônus de Speed (NPC)                  https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
 

Postado
19 horas atrás, Reds disse:

na internet ta cheio cara, tem q pesquisar antes de chorar, slot system, tem para várias versões, inclusive veio no servidor que eu baixei aqui no tibiaking

Nossa... Eu fico em forum o dia todo praticamente, nunca vi um sistema de upgrade system que tem os atributos como, magic level, sword skill, distance skill etc.. 
Eu queria implementar no meu sistema de upgrade.. Teria como dar essa moral?

LIB > Upgradesystem
 

--[[

PERFECT UPGRADE SYSTEM
2.0

Criado por Oneshot

É proibido a venda ou a cópia sem os devidos créditos desse script.

]]--

UpgradeHandler = {
	levels = {
		[1] = {100, false, true},
		[2] = {100, false, true},
		[3] = {50, false, true},
		[4] = {40, false, true},
		[5] = {30, false, true},
		[6] = {20, false, true},
		[7] = {10, false, true},
		[8] = {5, false, true},
		[9] = {3, false, true},
		[10] = {1, false, true}
	},
	broadcast = 9,
	attributes = {
		["attack"] = 2,
		["defense"] = 1,
		["armor"] = 1,
	},
	message = {
		console = "Tentando refinar %s ao nivel +%s com %s%% taxa de sucesso.",
		success = "Você refinou %s ao nivel +%s",
		fail = "Você falhou na refinação de %s ao nivel +%s",
		downgrade = "O nível de refinação %s rebaixou a +%s",
		erase = "O nível de refinação %s foi apagada.",
		maxlevel = "O item %s já está no nível máximo de refinação.",
		notupgradeable = "Este item não pode ser refinado.",
		broadcast = "O item %s foi refinado do nivel %s ao nivel +%s.\nParabéns!!",
		invalidtool = "Este item não é refinavel. .",
		toolrange = "A flawless ice crystal so pode refinar itens entre os nivel +%s e +%s"
	},
	tools = {
		[8300] = {range = {0, 6}, info = {chance = 0, removeable = true}},
		[8306] = {range = {0, 10}, info = {chance = 5, removeable = true}},
	},
	
	isEquipment = function(self)
		local weaponType = self:getItemWeaponType()
		return ((weaponType > 0 and weaponType < 7) or self.item.armor ~= 0)
	end,
	
	setItemName = function(self, name)
		return doItemSetAttribute(self.item.uid, "name", name)
	end,
	
	chance = function(self)
		local chances = {}
		chances.upgrade = (self.levels[self.item.level + 1][1] or 100)
		chances.downgrade = (self.item.level * 5)
		chances.erase = (self.item.level * 11)
		
		return chances
	end
}

function UpgradeHandler:new(item)
	local obj, ret = {}
	obj.item = {}
	
	obj.item.level = 0
	obj.item.uid = item.uid
	for key, value in pairs(getItemInfo(item.itemid)) do
		obj.item[key] = value
	end
	
	ret = setmetatable(obj, {__index = function(self, index)
			if _G[index] then
					return (setmetatable({callback = _G[index]}, {__call = function(self, ...)
						return self.callback(item.uid, ...)
				end}))
			else
				return UpgradeHandler[index]
			end
	end})
	
	if ret:isEquipment() then
		ret:update()
		return ret
	end
	return false
end

function UpgradeHandler:update()
	self.item.level = (tonumber(self:getItemName():match("%+(%d+)")) or 0)
end

function UpgradeHandler:refine(uid, item)
	if not self.item then
		doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.notupgradeable)
		return "miss"
	end
	
	local tool = self.tools[item.itemid]
	
	if(tool == nil) then
		doPlayerSendTextMessage(uid, MESSAGE_EVENT_DEFAULT, self.message.invalidtool)
		return "miss"
	end
	
	if(self.item.level > #self.levels) then
		doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.maxlevel:format(self.item.name))
		return "miss"
	end
	
	if(self.item.level < tool.range[1] or self.item.level >= tool.range[2]) then
		doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.toolrange:format(unpack(tool.range)))
		return "miss"
	end
	
	local chance = (self:chance().upgrade + tool.info.chance)
	doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_BLUE, self.message.console:format(self.item.name, (self.item.level + 1), math.min(100, chance)))
	
	if(tool.info.removeable == true) then
		doRemoveItem(item.uid, 1)
	end
	
	if chance * 100 > math.random(1, 10000) then
		doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_ORANGE, self.message.success:format(self.item.name, (self.item.level + 1)))
		if (self.item.level + 1) >= self.broadcast then
		end
		
		self:setItemName((self.item.level > 0 and self:getItemName():gsub("%+(%d+)", "+".. (self.item.level + 1)) or (self:getItemName() .." +1")))
		for key, value in pairs(self.attributes) do
			if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
				doItemSetAttribute(self.item.uid, key, (self.item.level > 0 and getItemAttribute(self.item.uid, key) or self.item[key]) + value)
			end
		end
		return "success"
	elseif item.itemid == 8300 then
		doPlayerSendTextMessage(uid, MESSAGE_STATUS_CONSOLE_RED, self.message.downgrade:format(self.item.name, (self.item.level - 1)))
		self:setItemName((self.item.level == 1 and self.item.name or self:getItemName():gsub("%+(%d+)", "+".. (self.item.level - 1))))
		for key, value in pairs(self.attributes) do
			if getItemAttribute(self.item.uid, key) ~= nil or self.item[key] ~= 0 then
				doItemSetAttribute(self.item.uid, key, (self.item[key] + value * (self.item.level - 1)))
			end
		end
		return "fail"
	end
end

 

Postado
  • Autor
Em 26/06/2016 at 22:48, Reds disse:

na internet ta cheio cara, tem q pesquisar antes de chorar, slot system, tem para várias versões, inclusive veio no servidor que eu baixei aqui no tibiaking

tem como voce colar aki o seu upgrade system que aumenta o ml ?

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo