kill NPC

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
kain13
Posts: 93
Joined: Tue Sep 22, 2009 3:14 pm
Location: UA

kill NPC

Post by kain13 »

L2J Revision 4422:
L2JDP Revision 7669:
sorry for newbie question, but I cant understand how to prevent killing NPCs.
On my server, people can kill some NPC, for example gatekeepers, but some NPC like Lottery cant kill, what a problem?
thnx

(know about "AltAttackableNpcs =" this is not solution)
Phantom2005
Posts: 72
Joined: Wed Jul 06, 2005 4:27 pm
Location: Netherlands

Re: kill NPC

Post by Phantom2005 »

L2Character.java

Code: Select all

     public L2Character(int objectId, L2CharTemplate template)    {        super(objectId);        setInstanceType(InstanceType.L2Character);        initCharStat();        initCharStatus();                ......................                setIsInvul(true); <-----------------    } 
CharStatus

Code: Select all

     public void reduceHp(double value, L2Character attacker, boolean awake, boolean isDOT, boolean isHPConsumption)    {        if (getActiveChar().isDead())            return;                // invul handling        if (getActiveChar().isInvul()) <-------------------        {            // other chars can't damage            if (attacker != getActiveChar())                return;                        // only DOT and HP consumption allowed for damage self            if (!isDOT && !isHPConsumption)                return;        }................ 

I don't know what kind of "NPC Type" you are using but L2Npc should block damage.
"If 64 bits isn't enough, the next logical step is 128 bits. That's enough to survive Moore's Law until I'm dead, and after that, it's not my problem."
©Jeff Bonwick
kain13
Posts: 93
Joined: Tue Sep 22, 2009 3:14 pm
Location: UA

Re: kill NPC

Post by kain13 »

I use L2NpcBuffer.

Yes, L2Npc cant die, but many other like gatekeepers, Olimp., dusk ets die.
Phantom2005
Posts: 72
Joined: Wed Jul 06, 2005 4:27 pm
Location: Netherlands

Re: kill NPC

Post by Phantom2005 »

Those are inheritances of L2Npc...
"If 64 bits isn't enough, the next logical step is 128 bits. That's enough to survive Moore's Law until I'm dead, and after that, it's not my problem."
©Jeff Bonwick
kain13
Posts: 93
Joined: Tue Sep 22, 2009 3:14 pm
Location: UA

Re: kill NPC

Post by kain13 »

npc.sql
Player can kill this NPC -->
(30080,30080,'Clarissa',0,'Gatekeeper',0,'LineageNPC.a_teleporter_FHuman',8.00,25.00,70,'female','L2Teleporter',40,2444,1225,0.00,0.00,40,43,30,21,20,20,0,0,1086,471,749,313,230,0,333,0,0,0,45,109,0,1),

Player can't kill this NPC -->
(30990,30990,'Lottery Ticket Seller',0,'',0,'LineageNPC.a_casino_MHuman',8.00,23.00,70,'male','L2Npc',40,2444,1225,0.00,0.00,40,43,30,21,20,20,0,0,1086,471,749,313,230,0,333,0,0,0,45,109,0,1),
Lol player kill Gatekeeper because of what the normal players can't teleport!
So, what now? If I change L2Teleporter то L2Npc, Gatekeeper will not work.
This problem is just me?
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: kill NPC

Post by _DS_ »

Yes, just you... check custom stuff.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
kain13
Posts: 93
Joined: Tue Sep 22, 2009 3:14 pm
Location: UA

Re: kill NPC

Post by kain13 »

_DS_ wrote:Yes, just you... check custom stuff.
server downloaded from this http://www.l2jserver.com/nightly/
edit just server.properties and loginserver.properties. Then create char. give him admin (127) go to game, target GK, use //kill and he die! How it possible??
User avatar
Hitokiri
Posts: 34
Joined: Tue Oct 19, 2010 6:26 pm

Re: kill NPC

Post by Hitokiri »

Sometimes the problem is not so deep that u need to search errors in the java core files. When u are starting a server try to check all configuration files not only the part for root and pasword of MySql Working with L2J from the begining never got such a problem :shock:

Try to click your nick and than tipe //ban :mrgreen:
Last edited by Hitokiri on Sat Oct 23, 2010 7:09 am, edited 1 time in total.
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: kill NPC

Post by _DS_ »

kain13 wrote:
_DS_ wrote:Yes, just you... check custom stuff.
server downloaded from this http://www.l2jserver.com/nightly/
edit just server.properties and loginserver.properties. Then create char. give him admin (127) go to game, target GK, use //kill and he die! How it possible??
LOL, and if you use //shutdown server will be stopped. How it possible ????
Test with non-GM char.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
kain13
Posts: 93
Joined: Tue Sep 22, 2009 3:14 pm
Location: UA

Re: kill NPC

Post by kain13 »

_DS_ wrote:LOL, and if you use //shutdown server will be stopped. How it possible ????
Test with non-GM char.
don't understand, you is L2j Senior Developer but writing shit. Just try yourself use command //kill on (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...), and (30990,30990,'Lottery Ticket Seller',...,'L2Npc) L2Teleporter will die L2Npc not.

