xXObanXx Posted October 28, 2013 Posted October 28, 2013 Hello... so i updated my pack (L2j) with the latest revision (skill and effect system complete rework) and i have these problems on CTF.java: for (AbstractEffect e : summon.getAllEffects()) { if (e != null) { e.exit(); } } also i've solved an error by my own but didn't test it... is it ok? AbstractEffect eInvisible = _player.getFirstEffect(L2EffectType.HIDE); to AbnormalType eInvisible = AbnormalType.HIDE; i will appreciate your help! :)
0 ^Wyatt Posted October 28, 2013 Posted October 28, 2013 for (BuffInfo e : summon.getEffectList().getEffects()) { if (e != null) { e.stopAllEffects(false); } }
0 ^Wyatt Posted October 28, 2013 Posted October 28, 2013 (edited) What about changing AbstractEffect to L2Effect? Last rev of unstable or stable...? Edited October 28, 2013 by ^Wyatt
0 xXObanXx Posted October 28, 2013 Author Posted October 28, 2013 (edited) What about changing AbstractEffect by L2Effect? Last rev of unstable or stable...? unstable... and L2Effect renamed with AbstractEffect..! Edited October 28, 2013 by xXObanXx
0 ^Wyatt Posted October 28, 2013 Posted October 28, 2013 Try with CharEffectList e : summon.getEffectList()
0 xXObanXx Posted October 28, 2013 Author Posted October 28, 2013 Try with CharEffectList e : summon.getEffectList() error (Can only iterate over an array or an instance of java.lang.Iterable) on summon.getEffectList()
0 xXObanXx Posted October 28, 2013 Author Posted October 28, 2013 for (BuffInfo e : summon.getEffectList().getEffects()) { if (e != null) { e.stopAllEffects(false); } } working..! thank you dude! :)
0 Tryskell Posted October 28, 2013 Posted October 28, 2013 Replace the whole loop for : summon.stopAllEffects(); Finale if you want to access getEffectList(), and notably if you know it's a buff, debuff, etc, you should access it via the internal map. For instance, retrieveing all buff effect types should be called like that : summon.getEffectList().getBuffs().values() An important note, it returns BuffInfo type.
0 ^Wyatt Posted October 28, 2013 Posted October 28, 2013 (edited) Oh shit, the loop's purpose was to just stopAllEffects() ? dafuq I should start reading, just do what tryskell said. I thought it had some checks :rage: Edited October 28, 2013 by ^Wyatt
0 Tryskell Posted October 28, 2013 Posted October 28, 2013 Haha :D. About HIDE stuff, what is it supposed to do ? What is the original code, what do you want to do ?
0 xXObanXx Posted October 28, 2013 Author Posted October 28, 2013 (edited) Replace the whole loop for : summon.stopAllEffects(); Finale if you want to access getEffectList(), and notably if you know it's a buff, debuff, etc, you should access it via the internal map. For instance, retrieveing all buff effect types should be called like that : summon.getEffectList().getBuffs().values() An important note, it returns BuffInfo type. correct me if i'm wrong... is it ok? from this: if (player.getSummon() != null) { L2Summon summon = player.getSummon(); for (BuffInfo e : summon.getEffectList().getEffects()) { if (e != null) { e.stopAllEffects(false); } } if (summon instanceof L2PetInstance) { summon.unSummon(player); } } to this: if (player.getSummon() != null) { L2Summon summon = player.getSummon(); summon.stopAllEffects(); summon.getEffectList().getBuffs().values(); if (summon instanceof L2PetInstance) { summon.unSummon(player); } } Edited October 28, 2013 by xXObanXx
0 xXObanXx Posted October 28, 2013 Author Posted October 28, 2013 Haha :D. About HIDE stuff, what is it supposed to do ? What is the original code, what do you want to do ? about hide i replaced the original code with this AbnormalType eInvisible = AbnormalType.HIDE; (didn't test it yet)
0 Tryskell Posted October 28, 2013 Posted October 28, 2013 (edited) You probably want to do : final L2Summon summon = player.getSummon(); if (summon != null) { // Unsummon if it was a pet, otherwise clean current effects. if (summon.isPet()) summon.unSummon(player); else summon.stopAllEffects(); } - Latest L2J don't use instanceof anymore. You still can use, but well. - No use to clean effects on pets as you unsummon them (not useful). About summon.getEffectList().getBuffs().values(); I was simply saying effects have been reworked, and now you can use preformated data (in that case, it returns current buffs effects from the summon). It hasn't to be part of your code. I just gave an exemple to retrieve active buffs effects. And btw you lacked a : List<BuffInfo> list = summon.getEffectList().getBuffs().values(); to store it... What you did was useless, if not worst :D. About hide, I want original code and where it is used. What you did is wrong. Before the point of that code was to retrieve if player was under a HIDE effect, now you messed. Edited October 28, 2013 by Tryskell
0 xXObanXx Posted October 28, 2013 Author Posted October 28, 2013 (edited) About hide, I want original code and where it is used. What you did is wrong. Before the point of that code was to retrieve if player was under a HIDE effect, now you messed. Original line: L2Effect eInvisible = _player.getFirstEffect(L2EffectType.HIDE); replaced with: AbnormalType eInvisible = AbnormalType.HIDE; the whole code is: // If player is invisible, make them visible if (_player.getAppearance().getInvisible()) { @SuppressWarnings("unused") AbnormalType eInvisible = AbnormalType.HIDE; } Edited October 28, 2013 by xXObanXx
0 ^Wyatt Posted October 28, 2013 Posted October 28, 2013 @Tryskell I don't think it's useless to remove buffs from pets that will be unsummoned. If they didn't change it, as far as I remember... in l2jserver when you unsummon a pet, buffs are stored.
0 Tryskell Posted October 28, 2013 Posted October 28, 2013 @Tryskell I don't think it's useless to remove buffs from pets that will be unsummoned. If they didn't change it, as far as I remember... in l2jserver when you unsummon a pet, buffs are stored. It's a ctf, and that section is probably sent when character enters the event. There's no use to clean pet buffs. The only stuff to verify is the possibility to get a pet while being in ctf event (no possibility to summon). @topic author, I want the use of eInvisible.
Question
xXObanXx
Hello... so i updated my pack (L2j) with the latest revision (skill and effect system complete rework)
and i have these problems on CTF.java:
i will appreciate your help! :)
30 answers to this question
Recommended Posts