FapFap 13 Report post Posted September 3, 2018 Wondering how to make the conch stun only 1 second, heres my skill script: function SkillArea_Line_Bkcj ( sklv ) --技能"Conch Ray"的技能区域公式 local lenth = 500 + sklv * 30 local width = 100 + sklv * 10 SetSkillRange ( 1 , lenth , width ) end function SkillCooldown_Bkcj( sklv ) local Cooldown = 7000 - sklv * 500 return Cooldown end function SkillSp_Bkcj ( sklv ) local sp_reduce = 20+ sklv * 3 return sp_reduce end function SkillEnergy_Bkcj ( sklv ) local energy_reduce = math.floor ( 3 + sklv * 0.5 ) return energy_reduce end function Skill_Bkcj_Begin ( role , sklv ) local sp = Sp(role) local sp_reduce = SkillSp_Bkcj ( sklv ) if sp - sp_reduce < 0 then SkillUnable(role) return end Sp_Red (role , sp_reduce ) end function Skill_Bkcj_End ( ATKER , DEFER , sklv ) local sta_atk= Sta ( ATKER ) local sta_def = Sta ( DEFER ) local AddStateLv = 0 AddStateLv = GetChaStateLv ( ATKER , STATE_MLCH ) local dmg = math.floor( 200 + sklv*30 +sta_atk*5 ) local map_name_DEFER = GetChaMapName ( DEFER ) local agi_atker = Agi(ATKER) local Can_Pk_Garner2 = Is_NormalMonster (DEFER) local Can_Pk_Bountypk = Is_NormalMonster (DEFER) if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then if Can_Pk_Garner2 == 0 then dmg = math.floor(MAGIC_Atk_Dmg(ATKER,DEFER)+sklv*200) local rate = math.random(1,200) if rate >= Con(DEFER) then local statetime = sklv/4 local statelv = sklv AddState ( ATKER , DEFER , STATE_XY , statelv , statetime ) end end end if map_name_ATKER == "bountypk" or map_name_DEFER == "bountypk" then if Can_Pk_Bountypk == 0 then dmg = math.floor(MAGIC_Atk_Dmg(ATKER,DEFER)+sklv*200) local rate = math.random(1,200) if rate >= Con(DEFER) then local statetime = sklv/4 local statelv = sklv AddState ( ATKER , DEFER , STATE_XY , statelv , statetime ) end end end -- Jack Coral (permanent) local coralslot = GetChaItem(ATKER, 1, 6); local coralid = GetItemID(coralslot); if(coralid == StrikeCoral)then local energy = GetItemAttr(coralslot, ITEMATTR_ENERGY); local mxenergy = GetItemAttr(coralslot, ITEMATTR_MAXENERGY); SetItemAttr(coralslot, ITEMATTR_ENERGY, mxenergy) end local dmg_fin = Cuihua_Mofa ( dmg , AddStateLv ) local dmg_ElfSkill = ElfSkill_MagicAtk ( dmg , ATKER ) dmg_fin = dmg_fin + dmg_ElfSkill Hp_Endure_Dmg ( DEFER , dmg_fin ) end Quote Share this post Link to post Share on other sites
Onioni 58 Report post Posted September 3, 2018 (edited) Now it's like this skill level/4 in CA and bh.. Just edit that.. local statetime = sklv/4 AddState ( ATKER , DEFER , STATE_XY , statelv , statetime ) Edited September 3, 2018 by Onioni Quote Download: Nightmare Demonic Helm Dimension Pirates Online files: get now New map Project: Flag PK Black Skin 3.1.3 for pko 1: Get now Share this post Link to post Share on other sites
FapFap 13 Report post Posted September 3, 2018 58 minutes ago, Onioni said: Now it's like this skill level/4 in CA and bh.. Just edit that.. local statetime = sklv/4 AddState ( ATKER , DEFER , STATE_XY , statelv , statetime ) sklv/4 does it mean that it gives 4 sec stun per lvl? Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted September 3, 2018 No, it means that it stuns 1/4 of the skill level. For example: if you have it maxed (lvl 10) it'll stun 2.5secs. if you want to set it to a specific ammount of time just do local statetime = 2 or so 1 Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted September 5, 2018 On 9/3/2018 at 2:45 PM, iZae said: No, it means that it stuns 1/4 of the skill level. For example: if you have it maxed (lvl 10) it'll stun 2.5secs. if you want to set it to a specific ammount of time just do local statetime = 2 or so it gives infinite stun Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted September 5, 2018 how to make it stun by random % ? Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted September 5, 2018 You really need to learn a lil bit of Lua. local rate = math.random(1,200) if rate >= Con(DEFER) then local statetime = sklv/4 local statelv = sklv AddState ( ATKER , DEFER , STATE_XY , statelv , statetime ) end that means that every time the skill is called inside CA, it will set a random number between 1 and 200, and if that number is greater than the amount of Constitution of the defer (it means, the one who will receive the stun) then stun. For example I attack you with a conch ray, the system sets the random number of 15 wich is lower than your Constitution, then no stun is applied. If you're asking a random time for the stun you can just do something like: local statetime = math.random(1,4) -- which means that it will randomnly stun for 1 till 4 seconds. Quote Share this post Link to post Share on other sites
Fisal Moha 21 Report post Posted September 16, 2018 On 9/3/2018 at 11:53 AM, FapFap said: Wondering how to make the conch stun only 1 second, heres my skill script: function SkillArea_Line_Bkcj ( sklv ) --技能"Conch Ray"的技能区域公式 local lenth = 500 + sklv * 30 local width = 100 + sklv * 10 SetSkillRange ( 1 , lenth , width ) end function SkillCooldown_Bkcj( sklv ) local Cooldown = 7000 - sklv * 500 return Cooldown end function SkillSp_Bkcj ( sklv ) local sp_reduce = 20+ sklv * 3 return sp_reduce end function SkillEnergy_Bkcj ( sklv ) local energy_reduce = math.floor ( 3 + sklv * 0.5 ) return energy_reduce end function Skill_Bkcj_Begin ( role , sklv ) local sp = Sp(role) local sp_reduce = SkillSp_Bkcj ( sklv ) if sp - sp_reduce < 0 then SkillUnable(role) return end Sp_Red (role , sp_reduce ) end function Skill_Bkcj_End ( ATKER , DEFER , sklv ) local sta_atk= Sta ( ATKER ) local sta_def = Sta ( DEFER ) local AddStateLv = 0 AddStateLv = GetChaStateLv ( ATKER , STATE_MLCH ) local dmg = math.floor( 200 + sklv*30 +sta_atk*5 ) local map_name_DEFER = GetChaMapName ( DEFER ) local agi_atker = Agi(ATKER) local Can_Pk_Garner2 = Is_NormalMonster (DEFER) local Can_Pk_Bountypk = Is_NormalMonster (DEFER) if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then if Can_Pk_Garner2 == 0 then dmg = math.floor(MAGIC_Atk_Dmg(ATKER,DEFER)+sklv*200) local rate = math.random(1,200) if rate >= Con(DEFER) then local statetime = sklv/4 local statelv = sklv AddState ( ATKER , DEFER , STATE_XY , statelv , statetime ) end end end if map_name_ATKER == "bountypk" or map_name_DEFER == "bountypk" then if Can_Pk_Bountypk == 0 then dmg = math.floor(MAGIC_Atk_Dmg(ATKER,DEFER)+sklv*200) local rate = math.random(1,200) if rate >= Con(DEFER) then local statetime = sklv/4 local statelv = sklv AddState ( ATKER , DEFER , STATE_XY , statelv , statetime ) end end end -- Jack Coral (permanent) local coralslot = GetChaItem(ATKER, 1, 6); local coralid = GetItemID(coralslot); if(coralid == StrikeCoral)then local energy = GetItemAttr(coralslot, ITEMATTR_ENERGY); local mxenergy = GetItemAttr(coralslot, ITEMATTR_MAXENERGY); SetItemAttr(coralslot, ITEMATTR_ENERGY, mxenergy) end local dmg_fin = Cuihua_Mofa ( dmg , AddStateLv ) local dmg_ElfSkill = ElfSkill_MagicAtk ( dmg , ATKER ) dmg_fin = dmg_fin + dmg_ElfSkill Hp_Endure_Dmg ( DEFER , dmg_fin ) end local statetime = math.min(1,math.floor(sklv/4)) maybe that cause infinite stun also there might be another error that cause infinite stun check Error logs for more info Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted September 17, 2018 15 hours ago, Fisal Moha said: local statetime = math.min(1,math.floor(sklv/4)) maybe that cause infinite stun also there might be another error that cause infinite stun check Error logs for more info Ain't no way that it causes infinte stun: math.min returns the minimum between 1 and the result of "math.floor(sklv/4)" and math.floor returns an integer not greater than the result of (sklv/4) so in case the sklv is 10 (max) the whole line would b e statetime = math.min(1,math.floor(10/4)) = math.min(1,math.floor(2.5)) = math.min(1,2) = 1 Quote Share this post Link to post Share on other sites
Fisal Moha 21 Report post Posted September 17, 2018 16 minutes ago, iZae said: Ain't no way that it causes infinte stun: math.min returns the minimum between 1 and the result of "math.floor(sklv/4)" and math.floor returns an integer not greater than the result of (sklv/4) so in case the sklv is 10 (max) the whole line would b e statetime = math.min(1,math.floor(10/4)) = math.min(1,math.floor(2.5)) = math.min(1,2) = 1 lets say its maybe unusual activity idk but sometime that unusual happen when there is a lot of players well he should try every possibility and make sure there is no error in your files specially cha_time to find out there a method i usually did is to see HP/SP recovery work or not Quote Share this post Link to post Share on other sites