Jump to content

Recommended Posts

  • 3 weeks later...
Posted (edited)

Newbie here!  :happyforever: 

Do you know maybe why this error occurs while compiling?
 

 [javac] C:\Users\nikosPC\workspace aCis\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:157: error: variable declaration not allowed here
    [javac]   final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
    [javac]                                                       ^
 

Thanks in advance!  :-*

Edited by NickTs
Posted (edited)

Newbie here!  :happyforever: 

 

Do you know maybe why this error occurs while compiling?

 

 [javac] C:\Users\nikosPC\workspace aCis\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:157: error: variable declaration not allowed here
    [javac]   final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
    [javac]                                                               ^

 

Thanks in advance!  :-*

Hello,

Since i didnt edit these lines , you are missing something ... this error says that you are trying to redeclare it...

(Maybe you added this line in IF statement or something?)

The solution for you is to clean your instance and insert again the lines that i gave you or paste your buffer instance (in <code>) here to check it

p.s this is for latest free rev (acis)

Edited by ⏇Melron⏇℠Abs
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 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 net.sf.l2j.gameserver.model.actor.instance;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

import net.sf.l2j.Config;
import net.sf.l2j.commons.lang.StringUtil;
import net.sf.l2j.gameserver.datatables.BufferTable;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.L2Character;
import net.sf.l2j.gameserver.model.actor.L2Summon;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class L2BufferInstance extends L2NpcInstance
{
	public L2BufferInstance(int objectId, NpcTemplate template)
	{
		super(objectId, template);
	}
	
	@Override
	public void onBypassFeedback(L2PcInstance player, String command)
	{
		StringTokenizer st = new StringTokenizer(command, " ");
		String currentCommand = st.nextToken();
		int buffid = 0;
		
		if (currentCommand.startsWith("menu"))
		{
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		if (currentCommand.startsWith("chat"))
		{
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), Integer.parseInt(st.nextToken())));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("cleanup"))
		{
            L2Skill buff;
            buff = SkillTable.getInstance().getInfo(1056, 1);
            buff.getEffects(this, player);
			player.stopAllEffectsExceptThoseThatLastThroughDeath();
			player.broadcastPacket(new MagicSkillUse(this, player, 1056, 1, 5, 0));
			
			final L2Summon summon = player.getPet();
			if (summon != null)
			{
                buff.getEffects(this, summon);
				summon.broadcastPacket(new MagicSkillUse(this, summon, 1056, 1, 5, 0));
				summon.stopAllEffectsExceptThoseThatLastThroughDeath();
			}
			
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("heal"))
		{
			player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
			player.setCurrentCp(player.getMaxCp());
		    L2Skill buff = SkillTable.getInstance().getInfo(1218, 1);
	        buff.getEffects(this, player);
			player.broadcastPacket(new MagicSkillUse(this, player, 1218, 1, 5, 0));
			final L2Summon summon = player.getPet();
			if (summon != null)
			{
                buff.getEffects(this, player);
				summon.broadcastPacket(new MagicSkillUse(this, summon, 1218, 1, 5, 0));
				summon.setCurrentHpMp(summon.getMaxHp(), summon.getMaxMp());
			}
			
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("support"))
		{
			showGiveBuffsWindow(player, st.nextToken());
		}
		else if (currentCommand.startsWith("givebuffs"))
		{
			final String targetType = st.nextToken();
			final String schemeName = st.nextToken();
			final int cost = Integer.parseInt(st.nextToken());
			
			final L2Character target = (targetType.equalsIgnoreCase("pet")) ? player.getPet() : player;
			if (target == null)
				player.sendMessage("You don't have a pet.");
			else if (cost == 0 || player.reduceAdena("NPC Buffer", cost, this, true))
			{
				for (int skillId : BufferTable.getInstance().getScheme(player.getObjectId(), schemeName))
					SkillTable.getInstance().getInfo(skillId, SkillTable.getInstance().getMaxLevel(skillId)).getEffects(this, target);
			}
			showGiveBuffsWindow(player, targetType);
		}
		else if (currentCommand.startsWith("editschemes"))
		{
			showEditSchemeWindow(player, st.nextToken(), st.nextToken());
		}
		if (currentCommand.startsWith("getbuff"))
		{
			buffid = Integer.parseInt(st.nextToken());
			int nextWindow = Integer.parseInt(st.nextToken());
			if (buffid != 0)
			{
                               L2Skill buff =SkillTable.getInstance().getInfo(buffid, SkillTable.getInstance().getMaxLevel(buffid));
                               buff.getEffects(this, player);
				player.broadcastPacket(new MagicSkillUse(this, player, buffid, SkillTable.getInstance().getMaxLevel(buffid), 0, 0));
				final NpcHtmlMessage html = new NpcHtmlMessage(0);
				html.setFile(getHtmlPath(getNpcId(), nextWindow));
				html.replace("%objectId%", getObjectId());
				player.sendPacket(html);
			}
		}
		else if (currentCommand.startsWith("fighterSet"))
		{
                       int fighterSet[] = Config.FIGHTER_SET_LIST;
			player.stopAllEffectsExceptThoseThatLastThroughDeath();
			L2Skill buff ;
			for (int id: fighterSet)
			{
				buff = SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id));
                               buff.getEffects(this, player);
				player.broadcastPacket(new MagicSkillUse(this, player, id, buff.getLevel(), 0, 0));
			}
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("mageSet"))
		{
                       int mageSet[] = Config.MAGE_SET_LIST;
			player.stopAllEffectsExceptThoseThatLastThroughDeath();
			L2Skill buff ;
                       for (int id: mageSet)
                        {
                            buff = SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id));
                            buff.getEffects(this, player);
                            player.broadcastPacket(new MagicSkillUse(this, player, id, buff.getLevel(), 0, 0));
                        }
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("skill"))
		{
			final String groupType = st.nextToken();
			final String schemeName = st.nextToken();
			
			final int skillId = Integer.parseInt(st.nextToken());
			
			final List<Integer> skills = BufferTable.getInstance().getScheme(player.getObjectId(), schemeName);
			
			if (currentCommand.startsWith("skillselect") && !schemeName.equalsIgnoreCase("none"))
			{
				if (skills.size() < Config.BUFFER_MAX_SKILLS)
					skills.add(skillId);
				else
					player.sendMessage("This scheme has reached the maximum amount of buffs.");
			}
			else if (currentCommand.startsWith("skillunselect"))
				skills.remove(Integer.valueOf(skillId));
			
			showEditSchemeWindow(player, groupType, schemeName);
		}
		else if (currentCommand.startsWith("manageschemes"))
		{
			showManageSchemeWindow(player);
		}
		else if (currentCommand.startsWith("createscheme"))
		{
			try
			{
				final String schemeName = st.nextToken();
				if (schemeName.length() > 14)
				{
					player.sendMessage("Scheme's name must contain up to 14 chars. Spaces are trimmed.");
					showManageSchemeWindow(player);
					return;
				}
				
				final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
				if (schemes != null)
				{
					if (schemes.size() == Config.BUFFER_MAX_SCHEMES)
					{
						player.sendMessage("Maximum schemes amount is already reached.");
						showManageSchemeWindow(player);
						return;
					}
					
					if (schemes.containsKey(schemeName))
					{
						player.sendMessage("The scheme name already exists.");
						showManageSchemeWindow(player);
						return;
					}
				}
				
				BufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<Integer>());
				showManageSchemeWindow(player);
			}
			catch (Exception e)
			{
				player.sendMessage("Scheme's name must contain up to 14 chars. Spaces are trimmed.");
				showManageSchemeWindow(player);
			}
		}
		else if (currentCommand.startsWith("deletescheme"))
		{
			try
			{
				final String schemeName = st.nextToken();
				final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
				
				if (schemes != null && schemes.containsKey(schemeName))
					schemes.remove(schemeName);
			}
			catch (Exception e)
			{
				player.sendMessage("This scheme name is invalid.");
			}
			showManageSchemeWindow(player);
		}
		else if (currentCommand.startsWith("clearscheme"))
		{
			try
			{
				final String schemeName = st.nextToken();
				final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
				
				if (schemes != null && schemes.containsKey(schemeName))
					schemes.get(schemeName).clear();
			}
			catch (Exception e)
			{
				player.sendMessage("This scheme name is invalid.");
			}
			showManageSchemeWindow(player);
		}
		
		super.onBypassFeedback(player, command);
	}
	
	@Override
	public String getHtmlPath(int npcId, int val)
	{
		String filename = "";
		if (val == 0)
			filename = "" + npcId;
		else
			filename = npcId + "-" + val;
		
		return "data/html/mods/buffer/" + filename + ".htm";
	}
	
	/**
	 * Sends an html packet to player with Give Buffs menu info for player and pet, depending on targetType parameter {player, pet}
	 * @param player : The player to make checks on.
	 * @param targetType : a String used to define if the player or his pet must be used as target.
	 */
	private void showGiveBuffsWindow(L2PcInstance player, String targetType)
	{
		final StringBuilder sb = new StringBuilder(200);
		
		final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
		if (schemes == null || schemes.isEmpty())
			sb.append("<center><font color=\"LEVEL\">You haven't defined any scheme</font></center>");
		else
		{
			for (Map.Entry<String, ArrayList<Integer>> scheme : schemes.entrySet())
			{
				final int cost = getFee(scheme.getValue());
				StringUtil.append(sb, "<font color=\"LEVEL\"><a action=\"bypass -h npc_%objectId%_givebuffs ", targetType, " ", scheme.getKey(), " ", cost, "\">", scheme.getKey(), " (", scheme.getValue().size(), " skill(s))</a>", ((cost > 0) ? " - Adena cost: " + cost : ""), "</font><br1>");
			}
		}
		
		final NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile(getHtmlPath(getNpcId(), 1));
		html.replace("%schemes%", sb.toString());
		html.replace("%targettype%", (targetType.equalsIgnoreCase("pet") ? " <a action=\"bypass -h npc_%objectId%_support player\">yourself</a> | your pet" : "yourself | <a action=\"bypass -h npc_%objectId%_support pet\">your pet</a>"));
		html.replace("%objectId%", getObjectId());
		player.sendPacket(html);
	}
	
	/**
	 * Sends an html packet to player with Manage scheme menu info. This allows player to create/delete/clear schemes
	 * @param player : The player to make checks on.
	 */
	private void showManageSchemeWindow(L2PcInstance player)
	{
		final StringBuilder sb = new StringBuilder(200);
		
		final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
		if (schemes == null || schemes.isEmpty())
			sb.append("<center><font color=\"3399CC\">You haven't created any scheme.</font></center>");
		else
		{
			sb.append("<table bgcolor=000000 width =300>");
			for (Map.Entry<String, ArrayList<Integer>> scheme : schemes.entrySet())
				StringUtil.append(sb, "<tr><td width=140>", scheme.getKey(), " (", scheme.getValue().size(), " skill(s))</td><td width=60><button value=\"Clear\" action=\"bypass -h npc_%objectId%_clearscheme ", scheme.getKey(), "\" width=55 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td width=60><button value=\"Drop\" action=\"bypass -h npc_%objectId%_deletescheme ", scheme.getKey(), "\" width=55 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
			
			sb.append("</table>");
		}
		
		final NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile(getHtmlPath(getNpcId(), 2));
		html.replace("%schemes%", sb.toString());
		html.replace("%max_schemes%", Config.BUFFER_MAX_SCHEMES);
		html.replace("%objectId%", getObjectId());
		player.sendPacket(html);
	}
	
	/**
	 * This sends an html packet to player with Edit Scheme Menu info. This allows player to edit each created scheme (add/delete skills)
	 * @param player : The player to make checks on.
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 */
	private void showEditSchemeWindow(L2PcInstance player, String groupType, String schemeName)
	{
		final NpcHtmlMessage html = new NpcHtmlMessage(0);
		
		if (schemeName.equalsIgnoreCase("none"))
			html.setFile(getHtmlPath(getNpcId(), 3));
		else
		{
			if (groupType.equalsIgnoreCase("none"))
				html.setFile(getHtmlPath(getNpcId(), 4));
			else
			{
				html.setFile(getHtmlPath(getNpcId(), 5));
				html.replace("%skilllistframe%", getGroupSkillList(player, groupType, schemeName));
			}
			html.replace("%schemename%", schemeName);
			html.replace("%myschemeframe%", getPlayerSchemeSkillList(player, groupType, schemeName));
			html.replace("%typesframe%", getTypesFrame(groupType, schemeName));
		}
		html.replace("%schemes%", getPlayerSchemes(player, schemeName));
		html.replace("%objectId%", getObjectId());
		player.sendPacket(html);
	}
	
	/**
	 * @param player : The player to make checks on.
	 * @param schemeName : The name to don't link (previously clicked).
	 * @return a String listing player's schemes. The scheme currently on selection isn't linkable.
	 */
	private static String getPlayerSchemes(L2PcInstance player, String schemeName)
	{
		final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
		if (schemes == null || schemes.isEmpty())
			return "<table bgcolor=000000 width =300><tr><td align=center width=300><font color=\"3399CC\">Please create at least one scheme.</font></td></tr></table>";
		
		final StringBuilder sb = new StringBuilder(200);
		sb.append("<table bgcolor=000000 width =300>");
		
		for (Map.Entry<String, ArrayList<Integer>> scheme : schemes.entrySet())
		{
			if (schemeName.equalsIgnoreCase(scheme.getKey()))
				StringUtil.append(sb, "<tr><td align=center width=300>", scheme.getKey(), " (<font color=\"LEVEL\">", scheme.getValue().size(), "</font> / ", Config.BUFFER_MAX_SKILLS, " skill(s))</td></tr>");
			else
				StringUtil.append(sb, "<tr><td align=center width=300><font color=\"3399CC\"><a action=\"bypass -h npc_%objectId%_editschemes none ", scheme.getKey(), "\">", scheme.getKey(), " (", scheme.getValue().size(), " / ", Config.BUFFER_MAX_SKILLS, " skill(s))</a></font></td></tr>");
		}
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param player : The player to make checks on.
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 * @return a String representing skills available to selection for a given groupType.
	 */
	private static String getGroupSkillList(L2PcInstance player, String groupType, String schemeName)
	{
		final List<Integer> skills = new ArrayList<>();
		for (int skillId : BufferTable.getSkillsIdsByType(groupType))
		{
			if (BufferTable.getInstance().getSchemeContainsSkill(player.getObjectId(), schemeName, skillId))
				continue;
			
			skills.add(skillId);
		}
		
		if (skills.isEmpty())
			return "That group doesn't contain any skills.";
		
		final StringBuilder sb = new StringBuilder(500);
		
		sb.append("<table>");
		int count = 0;
		for (int skillId : skills)
		{
			if (BufferTable.getInstance().getSchemeContainsSkill(player.getObjectId(), schemeName, skillId))
				continue;
			
			if (count == 0)
				sb.append("<tr>");
			
			if (skillId < 100)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, "\" width=32 height=32 back=\"icon.skill00", skillId, "\" fore=\"icon.skill00", skillId, "\"></td>");
			else if (skillId < 1000)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, "\" width=32 height=32 back=\"icon.skill0", skillId, "\" fore=\"icon.skill0", skillId, "\"></td>");
			else
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, "\" width=32 height=32 back=\"icon.skill", skillId, "\" fore=\"icon.skill", skillId, "\"></td>");
			
			count++;
			if (count == 6)
			{
				sb.append("</tr>");
				count = 0;
			}
		}
		
		if (!sb.toString().endsWith("</tr>"))
			sb.append("</tr>");
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param player : The player to make checks on.
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 * @return a String representing a given scheme's content.
	 */
	private static String getPlayerSchemeSkillList(L2PcInstance player, String groupType, String schemeName)
	{
		final List<Integer> skills = BufferTable.getInstance().getScheme(player.getObjectId(), schemeName);
		if (skills.isEmpty())
			return "<font color=\"3399CC\">That scheme is empty.</font>";
		
		final StringBuilder sb = new StringBuilder(500);
		sb.append("<table>");
		int count = 0;
		
		for (int sk : skills)
		{
			if (count == 0)
				sb.append("<tr>");
			
			if (sk < 100)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", sk, "\" width=32 height=32 back=\"icon.skill00", sk, "\" fore=\"icon.skill00", sk, "\"></td>");
			else if (sk < 1000)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", sk, "\" width=32 height=32 back=\"icon.skill0", sk, "\" fore=\"icon.skill0", sk, "\"></td>");
			else
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", sk, "\" width=32 height=32 back=\"icon.skill", sk, "\" fore=\"icon.skill", sk, "\"></td>");
			
			count++;
			if (count == 6)
			{
				sb.append("</tr>");
				count = 0;
			}
		}
		
		if (!sb.toString().endsWith("<tr>"))
			sb.append("<tr>");
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 * @return a string representing all groupTypes availables. The group currently on selection isn't linkable.
	 */
	private static String getTypesFrame(String groupType, String schemeName)
	{
		final StringBuilder sb = new StringBuilder(500);
		sb.append("<table>");
		
		int count = 0;
		for (String s : BufferTable.getSkillTypes())
		{
			if (count == 0)
				sb.append("<tr>");
			
			if (groupType.equalsIgnoreCase(s))
				StringUtil.append(sb, "<td width=65>", s, "</td>");
			else
				StringUtil.append(sb, "<td width=65><a action=\"bypass -h npc_%objectId%_editschemes ", s, " ", schemeName, "\">", s, "</a></td>");
			
			count++;
			if (count == 4)
			{
				sb.append("</tr>");
				count = 0;
			}
		}
		
		if (!sb.toString().endsWith("</tr>"))
			sb.append("</tr>");
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param list : A list of skill ids.
	 * @return a global fee for all skills contained in list.
	 */
	private static int getFee(ArrayList<Integer> list)
	{
		if (Config.BUFFER_STATIC_BUFF_COST >= 0)
			return (list.size() * Config.BUFFER_STATIC_BUFF_COST);
		
		int fee = 0;
		for (int sk : list)
			fee += Config.BUFFER_BUFFLIST.get(sk).getValue();
		
		return fee;
	}
}

