Jump to content
  • 0

Change Beleth Script


Question

Posted

hi i want to change the beleth script so you dont have to be in a command channel to enter, how can i make this code to where you only have to have x amount of people to enter, i set the configs to min players 1 but when i try to enter is says " A leader who can create a command channel of 36 or more should initiate the conversation " Thanks

 

/*

* This program is free software: you can redistribute it and/or modify it under

* the terms of the GNU General Public License as published by the Free Software

* Foundation, either version 3 of the License, or (at your option) any later

* version.

*

* This program is distributed in the hope that it will be useful, but WITHOUT

* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS

* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more

* details.

*

* You should have received a copy of the GNU General Public License along with

* this program. If not, see <http://www.gnu.org/licenses/>.

*/

package teleports.SteelCitadelTeleport;

 

import com.l2jserver.Config;

import com.l2jserver.gameserver.instancemanager.GrandBossManager;

import com.l2jserver.gameserver.instancemanager.ZoneManager;

import com.l2jserver.gameserver.model.L2CommandChannel;

import com.l2jserver.gameserver.model.L2Party;

import com.l2jserver.gameserver.model.actor.L2Npc;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

import com.l2jserver.gameserver.model.quest.Quest;

import com.l2jserver.gameserver.model.zone.type.L2BossZone;

 

/**

* @author GKR

*/

public class SteelCitadelTeleport extends Quest

{

private static final int BELETH = 29118;

private static final int NAIA_CUBE = 32376;

 

public SteelCitadelTeleport(int questId, String name, String descr)

{

super(questId, name, descr);

 

addStartNpc(NAIA_CUBE);

addTalkId(NAIA_CUBE);

}

 

@Override

public String onTalk(L2Npc npc, L2PcInstance player)

{

switch (npc.getNpcId())

{

case NAIA_CUBE:

if (GrandBossManager.getInstance().getBossStatus(BELETH) == 3)

{

return "32376-02.htm";

}

 

final L2CommandChannel channel = player.getParty() == null ? null : player.getParty().getCommandChannel();

 

if ((channel == null) || (channel.getLeader().getObjectId() != player.getObjectId()) || (channel.getMemberCount() < Config.BELETH_MIN_PLAYERS))

{

return "32376-02a.htm";

}

 

if (GrandBossManager.getInstance().getBossStatus(BELETH) > 0)

{

return "32376-03.htm";

}

 

final L2BossZone zone = (L2BossZone) ZoneManager.getInstance().getZoneById(12018);

if (zone != null)

{

GrandBossManager.getInstance().setBossStatus(BELETH, 1);

 

for (L2Party party : channel.getPartys())

{

if (party == null)

{

continue;

}

 

for (L2PcInstance pl : party.getMembers())

{

if (pl.isInsideRadius(npc.getX(), npc.getY(), npc.getZ(), 3000, true, false))

{

zone.allowPlayerEntry(pl, 30);

pl.teleToLocation(16342, 209557, -9352, true);

}

}

}

}

}

return null;

}

 

public static void main(String[] args)

{

new SteelCitadelTeleport(-1, "SteelCitadelTeleport", "teleports");

}

}

10 answers to this question

Recommended Posts

  • 0
Posted

try

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package teleports.SteelCitadelTeleport;

import com.l2jserver.Config;
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.instancemanager.ZoneManager;
import com.l2jserver.gameserver.model.L2CommandChannel;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.zone.type.L2BossZone;

/**
* @author GKR
*/
public class SteelCitadelTeleport extends Quest
{
   private static final int BELETH = 29118;
   private static final int NAIA_CUBE = 32376;
   
   public SteelCitadelTeleport(int questId, String name, String descr)
   {
      super(questId, name, descr);
      
      addStartNpc(NAIA_CUBE);
      addTalkId(NAIA_CUBE);
   }
   
