Jump to content
ratonter

How to keep Kylin Effect, if fused? (Solved) ✔

Recommended Posts

Hello some one can tell me how can i set a function for get the effect kylen while the set stil fussed.. i mean get the effect kylin while the set be fuse with an app

Share this post


Link to post
Share on other sites

If you already got function on one with normal set you can use this line to get the actual id of item


 


    local checkSlot = GetEquipItemP(role,5)-- here it will check the slot 5 is neck you could find ids in Look.lua which located at script/calculate

    local ItemID = 0--we set it here always 0 for failure
    if checkSlot ~= nil then -- check when is empty or null
  		ItemID = GetItemFissionID (checkSlot) -- this here will get the actual ItemID from Fissioned one
	end

 

hope i helped and try use your head a bit you never learn unless you challenge yourself!

 

good luck buddy.

Edited by Fisal Moha
  • Thanks 1

Share this post


Link to post
Share on other sites
9 minutes ago, Fisal Moha said:

If you already got function on one with normal set you can use this line to get the actual id of item


 



    local checkSlot = GetEquipItemP(role,5)-- here it will check the slot 5 is neck you could find ids in Look.lua which located at script/calculate

    local ItemID = 0--we set it here always 0 for failure
    if checkSlot ~= nil then -- check when is empty or null
  		ItemID = GetItemFissionID (checkSlot) -- this here will get the actual ItemID from Fissioned one
	end

 

hope i helped and try use your head a bit you never learn unless you challenge yourself!

 

good luck buddy.

thanks man, but i still not understand :/

 

 

Share this post


Link to post
Share on other sites

This applies for Kylin and or Black Dragon.

 

In your server files, Resource\script\calculate\functions.lua

 

Find "function CheckItem_Nianshou ( role )"

This is what parameters it will check, to see if a player is wearing the ItemID's, if they are, and they also have a certain item in their inventory then they can keep the effect while item is fused.

 

function CheckItem_Nianshou ( role )
	local Atk = IsPlayer ( role )
	local boat = ChaIsBoat ( role )
	if Atk == 0 or boat == 1 then
		return 0
	end
	local cha = TurnToCha ( role )
	local Cha_Num = GetChaTypeID( cha )
	local item = CheckBagItem(role,7008) -- Item required to be in your inventory if fused.
	local head = GetChaItem ( role , 1 , 0 ) -- Checking head item
	local body = GetChaItem ( role , 1 , 2 ) -- Checking body item
	local hand = GetChaItem ( role , 1 , 3 ) -- Checking gloves item
	local foot = GetChaItem ( role , 1 , 4 ) -- Checking boots item
	local Head_ID = GetItemID ( head ) -- Retrieve the ItemID of head
	local Body_ID = GetItemID ( body ) -- Retrieve the ItemID of body
	local Hand_ID = GetItemID ( hand ) -- Retrieve the ItemID of gloves
	local Foot_ID = GetItemID ( foot ) -- Retrieve the ItemID of boots
	local FBody_ID = GetItemAttr ( body , ITEMATTR_VAL_FUSIONID ) -- Get the fused ItemID of body
	local FHand_ID = GetItemAttr ( hand , ITEMATTR_VAL_FUSIONID ) -- Get the fused ItemID of gloves
	local FFoot_ID = GetItemAttr ( foot , ITEMATTR_VAL_FUSIONID ) -- Get the fused ItemID of boots
 
	-- If less than ID 5000 (means its not apparel).
	if  Body_ID<5000 or Hand_ID<5000 or Foot_ID<5000 then
	

	if Body_ID ~= 0825  and Body_ID ~= 2549 then  --If Armor ID is 825, and or 2549, then it is considered Kylin
		return 0
	end

	if Hand_ID ~= 0826  and Hand_ID ~= 2550 then --If Gloves ID is 826, and or 2550, then it is considered Kylin
		return 0
	end

	if Foot_ID ~= 0827  and Foot_ID ~= 2551 then --If Armor ID is 827, and or 2551, then it is considered Kylin
		return 0
	end

