[HELP] How to add effect to character

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
CSharpRU
Posts: 72
Joined: Sat Sep 03, 2011 10:43 am
Location: Russia
Contact:

[HELP] How to add effect to character

Post 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);}
Sylar88
Posts: 113
Joined: Sun Feb 06, 2011 6:34 pm

Re: [HELP] How to add effect to character

Post 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.
Someone who didnt bother reading the svn or ant manual and just waited for you to make him a visual guide for eclipse is not a guy that is willing to learn ... He is the definition of the leecher.
CSharpRU
Posts: 72
Joined: Sat Sep 03, 2011 10:43 am
Location: Russia
Contact:

Re: [HELP] How to add effect to character

Post 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.
Post Reply