Jump to content
  • 0

Killable NPC?


Question

Posted

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:

@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);
    }

But that doesnt seem to do anything. HP of the flag is not decreasing when I hit it.

How can I make it mortal?

 

Working with latesr rev of l2jserver

8 answers to this question

Recommended Posts

  • 0
Posted

mind telling the problemm so people whit a similar/same problemm can fix it alone

@Override

    public boolean isAttackable()

    {

        return true;

    }

 

and setIsInvul(false); for every npc you want to be killable.

 

 

 

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..