   @Override
   public String onTalk(L2Npc npc, L2PcInstance player)
   {
      switch (npc.getNpcId())
      {
         case NAIA_CUBE:
            if (GrandBossManager.getInstance().getBossStatus(BELETH) == 3)
            {
               return "32376-02.htm";
            }
            
            final L2CommandChannel channel = player.getParty() == null ? null : player.getParty().getCommandChannel();
            
            if ((channel != null && channel.getMemberCount() < Config.BELETH_MIN_PLAYERS) || (channel == null && player.getParty() != null && player.getParty().getPartyMembersCount() < Config.BELETH_MIN_PLAYERS) || (channel == null && player.getParty() == null))
            {
               return "32376-02a.htm";
            }


            if (GrandBossManager.getInstance().getBossStatus(BELETH) > 0)
            {
               return "32376-03.htm";
            }
            
            final L2BossZone zone = (L2BossZone) ZoneManager.getInstance().getZoneById(12018);
            if (zone != null)
            {
               GrandBossManager.getInstance().setBossStatus(BELETH, 1);
               
               for (L2Party party : channel.getPartys())
               {
                  if (party == null)
                  {
                     continue;
                  }
                  
                  for (L2PcInstance pl : party.getMembers())
                  {
                     if (pl.isInsideRadius(npc.getX(), npc.getY(), npc.getZ(), 3000, true, false))
                     {
                        zone.allowPlayerEntry(pl, 30);
                        pl.teleToLocation(16342, 209557, -9352, true);
                     }
                  }
               }
            }
      }
      return null;
   }
   
   public static void main(String[] args)
   {
      new SteelCitadelTeleport(-1, "SteelCitadelTeleport", "teleports");
   }
}

  • 0
Posted

I did with notepad... GoD... edit it with eclipse and change it if I put a method wrong...

Maybe it's getMembersCount()... just use eclipse to know it...

  • 0
Posted

Learn to read and drop that

 

            final L2CommandChannel channel = player.getParty() == null ? null : player.getParty().getCommandChannel();
            
            if ((channel == null) || (channel.getLeader().getObjectId() != player.getObjectId()) || (channel.getMemberCount() < Config.BELETH_MIN_PLAYERS))
            {
               return "32376-02a.htm";
            }

+ the import.

  • 0
Posted

Learn to read and drop that

Referring to me or to @author? :o

 

Anyway, only removing it I think it's not doing what he wants:

how can i make this code to where you only have to have x a-beep-t of people to enter,

I think he wants to keep the X minimum number of players to enter, but not necessary to be in a command channel.

  • 0
Posted

Ok so i edit it in eclipse and got the correct method, i dont get any error in game or in console but it still wont teleport me to beleth

 

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package teleports.SteelCitadelTeleport;

import com.l2jserver.Config;
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.instancemanager.ZoneManager;
import com.l2jserver.gameserver.model.L2CommandChannel;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.zone.type.L2BossZone;

/**
* @author GKR
*/
public class SteelCitadelTeleport extends Quest
{
   private static final int BELETH = 29118;
   private static final int NAIA_CUBE = 32376;
   
   public SteelCitadelTeleport(int questId, String name, String descr)
   {
      super(questId, name, descr);
      
      addStartNpc(NAIA_CUBE);
      addTalkId(NAIA_CUBE);
   }
   
   @Override
   public String onTalk(L2Npc npc, L2PcInstance player)
   {
      switch (npc.getNpcId())
      {
         case NAIA_CUBE:
            if (GrandBossManager.getInstance().getBossStatus(BELETH) == 3)
            {
               return "32376-02.htm";
            }
            
            final L2CommandChannel channel = player.getParty() == null ? null : player.getParty().getCommandChannel();
            
            if ((channel != null && channel.getMemberCount() < Config.BELETH_MIN_PLAYERS) || (channel == null && player.getParty() != null && player.getParty().getPartyMembersCount() < Config.BELETH_MIN_PLAYERS) || (channel == null && player.getParty() == null))
            {
               return "32376-02a.htm";
            }


            if (GrandBossManager.getInstance().getBossStatus(BELETH) > 0)
            {
               return "32376-03.htm";
            }
            
            final L2BossZone zone = (L2BossZone) ZoneManager.getInstance().getZoneById(12018);
            if (zone != null)
            {
               GrandBossManager.getInstance().setBossStatus(BELETH, 1);
               
               for (L2Party party : channel.getPartys())
               {
                  if (party == null)
                  {
                     continue;
                  }
                  
                  for (L2PcInstance pl : party.getMembers())
                  {
                     if (pl.isInsideRadius(npc.getX(), npc.getY(), npc.getZ(), 3000, true, false))
                     {
                        zone.allowPlayerEntry(pl, 30);
                        pl.teleToLocation(16342, 209557, -9352, true);
                     }
                  }
               }
            }
      }
      return null;
   }
   
