Jump to content

Recommended Posts

Looking for someone who could help me to make balanced pk map
that's mean all the players will have same stats inside this map doesn't matter if he's gemmed or clean everyone will be with same stats

if someone can help me to do it pm me here or discord : MiniMan#9579

I can pay for the service thanks .

Share this post


Link to post
Share on other sites

Hi @MiniMan!

 

Q: How to make this work?
R: Simple, paste codes below at end of AttrCalculate.lua and call BalancedPkMap(role) at navtive function located at AttrCalculate.lua -> ExAttrSet(role) or use hooks.

 

Native function method
function ExAttrSet(role)

  if IsPlayer(role) == 1 then
    BalancedPkMap(role)
    -- Some codes heres
end

 

Hooking method, must have Hook Library by Matt
Hook:AddPostHook("ExAttrSet", BalancedPkMap)

 

Note¹: I didn't tested that, but may work.

 

NewPlayerAttrSet = {}
NewPlayerAttrSet.Attribute = {Max = {HP = 100, SP = 100}, Attack = {Min = 2000, Max = 2500, Speed = 250}, Defense = 500, Resist = 25, HitRate = 250, Dodge = 250, MoveSpeed = 600}


BalancedPkMap = function(Player)
	if GetChaMapName(Player) == "FarmMap" then
		if NewPlayerAttrSet.Attribute ~= nil then
			local mf_final = Mf_final(Player)	
			local crt_final = Crt_final(Player)
			local hrec_final = Hrec_final(Player)
			local srec_final = Srec_final(Player)
			local adis_final = Adis_final(Player)
			SetCharaAttr(NewPlayerAttrSet.Attribute.Max.HP, Player, ATTR_MXHP)
			SetCharaAttr(NewPlayerAttrSet.Attribute.Max.SP, Player, ATTR_MXSP)
			SetCharaAttr(NewPlayerAttrSet.Attribute.Attack.Min, Player, ATTR_MNATK)
			SetCharaAttr(NewPlayerAttrSet.Attribute.Attack.Max, Player, ATTR_MXATK)
			SetCharaAttr(NewPlayerAttrSet.Attribute.Defense, Player, ATTR_DEF )
			SetCharaAttr(NewPlayerAttrSet.Attribute.Resist, Player, ATTR_PDEF) 
			SetCharaAttr(NewPlayerAttrSet.Attribute.HitRate, Player, ATTR_HIT )
			SetCharaAttr(NewPlayerAttrSet.Attribute.Dodge, Player, ATTR_FLEE)
			SetCharaAttr(mf_final, Player, ATTR_MF )
			SetCharaAttr(crt_final, Player, ATTR_CRT )
			SetCharaAttr(hrec_final, Player, ATTR_HREC )
			SetCharaAttr(srec_final, Player, ATTR_SREC )
			SetCharaAttr(adis_final, Player, ATTR_ADIS )
			SetCharaAttr(NewPlayerAttrSet.Attribute.MoveSpeed, Player, ATTR_MSPD )
			SetCharaAttr(100000/NewPlayerAttrSet.Attribute.Attack.Speed, Player, ATTR_ASPD )	
		end
	end
end

 

Edited by Satan
Code fixing
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×