Jump to content
ahmad

Whirlpool skill bug

Recommended Posts

helo!~
every time i use Whirlpool  skill appear some error inside lua error

 

[10-17 00:51:46]DoString State_Xw_Add
[10-17 00:51:46]./resource/script\calculate\functions.lua:655: attempt to perform arithmetic on a nil value
[10-17 00:52:02]DoString State_Xw_Rem
[10-17 00:52:02]./resource/script\calculate\functions.lua:655: attempt to perform arithmetic on a nil value


this the function inside function.lua
 


function Mspd(a)
	--LuaPrint("Obtain character attribute mspd") 
	local mspd=GetChaAttr(a,ATTR_MSPD) --[[取mspd]]--
	return mspd 
end 

function MspdSa(a)
	--LuaPrint("Obtain character attribute mspd_sa") 
	local mspdsa=  GetChaAttr(a, ATTR_STATEC_MSPD)/ATTR_RADIX   --[[取mspd状态百分比]]--
	return mspdsa 
end 

 
and this inside skilleff
 

function Skill_Xw_End ( ATKER , DEFER , sklv ) 
end 

function State_Xw_Add ( role , statelv ) 
	local mspdsa_dif = 0.1 + statelv * 0.02 
	local aspdsa_dif = 0.05 + statelv * 0.01 
	local mspdsa = ( MspdSa ( cha_role ) - mspdsa_dif )  * ATTR_RADIX
	local aspdsa = ( AspdSa ( cha_role ) - aspdsa_dif )  * ATTR_RADIX
	SetCharaAttr( mspdsa , role , ATTR_STATEC_MSPD ) 
	SetCharaAttr( aspdsa , role , ATTR_STATEC_ASPD ) 
	ALLExAttrSet( role )  
end 

function State_Xw_Rem ( role , statelv ) 
	local mspdsa_dif = 0.1 + statelv * 0.02 
	local aspdsa_dif = 0.05 + statelv * 0.01 
	local mspdsa = ( MspdSa ( cha_role ) + mspdsa_dif )  * ATTR_RADIX
	local aspdsa = ( AspdSa ( cha_role ) + aspdsa_dif )  * ATTR_RADIX
	SetCharaAttr( mspdsa , role , ATTR_STATEC_MSPD ) 
	SetCharaAttr( aspdsa , role , ATTR_STATEC_ASPD ) 
	ALLExAttrSet( role )  
end 


function State_Xw_Tran ( statelv ) 
	return 1     
end

skilinfo line
 

0218	Whirlpool	1	16,10	1,-1	1,-1	1,-1	-1	2	1	0	-1	217,4	1	2	2	1000	5	2	0	0	3	0	SkillArea_State_Xw	SkillSp_Xw	0	0	SkillArea_Circle_Xw	0	Skill_Xw_End	0	0	0	0	0	0	0	0	0	0	0	0	0	0	SkillCooldown_Xw	1	1	12	0	110	-1	278	0	0	247,0	0,0	-1	-1	-1	0	0	111	-1	0	0	279	0	s0218.tga	0	0	Creates a whirlpool to decrease movement speed of hostile ships within range	Effect increases with each level	Consumes 21 SP at Level 1. Increases by 1 SP per skill level	0																																		

skilleff line
 

12	Whirlpool	-1	State_Xw_Tran	State_Xw_Add	State_Xw_Rem	1	0	1	1	1	1	1	1	1	1	1	1	1	1	0	0	0	-1	280	1	0	0	0	0	0

 

Share this post


Link to post
Share on other sites

Change the name of the variable 'cha_role' to 'role' in skilleff.lua


Share this post


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

Give us functions.lua string #655

line 655 it's
local mspdsa= GetChaAttr(a, ATTR_STATEC_MSPD)/ATTR_RADIX --[[取mspd状态百分比]]--

 

 

13 hours ago, V3ct0r said:

Change the name of the variable 'cha_role' to 'role' in skilleff.lua

didn't work have this error 
image.png.ddc5dcaa8c0e51af273914c793dbc55c.png

image.png.742d8a50172166df93d8d1c4da93fc0a.png

and this cha_role inside function.lua
image.png.50b6c615e59da97e3a1927f3cb5b40c2.png

image.png.9d78ee4e07ba946963892a1255a802ba.png



image.png.1e3c3ca99e1f6333bc7b0fc572df76ed.png

Share this post


Link to post
Share on other sites

@Ahmed, change 'role' on the line 5837 to 'statelv'


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