   public static void main(String[] args)
   {
      new SteelCitadelTeleport(-1, "SteelCitadelTeleport", "teleports");
   }
}

 

 

I also tried Tryskell method:

 

so it looks like this

 

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package teleports.SteelCitadelTeleport;

import com.l2jserver.Config;
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.instancemanager.ZoneManager;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.zone.type.L2BossZone;

/**
* @author GKR
*/
public class SteelCitadelTeleport extends Quest
{
   private static final int BELETH = 29118;
   private static final int NAIA_CUBE = 32376;
   
   public SteelCitadelTeleport(int questId, String name, String descr)
   {
      super(questId, name, descr);
      
      addStartNpc(NAIA_CUBE);
      addTalkId(NAIA_CUBE);
   }
   
   @Override
   public String onTalk(L2Npc npc, L2PcInstance player)
   {
      switch (npc.getNpcId())
      {
         case NAIA_CUBE:
            if (GrandBossManager.getInstance().getBossStatus(BELETH) == 3)
            {
               return "32376-02.htm";
            }
            


            if (GrandBossManager.getInstance().getBossStatus(BELETH) > 0)
            {
               return "32376-03.htm";
            }
            
            final L2BossZone zone = (L2BossZone) ZoneManager.getInstance().getZoneById(12018);
            if (zone != null)
            {
               GrandBossManager.getInstance().setBossStatus(BELETH, 1);
               
               for (L2Party party : channel.getPartys())
               {
                  if (party == null)
                  {
                     continue;
                  }
                  
                  for (L2PcInstance pl : party.getMembers())
                  {
                     if (pl.isInsideRadius(npc.getX(), npc.getY(), npc.getZ(), 3000, true, false))
                     {
                        zone.allowPlayerEntry(pl, 30);
                        pl.teleToLocation(16342, 209557, -9352, true);
                     }
                  }
               }
            }
      }
      return null;
   }
   
   public static void main(String[] args)
   {
      new SteelCitadelTeleport(-1, "SteelCitadelTeleport", "teleports");
   }
}

 

 

and i get this

1. ERROR in \SteelCitadelTeleport.java (at line 65)
        for (L2Party party : channel.getPartys())
                             ^^^^^^^
channel cannot be resolved
----------
1 problem (1 error)channel cannot be resolved
Failed executing script: C:\server\game\data\scripts\teleports\SteelCitadelTelep
ort\SteelCitadelTeleport.java. See SteelCitadelTeleport.java.error.log for detai
ls.

 

 

lol so mabey instead of terying to make this work if i just teleport to beleth spawn will he just spawn like he normally would, thanks so much both of you

  • 0
Posted
/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package teleports.SteelCitadelTeleport;

import com.l2jserver.Config;
import com.l2jserver.gameserver.instancemanager.GrandBossManager;
import com.l2jserver.gameserver.instancemanager.ZoneManager;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.zone.type.L2BossZone;

/**
* @author GKR
*/
public class SteelCitadelTeleport extends Quest
{
   private static final int BELETH = 29118;
   private static final int NAIA_CUBE = 32376;
   
   public SteelCitadelTeleport(int questId, String name, String descr)
   {
      super(questId, name, descr);
      
      addStartNpc(NAIA_CUBE);
      addTalkId(NAIA_CUBE);
   }
   
   @Override
   public String onTalk(L2Npc npc, L2PcInstance player)
   {
      switch (npc.getNpcId())
      {
         case NAIA_CUBE:
            if (GrandBossManager.getInstance().getBossStatus(BELETH) == 3)
            {
               return "32376-02.htm";
            }

            if (GrandBossManager.getInstance().getBossStatus(BELETH) > 0)
            {
               return "32376-03.htm";
            }
            
            final L2BossZone zone = (L2BossZone) ZoneManager.getInstance().getZoneById(12018);
            if (zone != null)
            {
               GrandBossManager.getInstance().setBossStatus(BELETH, 1);
               L2Party party = player.getParty();
                  if (party != null)
                  {
                     for (L2PcInstance pl : party.getMembers())
                  {
                     if (pl.isInsideRadius(npc.getX(), npc.getY(), npc.getZ(), 3000, true, false))
                     {
                        zone.allowPlayerEntry(pl, 30);
                        pl.teleToLocation(16342, 209557, -9352, true);
                     }
                  }
                  }
                  else
{
zone.allowPlayerEntry(player, 30);
                        player.teleToLocation(16342, 209557, -9352, true);
}     
            }
      }
      return null;
   }
   
