» Find Revision
L2J Revision Number:4487
L2JDP Revision Number:7760
I'm trying to make NPC Flag wich you can capture by killing it. Capturing works fine. If you kill the flag it becomes your factions flag. But... problem is that the flag is imortal. Only way to kill it is by //kill.
I added this code to L2TpFlaginstance.java:
Code: Select all
@Override public void reduceCurrentHp(double damage, L2Character attacker, L2Skill skill) { L2PcInstance plajor = null; boolean cord = false; if (attacker instanceof L2PcInstance) plajor = (L2PcInstance) attacker; else if (attacker instanceof L2SummonInstance) plajor = ((L2SummonInstance) attacker).getOwner(); if (/*plajor.inWorld() == 1 && */plajor.getFactionId() != getFlagFactionId()) cord = true; if (cord) super.reduceCurrentHp(damage, attacker, skill); }
How can I make it mortal?