Thanks for the quick responce! Seems legit now!  :y u no?:

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 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 net.sf.l2j.gameserver.model.actor.instance;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

import net.sf.l2j.Config;
import net.sf.l2j.commons.lang.StringUtil;
import net.sf.l2j.gameserver.datatables.BufferTable;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.L2Character;
import net.sf.l2j.gameserver.model.actor.L2Summon;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class L2BufferInstance extends L2NpcInstance
{
	public L2BufferInstance(int objectId, NpcTemplate template)
	{
		super(objectId, template);
	}
	
	@Override
	public void onBypassFeedback(L2PcInstance player, String command)
	{
		StringTokenizer st = new StringTokenizer(command, " ");
		String currentCommand = st.nextToken();
		int buffid = 0;
		
		if (currentCommand.startsWith("menu"))
		{
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		if (currentCommand.startsWith("chat"))
		{
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), Integer.parseInt(st.nextToken())));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("cleanup"))
		{
            L2Skill buff;
            buff = SkillTable.getInstance().getInfo(1056, 1);
            buff.getEffects(this, player);
			player.stopAllEffectsExceptThoseThatLastThroughDeath();
			player.broadcastPacket(new MagicSkillUse(this, player, 1056, 1, 5, 0));
			
			final L2Summon summon = player.getPet();
			if (summon != null)
			{
                buff.getEffects(this, summon);
				summon.broadcastPacket(new MagicSkillUse(this, summon, 1056, 1, 5, 0));
				summon.stopAllEffectsExceptThoseThatLastThroughDeath();
			}
			
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("heal"))
		{
			player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
			player.setCurrentCp(player.getMaxCp());
		    L2Skill buff = SkillTable.getInstance().getInfo(1218, 1);
	        buff.getEffects(this, player);
			player.broadcastPacket(new MagicSkillUse(this, player, 1218, 1, 5, 0));
			final L2Summon summon = player.getPet();
			if (summon != null)
			{
                buff.getEffects(this, player);
				summon.broadcastPacket(new MagicSkillUse(this, summon, 1218, 1, 5, 0));
				summon.setCurrentHpMp(summon.getMaxHp(), summon.getMaxMp());
			}
			
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("support"))
		{
			showGiveBuffsWindow(player, st.nextToken());
		}
		else if (currentCommand.startsWith("givebuffs"))
		{
			final String targetType = st.nextToken();
			final String schemeName = st.nextToken();
			final int cost = Integer.parseInt(st.nextToken());
			
			final L2Character target = (targetType.equalsIgnoreCase("pet")) ? player.getPet() : player;
			if (target == null)
				player.sendMessage("You don't have a pet.");
			else if (cost == 0 || player.reduceAdena("NPC Buffer", cost, this, true))
			{
				for (int skillId : BufferTable.getInstance().getScheme(player.getObjectId(), schemeName))
					SkillTable.getInstance().getInfo(skillId, SkillTable.getInstance().getMaxLevel(skillId)).getEffects(this, target);
			}
			showGiveBuffsWindow(player, targetType);
		}
		else if (currentCommand.startsWith("editschemes"))
		{
			showEditSchemeWindow(player, st.nextToken(), st.nextToken());
		}
		if (currentCommand.startsWith("getbuff"))
		{
			buffid = Integer.parseInt(st.nextToken());
			int nextWindow = Integer.parseInt(st.nextToken());
			if (buffid != 0)
			{
                               L2Skill buff =SkillTable.getInstance().getInfo(buffid, SkillTable.getInstance().getMaxLevel(buffid));
                               buff.getEffects(this, player);
				player.broadcastPacket(new MagicSkillUse(this, player, buffid, SkillTable.getInstance().getMaxLevel(buffid), 0, 0));
				final NpcHtmlMessage html = new NpcHtmlMessage(0);
				html.setFile(getHtmlPath(getNpcId(), nextWindow));
				html.replace("%objectId%", getObjectId());
				player.sendPacket(html);
			}
		}
		else if (currentCommand.startsWith("fighterSet"))
		{
                       int fighterSet[] = Config.FIGHTER_SET_LIST;
			player.stopAllEffectsExceptThoseThatLastThroughDeath();
			L2Skill buff ;
			for (int id: fighterSet)
			{
				buff = SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id));
                               buff.getEffects(this, player);
				player.broadcastPacket(new MagicSkillUse(this, player, id, buff.getLevel(), 0, 0));
			}
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("mageSet"))
		{
                       int mageSet[] = Config.MAGE_SET_LIST;
			player.stopAllEffectsExceptThoseThatLastThroughDeath();
			L2Skill buff ;
                       for (int id: mageSet)
                        {
                            buff = SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id));
                            buff.getEffects(this, player);
                            player.broadcastPacket(new MagicSkillUse(this, player, id, buff.getLevel(), 0, 0));
                        }
			final NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile(getHtmlPath(getNpcId(), 0));
			html.replace("%objectId%", getObjectId());
			player.sendPacket(html);
		}
		else if (currentCommand.startsWith("skill"))
		{
			final String groupType = st.nextToken();
			final String schemeName = st.nextToken();
			
			final int skillId = Integer.parseInt(st.nextToken());
			
			final List<Integer> skills = BufferTable.getInstance().getScheme(player.getObjectId(), schemeName);
			
			if (currentCommand.startsWith("skillselect") && !schemeName.equalsIgnoreCase("none"))
			{
				if (skills.size() < Config.BUFFER_MAX_SKILLS)
					skills.add(skillId);
				else
					player.sendMessage("This scheme has reached the maximum amount of buffs.");
			}
			else if (currentCommand.startsWith("skillunselect"))
				skills.remove(Integer.valueOf(skillId));
			
			showEditSchemeWindow(player, groupType, schemeName);
		}
		else if (currentCommand.startsWith("manageschemes"))
		{
			showManageSchemeWindow(player);
		}
		else if (currentCommand.startsWith("createscheme"))
		{
			try
			{
				final String schemeName = st.nextToken();
				if (schemeName.length() > 14)
				{
					player.sendMessage("Scheme's name must contain up to 14 chars. Spaces are trimmed.");
					showManageSchemeWindow(player);
					return;
				}
				
				final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
				if (schemes != null)
				{
					if (schemes.size() == Config.BUFFER_MAX_SCHEMES)
					{
						player.sendMessage("Maximum schemes amount is already reached.");
						showManageSchemeWindow(player);
						return;
					}
					
					if (schemes.containsKey(schemeName))
					{
						player.sendMessage("The scheme name already exists.");
						showManageSchemeWindow(player);
						return;
					}
				}
				
				BufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList<Integer>());
				showManageSchemeWindow(player);
			}
			catch (Exception e)
			{
				player.sendMessage("Scheme's name must contain up to 14 chars. Spaces are trimmed.");
				showManageSchemeWindow(player);
			}
		}
		else if (currentCommand.startsWith("deletescheme"))
		{
			try
			{
				final String schemeName = st.nextToken();
				final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
				
				if (schemes != null && schemes.containsKey(schemeName))
					schemes.remove(schemeName);
			}
			catch (Exception e)
			{
				player.sendMessage("This scheme name is invalid.");
			}
			showManageSchemeWindow(player);
		}
		else if (currentCommand.startsWith("clearscheme"))
		{
			try
			{
				final String schemeName = st.nextToken();
				final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
				
				if (schemes != null && schemes.containsKey(schemeName))
					schemes.get(schemeName).clear();
			}
			catch (Exception e)
			{
				player.sendMessage("This scheme name is invalid.");
			}
			showManageSchemeWindow(player);
		}
		
		super.onBypassFeedback(player, command);
	}
	
	@Override
	public String getHtmlPath(int npcId, int val)
	{
		String filename = "";
		if (val == 0)
			filename = "" + npcId;
		else
			filename = npcId + "-" + val;
		
		return "data/html/mods/buffer/" + filename + ".htm";
	}
	
	/**
	 * Sends an html packet to player with Give Buffs menu info for player and pet, depending on targetType parameter {player, pet}
	 * @param player : The player to make checks on.
	 * @param targetType : a String used to define if the player or his pet must be used as target.
	 */
	private void showGiveBuffsWindow(L2PcInstance player, String targetType)
	{
		final StringBuilder sb = new StringBuilder(200);
		
		final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
		if (schemes == null || schemes.isEmpty())
			sb.append("<center><font color=\"LEVEL\">You haven't defined any scheme</font></center>");
		else
		{
			for (Map.Entry<String, ArrayList<Integer>> scheme : schemes.entrySet())
			{
				final int cost = getFee(scheme.getValue());
				StringUtil.append(sb, "<font color=\"LEVEL\"><a action=\"bypass -h npc_%objectId%_givebuffs ", targetType, " ", scheme.getKey(), " ", cost, "\">", scheme.getKey(), " (", scheme.getValue().size(), " skill(s))</a>", ((cost > 0) ? " - Adena cost: " + cost : ""), "</font><br1>");
			}
		}
		
		final NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile(getHtmlPath(getNpcId(), 1));
		html.replace("%schemes%", sb.toString());
		html.replace("%targettype%", (targetType.equalsIgnoreCase("pet") ? " <a action=\"bypass -h npc_%objectId%_support player\">yourself</a> | your pet" : "yourself | <a action=\"bypass -h npc_%objectId%_support pet\">your pet</a>"));
		html.replace("%objectId%", getObjectId());
		player.sendPacket(html);
	}
	
	/**
	 * Sends an html packet to player with Manage scheme menu info. This allows player to create/delete/clear schemes
	 * @param player : The player to make checks on.
	 */
	private void showManageSchemeWindow(L2PcInstance player)
	{
		final StringBuilder sb = new StringBuilder(200);
		
		final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
		if (schemes == null || schemes.isEmpty())
			sb.append("<center><font color=\"3399CC\">You haven't created any scheme.</font></center>");
		else
		{
			sb.append("<table bgcolor=000000 width =300>");
			for (Map.Entry<String, ArrayList<Integer>> scheme : schemes.entrySet())
				StringUtil.append(sb, "<tr><td width=140>", scheme.getKey(), " (", scheme.getValue().size(), " skill(s))</td><td width=60><button value=\"Clear\" action=\"bypass -h npc_%objectId%_clearscheme ", scheme.getKey(), "\" width=55 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td width=60><button value=\"Drop\" action=\"bypass -h npc_%objectId%_deletescheme ", scheme.getKey(), "\" width=55 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
			
			sb.append("</table>");
		}
		
		final NpcHtmlMessage html = new NpcHtmlMessage(0);
		html.setFile(getHtmlPath(getNpcId(), 2));
		html.replace("%schemes%", sb.toString());
		html.replace("%max_schemes%", Config.BUFFER_MAX_SCHEMES);
		html.replace("%objectId%", getObjectId());
		player.sendPacket(html);
	}
	
	/**
	 * This sends an html packet to player with Edit Scheme Menu info. This allows player to edit each created scheme (add/delete skills)
	 * @param player : The player to make checks on.
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 */
	private void showEditSchemeWindow(L2PcInstance player, String groupType, String schemeName)
	{
		final NpcHtmlMessage html = new NpcHtmlMessage(0);
		
		if (schemeName.equalsIgnoreCase("none"))
			html.setFile(getHtmlPath(getNpcId(), 3));
		else
		{
			if (groupType.equalsIgnoreCase("none"))
				html.setFile(getHtmlPath(getNpcId(), 4));
			else
			{
				html.setFile(getHtmlPath(getNpcId(), 5));
				html.replace("%skilllistframe%", getGroupSkillList(player, groupType, schemeName));
			}
			html.replace("%schemename%", schemeName);
			html.replace("%myschemeframe%", getPlayerSchemeSkillList(player, groupType, schemeName));
			html.replace("%typesframe%", getTypesFrame(groupType, schemeName));
		}
		html.replace("%schemes%", getPlayerSchemes(player, schemeName));
		html.replace("%objectId%", getObjectId());
		player.sendPacket(html);
	}
	
	/**
	 * @param player : The player to make checks on.
	 * @param schemeName : The name to don't link (previously clicked).
	 * @return a String listing player's schemes. The scheme currently on selection isn't linkable.
	 */
	private static String getPlayerSchemes(L2PcInstance player, String schemeName)
	{
		final Map<String, ArrayList<Integer>> schemes = BufferTable.getInstance().getPlayerSchemes(player.getObjectId());
		if (schemes == null || schemes.isEmpty())
			return "<table bgcolor=000000 width =300><tr><td align=center width=300><font color=\"3399CC\">Please create at least one scheme.</font></td></tr></table>";
		
		final StringBuilder sb = new StringBuilder(200);
		sb.append("<table bgcolor=000000 width =300>");
		
		for (Map.Entry<String, ArrayList<Integer>> scheme : schemes.entrySet())
		{
			if (schemeName.equalsIgnoreCase(scheme.getKey()))
				StringUtil.append(sb, "<tr><td align=center width=300>", scheme.getKey(), " (<font color=\"LEVEL\">", scheme.getValue().size(), "</font> / ", Config.BUFFER_MAX_SKILLS, " skill(s))</td></tr>");
			else
				StringUtil.append(sb, "<tr><td align=center width=300><font color=\"3399CC\"><a action=\"bypass -h npc_%objectId%_editschemes none ", scheme.getKey(), "\">", scheme.getKey(), " (", scheme.getValue().size(), " / ", Config.BUFFER_MAX_SKILLS, " skill(s))</a></font></td></tr>");
		}
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param player : The player to make checks on.
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 * @return a String representing skills available to selection for a given groupType.
	 */
	private static String getGroupSkillList(L2PcInstance player, String groupType, String schemeName)
	{
		final List<Integer> skills = new ArrayList<>();
		for (int skillId : BufferTable.getSkillsIdsByType(groupType))
		{
			if (BufferTable.getInstance().getSchemeContainsSkill(player.getObjectId(), schemeName, skillId))
				continue;
			
			skills.add(skillId);
		}
		
		if (skills.isEmpty())
			return "That group doesn't contain any skills.";
		
		final StringBuilder sb = new StringBuilder(500);
		
		sb.append("<table>");
		int count = 0;
		for (int skillId : skills)
		{
			if (BufferTable.getInstance().getSchemeContainsSkill(player.getObjectId(), schemeName, skillId))
				continue;
			
			if (count == 0)
				sb.append("<tr>");
			
			if (skillId < 100)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, "\" width=32 height=32 back=\"icon.skill00", skillId, "\" fore=\"icon.skill00", skillId, "\"></td>");
			else if (skillId < 1000)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, "\" width=32 height=32 back=\"icon.skill0", skillId, "\" fore=\"icon.skill0", skillId, "\"></td>");
			else
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillselect ", groupType, " ", schemeName, " ", skillId, "\" width=32 height=32 back=\"icon.skill", skillId, "\" fore=\"icon.skill", skillId, "\"></td>");
			
			count++;
			if (count == 6)
			{
				sb.append("</tr>");
				count = 0;
			}
		}
		
		if (!sb.toString().endsWith("</tr>"))
			sb.append("</tr>");
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param player : The player to make checks on.
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 * @return a String representing a given scheme's content.
	 */
	private static String getPlayerSchemeSkillList(L2PcInstance player, String groupType, String schemeName)
	{
		final List<Integer> skills = BufferTable.getInstance().getScheme(player.getObjectId(), schemeName);
		if (skills.isEmpty())
			return "<font color=\"3399CC\">That scheme is empty.</font>";
		
		final StringBuilder sb = new StringBuilder(500);
		sb.append("<table>");
		int count = 0;
		
		for (int sk : skills)
		{
			if (count == 0)
				sb.append("<tr>");
			
			if (sk < 100)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", sk, "\" width=32 height=32 back=\"icon.skill00", sk, "\" fore=\"icon.skill00", sk, "\"></td>");
			else if (sk < 1000)
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", sk, "\" width=32 height=32 back=\"icon.skill0", sk, "\" fore=\"icon.skill0", sk, "\"></td>");
			else
				StringUtil.append(sb, "<td><button action=\"bypass -h npc_%objectId%_skillunselect ", groupType, " ", schemeName, " ", sk, "\" width=32 height=32 back=\"icon.skill", sk, "\" fore=\"icon.skill", sk, "\"></td>");
			
			count++;
			if (count == 6)
			{
				sb.append("</tr>");
				count = 0;
			}
		}
		
		if (!sb.toString().endsWith("<tr>"))
			sb.append("<tr>");
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param groupType : The group of skills to select.
	 * @param schemeName : The scheme to make check.
	 * @return a string representing all groupTypes availables. The group currently on selection isn't linkable.
	 */
	private static String getTypesFrame(String groupType, String schemeName)
	{
		final StringBuilder sb = new StringBuilder(500);
		sb.append("<table>");
		
		int count = 0;
		for (String s : BufferTable.getSkillTypes())
		{
			if (count == 0)
				sb.append("<tr>");
			
			if (groupType.equalsIgnoreCase(s))
				StringUtil.append(sb, "<td width=65>", s, "</td>");
			else
				StringUtil.append(sb, "<td width=65><a action=\"bypass -h npc_%objectId%_editschemes ", s, " ", schemeName, "\">", s, "</a></td>");
			
			count++;
			if (count == 4)
			{
				sb.append("</tr>");
				count = 0;
			}
		}
		
		if (!sb.toString().endsWith("</tr>"))
			sb.append("</tr>");
		
		sb.append("</table>");
		
		return sb.toString();
	}
	
	/**
	 * @param list : A list of skill ids.
	 * @return a global fee for all skills contained in list.
	 */
	private static int getFee(ArrayList<Integer> list)
	{
		if (Config.BUFFER_STATIC_BUFF_COST >= 0)
			return (list.size() * Config.BUFFER_STATIC_BUFF_COST);
		
		int fee = 0;
		for (int sk : list)
			fee += Config.BUFFER_BUFFLIST.get(sk).getValue();
		
		return fee;
	}
}

