Jump to content
  • 0

Change Beleth Script


lowrider88

Question

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");

}

}

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

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");
   }
}

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0
/*
* 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");
   }
} 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hood-services https://campsite.bio/utchihaamkt  
    • Server Rates: » Xp 500x. » Sp 500x. » Aden 500x. » Drop 1x. » PartyXp 2x. » PartySp 2x. » Starting character level -61. Enchant rates: » Safe enchant +4. » Blessed and simple scrolls max enchant (+16). » Crystal scrolls max enchant (+20). » Simple enchant scrolls chance – 65%. » Blessed enchant scrolls chance – 100%. » Crystal enchant scrolls chance – 50% Augmentations: » Mid life stone skill chance – 5%. » High life stone skill chance – 10%. » Top life stone skill chance – 20%. » Augments 1+1 Unique features: » Main town – Giran » Automatic-Manual Potions. » Working 2 castle sieges. (Giran-Aden) » SPS cancel lasts 10 seconds and than buffs come back. » Stackable scrolls, lifestones, book of giants. » Unique pvp zone » More then 11 active raid bosses. » Wedding system. » Unique farming areas. » Npc skill enchanter. » Full npc buffer with auto buff. » Max count of buffs – 55. » Max subclasses – 4. » Free and no quest class change. » Free and no quest sub class. » Raid boss drop nobless item. » No weight limit. » Unique protection anti-hwy armor for archers/daggers etc. » Ingame password change. » Top pvp/pk/online ranks NPC. » Unique monsters & NPC. » Interlude retail skills. » Server up-time [24/7] [99]%. » Perfect class balance (all class can kill all class depending on players skill and setup knowledge,gear,augmentations). » Announcements on double kills triple kills etc. » Announcements on Grand Boss death , with the name of the killer as well as clan name of the player. » Information Npc in game with all servers infromations. Custom server gear : 1). Titanium Armor Lv.1 2). Epic Armor Lv.2 3). Epic Weapons-Kamikaze-Black S grade (Same Stats) 4). Demonic-Angelic Wings-Baium Hair-Custom Accessories (SameStats) 5). Custom Fighter/Mage tattoo Lv1-Lv2-Lv3 6). Shirt (STR,CON,INT +1) 7). Custom Shields Server Commands: .tvtjoin .tvtleave – Join or leave tvt event. .ctfjoin .ctfleave – Join or leave ctf event. .dmjoin .dmleave – Join of leave dm event. .online – current online players count. .repair – repairs stuck character in world. .menu – opens online menu panel. .exit – PVP zone exit in case you are bullied. .changepassword - Opens online menu then u can change ur password in game. .farm - Enable/disable autofarm Event system: » TVT event » CTF event » DM event » Tournament Event » Party Zone » Unique event shop. Olympiad game: » Retail olympiad game. » Competition period [1] week. » Olympiad start time [18:00] end [00:00] GMT+2. » New Heroes every Sunday.
    • Tomorrow grand opening lests go 🙂 
    • New season of Warfire X150 has been postponed to September 28th.
  • Topics

×
×
  • Create New...