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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Lineage2Network - Interlude Reimagined   Embark on a revitalized journey through the classic Interlude era with Lineage2.Network. Our server is meticulously crafted by veteran players to deliver a seamless and engaging experience, blending the nostalgia of the Chaotic Chronicle with modern enhancements.     Server details   Chronicle: Interlude + Classic Rates: EXP x30 | Adena x10 | Drop x10 | Spoil x10     Server features   Daily Missions - complete special tasks for daily rewards Attendance Rewards - get rewards for online time Custom Events - TVT, DM, CTF NPC buffer duration - 2 hours   Mana Potions - restores 1000 MP, 10s cooldown Ring of Core additional stats: +1 STR Earring of Orfen additional stats: +1 INT Shadow Earring of Zaken - 7 days Shadow Ring of Queen Ant - 7 days   Max buff count - 24 (20 + 4 with Divine Inspiration) Noblesse, Heroic Valor, Flames of Invincibility and Celestial Shield don't take buff slot Reworked Cancel, Mage and Warrior Banes – removed buffs reappear after 30s Block Buffs - block all incoming buffs except from self/party Sweeper Festival added to Spoiler class   Subclass – retail or purchasable Noblesse – retail or purchasable up to Barakiel; collect 8 fragments for full staff 1st & 2nd class free, 3rd needs 700 Halisha Marks or is purchasable New Olympiad System: new stadiums with NPC buffer,  1 week period.     Key dates     Beta Launch: April 14, 2025 Official Launch: May 9, 2025     Check out full server details in our website And visit our discord   Join us and be part of community where classic gameplay meets innovative updates. Whether you're a solo adventurer or part of a formidable clan, Lineage2.Network offers a dynamic and balanced environment for all.  
    • Good day. Our game currency store is looking for suppliers of adena and items on a project such as L2REBORN x10. We also sell Epic jewelry and various items on this project L2REBORN x10. There are items and adena on L2REBORN x1. For all questions, write to us in discord - goddardshop
  • Topics

×
×
  • Create New...