Yes I use clear (max clear, without custom) server, and create normal character, and he is killig L2Teleporter but can't kill L2Npc.

p.s why would you not first check and then try to be clever?
User avatar
Hitokiri
Posts: 34
Joined: Tue Oct 19, 2010 6:26 pm

Re: kill NPC

Post by Hitokiri »

kain13 wrote:
_DS_ wrote:LOL, and if you use //shutdown server will be stopped. How it possible ????
Test with non-GM char.
don't understand, you is L2j Senior Developer but writing shit. Just try yourself use command //kill on (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...), and (30990,30990,'Lottery Ticket Seller',...,'L2Npc) L2Teleporter will die L2Npc not.

Yes I use clear (max clear, without custom) server, and create normal character, and he is killig L2Teleporter but can't kill L2Npc.

p.s why would you not first check and then try to be clever?
You want to say that a normal player can use commands like //kill //sethero and so on? :shock:
Could it be that u gave 127 acces rights to players? What is the acces level of character that u use for testing? Check it in database.
Edelvez
Posts: 173
Joined: Fri Nov 06, 2009 6:32 am
Location: Argentina

Re: kill NPC

Post by Edelvez »

I understood that... What he meant is that an ordinary player, with access level 0, can kill an NPC L2Teleporter type shock and a type L2Npc, can hit but not killed.

Well understood?? :|
Someone once told me: "The easiest way of doing things, making them the hard way" ;)
kain13
Posts: 93
Joined: Tue Sep 22, 2009 3:14 pm
Location: UA

Re: kill NPC

Post by kain13 »

Edelvez wrote:I understood that... What he meant is that an ordinary player, with access level 0, can kill an NPC L2Gatekeeper type shock and a type L2Npc, can hit but not killed.

Well understood?? :|
yes, one people with working brain.

normal character = 0 access, Admin = 127.
normal character can kill with weapon (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...) but can't (30990,30990,'Lottery Ticket Seller',...,'L2Npc)
Admin can kill with comand //kill (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...) but can't (30990,30990,'Lottery Ticket Seller',...,'L2Npc)

What you can't understand?
Edelvez
Posts: 173
Joined: Fri Nov 06, 2009 6:32 am
Location: Argentina

Re: kill NPC

Post by Edelvez »

kain13 wrote:
Edelvez wrote:I understood that... What he meant is that an ordinary player, with access level 0, can kill an NPC L2Gatekeeper type shock and a type L2Npc, can hit but not killed.

Well understood?? :|
yes, one people with working brain.

normal character = 0 access, Admin = 127.
normal character can kill with weapon (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...) but can't (30990,30990,'Lottery Ticket Seller',...,'L2Npc)
Admin can kill with comand //kill (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...) but can't (30990,30990,'Lottery Ticket Seller',...,'L2Npc)

What you don't understand?
I win! I want my reward! :D


It seems odd, because I'm testing it right now and a common character attack message I get locked... bone that invunerable..
Someone once told me: "The easiest way of doing things, making them the hard way" ;)
User avatar
Hitokiri
Posts: 34
Joined: Tue Oct 19, 2010 6:26 pm

Re: kill NPC

Post by Hitokiri »

kain13 wrote:
Edelvez wrote:I understood that... What he meant is that an ordinary player, with access level 0, can kill an NPC L2Gatekeeper type shock and a type L2Npc, can hit but not killed.

Well understood?? :|
yes, one people with working brain.

normal character = 0 access, Admin = 127.
normal character can kill with weapon (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...) but can't (30990,30990,'Lottery Ticket Seller',...,'L2Npc)
Admin can kill with comand //kill (30080,30080,'Clarissa',0,'Gatekeeper',...,'L2Teleporter',...) but can't (30990,30990,'Lottery Ticket Seller',...,'L2Npc)

What you can't understand?
`isUndead` tinyint(1) NOT NULL DEFAULT '0', so in your npc. sql should be

Code: Select all

(30080,30080,'Clarissa',0,'Gatekeeper',0,'LineageNPC.a_teleporter_FHuman',8.00,25.00,70,'female','L2Teleporter',40,2444,1225,0.00,0.00,40,43,30,21,20,20,0,0,1086,471,749,313,230,0,333,0,0,0,0,45,109,1,0,1), 
So last 3 numbers shold be 1,0,1 not 0,0,1
Post Reply