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

Yes, thats exactly what I meant.

 

My extender was the same, and everything was fine.

  • 0
Posted

What actually defines if it is killable or not? Can someone post some example how you did it? maybe then I will be able to figure out whats wrong.

  • 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...