Thanks for the quick responce! Seems legit now!  :y u no?:

 

i just compiled with your instance and i didnt get any error...

Posted

Buffs with MANUAL description, so old school :D

Don't talk, you didn't ask me. He was bored and he decided no to write the description in database and load it in every buff base on ID

but write it manually cause he knew you would comment on it. He pwned you.

Posted

Don't talk, you didn't ask me. He was bored and he decided no to write the description in database and load it in every buff base on ID

but write it manually cause he knew you would comment on it. He pwned you.

shhh.jpg

Posted (edited)

Sup, why i always get Application information is incorect.

i added npc to

acis\gameserver\data\xml\npcs\50000-50999

when added files to 

acis\gameserver\data\html\mods\buffer

 

What i`am doing wrong?

Sorry for elpy lvl... 

 

<npc id="50008" idTemplate="30519" name="Tryskell" title="Crappy Buffer">
<set name="level" val="70"/>
<set name="radius" val="7"/>
<set name="height" val="18"/>
<set name="rHand" val="0"/>
<set name="lHand" val="0"/>
<set name="type" val="L2Buffer"/>
<set name="exp" val="0"/>
<set name="sp" val="0"/>
<set name="hp" val="2444.46819"/>
<set name="mp" val="1345.8"/>
<set name="hpRegen" val="7.5"/>
<set name="mpRegen" val="2.7"/>
<set name="pAtk" val="688.86373"/>
<set name="pDef" val="295.91597"/>
<set name="mAtk" val="470.40463"/>
<set name="mDef" val="216.53847"/>
<set name="crit" val="4"/>
<set name="atkSpd" val="253"/>
<set name="str" val="40"/>
<set name="int" val="21"/>
<set name="dex" val="30"/>
<set name="wit" val="20"/>
<set name="con" val="43"/>
<set name="men" val="20"/>
<set name="corpseTime" val="7"/>
<set name="walkSpd" val="50"/>
<set name="runSpd" val="120"/>
<set name="dropHerbGroup" val="0"/>
<set name="attackRange" val="40"/>
<ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" canMove="true" seedable="false"/>
<skills>
<skill id="4045" level="1"/>
<skill id="4416" level="18"/>
</skills>
</npc>
Edited by hadius
Posted

 

Sup, why i always get Application information is incorect.

i added npc to

acis\gameserver\data\xml\npcs\50000-50999

when added files to 

acis\gameserver\data\html\mods\buffer

 

What i`am doing wrong?