   public static void main(String[] args)
   {
      new SteelCitadelTeleport(-1, "SteelCitadelTeleport", "teleports");
   }
} 

Guest
This topic is now closed to further replies.


  • Posts

    • Hello everyone, I am selling the complete AdvExt64 FULL Extender for L2OFF PTS Interlude servers, including the complete source code.   Note: This is NOT the Vanganth extender. This is the complete, fully featured Interlude advext64 extender its full source code. Here is a breakdown of the key features included in this extender:   💻 Source Code Included   Full Extender Source: Modify, compile, and add your own custom features with zero limitations   ⚔️[NEW] Boss Spawns & Global Announcements   Boss Management (BossSpawn.txt): Full control over the exact spawn coordinates and respawn times for any Raid or Epic Boss. Auto-Announce: The server will automatically send a global announcement whenever a normal Raid Boss or Epic Boss spawns (supports custom chat colors). 🏪 Exclusive Systems (OtherSettings) [SearchStore] Costume system; Skins Clan Crest on NPCs:   🌟 Core Systems & Quality of Life AIO (All-In-One) System Premium & VIP System Offline Trade & Market Custom NPC Buffer Extended Teleports Buff Store System: Buff Item Fast Load L2Npc Multi-language System   ⚔️ [NEW] Event Engine (Fully Automated) Good vs Evil (GVE) & All vs All (AVA): Team vs Team (TvT) Capture the Flag (CTF): Last Hero (DeathMatch) Party Death "Server First" Promos: Custom Drop Events Vip System Newbie Rates: ⚙️ Custom Gameplay Mechanics Daily/Weekly/Monthly Missions: Advanced Enchant System: Attribute System Special Map Areas: Olympiad Extras: PvP/PK Systems: In-Game Mail Clan Search Seach Store Bot Report   🛡️ Security & Administration Anti-Bot Integrations:  Patch & HWID Protection: Builder System Jail & Chat Filter System   Price: 500 USD Contact Telegram: @TrakinasXP      
    • [SIZE=4][B]🇨🇦 NEWCANADA40 — 40% OFF VPS in Canada (Toronto)[/B][/SIZE] We are excited to announce the launch of our new location — Toronto, Canada. [B]Promo code:[/B] NEWCANADA40 [B]Discount:[/B] 40% on VPS orders [B]Valid until:[/B] June 7 ✔ New Canadian location ✔ Excellent North American connectivity ✔ Fast server deployment ✔ Suitable for any project [B]How to activate:[/B] — Visit our website — Select Canada (Toronto) as your location — Enter the promo code during checkout 👉 [url=https://bit.hosting]https://bit.hosting[/url] [I]The offer is valid for new Toronto VPS orders until June 7, 2026.</I>
    • Thanks for the collection and the free advertising! These files have been in the public domain for a long time — you just saved people the trouble of searching. A true fan. 😄 Just to clarify for everyone reading: these files have nothing to do with this topic. They are 10+ year old builds, and since various third-party modifications exist in the wild, we cannot guarantee what may have been added or changed in those versions. Use them at your own risk. We have absolutely no judgment toward those who are on a tight budget and can't afford our current builds — these old shared files might genuinely help you get started. Just use them carefully and at your own risk. And please don't judge developers for the mistakes they made early in their careers — every developer goes through stages of growth, and what you see in those old builds is simply a snapshot of where we were back then. We've come a long way since. If you're interested in our older builds, we have a dedicated thread for that with significantly reduced prices — very accessible for any budget. We have also recently resumed full technical support for legacy builds, handled by a separate team that doesn't interfere with our private development direction for larger projects. You can find our legacy builds here: Our OLd L2-scripts Packs Actual revisions Our current private sources are a completely different story — which is exactly what this thread is about. Too bad all your time goes into collecting other people's old code instead of developing your own project. Though judging by "L2MID is currently offline, we will come back soon in 2026" — you clearly have plenty of time on your hands. 😉
  • 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..