Ir para conteúdo

Featured Replies

  • Respostas 13
  • Visualizações 3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Adaptação do Script do membro: @Apocalypse. Tópico Oficial com instruções de instalação: CLIQUE AQUI.     -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = false -- Usar sistema de St

Postado
  • Autor
14 horas atrás, Yurotsz disse:

como faz para coloca as exp subi no char quando esta em party shared esta aparecendo em escrito vermelho pode ajuda ??

 

Você pode tentar assim.

 

-- CONFIGURAÇÕES DE EXPERIENCIA --

useStages = false -- Usar sistema de Stages , true/false
premiumMultipliqueExp = 2 -- Players Premiums terão exp multiplicada, caso não querer deixe 1.
rateExp = 300 -- Exp caso não for usar stages.


local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA  REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.)
	["1-50"] = 300,
	["51-100"] = 250,
	["101-150"] = 200,
	["151-200"] = 150,
	["201-250"] = 100,
	["251-300"] = 50,
	["351-400"] = 25,
}
ultimateExp = 15 -- exp que vai usar caso o level do player não tiver mais na tabela .

-- CONFIGURAÇÕES DA PARTY

partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party
levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp.
expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp.
expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp.
expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp.

-- CONFIGURAÇÕES DE RINGS --

local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP.
	[3048] = 2,
	[3049] = 4,
	[3050] = 6,
}

-- FIM DAS CONFIGURAÇÕES --


function CalculeExp(monsterhp, exptotal, hit)
	hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0
	return hit < 0 and 0 or hit
end

function isSummon(cid)
return getCreatureMaster(cid)
end

function onStatsChange(cid, attacker, type, combat, value)
	if isPlayer(attacker) and isMonster(cid) then
		if getCreatureStorage(cid, 50001) ~= 1 then
			doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp)
			doCreatureSetStorage(cid, 50001, 1)
		end
	end
	if type == STATSCHANGE_HEALTHLOSS then
		if isMonster(cid) then
			if isCreature(attacker) then
				local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker
				if isPlayer(_cid) then
					if useStages then
						for strstage, experience in pairs(stages) do
							tabstage = string.explode(strstage, "-")
							if getPlayerLevel(_cid) >= tonumber(tabstage[1]) and getPlayerLevel(_cid) <= tonumber(tabstage[2]) then
								ultimateExp = experience
							end
						end
						experienceRate = ultimateExp
					else
						experienceRate = rateExp
					end
					local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value)
					if getCreatureStorage(cid, 50002) > 0 then
						if getCreatureStorage(cid, 50002) - expgain < 0 then
							expgain = getCreatureStorage(cid, 50002)
						end
						doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain)
						local ringexp = 1
						for idring, expring in pairs(rings) do
							if getPlayerSlotItem(_cid, 9).itemid == idring then
								ringexp = expring
								break
							end
						end
						local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1
						expgain = expgain * ringexp * premiumMultipliqueExp
						local party = false
						if isInParty(_cid) then
							local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent
							for indice, partyMember in pairs(partyMembers) do
								attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember)
								attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember)
								x = false
								if math.abs(attackerLevel - partyLevel) > levelBlockParty then
									x = true
								elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then
									x = true
								elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then
									x = true
								elseif attackerPos.z ~= partyPos.z then
									x = true
								elseif _cid == partyMember then
									x = true
								end
								if x then
									partyMembers[indice] = nil
								end
							end
							if #partyMembers ~= 0 then
								expParty = math.ceil(expgain / 100 * partyPorcent)
								expmember = math.ceil(expParty / #partyMembers)
								for _, member in pairs(partyMembers) do
									if member ~= _cid then
										doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.")
										doSendAnimatedText(member, expmember, 215)
										doPlayerAddExp(member, expmember)
									end
								end
								doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)")
								doSendAnimatedText(_cid, expgain - expParty, 215)
								doPlayerAddExp(_cid, expgain - expParty)
								party = true
							else
								party = false
							end
						end
						if not party then
							doPlayerAddExp(_cid, expgain)
							doSendAnimatedText(getThingPos(_cid), expgain, 215)
						end
					end
				end
			end
		end
	end
	return true
end

function onCombat(cid, target)
	if isMonster(target) and not isSummon(target) and not isPlayer(target) then
		registerCreatureEvent(target, "ExpGain")
	end
	return true
end

 

Editado por Frenesy (veja o histórico de edições)

Postado

esta dando esse problema

 

 [23:17:28.460] [Error - CreatureScript Interface]
[23:17:28.465] data/creaturescripts/scripts/exphit.lua:onStatsChange
[23:17:28.467] Description:
[23:17:28.471] attempt to index a number value
[23:17:28.473] stack traceback:
[23:17:28.476]  [C]: in function 'doSendAnimatedText'
[23:17:28.478]  data/creaturescripts/scripts/exphit.lua:113: in function <data/creaturescripts/scripts/exphit.lua:47>

Postado
  • Autor
Em 25/01/2021 em 23:18, Yurotsz disse:

esta dando esse problema

 

 [23:17:28.460] [Error - CreatureScript Interface]
[23:17:28.465] data/creaturescripts/scripts/exphit.lua:onStatsChange
[23:17:28.467] Description:
[23:17:28.471] attempt to index a number value
[23:17:28.473] stack traceback:
[23:17:28.476]  [C]: in function 'doSendAnimatedText'
[23:17:28.478]  data/creaturescripts/scripts/exphit.lua:113: in function <data/creaturescripts/scripts/exphit.lua:47>

 

Pois na linha 113 onde está ocorrendo o erro, troque o:

doSendAnimatedText(member, expmember, 215)

por:

doSendAnimatedText(getCreaturePosition(member), expmember, 215)

E veja se resolve.

  • 2 weeks later...
Postado
Em 30/01/2021 em 18:40, Frenesy disse:

 

Pois na linha 113 onde está ocorrendo o erro, troque o:


doSendAnimatedText(member, expmember, 215)

por:


doSendAnimatedText(getCreaturePosition(member), expmember, 215)

E veja se resolve.

Valeu funciono agora so como que faço pra pode pega a exp no final quando o bixo morre

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