Ir para conteúdo

Featured Replies

Postado

Olá, o Adriano Swatt estava fazendo um script pra mim, mas devido a alguns problemas e aos corres do dia-a-dia ele não teve tempo de terminar, gostaria da ajuda para terminar esse script...

 

O script consiste em:

O boost é ativado ao summonar o monstro e não usando algum item como ja vi em outro post

O cálculo do dano adicionado é feito através da soma do level e do ML, o resultado disso se toma como porcentagem a adicionar no dano que o monstro iria hitar, ex; level = 50 + ML = 35, result = 85, o hit do monstro ficaria 350(exemplo) + 85% dos 350, o mesmo serve no caso do monstro se auto healar (MONK por exemplo), mas o boost é pra qualquer summon

A vida do monstro segue a mesma logica só que ao invés do hit aumentar é a vida obviamente

 

local eventName = "00testing"
local percent_limit = 500

function onStatsChange(cid, attacker, type, combat, value)
	print('LUTA OCORRENDO')
	if type == STATSCHANGE_HEALTHLOSS and value >= 1 then
			-- print('LIST TARGET: '..getMonsterTargetList(attacker)[1]..'') -- Retorna UID
			registerCreatureEvent(getCreatureTarget(attacker), eventName)
			print('REGISTRANDO EVENTO EM: '..getCreatureName(attacker):lower()..' ATACANDO UM '..getCreatureName(getCreatureTarget(attacker)):lower()..'.')
		if getCreatureMaster(attacker) then
			ownSummon = getCreatureMaster(attacker)
			print('TEMOS: '..getCreatureName(attacker):lower()..' ATACANDO UM '..getCreatureName(cid):lower()..'.')
			if isPlayer(ownSummon) then
				local overflow_protection = {}
				if overflow_protection[attacker] then
					overflow_protection[attacker] = nil
					return true
				end
				getML = getPlayerMagLevel(ownSummon)
				getLvL = getPlayerLevel(ownSummon)
				addDMG = getML + getLvL -- Percent
				if addDMG < percent_limit then
					percDMG = math.floor(value*(addDMG/100))
					newValue = (value+percDMG)
					print('True Value: '..value..' // PercDMG: '..percDMG..' // NewValue: '..newValue..' [ML: '..getML..'/ LVL: '..getLvL..'].')
				else
					percDMG = math.floor(value*(percent_limit/100))
					newValue = (value+percDMG)
					print('True Value: '..value..' // PercDMG: '..percDMG..' // NewValue: '..newValue..' [ML: '..getML..'/ LVL: '..getLvL..'].')
				end
				overflow_protection[attacker] = true
				doPlayerSendTextMessage(ownSummon, MESSAGE_STATUS_DEFAULT, "Your "..getCreatureName(attacker).." deals "..newValue.." [hit "..value.." + "..percDMG.." boost damage] to "..(getMonsterInfo(getCreatureName(cid)).description)..".")
				doTargetCombatHealth(attacker, cid, combat, -newValue, -newValue, CONST_ME_NONE)
				return false
			else
				print('SUMMON ISN\'T BY PLAYER // ATTACKER: '..getCreatureName(attacker)..' -> CID: '..getCreatureName(cid)..'.')
			end
		else
			print('NOT IS A SUMMON // ATTACKER: '..getCreatureName(attacker)..' -> CID: '..getCreatureName(cid)..'.')
		end
	else
		print('SEM PERDA DE VIDA // CID: '..getCreatureName(cid)..'.')
	end
return true
end

 

Postado
Em 13/11/2016 ás 16:36, blackz disse:

TERIA COMO COLOCAR ELE ANTES DO ML COLOCA NO CLUB POIS VOU USA NUM NTO ASSIM POSSO MODIFICAR PARA UP KUCHYOUSE

 

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 96k
  • Posts 512.7k

Informação Importante

Confirmação de Termo