Page 1 of 1

[HELP] How to add effect to character

Posted: Sat Sep 03, 2011 10:59 am
by CSharpRU
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: last at now time
L2JDP Revision Number: last at now time

How to add effect to character with my abnormal time?

If i use modified

Code: Select all

Env env = new Env(player, player, skill, PERIOD);skill.getEffects(player, player, env);
or

Code: Select all

effect.setAbnormalTime(PERIOD);player.addEffect(effect);
I don't take good result, in both cases when relogin player get standart abnormal time (like 20 mins for buffs, 5 for songs and etc). And second method don't update player buff icons (abnormal status).

setAbnormalTime code (L2Effect.java):

Code: Select all

public void setAbnormalTime(int time){    _abnormalTime = time;}
skill.getEffects code (L2Skill.java):

Code: Select all

L2Effect e = et.getEffect(env);if (e != null){    if(env.period > 0)        e.setAbnormalTime(env.period);                        e.scheduleEffect();    effects.add(e);}

Re: [HELP] How to add effect to character

Posted: Sat Sep 03, 2011 11:18 am
by Sylar88
Atm im searching for something similar. Each effect has an effecttemplate that gets its stats from. If you add modifiers in layers above the initialization of the effect objects, its highly possible that you miss out some occasions.

The best idea is to add your modifier in the constructor of the effect , where it reads the abnormaltime from its effecttemplate.

Re: [HELP] How to add effect to character

Posted: Sat Sep 03, 2011 11:34 am
by CSharpRU
Sylar88 wrote:Atm im searching for something similar. Each effect has an effecttemplate that gets its stats from. If you add modifiers in layers above the initialization of the effect objects, its highly possible that you miss out some occasions.

The best idea is to add your modifier in the constructor of the effect , where it reads the abnormaltime from its effecttemplate.
I'm try this and get it work only for songs/dances.