Jump to content
  • 0

L2Jfrozen Προβλημα Με Voice Command Βοηθεια


ThugLord92

Question

Voice Command .gmshop οτι multisell και να βαλω ολα φαινονται ενταξει αλλα μολις πατισω να αγορασω κατι και πατισω "πως ειμαι σιγουρος" δεν γινεται η αγορα ο gameserver δεν βγαζει καποιο error  απλα δεν γινεται τιποτα

 

Ολα τα υπολοιπα voice commands λειτουργουν κανονικα

/*
 * L2jFrozen Project - www.l2jfrozen.com 
 * 
 * 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 2, 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.powerpak.gmshop;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.cache.HtmCache;
import com.l2jfrozen.gameserver.handler.IBBSHandler;
import com.l2jfrozen.gameserver.handler.ICustomByPassHandler;
import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.entity.event.CTF;
import com.l2jfrozen.gameserver.model.entity.event.DM;
import com.l2jfrozen.gameserver.model.entity.event.TvT;
import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
import com.l2jfrozen.gameserver.model.multisell.L2Multisell;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.powerpak.PowerPakConfig;
import com.l2jfrozen.gameserver.taskmanager.AttackStanceTaskManager;

/**
 * @author L2JFrozen
 */
public class GMShop implements IVoicedCommandHandler, ICustomByPassHandler, IBBSHandler
{
	
	@Override
	public String[] getVoicedCommandList()
	{
		
		return new String[]
		{
			PowerPakConfig.GMSHOP_COMMAND
		};
	}
	
	private boolean checkAllowed(final L2PcInstance activeChar)
	{
		String msg = null;
		if (activeChar.isSitting())
			msg = "GMShop is not available when you sit";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("ALL"))
			msg = "GMShop is not available in this area";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("CURSED") && activeChar.isCursedWeaponEquiped())
			msg = "GMShop is not available with the cursed sword";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("ATTACK") && AttackStanceTaskManager.getInstance().getAttackStanceTask(activeChar))
			msg = "GMShop is not available during the battle";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("DUNGEON") && activeChar.isIn7sDungeon())
			msg = "GMShop is not available in the catacombs and necropolis";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("RB") && activeChar.isInsideZone(L2Character.ZONE_NOSUMMONFRIEND))
			msg = "GMShop is not available in this area";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("PVP") && activeChar.isInsideZone(L2Character.ZONE_PVP))
			msg = "GMShop is not available in this area";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("PEACE") && activeChar.isInsideZone(L2Character.ZONE_PEACE))
			msg = "GMShop is not available in this area";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("SIEGE") && activeChar.isInsideZone(L2Character.ZONE_SIEGE))
			msg = "GMShop is not available in this area";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("OLYMPIAD") && (activeChar.isInOlympiadMode() || activeChar.isInsideZone(L2Character.ZONE_OLY) || Olympiad.getInstance().isRegistered(activeChar) || Olympiad.getInstance().isRegisteredInComp(activeChar)))
			msg = "GMShop is not available at Olympiad";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("EVENT") && (activeChar._inEvent))
			msg = "GMShop is not available at the opening event";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("TVT") && activeChar._inEventTvT && TvT.is_started())
			msg = "GMShop is not available in TVT";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("CTF") && activeChar._inEventCTF && CTF.is_started())
			msg = "GMShop is not available in CTF";
		else if (PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("DM") && activeChar._inEventDM && DM.is_started())
			msg = "GMShop is not available in DM";
		
		if (msg != null)
			activeChar.sendMessage(msg);
		
		return msg == null;
	}
	
	@Override
	public boolean useVoicedCommand(final String command, final L2PcInstance activeChar, final String params)
	{
		if (activeChar == null)
			return false;
		if (!checkAllowed(activeChar))
			return false;
		
		if (command.compareTo(PowerPakConfig.GMSHOP_COMMAND) == 0)
		{
			String index = "";
			if (params != null && params.length() != 0)
				if (!params.equals("0"))
					index = "-" + params;
			final String text = HtmCache.getInstance().getHtm("data/html/gmshop/gmshop" + index + ".htm");
			final NpcHtmlMessage htm = new NpcHtmlMessage(activeChar.getLastQuestNpcObject());
			htm.setHtml(text);
			activeChar.sendPacket(htm);
		}
		
		return false;
	}
	
	private static String[] _CMD =
	{
		"gmshop"
	};
	
	@Override
	public String[] getByPassCommands()
	{
		return _CMD;
	}
	
	@Override
	public void handleCommand(final String command, final L2PcInstance player, final String parameters)
	{
		if (player == null)
			return;
		if (parameters == null || parameters.length() == 0)
			return;
		if (!checkAllowed(player))
			return;
		
		if (!PowerPakConfig.GMSHOP_USEBBS && !PowerPakConfig.GMSHOP_USECOMMAND)
		{
			
			L2NpcInstance gmshopnpc = null;
			
			if (player.getTarget() != null)
				if (player.getTarget() instanceof L2NpcInstance)
				{
					gmshopnpc = (L2NpcInstance) player.getTarget();
					if (gmshopnpc.getTemplate().getNpcId() != PowerPakConfig.GMSHOP_NPC)
						gmshopnpc = null;
				}
			
			// Possible fix to Buffer - 1
			if (gmshopnpc == null)
				return;
			
			// Possible fix to Buffer - 2
			if (!player.isInsideRadius(gmshopnpc, L2NpcInstance.INTERACTION_DISTANCE, false, false))
				return;
			
		}// else (voice and bbs)
		
		if (parameters.startsWith("multisell"))
		{
			try
			{
				L2Multisell.getInstance().SeparateAndSend(Integer.parseInt(parameters.substring(9).trim()), player, false, 0);
			}
			catch (final Exception e)
			{
				if (Config.ENABLE_ALL_EXCEPTIONS)
					e.printStackTrace();
				
				player.sendMessage("This list does not exist");
			}
		}
		else if (parameters.startsWith("Chat"))
			useVoicedCommand("", player, parameters.substring(4).trim());
		
	}
	
	@Override
	public String[] getBBSCommands()
	{
		return _CMD;
	}
}

Edited by ThugLord92
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

    • 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 🙂 
  • Topics

×
×
  • Create New...