Dan 184 Report post Posted December 24, 2017 (edited) Scenario: I'm equipped with cape/and state rem/add effect 2.2k passive max with cape/pet/state I poss (In argent) I get 2.6k max I then take off cape/state effect (at 2.1k max now) and teleport to icicle (now I'm back to 2.6k max) BUT without state/cape Now I put on cape+state effect and now my max is 3.2k (Why does this happen?) Pet Scripts: function Skill_JLFT_End ( ATKER , DEFER , sklv ) local statelv = sklv local statetime = 190 - sklv * 10 local item_elf = GetChaItem(ATKER , 2, 1) -- Pet Handle local item_elf_type = GetItemType ( item_elf ) -- Pet Type local Item_ID = GetItemID ( item_elf ) -- Pet ID if Item_ID==231 then AddState( ATKER , ATKER , STATE_JLFT1, statelv , statetime ) elseif Item_ID==232 then AddState( ATKER , ATKER , STATE_JLFT2, statelv , statetime ) elseif Item_ID==233 then AddState( ATKER , ATKER , STATE_JLFT3, statelv , statetime ) elseif Item_ID==235 then AddState( ATKER , ATKER , STATE_JLFT4, statelv , statetime ) elseif Item_ID==234 then AddState( ATKER , ATKER , STATE_JLFT5, statelv , statetime ) elseif Item_ID==236 then AddState( ATKER , ATKER , STATE_JLFT6, statelv , statetime ) elseif Item_ID==237 then AddState( ATKER , ATKER , STATE_JLFT7, statelv , statetime ) elseif Item_ID==681 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==680 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==143 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==144 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==145 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==146 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==147 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==148 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==149 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==150 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==151 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==152 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==153 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==183 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==184 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==185 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==186 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==187 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==188 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==189 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==190 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==191 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==231 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==237 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==422 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==423 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==424 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==457 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==458 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) elseif Item_ID==500 then AddState( ATKER , ATKER , STATE_JLFT8, statelv , statetime ) end end ----------------------------- function State_JLFT_Add ( role , sklv ) local Item_bg = GetChaItem ( role , 2 , 1 ) local Get_Item_Type = GetItemType ( Item_bg ) if Get_Item_Type == 59 then local Item_ID = GetItemID ( Item_bg ) 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 = 1 --GetNum_Part1 ( Num_JL ) local Part2 = GetNum_Part2 ( Num_JL ) local Part3 = GetNum_Part3 ( Num_JL ) local Part4 = GetNum_Part4 ( Num_JL ) local Part5 = GetNum_Part5 ( Num_JL ) local Part6 = GetNum_Part6 ( Num_JL ) local Part7 = GetNum_Part7 ( Num_JL ) if Part1 == 1 then local star = 0 local statelv = lv_JL * 0.025 * (sklv + 1) * 0.05 ----lv*1/40*(skilllv+1)/2*0.1 if Item_ID ==232 then local star = lv_JL SetCharaAttr(star, role, ATTR_STATEV_STR) end if Item_ID ==233 then local star = lv_JL SetCharaAttr(star, role, ATTR_STATEV_CON) end if Item_ID ==234 then local star = lv_JL SetCharaAttr(star, role, ATTR_STATEV_STA) end if Item_ID ==235 then local star = lv_JL SetCharaAttr(star, role, ATTR_STATEV_DEX) end if Item_ID ==236 then local star = lv_JL SetCharaAttr(star ,role , ATTR_STATEV_AGI) end if Item_ID == 681 or Item_ID == 231 or Item_ID == 237 or Item_ID == 680 or Item_ID == 143 or Item_ID == 144 or Item_ID == 145 or Item_ID == 146 or Item_ID == 147 or Item_ID == 148 or Item_ID == 149 or Item_ID == 150 or Item_ID == 151 or Item_ID == 152 or Item_ID == 153 or Item_ID == 422 or Item_ID == 423 or Item_ID == 424 or Item_ID == 183 or Item_ID == 184 or Item_ID == 185 or Item_ID == 186 or Item_ID == 187 or Item_ID == 188 or Item_ID == 189 or Item_ID == 190 or Item_ID == 191 or Item_ID == 457 or Item_ID == 458 then if str~=nil and str~=0 then SetCharaAttr(str ,role , ATTR_STATEV_STR) end if con~=nil and con~=0 then SetCharaAttr(con ,role , ATTR_STATEV_CON) end if sta~=nil and sta~=0 then SetCharaAttr(sta ,role , ATTR_STATEV_STA) end if dex~=nil and dex~=0 then SetCharaAttr(dex ,role , ATTR_STATEV_DEX) end if agi~=nil and agi~=0 then SetCharaAttr(agi ,role , ATTR_STATEV_AGI) end end if Item_ID == 500 then if str~=nil and str~=0 then local star = str*1.2 SetCharaAttr(star ,role , ATTR_STATEV_STR) end if con~=nil and con~=0 then local star = con*1.2 SetCharaAttr(star ,role , ATTR_STATEV_CON) end if sta~=nil and sta~=0 then local star = sta*1.2 SetCharaAttr(star ,role , ATTR_STATEV_STA) end if dex~=nil and dex~=0 then local star = dex*1.2 SetCharaAttr(star ,role , ATTR_STATEV_DEX) end if agi~=nil and agi~=0 then local star = agi*1.2 SetCharaAttr(star ,role , ATTR_STATEV_AGI) end local star = GetChaAttr( role, ATTR_BMF ) * lv_JL * 0.02 local star2 = GetChaAttr( role, ATTR_BMF ) SetCharaAttr(star ,role , ATTR_BMF) local star = GetChaAttr( role, ATTR_STATEV_PDEF ) + 3 SetCharaAttr(star ,role , ATTR_STATEV_PDEF) end end end ALLExAttrSet(role) end ---------------------- function State_JLFT_Rem ( role , sklv ) SetCharaAttr(0 ,role , ATTR_STATEV_STR) SetCharaAttr(0 ,role , ATTR_STATEV_CON) SetCharaAttr(0 ,role , ATTR_STATEV_STA) SetCharaAttr(0 ,role , ATTR_STATEV_DEX) SetCharaAttr(0 ,role , ATTR_STATEV_AGI) SetCharaAttr(0 ,role , ATTR_STATEV_MF) SetCharaAttr(0 ,role , ATTR_STATEV_LUK) SetCharaAttr(0 ,role , ATTR_STATEV_PDEF) ALLExAttrSet(role) end Edited December 24, 2017 by Vang Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted December 25, 2017 It's cape problem, it is a problem with cha_timer (cloak custom hook) i think, (you using @KONG's Admiral Cloak?) i have such problem tho.. \ Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted December 25, 2017 6 hours ago, Rinor said: It's cape problem, it is a problem with cha_timer (cloak custom hook) i think, (you using @KONG's Admiral Cloak?) i have such problem tho.. \ Nah I checked, it's not cape problem, it's something with the fairy poss because I'm gaining all the stats from cape and my state effect item. So whatever pet I use and poss with, I lose stats from that after the poss is finish and I have to poss again. So it's basically clearing all my stats not just from pet poss when finish but also from the cape/state effect. Quote Share this post Link to post Share on other sites
x3w0r 33 Report post Posted December 25, 2017 The wrong thing is in the removal state, check skilleff if they're right as well as your state of adding/removal codes.Let me know if it worked out. Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted December 26, 2017 4 hours ago, x3wor said: The wrong thing is in the removal state, check skilleff if they're right as well as your state of adding/removal codes.Let me know if it worked out. My remove states are fine for cape/item it's the poss. Quote Share this post Link to post Share on other sites
x3w0r 33 Report post Posted December 26, 2017 19 hours ago, Vang said: My remove states are fine for cape/item it's the poss. Imho, there is nothing that would conflict the poss function on its job, it must be something else that triggers this problem. Quote Share this post Link to post Share on other sites
AlGhoul 66 Report post Posted December 27, 2017 @Billy solution ALL STATES that are to be added must NOT have the ALLExAttrSet(role) or AttrRecheck(role) lines, as this would cause an overflow error. Quote Kind regards, AG. Share this post Link to post Share on other sites
Rinor 59 Report post Posted December 27, 2017 (edited) The funny thing is that in two chars that i used cape first works fine, other chars that i try i have that problem lol... Edited December 27, 2017 by Rinor Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted December 27, 2017 2 hours ago, J0k3r said: @Billy solution ALL STATES that are to be added must NOT have the ALLExAttrSet(role) or AttrRecheck(role) lines, as this would cause an overflow error. Will try this out if works, thanks. Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted December 27, 2017 4 hours ago, J0k3r said: @Billy solution ALL STATES that are to be added must NOT have the ALLExAttrSet(role) or AttrRecheck(role) lines, as this would cause an overflow error. Just the add? not in remove? Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted December 27, 2017 Hm, I removed ALLExAttrSet(role) from all my cape/state eff but problem still remains when teleporting. Quote Share this post Link to post Share on other sites
Andy 39 Report post Posted December 28, 2017 (edited) ward Edited December 28, 2017 by Andy Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted December 30, 2017 On 12/27/2017 at 6:23 PM, J0k3r said: @Billy solution ALL STATES that are to be added must NOT have the ALLExAttrSet(role) or AttrRecheck(role) lines, as this would cause an overflow error. Still same problem.. On 12/27/2017 at 11:41 PM, Vang said: Hm, I removed ALLExAttrSet(role) from all my cape/state eff but problem still remains when teleporting. Found any solution yet? Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted December 31, 2017 2 hours ago, Rinor said: Still same problem.. Found any solution yet? Sadly not. Quote Share this post Link to post Share on other sites
Eviles 179 Report post Posted December 31, 2017 Hello, This can be fixed if you use serialize to record attributes that is set to players when possed and removed. 1. Applying attr bonus to player: - Get player attr and add with skill attr, save on table and SetCharaAttr() 2. Removing attr bonus to player: - check if attr saved on table is not nil, decrease player current attr with value saved on table, define attr value saved as nil, SetCharaAttr() Basically, there's a little about what you can be doing. Oh, and if you in doubt there's something like that on released SPKO files, feel free coding! Quote Share this post Link to post Share on other sites
Eviles 179 Report post Posted December 31, 2017 (edited) On 27/12/2017 at 3:23 PM, J0k3r said: @Billy solution ALL STATES that are to be added must NOT have the ALLExAttrSet(role) or AttrRecheck(role) lines, as this would cause an overflow error. This if he uses AttrRecheck() instead of a timer. Edited December 31, 2017 by Satan Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted January 6, 2018 On 12/31/2017 at 1:11 PM, Satan said: Basically, there's a little about what you can be doing. Oh, and if you in doubt there's something like that on released SPKO files, feel free coding! Does released spko files has the serialize part done? Quote Share this post Link to post Share on other sites