Sorry for elpy lvl... 

 

<npc id="50008" idTemplate="30519" name="Tryskell" title="Crappy Buffer">
<set name="level" val="70"/>
<set name="radius" val="7"/>
<set name="height" val="18"/>
<set name="rHand" val="0"/>
<set name="lHand" val="0"/>
<set name="type" val="L2Buffer"/>
<set name="exp" val="0"/>
<set name="sp" val="0"/>
<set name="hp" val="2444.46819"/>
<set name="mp" val="1345.8"/>
<set name="hpRegen" val="7.5"/>
<set name="mpRegen" val="2.7"/>
<set name="pAtk" val="688.86373"/>
<set name="pDef" val="295.91597"/>
<set name="mAtk" val="470.40463"/>
<set name="mDef" val="216.53847"/>
<set name="crit" val="4"/>
<set name="atkSpd" val="253"/>
<set name="str" val="40"/>
<set name="int" val="21"/>
<set name="dex" val="30"/>
<set name="wit" val="20"/>
<set name="con" val="43"/>
<set name="men" val="20"/>
<set name="corpseTime" val="7"/>
<set name="walkSpd" val="50"/>
<set name="runSpd" val="120"/>
<set name="dropHerbGroup" val="0"/>
<set name="attackRange" val="40"/>
<ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" canMove="true" seedable="false"/>
<skills>
<skill id="4045" level="1"/>
<skill id="4416" level="18"/>
</skills>
</npc>

