jexu1234 0 Report post Posted January 14, 2017 Hello, wanted to know if anyone has the kylin effect function , And if they can make a guide on how to add the effect to precise equipment please. Thanks Quote Share this post Link to post Share on other sites
Gamez Pirates 44 Report post Posted January 14, 2017 32 minutes ago, jexu1234 said: Hello, wanted to know if anyone has the kylin effect function , And if they can make a guide on how to add the effect to precise equipment please. Thanks functions.lua 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 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 ) if Body_ID ~= 0825 and Body_ID ~= 2549 then return 0 end if Hand_ID ~= 0826 and Hand_ID ~= 2550 then return 0 end if Foot_ID ~= 0827 and Foot_ID ~= 2551 then return 0 end if Cha_Num == 4 then if Head_ID ~= 0828 and Head_ID ~= 2552 then return 0 end end return 1 end Explanation: 0825,0826,0827,0828, 2549,2550,2551,2552 are all Kylin Iteminfo numbers which the effect will apply to. functions lua -> function HP_Dmg(role,dmg) --This is for CA Damage stuff local Check_Nianshou = CheckItem_Nianshou ( role ) local CheckItem_fighting = CheckItem_fighting ( role ) local IsGarnerWiner = IsGarnerWiner(role) if Check_Nianshou == 1 then local Percentage = Percentage_Random ( 0.1 ) if Percentage == 1 then dmg = dmg * -1 SystemNotice ( role , "Recieved blessing from Goddess. Drains enemy HP.") end end Now let's have a look at skilleffect.lua function Skill_Melee_End, add this to the end of it local Check_Nianshou = CheckItem_Nianshou ( ATKER ) if Check_Nianshou == 1 then local P_R = 0.1 local job = GetChaAttr( ATKER , ATTR_JOB ) if job == 5 then P_R = 0.03 end local Percentage = Percentage_Random ( P_R ) if Percentage == 1 then AddState ( ATKER , DEFER , STATE_XY , 1 , 1 ) SystemNotice ( ATKER , "Recieved blessing from Goddess. Knock out target for 1 sec") end end Check_Ys_Rem ( ATKER , DEFER) and finally in the same lua, find Function Skill_Range_End and add this to the end local Check_Nianshou = CheckItem_Nianshou ( ATKER ) if Check_Nianshou == 1 then local Percentage = Percentage_Random ( 0.1 ) if Percentage == 1 then AddState ( ATKER , DEFER , STATE_XY , 1 , 1 ) SystemNotice ( ATKER , "Recieved blessing from Goddess. Knock out target for 1 sec") end end Check_Ys_Rem ( ATKER , DEFER ) If I forgot something, It's 3AM, don't blame me. Enjoy. 1 Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted January 14, 2017 This goes in functions.lua: function CheckEquipmentSet(Player, Head, Body, Glove, Shoes, Neck, RHand, LHand, Ring1, Ring2) if Head ~= 0 then if GetItemID(GetChaItem(Player, 1, 0))~= Head then if GetItemAttr(GetChaItem(Player, 1, 0), ITEMATTR_VAL_FUSIONID)~= Head then return 0 end end end if Body ~= 0 then if GetItemID(GetChaItem(Player, 1, 2))~= Body then if GetItemAttr(GetChaItem(Player, 1, 2), ITEMATTR_VAL_FUSIONID)~= Body then return 0 end end end if Glove ~= 0 then if GetItemID(GetChaItem(Player, 1, 3))~= Glove then if GetItemAttr(GetChaItem(Player, 1, 3), ITEMATTR_VAL_FUSIONID)~= Glove then return 0 end end end if Shoes ~= 0 then if GetItemID(GetChaItem(Player, 1, 4))~= Shoes then if GetItemAttr(GetChaItem(Player, 1, 4), ITEMATTR_VAL_FUSIONID)~= Shoes then return 0 end end end if Neck ~= 0 then if GetItemID(GetChaItem(Player, 1, 5))~= Neck then return 0 end end if RHand ~= 0 then if GetItemID(GetChaItem(Player, 1, 9))~= RHand then if GetItemAttr(GetChaItem(Player, 1, 9), ITEMATTR_VAL_FUSIONID)~= RHand then return 0 end end end if LHand ~= 0 then if GetItemID(GetChaItem(Player, 1, 6))~= LHand then if GetItemAttr(GetChaItem(Player, 1, 6), ITEMATTR_VAL_FUSIONID)~= LHand then return 0 end end end if Ring1 ~= 0 then if GetItemID(GetChaItem(Player, 1, 7))~= Ring1 then return 0 end end if Ring2 ~= 0 then if GetItemID(GetChaItem(Player, 1, 8))~= Ring2 then return 0 end end return 1 end Then add this there as well: function Set_KylinEquipment(Player) if CheckEquipmentSet(Player, 0, <BODY_ID>, <GLOVE_ID>, <BOOTS_ID>, 0, 0, 0, 0, 0) == 1 then return 1 end return 0 end Then just add this anywhere you want to do anything you need. if Set_KylinEquipment(Player) == 1 then if math.random(1, 100) <= 10 then -- <CODE_HERE> end end @Gamez Pirates has given you the default go-to function from server files, you can use that and do it without learning more. What I gave you is a better function so you can easily add more requirements, of course if you learn how to modify it (everything is simple and explained within the functions). This takes the load off of repeating every time, now you just add a single function and it will do the check for you, whether the equipment is fused or not. 3 1 Quote Share this post Link to post Share on other sites
Turisasx 2 Report post Posted April 28, 2020 hello, sorry for replying a 3 year old post, but im very interested about learning more about set effects and i want to understand this part of the code local Check_Nianshou = CheckItem_Nianshou ( ATKER ) ------ this check if the set is equiped if Check_Nianshou == 1 then ---- this says it is on local P_R = 0.1 ---- local numeric definition for p_r? local job = GetChaAttr( ATKER , ATTR_JOB ) ---- ask for the class of the attacker? if job == 5 then ----- if class is ... herbalist? P_R = 0.03 ---- another definition? end local Percentage = Percentage_Random ( P_R ) ---- confused about this part if Percentage == 1 then AddState ( ATKER , DEFER , STATE_XY , 1 , 1 ) ---- STATE_XY this mean stun? where i can check other states? SystemNotice ( ATKER , "Recieved blessing from Goddess. Knock out target for 1 sec") end end Check_Ys_Rem ( ATKER , DEFER) ------dont get this part Also, where is the hp recover fuction? this seems only to be for the mini stun, but kylin set also heals u by a small chance from taking hits. I want to understand the already made effects so i can create my owns more effectively thank you! Quote Share this post Link to post Share on other sites