Jump to content

Question

Posted (edited)

Hello community, i never write anything here, i just wonder, how can i set some code to check if the members of a clan are dualboxing, because i adapted reborn12 Clan reward from acis, and the rewards are working good, this is the code i can manage to make it work:
(Also i don't know how to make a list to add all clan lvl 6 skills.)

Once is finished i want to share it with the htmls.

Dont know why do not add the skills to the clan

 



 

package com.l2jserver.gameserver.model.actor.instance;

import java.util.Map;
import java.util.StringTokenizer;

import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.datatables.SkillData;
import com.l2jserver.gameserver.enums.InstanceType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.AcquireSkillDone;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
import com.l2jserver.gameserver.network.serverpackets.EtcStatusUpdate;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.network.serverpackets.ValidateLocation;

/**
 * @author Reborn12
 */
public class L2ClanManagerInstance extends L2Npc
{
	
	public static Map<Integer, Integer> CLAN_SKILLS;
	
	public L2ClanManagerInstance(L2NpcTemplate template)
	{
		super(template);
		setInstanceType(InstanceType.L2ClanManagerInstance);
	}
	
	public int[] clanSkills =
		 {
			391, 370, 371, 373, 374, 376, 377, 379, 383	 
		 };

	public void onBypassFeedback(L2PcInstance player, String command)
	{
		StringTokenizer st = new StringTokenizer(command, " ");
		String actualCommand = st.nextToken();
		
		if (actualCommand.startsWith("mainHtml"))
		{
			showMainHtml(player, "data/html/mods/ClanManager/main.htm");
		}
		else if (actualCommand.startsWith("clanreward"))
		{
			showMainHtml(player, "data/html/mods/ClanManager/clanreward.htm");
		}
		else if (actualCommand.startsWith("getclanreward"))
		{
			
		if (player.getClan() == null)
		{
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "You don't have a clan."));
			return;
		}
		else if ((player.getClan() == null) || (!player.isClanLeader()))
		{
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "You need to be a Clan leader to take this reward."));
			return;
		}
		else if (player.getClan().getLevel() <= 4)
		{
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "Your clan need to be at least Lvl 5!"));
			return;
		}
		else if (player.getClan().getLevel() >= 6)
		{
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "Your clan is already Lv 6 or more!"));
			return;	
		}
		
		else if (player.getClan().getMembersCount() <= 14)
		{
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "You need minimum 15 members."));
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "Members amount: " + (player.getClan().getMembersCount()) + "."));
			return ;	
		}
		else if (player.getClan().getOnlineMembersCount() <= 9)
		{
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "You need minimum 10 members online."));
			player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "Members online: " + (player.getClan().getMembersCount()) + "."));
			return;	
		}
		else if (player.isClanLeader() && player.getClan().getMembersCount() >= 15 && player.getClan().getOnlineMembersCount() >= 10)
			{
				player.getClan().changeLevel(6);
                
				//Ids> 391, 370, 371, 373, 374, 376, 377, 379, 383
				for (int s : clanSkills)
				{
					Skill clanSkill = SkillData.getInstance().getInfo(s, SkillData.getInstance().getMaxLevel(s));
					player.getClan().addNewSkill(clanSkill);
					player.getClan().broadcastClanStatus();
				}
				player.getClan().addReputationScore(15000, true);
				player.sendPacket(new EtcStatusUpdate(player));
			    player.sendPacket(new AcquireSkillDone());
				player.sendPacket(new CreatureSay(0, Say2.BATTLEFIELD, "Clan Manager", "Congratulations, Your clan has been rewarded!."));
			}

				
		}
		else
			super.onBypassFeedback(player, command);
	}
	@Override
	public void onAction(L2PcInstance player)
	{
		if (this != player.getTarget())
		{
			player.setTarget(this);
			player.sendPacket(new ValidateLocation(player));
		}
		else if (isInsideRadius(player, 100, false, false))
		{
			player.setLastFolkNPC(this);
			showMainHtml(player, "data/html/mods/ClanManager/main.htm");
			player.sendPacket(ActionFailed.STATIC_PACKET);
		}
		else
		{
			player.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, this);
			player.sendPacket(ActionFailed.STATIC_PACKET);
		}
	}
	
	private void showMainHtml(L2PcInstance player, String file)
	{
		String filename = HtmCache.getInstance().getHtm(file);
		if (filename != null)
		{
			NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
			html.setHtml(filename);
			html.replace("%objectId%", String.valueOf(getObjectId()));
			html.replace("%charname%", player.getName());
			player.sendPacket(html);
			filename = null;
			html = null;
		}
	}
}

 

Clan 6 or more.jpg

Clan leader.jpg

Clan lvl 5 required.jpg

clanreward1.jpg

Edited by JackCerutti

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.


  • Posts

    • Γεια σε ολους, προσπαθω εδω και 2 μερες να κανω αυτο το πραγμα να λειτουργει. το καταφερα για ενα διαστημα 5 ωρων. αλλα φαινεται οτι το discord μου κανει block to dll. ή κατι αλλο που δεν μπορω να ειμαι σιγουρος για το τι φταιει... αν καποιος γνωριζει κατι ας στειλει ενα pm να το δουμε μαζι.  *το source το εφιαξα εγω. https://youtu.be/kMvrbo9VBZc  ενα βιντεο που δειχνει πως δουλευε πριν σταματησει να δουλευει...   
    • thank you, please move to the desired category
    • wrong section, you need move this post to https://maxcheaters.com/forum/72-marketplace-l2packs-files/
    • Unlock Unlimited Access with GoProxy's Residential Proxies!   Experience seamless, secure, and unrestricted connectivity worldwide with GoProxy's Unlimited Residential Proxies. Our service offers access to a global network of rotating residential IPs, ensuring top performance for your large-scale data collection, streaming, and more.     ✔️Unlimited Traffic & IPs: Enjoy unrestricted access with our rotating residential proxies, delivering high performance through a vast global IP pool. ✔️High Success Rate: Achieve a 99.96% success rate with a rapid 0.6-second response time, ensuring efficient and reliable operations. ✔️Flexible Sessions: Customize IP rotation to fit your project needs, with options for automatic rotation and sticky sessions lasting up to 60 minutes. ✔️Global Coverage: Access IPs from over 120 countries, making it ideal for businesses requiring high bandwidth without region-specific constraints.     All plans include unlimited traffic and IPs, unlimited concurrent requests, and access to real residential IP addresses. Elevate your online operations with GoProxy's Unlimited Residential Proxies—your smart choice for large-scale projects.   👉 Learn more and get started today: GoProxy Unlimited Proxies
  • Topics

×
×
  • Create New...