else

	--Recall that we created "FBody/FHand/FFoot above, the F in front of the objective stands for "fusion" in this case, just to make it easy to read.

		-- Checking if player wearing armor
		if FBody_ID ~= 0825 and FBody_ID ~= 2549   then
			return 0
		end
 
		-- Checking  if player wearing gloves
		if FHand_ID ~= 0826 and FHand_ID ~= 2550 then
			return 0
		end
 
		-- Checking  if player wearing boots
		if FFoot_ID ~= 0827 and FFoot_ID ~= 2551 then
			return 0
		end
 
		-- Checking if player has the item required "The item needed in inventory".
		if item < 1 then
			return 0
		end
	-- End checking
	end
 
	-- After checking, apply the effects
	return 1
 
	-- End of process
end

 

Next, we apply this into the attacking parameters.

 

Find  "function Skill_Melee_End ( ATKER , DEFER , sklv )" in Resource\script\calculate\skilleffect.lua

This one is for "Normal melee's" Non-range.

It will check for "Check_Nianshou" which we will call from functions.lua to identify the calling.

		local Check_Nianshou = CheckItem_Nianshou ( ATKER )
		
		if Check_Nianshou == 1 then
			local P_R = 0.2 -- 20% chance to obtain kylin effect.
			local job = GetChaAttr( ATKER , ATTR_JOB )
			if job == 5 then
				P_R = 1
			end
			local Percentage = Percentage_Random ( P_R )
			if Percentage == 1 then -- If the chance is obtained, then Add Stun for 1 second, and also a chance to apply heal.
				AddState ( ATKER , DEFER , STATE_XY , 1 , 1 )
				SystemNotice ( ATKER , "<Kylin Set> Target Stunned for 1 Second.")
			end
		end	

 

Now we go find the "Range" melee, which applies for Sharpshooters, or range classes.

"function Skill_Range_End ( ATKER , DEFER , sklv )" 

Same application here.

 

		local Check_Nianshou = CheckItem_Nianshou ( ATKER )
		
		if Check_Nianshou == 1 then
			local P_R = 0.2 -- 20% chance to obtain kylin effect.
			local job = GetChaAttr( ATKER , ATTR_JOB )
			if job == 5 then
				P_R = 1
			end
			local Percentage = Percentage_Random ( P_R )
			if Percentage == 1 then -- If the chance is obtained, then Add Stun for 1 second, and also a chance to apply heal.
				AddState ( ATKER , DEFER , STATE_XY , 1 , 1 )
				SystemNotice ( ATKER , "<Kylin Set> Target Stunned for 1 Second.")
			end
		end

 

  • Thanks 1

Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
3 hours ago, ratonter said:

thanks man, but i still not understand :/

 

 

I am sorry I forget one thing the function that run to check the itemid of fission id (cough)

 


function GetItemFissionID(Item)
	local MainID = GetItemID (Item)
	if MainID > 5000 and MainID ~= 9999 then
		return GetItemAttr(Item,ITEMATTR_VAL_FUSIONID)
	else
		return MainID
	end
end

 

anyway @ᴡʀx explained it well you can check his post carefully and you will surly manage to make it work.

 

good luck

  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, Brothers said:

Will this work the same with 85 ring effect?
When i fuse death armor, will it also keep effect?

It should work for any set u want to keep effect. make sure u do it correctly.

Share this post


Link to post
Share on other sites
On 9/1/2020 at 4:15 PM, Fisal Moha said:

I am sorry I forget one thing the function that run to check the itemid of fission id (cough)

 



function GetItemFissionID(Item)
	local MainID = GetItemID (Item)
	if MainID > 5000 and MainID ~= 9999 then
		return GetItemAttr(Item,ITEMATTR_VAL_FUSIONID)
	else
		return MainID
	end
end

 

anyway @ᴡʀx explained it well you can check his post carefully and you will surly manage to make it work.

 

good luck

May I know where you place this script ? I put it inside functions.lua but still its not detecting fused kylin set as kylin and the effect is not working. Can anyone clarify where should i put this script and why its not working for me. I already tested with both kylin set without apparel and the effect working well. So I suspect the only issue is the script for fussion or fission is not working.

Share this post


Link to post
Share on other sites
On 9/1/2020 at 7:15 AM, Dan said:

This applies for Kylin and or Black Dragon.

 

In your server files, Resource\script\calculate\functions.lua

 

Find "function CheckItem_Nianshou ( role )"

This is what parameters it will check, to see if a player is wearing the ItemID's, if they are, and they also have a certain item in their inventory then they can keep the effect while item is fused.

 


