Jump to content
Sign in to follow this  
kyleflow

Poss EXP persist after Poss END

Recommended Posts

I tried to add effect of mordo and angela jr into august pet and for the Stats wise, it seem like working well. But for the exp calculation, after the poss end, the benefit persist and even after log out after the 1st poss used, the exp kept giving exp benefit. does anyone knows why? here is the piece of script on the pet exp calculation section

 

---------------------------------------精灵加经验状态判断 Elf plus experience status judgment
			--local Check_star = {}
			--	Check_star[0] = t[i]  
			--	Check_star[1] = GetTeamCha( t[i] , 0 )  
			--	Check_star[2] = GetTeamCha( t[i] , 1 )   
			--	Check_star[3] = GetTeamCha( t[i] , 2 )    
			--	Check_star[4] = GetTeamCha( t[i] , 3 )
			--for m = 0 , 4 , 1 do	
			--	if ValidCha( Check_star[m] )== 1  then					--被加入组队经验分配的角色必须存在
					local Item_bg = GetChaItem ( t[i] , 2 , 1  ) --取角色背包第二栏的指针 Get the pointer of the second column of the character's backpack
					local Get_Item_Type = GetItemType ( Item_bg ) --调用程序接口获得Item道具类型 Call the program interface to obtain the Item prop type
					if Get_Item_Type==59 then --------判断是否为精灵
						local  Item_ID = GetItemID ( Item_bg )	--取ID
						local str = GetItemAttr( Item_bg ,ITEMATTR_VAL_STR )			--力量 
						local con = GetItemAttr( Item_bg ,ITEMATTR_VAL_CON )		 ---体质 
						local agi = GetItemAttr( Item_bg ,ITEMATTR_VAL_AGI )			--敏捷 
						local dex = GetItemAttr( Item_bg ,ITEMATTR_VAL_DEX )		 --专注 
						local sta = GetItemAttr( Item_bg ,ITEMATTR_VAL_STA )			 --精神 
						local URE = GetItemAttr( Item_bg ,ITEMATTR_URE )			--体力 
						local MAXURE = GetItemAttr( Item_bg ,ITEMATTR_MAXURE )		 --最大体力
						local lv_JL = str + con + agi + dex + sta	----一个精灵的等级
						local Num_JL = GetItemForgeParam ( Item_bg , 1 )
						local Part1 = GetNum_Part1 ( Num_JL )	--Get Num Part 1 到 Part 7
						local Part2 = GetNum_Part2 ( Num_JL )	
						local Part3 = GetNum_Part3 ( Num_JL )
						local StateLv1 = GetChaStateLv (t[i] , STATE_JLFT7 )
						local StateLv2 = GetChaStateLv (t[i] , STATE_JLFT8 )
						if Item_ID==237 and StateLv1~=0 then
							flag=1
						end
						if Item_ID==681 and StateLv2~=0 then
							flag=1
						end

						if Item_ID==7126 or Item_ID==500 and StateLv2~=0 then
							flag=2
						end
						-------custom script start here ----------
						if Item_ID==7126 or Item_ID==7362 and StateLv2~=0 then --August pet 1 to 4
							flag=3
						end
						if Item_ID==7126 or Item_ID==7363 and StateLv2~=0 then
							flag=4
						end
						if Item_ID==7126 or Item_ID==7364 and StateLv2~=0 then
							flag=5
						end
						if Item_ID==7126 or Item_ID==7365 and StateLv2~=0 then
							flag=6
						end
						-----custom stop here-------
						
						if flag==1  then ----有id为237或是681号的精灵并且精灵附体技能存在
							--if StateLv1 == 1 or StateLv2 == 1 then ---初级
							--	exp_up = exp_up*(0.005*lv_JL*0.1+1)
							--end
							--if StateLv1 == 2 or StateLv2 == 2 then ---中级
							--	exp_up = exp_up*(0.0125*lv_JL*0.1+1)
							--end
							--if StateLv1 == 3 or StateLv2 == 3 then ---高级
							--	exp_up = exp_up*(0.025*lv_JL*0.1+1)
							--end
							--if StateLv1 ~= 0 or StateLv2 ~= 0 then --original
							if StateLv1 ~= 0 or StateLv2 ~= 0 then
								exp_up = exp_up*(lv_JL*0.02+1)
							end
						elseif flag==2 then
							if Statelv1 ~= 0 or StateLv2 ~= 0 then
							exp_up = exp_up*2.5
							end
						--	URE=URE-4500
    					----custom start here ------
						elseif flag==3 then--tmbah flag try
							if Statelv1 ~= 0 or StateLv2 ~= 0 then
							exp_up = exp_up*2.5
							end
						elseif flag==4 then--tambah flag try
							if Statelv1 ~= 0 or StateLv2 ~= 0 then
							exp_up = exp_up*2.5
							end
						elseif flag==5 then--tambah flag try
							if Statelv1 ~= 0 or StateLv2 ~= 0 then
							exp_up = exp_up*2.5
							end
						elseif flag==6 then--tambah flag try
							if Statelv1 ~= 0 or StateLv2 ~= 0 then
							exp_up = exp_up*2.5
							end
    					------custom end here--------
						end
						SetItemAttr ( Item_bg , ITEMATTR_URE , URE ) 	
					end
			--	end
			--end
-------------------------------------------
-------------------------------------------

 

Share this post


Link to post
Share on other sites

Solved but the script very messy. Still if other have better ways to script it. please do comment.

 

						local StateLv1 = GetChaStateLv (t[i] , STATE_JLFT7 )
						local StateLv2 = GetChaStateLv (t[i] , STATE_JLFT8 )
						if Item_ID==237 and StateLv1~=0 then
							flag=1
						end
						if Item_ID==681 and StateLv2~=0 then
							flag=1
						end
						if Item_ID==500 and StateLv2~=0 then
							flag=1
						end
						if Item_ID==7362 and StateLv2~=0 then
							flag=1
						end
						if Item_ID==7363 and StateLv2~=0 then
							flag=1
						end
						if Item_ID==7364 and StateLv2~=0 then
							flag=1
						end
						if Item_ID==7365 and StateLv2~=0 then
							flag=1
						end
						if flag==1  then ----有id为237或是681号的精灵并且精灵附体技能存在 tutup kejap
							if StateLv1 ~= 0 or StateLv2 ~= 0 then
								if Item_ID == 7362 or Item_ID == 7363 or Item_ID == 7364 or Item_ID == 7365 or Item_ID == 500 then
								exp_up = exp_up*2.5
								else
								exp_up = exp_up*(lv_JL*0.02+1)
								end
							end 
						--[[elseif flag==2 then
							if Statelv1 ~= 0 or StateLv2 ~= 0 then
							exp_up = exp_up*2.5
							end]]--
						--	URE=URE-4500
						end
						SetItemAttr ( Item_bg , ITEMATTR_URE , URE ) 	
					end

 

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.

Sign in to follow this  

×
×
  • Create New...