Jump to content
FapFap

conch ray stun

Recommended Posts

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 

 

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

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...