Jump to content

Question

Posted (edited)
@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

12 answers to this question

Recommended Posts

  • 0
Posted (edited)

 

@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
  • 0
Posted (edited)

 

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
  • 0
Posted

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

  • 0
Posted

 

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

  • 0
Posted

 

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE   **Earn While You Spend - Introducing HS Cashback!**   Every purchase on our site now rewards you with **HS Keys cashback**   EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE   Here's how it works:       **1 USD = 1000 HS Keys**   **Get 3% cashback** on every purchase   **Use your HS Keys to **save on your next order**   ---   ### ⚡ Why this is awesome   * Every order gives you value back   * Stack it with promos & HS usage   * Turn your spending into future discounts   ---   ### Example   Spend **$10** → Get **300 HS Keys** back   Spend **$50** → Get **1500 HS Keys** back   ---   ### Smart system (built for fairness)   * Cashback is rounded to keep things balanced   * Prevents abuse from tiny orders   * Rewards real buyers   ---   ### Start earning now   Every purchase = progress toward your next discount   Shop now and build your HS balance!   #cashback #gamingdeals #d2r #rewards #loyalty   Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com     We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys.   Invite your friends using your personal link.   Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link.   Get your referral link here: www.d2rhiddenstash.com/profile     Start earning today
    • https://jumpshare.com/share/L45ApA5PVrGN2O5Ua5pQ   Skill synchronization with the server: Launching and synchronizing animations, launching and synchronizing effects. All of this is tied to the server's timing  
  • Topics

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