function CheckItem_Nianshou ( role )
	local Atk = IsPlayer ( role )
	local boat = ChaIsBoat ( role )
	if Atk == 0 or boat == 1 then
		return 0
	end
	local cha = TurnToCha ( role )
	local Cha_Num = GetChaTypeID( cha )
	local item = CheckBagItem(role,7008) -- Item required to be in your inventory if fused.
	local head = GetChaItem ( role , 1 , 0 ) -- Checking head item
	local body = GetChaItem ( role , 1 , 2 ) -- Checking body item
	local hand = GetChaItem ( role , 1 , 3 ) -- Checking gloves item
	local foot = GetChaItem ( role , 1 , 4 ) -- Checking boots item
	local Head_ID = GetItemID ( head ) -- Retrieve the ItemID of head
	local Body_ID = GetItemID ( body ) -- Retrieve the ItemID of body
	local Hand_ID = GetItemID ( hand ) -- Retrieve the ItemID of gloves
	local Foot_ID = GetItemID ( foot ) -- Retrieve the ItemID of boots
	local FBody_ID = GetItemAttr ( body , ITEMATTR_VAL_FUSIONID ) -- Get the fused ItemID of body
	local FHand_ID = GetItemAttr ( hand , ITEMATTR_VAL_FUSIONID ) -- Get the fused ItemID of gloves
	local FFoot_ID = GetItemAttr ( foot , ITEMATTR_VAL_FUSIONID ) -- Get the fused ItemID of boots
 
	-- If less than ID 5000 (means its not apparel).
	if  Body_ID<5000 or Hand_ID<5000 or Foot_ID<5000 then
	

	if Body_ID ~= 0825  and Body_ID ~= 2549 then  --If Armor ID is 825, and or 2549, then it is considered Kylin
		return 0
	end

	if Hand_ID ~= 0826  and Hand_ID ~= 2550 then --If Gloves ID is 826, and or 2550, then it is considered Kylin
		return 0
	end

	if Foot_ID ~= 0827  and Foot_ID ~= 2551 then --If Armor ID is 827, and or 2551, then it is considered Kylin
		return 0
	end

else

	--Recall that we created "FBody/FHand/FFoot above, the F in front of the objective stands for "fusion" in this case, just to make it easy to read.

		-- Checking if player wearing armor
		if FBody_ID ~= 0825 and FBody_ID ~= 2549   then
			return 0
		end
 
		-- Checking  if player wearing gloves
		if FHand_ID ~= 0826 and FHand_ID ~= 2550 then
			return 0
		end
 
		-- Checking  if player wearing boots
		if FFoot_ID ~= 0827 and FFoot_ID ~= 2551 then
			return 0
		end
 
		-- Checking if player has the item required "The item needed in inventory".
		if item < 1 then
			return 0
		end
	-- End checking
	end
 
	-- After checking, apply the effects
	return 1
 
	-- End of process
end

 

Next, we apply this into the attacking parameters.

 

Find  "function Skill_Melee_End ( ATKER , DEFER , sklv )" in Resource\script\calculate\skilleffect.lua

This one is for "Normal melee's" Non-range.

It will check for "Check_Nianshou" which we will call from functions.lua to identify the calling.


		local Check_Nianshou = CheckItem_Nianshou ( ATKER )
		
		if Check_Nianshou == 1 then
			local P_R = 0.2 -- 20% chance to obtain kylin effect.
			local job = GetChaAttr( ATKER , ATTR_JOB )
			if job == 5 then
				P_R = 1
			end
			local Percentage = Percentage_Random ( P_R )
			if Percentage == 1 then -- If the chance is obtained, then Add Stun for 1 second, and also a chance to apply heal.
				AddState ( ATKER , DEFER , STATE_XY , 1 , 1 )
				SystemNotice ( ATKER , "<Kylin Set> Target Stunned for 1 Second.")
			end
		end	

 

Now we go find the "Range" melee, which applies for Sharpshooters, or range classes.

"function Skill_Range_End ( ATKER , DEFER , sklv )" 

