Skip to content

Featured Replies

@Override

public boolean doDie(L2Character killer)

{

if (!super.doDie(killer))

return false;

{

   if (this.getNpcId() == 13016)

killer.teleportto(20808,145755,-3144);

   {

   player.sendMessage("You are the lucky one!");

   return;

   }

 

this doesnt work, it gives me errors what do i need to change?

 

i want to make when a mob(13016) gets killed the player who killed it to be teleported to the location above 

Edited by Procustration90

 

@Override
public boolean doDie(L2Character killer)
{
if (!super.doDie(killer))
return false;
{
   if (this.getNpcId() == 13016)
killer.teleportto(20808,145755,-3144);
   {
   player.sendMessage("You are the lucky one!");
   return;
   }
 
this doesnt work, it gives me errors what do i need to change?
 
i want to make when a mob(13016) gets killed the player who killed it to be teleported to the location above 

 

 

Did you code this yourself?

If yes ... noone can help you.

For me this is wrong:

{
if (!super.doDie(killer))
return false;
{

Edited by Stewie

  • Author

Ok i wrote the code by myself so i needed help from someone to what to change to make it work and what i did wrong..

 

Did you code this yourself?

If yes ... noone can help you.

For me this is wrong:

{
if (!super.doDie(killer))
return false;
{

 

you have 0 clue what those lines do please stay out of this topic...

 

tell me where it gives you error cause the only "mistake" here is the message which should be send to killer and not to player..other than that you might lost an uppercase or something...

Edited by Boorinio

Lol Stewie, those are the only correct  lines in the method ^^.

 

First,

   if (this.getNpcId() == 13016)
killer.teleportto(20808,145755,-3144);
   {
   player.sendMessage("You are the lucky one!");
   return;
   }

is wrong anyway, you probably want to do

 

   if (this.getNpcId() == 13016 && killer instanceof L2PcInstance)
   {
      killer.teleportto(20808,145755,-3144);
      killer.sendMessage("You are the lucky one!");
      return;
   }

Second, this refer to the victim, meaning in that case it should be at least setted in L2Npc or L2Attackable doDie. The point to set in the good doDie section is only for performance then, thanks to the npcid check. It has to be setted at least after the "super." call.

 

You also have to do a check regarding killer, because you would feel idiot if another NPC kills (Confusion skill and such) the NPC, being teleported and being the "lucky one".

doDie is boolean so you must use return true; instead of return

you don't even need return on that block it must be at the end of the method anyways

 

Lol Stewie, those are the only correct  lines in the method ^^.

 

First,

   if (this.getNpcId() == 13016)
killer.teleportto(20808,145755,-3144);
   {
   player.sendMessage("You are the lucky one!");
   return;
   }

is wrong anyway, you probably want to do

 

   if (this.getNpcId() == 13016 && killer instanceof L2PcInstance)
   {
      killer.teleportto(20808,145755,-3144);
      killer.sendMessage("You are the lucky one!");
      return;
   }

Second, this refer to the victim, meaning in that case it should be at least setted in L2Npc or L2Attackable doDie. The point to set in the good doDie section is only for performance then, thanks to the npcid check. It has to be setted at least after the "super." call.

 

You also have to do a check regarding killer, because you would feel idiot if another NPC kills (Confusion skill and such) the NPC, being teleported and being the "lucky one".

 

already told him in private but he seems not understand a thing...

 

Lol Stewie, those are the only correct  lines in the method ^^.

 

First,

   if (this.getNpcId() == 13016)
killer.teleportto(20808,145755,-3144);
   {
   player.sendMessage("You are the lucky one!");
   return;
   }

is wrong anyway, you probably want to do

 

   if (this.getNpcId() == 13016 && killer instanceof L2PcInstance)
   {
      killer.teleportto(20808,145755,-3144);
      killer.sendMessage("You are the lucky one!");
      return;
   }

Second, this refer to the victim, meaning in that case it should be at least setted in L2Npc or L2Attackable doDie. The point to set in the good doDie section is only for performance then, thanks to the npcid check. It has to be setted at least after the "super." call.

 

You also have to do a check regarding killer, because you would feel idiot if another NPC kills (Confusion skill and such) the NPC, being teleported and being the "lucky one".

 

 

Well atleast i'm glad i still find correct one in the code.

However u are the boss, respect, cya.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.