if you use a pack acis already exist you dont have to add new npc 

Posted (edited)

umm . its good one as it simple also but i like old school ;) .. but i have something, i talked to the NPC and chosed manage scheme and select some buffs, songs, dances, and (( Shilen Elder )) i get Critical Error, and when i click on Fighter Set | Mage Set in Full Buff section it cancel all buff i already have.

 

Please follow with the image bellow CFbg.jpg

 

Also Look at this photo, is that fine ?.. 

CTzG.jpg

Edited by thelol

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

    • tratando de crear un GvE tengo problemas con el scripts como no se mucho de esto me estoy ayudando con IA pero no puedo salir de este bache      [06:19:43]  WARN Quest GvE_AI not found! [06:19:45]  WARN Quest GvE_AI not found! [06:19:50]  WARN Quest GvE_AI not found! [06:25:51]  WARN Quest GvE_AI not found!
    • ## [1.5.5] - 2026-02-02   ### ✨ New Features - **Discord Login**: You can now sign in with your Discord account. Admins enable and configure Discord login in **cpadmin → Users** (Discord auth settings: Client ID, Client Secret, Redirect URI). If you already have an account with the same email (e.g. forum, Google, or legacy), signing in with Discord links to that account so you keep one profile. Discord login is available on Add Server, My Servers, Vote page, and Premium Ads booking. - **Setup Links**: In **cpadmin → Users**, both Google and Discord login settings now include direct links to their official developer portals (Google Cloud Console and Discord Developer Portal) for easier OAuth app setup.   ### 🔒 Security - **Email Required for Registration**: New user registration via OAuth (Forum, Google, Discord) now requires a valid email address. If the OAuth provider doesn't provide an email (e.g. unverified Discord email), registration is rejected with a clear message. This prevents anonymous accounts and ensures all users can receive important notifications.   ### 🔄 Improvements - **User Auth Badges**: In **cpadmin → Users**, the Registered Members table now shows auth method badges: **Forum**, **Google**, **Discord**, or **Legacy**. Users can have multiple badges if they've linked multiple login methods. - **Server Info Labels**: Translated server info labels (Owner Name, Language, Server Location) are now properly localized in all 5 languages (English, Spanish, Portuguese, Greek, Russian).   ---   ## [1.5.4] - 2026-02-01   ### ✨ New Features - **Google Login**: You can now sign in with your Google account. Admins enable and configure Google login in **cpadmin → Users** (Google auth settings: Client ID, Client Secret, Redirect URI). If you already have an account with the same email (e.g. forum or legacy), signing in with Google links to that account so you keep one profile. The login menu (navbar and login prompts) offers **Login with Forum Account**, **Login with Google** (when enabled), and **Create Forum Account**. Google login is available on Add Server, My Servers, Profile Settings, Vote page, and Premium Ads booking. - **Ban/Unban Members**: In **cpadmin → Users**, admins can ban or unban registered members. Banned users see a full-page message: "Sorry, you are banned from using this site." When a user is banned, all their servers are set to inactive. - **Moderator Activity Log**: **cpadmin → Moderators** now records when a moderator or admin enters the CPAdmin panel (e.g. "Moderator X entered CPAdmin panel at &lt;time&gt;") and when they change any cpadmin settings (only write actions are logged; read-only use is not). - **Clear Moderator Logs**: Admins can clear all moderator activity log entries via a **Clear logs** button with confirmation. Logs are shown at 100 per page with pagination. - **Filter by Moderator**: In the Moderator Activity Log, a **Filter by moderator** dropdown lets you view activity for a specific moderator or "All moderators." - **cpadmin → Users Tab**: New **Users** tab in the admin panel with Registered Members list (paginated), Google auth settings card, and per-user Ban/Unban and server links.   ### 🔄 Improvements - **cpadmin → Servers**: Each server name in the servers table is now clickable and opens that server’s info page. - **cpadmin → Users – Servers column**: The servers count/list is clickable and opens a small modal listing that user’s servers; each server name in the modal links to the server info page. - **cpadmin → Users – Search**: A search bar above the Registered Members table lets you search by **username**, **email**, or **server name**. Results are filtered on the server (paginated); clearing the search resets the list. - **Moderator Activity Log**: Pagination shows "Showing X–Y of Z" and "Page N of M" with Previous/Next when there are more than 100 entries. - **Login UI**: Login options (Forum, Google, Create account) are shown in a consistent dropdown and in modals (Add Server, My Servers, Vote, Premium Ads) for a clearer sign-in experience. - **Vote Page – Unauthenticated**: When you must log in to vote, the page now shows "Vote for [Server Name]" as the main heading and presents login options in a compact section.   ---   ## [1.5.3] - 2026-01-30   ### ✨ New Features - **File Logs in Admin Panel**: Admins can now view CodeIgniter PHP logs (api/writable/logs) directly in **cpadmin → Logs**. Select a date to view the log file, refresh to reload, or delete all log files to free up space.   ### 🔄 Improvements - **Cache System**: Full cache audit and improvements — when you clear cache in cpadmin, both backend and frontend caches are cleared. Server listings, My Servers, pricing, ad config, and chronicles all refresh with fresh data. New paid servers now appear in listings and My Servers immediately. - **Admin Panel – Server Rates**: Server rates in the admin servers table now display in compact format (e.g. x10000 → x10k, x100000 → x100k, x1000000 → x1m) for easier scanning. Hover to see the full value.
    • WTB High Five source running on Salvation/Fafurion client
    • MoMoProxy has updated more static residential proxies for USA location, anyone interested in can view: https://momoproxy.com/static-residential-proxies
  • 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..