Same application here.

 


		local Check_Nianshou = CheckItem_Nianshou ( ATKER )
		
		if Check_Nianshou == 1 then
			local P_R = 0.2 -- 20% chance to obtain kylin effect.
			local job = GetChaAttr( ATKER , ATTR_JOB )
			if job == 5 then
				P_R = 1
			end
			local Percentage = Percentage_Random ( P_R )
			if Percentage == 1 then -- If the chance is obtained, then Add Stun for 1 second, and also a chance to apply heal.
				AddState ( ATKER , DEFER , STATE_XY , 1 , 1 )
				SystemNotice ( ATKER , "<Kylin Set> Target Stunned for 1 Second.")
			end
		end

 

I follow all your steps, but after appereal fusion, effect of normal kylin set is still gone.

These steps were done by what u said:
 

Find "function CheckItem_Nianshou ( role )"

and changed...


Next, we apply this into the attacking parameters.
Find  "function Skill_Melee_End ( ATKER , DEFER , sklv )" in Resource\script\calculate\skilleffect.lua
This one is for "Normal melee's" Non-range.It will check for "Check_Nianshou" which we will call from functions.lua to identify the callin

 

Check..

 

Now we go find the "Range" melee, which applies for Sharpshooters, or range classes.
function Skill_Range_End ( ATKER , DEFER , sklv )" 
Same application here.

 

check check,,,

Share this post


Link to post
Share on other sites
13 hours ago, Dan said:

@Brothers You need to see if you have the item local item = CheckBagItem(role,7008) -- Item required to be in your inventory if fused.

Thanks for the quick response!
I use clean files, so i bet its not there yet.
Do i have to create this in function?

Share this post


Link to post
Share on other sites
11 hours ago, Brothers said:

Thanks for the quick response!
I use clean files, so i bet its not there yet.
Do i have to create this in function?

function IsSkySet( role )
	local Atk = IsPlayer ( role )
	local boat = ChaIsBoat ( role )
	if Atk == 0 or boat == 1 then return 0 end
	
	local head = GetChaItem ( role , 1 , 0 )
	local body = GetChaItem ( role , 1 , 2 )
	local hand = GetChaItem ( role , 1 , 3 )
	local foot = GetChaItem ( role , 1 , 4 )

	local Head_ID = GetItemID ( head )
	local Body_ID = GetItemID ( body )
	local Hand_ID = GetItemID ( hand )
	local Foot_ID = GetItemID ( foot )

	local FusedBody_ID = GetItemAttr ( body , ITEMATTR_VAL_FUSIONID )
	local FusedHand_ID = GetItemAttr ( hand , ITEMATTR_VAL_FUSIONID )
	local FusedFoot_ID = GetItemAttr ( foot , ITEMATTR_VAL_FUSIONID )

	-- local hasSkyStone =  CheckBagItem( role, 7529)

	--	if (Body_ID ~= idToBeChecked or Hand_ID ~= idToBeChecked or Foot_ID ~= idToBeChecked) then return 0 end	
	if (FusedBody_ID ~= 24 or FusedHand_ID ~= 25 or FusedFoot_ID ~= 26) then return 0 end

	-- if hasSkyStone ~= 1 then
	-- 	return 0
	-- end

	return 1
end

Here you go, I used this in Avacado Online, the normal (nonfuse) checks are commented but I kept them for convenience plus you can enable the hasSkyStone in-order to check for a fused set + a stone to have stun effect but don't enable it in place, you can add it to the fuse checks as an (or hasSkyStone ~= 1) also if you gonna use this function notice it returns false for mismatches, true otherwise so you have to check for either of the predictable conditions and beware of mismatches in lua, you have to explicitly check for a success 
 

local hasSkySet = IsSkySet(Player)
if hasSkySet == 1 then 
 -- perform something
end

because of the following

 

Quote

lua considers false and nil as false and anything else as true.

 

Implicit checks like the following example, are error prone and mostly won't work.

local hasSkySet = IsSkySet(Player)
if hasSkySet then 
 -- perform something
end


 


Kind regards, AG.

Share this post


Link to post
Share on other sites
17 hours ago, J0k3r said:

