Jump to content
  • 0

WTF is going on


FDB
 Share

Question

i added dont loose your buffs on death code

 

// Same thing if the Character isn't a Noblesse Blessed L2PlayableInstance
        else if (this instanceof L2Playable && ((L2Playable)this).isNoblesseBlessed())
        { 
			((L2Playable)this).stopNoblesseBlessing(null); 

        	if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff 
				((L2Playable)this).stopCharmOfLuck(null); 
		} 
		else

 

and i got this error

 


[javac] Compiling 1298 source files to C:\L2GateAway\L2JGateway\L2J_CORE\build\classes
    [javac] C:\L2GateAway\L2JGateway\L2J_CORE\java\com\it\br\gameserver\model\L2Character.java:1513: 'else' without 'if'
    [javac] 		else if (this instanceof L2PlayableInstance && ((L2PlayableInstance)this).isPhoenixBlessed()) 
    [javac] 		^
    [javac] 1 error

Link to comment
Share on other sites

Recommended Posts

  • 0

i just put one line on it lawl

nvm, i found what is it

 

        	if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff 
				((L2Playable)this).stopCharmOfLuck(null); 
		} 

change to

if ( ( (L2Playable)this).getCharmOfLuck())   {      //remove Lucky Charm if player have Nobless blessing buff 

Link to comment
Share on other sites

  • 0

ok, when some1 copy the code here, it lose some spaces

       // Same thing if the Character isn't a Noblesse Blessed L2PlayableInstance
       else if (this instanceof L2Playable && ((L2Playable)this).isNoblesseBlessed())
       { 
	((L2Playable)this).stopNoblesseBlessing(null); 

       	if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff 
		((L2Playable)this).stopCharmOfLuck(null); 
} 
else
	stopAllEffectsExceptThoseThatLastThroughDeath();
       

 

all that is ok, you should take a look here (the if before your code)

 

// Stop all active skills effects in progress on the L2Character,
// if the Character isn't affected by Soul of The Phoenix or Salvation
       if (this instanceof L2Playable && ((L2Playable)this).isPhoenixBlessed())
       {
          if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player has SoulOfThePhoenix/Salvation buff
             ((L2Playable)this).stopCharmOfLuck(null);
           if (((L2Playable)this).isNoblesseBlessed())
              ((L2Playable)this).stopNoblesseBlessing(null);
       }

 

without this if, you cant have a else

If you want to not lose buffs when die, just delete

else
	stopAllEffectsExceptThoseThatLastThroughDeath();

but take a look at all things that could happen with this.

 

 

EDIT

 

i removed

 

if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff 

will it work?

 

i got succesfull build but i am not sure that will work

if you remove that, then you will allways try to

((L2Playable)this).stopCharmOfLuck(null); 

even if you dont have it

 

 

Link to comment
Share on other sites

  • 0

// Stop all active skills effects in progress on the L2Character,
// if the Character isn't affected by Soul of The Phoenix or Salvation
        if (this instanceof L2Playable && ((L2Playable)this).isPhoenixBlessed())
        {
           if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player has SoulOfThePhoenix/Salvation buff
              ((L2Playable)this).stopCharmOfLuck(null);
            if (((L2Playable)this).isNoblesseBlessed())
               ((L2Playable)this).stopNoblesseBlessing(null);
        }
        // Same thing if the Character isn't a Noblesse Blessed L2PlayableInstance
        else if (this instanceof L2Playable && ((L2Playable)this).isNoblesseBlessed())
        { 
	((L2Playable)this).stopNoblesseBlessing(null); 

        	if (((L2Playable)this).getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff 
		((L2Playable)this).stopCharmOfLuck(null); 
} 
else
	stopAllEffectsExceptThoseThatLastThroughDeath();
        

this have 3 steps

-check if the char has salvation

-else check if the char has noblesse

-else delete all buffs

so you can chose, to

a) remove salvation and noblesse (if the char has this buffs), but never remove normall buff

        then delete

else
	stopAllEffectsExceptThoseThatLastThroughDeath();

 

b) never remove salvation, noblesse or any other buff

        then delete all the code quoted in the post (from

// Stop all active skills effects in progress on the L2Character,
// if the Character isn't affected by Soul of The Phoenix or Salvation
        if (this instanceof L2Playable && ((L2Playable)this).isPhoenixBlessed())

to

else
	stopAllEffectsExceptThoseThatLastThroughDeath();
        

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share




×
×
  • Create New...