Handling effects on L2PcInstance

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
User avatar
kimeraweb
Posts: 55
Joined: Sat Jul 31, 2010 5:33 pm
Location: Deutschland
Contact:

Handling effects on L2PcInstance

Post by kimeraweb »

L2J Revision last:
L2JDP Revision last:

Hi all, I am trying handle an effect on L2PcInstance.
What the class I have to be focused if I want an effect work or not while this effect is working?

Example, I am interested on drain effect with "Chant of Vampire". While he is not PK, buff (effect) is working, every hit get hp back from the target, but, when he become into Pkiller, I want this effect stops.

I hope being clear, thanks for answers.
GS: 4470
DP: 7733
User avatar
Copyleft
Posts: 253
Joined: Fri Feb 01, 2008 9:39 pm

Re: Handling effects on L2PcInstance

Post by Copyleft »

try this and see if it works

Code: Select all

 Index: data/stats/skills/01300-01399.xml===================================================================--- data/stats/skills/01300-01399.xml   (revision 7760)+++ data/stats/skills/01300-01399.xml   (working copy)@@ -289,12 +289,20 @@        <enchant2 name="mpInitialConsume" val="#ench2mpInitialConsume" />        <for>            <effect name="Buff" time="1200" val="0" stackOrder="#stackOrder" stackType="vampiric_attack">-               <add order="0x40" stat="absorbDam" val="#absorbDam" /> <!-- absorb HP from damage inflicted on enemies -->+               <add order="0x40" stat="absorbDam" val="#absorbDam" > <!-- absorb HP from damage inflicted on enemies -->+                   <and>+                       <player chaotic="False" />+                   </and>+               </add>            </effect>        </for>        <enchant1for>            <effect name="Buff" time="#ench1time" val="0" stackOrder="4" stackType="vampiric_attack">-               <add order="0x40" stat="absorbDam" val="9" /> <!-- absorb 9% HP from damage inflicted on enemies -->+               <add order="0x40" stat="absorbDam" val="9" > <!-- absorb 9% HP from damage inflicted on enemies -->+                   <and>+                       <player chaotic="False" />+                   </and>+               </add>            </effect>        </enchant1for>    </skill> 
User avatar
kimeraweb
Posts: 55
Joined: Sat Jul 31, 2010 5:33 pm
Location: Deutschland
Contact:

Re: Handling effects on L2PcInstance

Post by kimeraweb »

Looks very nice, but, what about if L2PcInstance get be flag?

I was reading and trying diferent core's classes, for handling in real time and I just got results when L2PcInstance starts buffering for effects, no while he's already effected.
GS: 4470
DP: 7733
User avatar
Copyleft
Posts: 253
Joined: Fri Feb 01, 2008 9:39 pm

Re: Handling effects on L2PcInstance

Post by Copyleft »

User avatar
kimeraweb
Posts: 55
Joined: Sat Jul 31, 2010 5:33 pm
Location: Deutschland
Contact:

Re: Handling effects on L2PcInstance

Post by kimeraweb »

I see! I was thinking in other way to do it, just something like "if it's flagged, drain stops", but this one is pretty good.

I'm interested when target is a L2MonsterInstance, not drain if it's flagged.

I did this easy one for magic skills:

Code: Select all

Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (revision 4470)+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (working copy) @@ -8836,7 +8849,7 @@        }                //************************************* Check skill availability *******************************************-       +        // Check if it's ok to summon        // siege golem (13), Wild Hog Cannon (299), Swoop Cannon (448)        if ((skill.getId() == 13 || skill.getId() == 299 || skill.getId() == 448)@@ -9126,6 +9139,13 @@            }        }        +       // Not draining while being flag+       if ((sklType == L2SkillType.DRAIN) && (getPvpFlag() != 0) && (target instanceof L2MonsterInstance))+       {+           sendPacket(SystemMessage.sendString("You cannot drain while you are flagged!"));+           return false;+       }+               // Check if this is a Pvp skill and target isn't a non-flagged/non-karma player        switch (sklTargetType)        { 
And I was thinking to do similar in other class for effects, but, again I tell you thank you very much, I appreciate your support.

I got a lot to make my thinkings :D
GS: 4470
DP: 7733
nykoz
Posts: 1
Joined: Wed Jun 01, 2011 9:29 pm

Re: Handling effects on L2PcInstance

Post by nykoz »

the code is effect skill Steal Essence... not absordam the dance of the vampire ... plase help!

Code: Select all

<for>            <effect name="Buff" time="7200" val="0" stackOrder="1" stackType="dance_of_vampire">                <add order="0x40" stat="absorbDam" val="5" /> <!-- absorb 8% HP from damage inflicted on enemies -->                               <and>                       <player flag="False" />                   </and>             </effect>        </for>
using this probe and does not work
Post Reply