Jump to content
  • 0

Killable NPC?


xuinia
 Share

Question

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

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Someone is trying to copy my Conquerable Feature xd?

Anyway never mind, joke.

What is your Instance extender?

extender?

public class L2TpFlagInstance extends L2Npc

That or you mean something else? :)

Link to comment
Share on other sites

  • 0

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.

 

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disbaled AdBlock