function IsSkySet( role )
	local Atk = IsPlayer ( role )
	local boat = ChaIsBoat ( role )
	if Atk == 0 or boat == 1 then return 0 end
	
	local head = GetChaItem ( role , 1 , 0 )
	local body = GetChaItem ( role , 1 , 2 )
	local hand = GetChaItem ( role , 1 , 3 )
	local foot = GetChaItem ( role , 1 , 4 )

	local Head_ID = GetItemID ( head )
	local Body_ID = GetItemID ( body )
	local Hand_ID = GetItemID ( hand )
	local Foot_ID = GetItemID ( foot )

	local FusedBody_ID = GetItemAttr ( body , ITEMATTR_VAL_FUSIONID )
	local FusedHand_ID = GetItemAttr ( hand , ITEMATTR_VAL_FUSIONID )
	local FusedFoot_ID = GetItemAttr ( foot , ITEMATTR_VAL_FUSIONID )

	-- local hasSkyStone =  CheckBagItem( role, 7529)

	--	if (Body_ID ~= idToBeChecked or Hand_ID ~= idToBeChecked or Foot_ID ~= idToBeChecked) then return 0 end	
	if (FusedBody_ID ~= 24 or FusedHand_ID ~= 25 or FusedFoot_ID ~= 26) then return 0 end

	-- if hasSkyStone ~= 1 then
	-- 	return 0
	-- end

	return 1
end

Here you go, I used this in Avacado Online, the normal (nonfuse) checks are commented but I kept them for convenience plus you can enable the hasSkyStone in-order to check for a fused set + a stone to have stun effect but don't enable it in place, you can add it to the fuse checks as an (or hasSkyStone ~= 1) also if you gonna use this function notice it returns false for mismatches, true otherwise so you have to check for either of the predictable conditions and beware of mismatches in lua, you have to explicitly check for a success 
 


local hasSkySet = IsSkySet(Player)
if hasSkySet == 1 then 
 -- perform something
end

because of the following

 

 

Implicit checks like the following example, are error prone and mostly won't work.


local hasSkySet = IsSkySet(Player)
if hasSkySet then 
 -- perform something
end


 

But does this helps function CheckItem_Nianshou? 
I guess i just have to make that work.
Im not sure, but i think SkySet is differend function, but same thing?

Share this post


Link to post
Share on other sites
On 10/2/2022 at 2:19 AM, Dan said:

@Brothers You need to see if you have the item local item = CheckBagItem(role,7008) -- Item required to be in your inventory if fused.

Can you please explain this to me? I didnt find this info above, so i might have to add this somewhere into my files?

Share this post


Link to post
Share on other sites
6 hours ago, Brothers said:

Can you please explain this to me? I didnt find this info above, so i might have to add this somewhere into my files?

It's checking if your character has the itemID 7008 in bag.


Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
10 hours ago, Dan said:

It's checking if your character has the itemID 7008 in bag.

Ah, because it says 

local item = CheckBagItem(role,7008) -- Item required to be in your inventory if fused.

Well, my iteminfo goes to 5999, does it mean i have to make an item to 7008? @Dan

Share this post


Link to post
Share on other sites
On 10/3/2022 at 8:23 PM, Brothers said:

But does this helps function CheckItem_Nianshou? 
I guess i just have to make that work.
Im not sure, but i think SkySet is differend function, but same thing?

This is just a name that you can replace, you should be concerned with the body of the function, you build up on it.


Kind regards, AG.

Share this post


Link to post
Share on other sites
On 10/6/2022 at 7:11 AM, Brothers said:

Ah, because it says 

local item = CheckBagItem(role,7008) -- Item required to be in your inventory if fused.

Well, my iteminfo goes to 5999, does it mean i have to make an item to 7008? @Dan

No, you can change the 7008 to an itemID you want.


Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
On 10/8/2022 at 5:07 AM, Dan said:

No, you can change the 7008 to an itemID you want.

Ah oke, thanks!
Is it also avaible to delete this line, so you just can fuse kylin to any appereal and keep the kylin effect?
 

Share this post


Link to post
Share on other sites
1 hour ago, Brothers said:

Ah oke, thanks!
Is it also avaible to delete this line, so you just can fuse kylin to any appereal and keep the kylin effect?
 

Yes but you need to modify the code, and do something else if you are not checking for character to have certain ItemID in inventory.

  • Thanks 1

Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
59 minutes ago, Dan said:

Yes but you need to modify the code, and do something else if you are not checking for character to have certain ItemID in inventory.

Ah oke, thanks for your replys! I changed item to auto rations, guess everyone will have that one in inventory 😃

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...