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.
Handling effects on L2PcInstance
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- kimeraweb
- Posts: 55
- Joined: Sat Jul 31, 2010 5:33 pm
- Location: Deutschland
- Contact:
Handling effects on L2PcInstance
GS: 4470
DP: 7733
DP: 7733
- Copyleft
- Posts: 253
- Joined: Fri Feb 01, 2008 9:39 pm
Re: Handling effects on L2PcInstance
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>
- kimeraweb
- Posts: 55
- Joined: Sat Jul 31, 2010 5:33 pm
- Location: Deutschland
- Contact:
Re: Handling effects on L2PcInstance
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.
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
DP: 7733
- Copyleft
- Posts: 253
- Joined: Fri Feb 01, 2008 9:39 pm
- kimeraweb
- Posts: 55
- Joined: Sat Jul 31, 2010 5:33 pm
- Location: Deutschland
- Contact:
Re: Handling effects on L2PcInstance
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:
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
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) {
I got a lot to make my thinkings

GS: 4470
DP: 7733
DP: 7733
-
- Posts: 1
- Joined: Wed Jun 01, 2011 9:29 pm
Re: Handling effects on L2PcInstance
the code is effect skill Steal Essence... not absordam the dance of the vampire ... plase help!
using this probe and does not work
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>