Jump to content
  • 0

Latest Revision Ctf Errors..!


Question

Posted

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! :)

Recommended Posts

  • 0
Posted (edited)

What about changing AbstractEffect to L2Effect? Last rev of unstable or stable...?

Edited by ^Wyatt
  • 0
Posted (edited)

What about changing AbstractEffect by L2Effect? Last rev of unstable or stable...?

unstable... and L2Effect renamed with AbstractEffect..!

Edited by xXObanXx
  • 0
Posted

 

Try with

CharEffectList e : summon.getEffectList()

error (Can only iterate over an array or an instance of java.lang.Iterable)

on summon.getEffectList()

  • 0
Posted

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
Posted (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 by ^Wyatt
  • 0
Posted (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 by xXObanXx
  • 0
Posted

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
Posted (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 by Tryskell
  • 0
Posted (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 by xXObanXx
  • 0
Posted

@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
Posted

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

Guest
This topic is now closed to further replies.
×
×
  • Create New...