Jump to content

Recommended Posts

Posted (edited)
Index: dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java
===================================================================
--- dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java   (revision 0)
+++ dist/game/data/scripts/handlers/voicedcommandhandlers/PkHunterVoiced.java   (revision 0)
@@ -0,0 +1,80 @@
+/*
+ * 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 handlers.voicedcommandhandlers;
+
+
+import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.StatsSet;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.PkHunterEvent;
+import com.l2jserver.gameserver.model.skills.l2skills.L2SkillTeleport;
+
+/**
+ *
+ * @author  Wyatt
+ */
+
+public class PkHunterVoiced implements IVoicedCommandHandler
+{
+    private static final String[] VOICED_COMMANDS = { "gopk", "pkinfo"};
+    
+       @Override
+       public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+       {
+               if (command.toLowerCase().equals("gopk"))
+               {
+                       if (activeChar.isFestivalParticipant() || activeChar.isInJail() || activeChar.isInDuel()
+                               || activeChar.isInOlympiadMode() || activeChar.inObserverMode() || PkHunterEvent.isPk(activeChar)
+                               )
+            {
+               activeChar.sendMessage("You can't use this command while participating in the Festival!");
+               return false;
+            }         
+                      
+                       if (PkHunterEvent.isActive())
+                       {
+                               StatsSet set = new StatsSet();
+                               set.set("skill_id", "2525");
+                               set.set("level", "1");
+                               set.set("target", "TARGET_SELF");
+                               set.set("name", "Scroll to move to PkHunter Event area");
+                               set.set("isMagic", "2");
+                               set.set("itemConsumeCount", "0");
+                               set.set("hitTime", "10000");
+                               set.set("operateType", "A1");
+                               set.set("skillType", "TELEPORT");
+                               set.set("teleCoords", PkHunterEvent.getPkLocation()[0]+","+PkHunterEvent.getPkLocation()[1]+","+PkHunterEvent.getPkLocation()[2]);
+                               activeChar.useMagic(new L2SkillTeleport(set), false, true);
+                               activeChar.sendMessage("Moving to PkHunter Event area...");
+                       }
+                       else
+                       {
+                               activeChar.sendMessage("PkHunter Event is not currently active.");
+                               return false;
+                       }
+               }
+               else if (command.toLowerCase().equals("pkinfo"))
+               {
+                       PkHunterEvent.sendLocationMessage(activeChar);
+               }
+               return true;
+       }
+      
+       @Override
+       public String[] getVoicedCommandList()
+       {
+               return VOICED_COMMANDS;
+       }      
+}

Well , I'm trying to make it work on L2jFreya , all fine , just the .gopk not working , and I got this error

Dec 11, 2013 8:21:43 PM com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket run
SEVERE: Client: [Character: asd[268489167] - Account: test - IP: 127.0.0.1] - Failed running: [C] 38 Say2 - L2J Server Version: ${l2j.revision} - DP Revision: ${l2jdp.revision} ; Enum value of type com.l2jserver.gameserver.model.L2Skill$SkillOpType required, but found: A1
java.lang.IllegalArgumentException: Enum value of type com.l2jserver.gameserver.model.L2Skill$SkillOpType required, but found: A1
	at com.l2jserver.gameserver.templates.StatsSet.getEnum(StatsSet.java:412)
	at com.l2jserver.gameserver.model.L2Skill.<init>(L2Skill.java:309)
	at com.l2jserver.gameserver.skills.l2skills.L2SkillTeleport.<init>(L2SkillTeleport.java:43)
	at handlers.voicedcommandhandlers.PkHunterVoiced.useVoicedCommand(PkHunterVoiced.java:60)
	at handlers.chathandlers.ChatAll.handleChat(ChatAll.java:72)
	at com.l2jserver.gameserver.network.clientpackets.Say2.runImpl(Say2.java:219)
	at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62)
	at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1001)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

On eclipse i change this import :  // import com.l2jserver.gameserver.model.StatsSet; //with: import com.l2jserver.gameserver.templates.StatsSet;

 

Im sure this is why i get error , but in freya i cant find the correct import for statsset ... Thats why i guess "soe" not working :/ any ideas were it is located?

Edited by ČυяŞŀŅğ
Posted

 

On eclipse i change this import :  // import com.l2jserver.gameserver.model.StatsSet; //with: import com.l2jserver.gameserver.templates.StatsSet;

 

Im sure this is why i get error , but in freya i cant find the correct import for statsset ... Thats why i guess "soe" not working :/ any ideas were it is located?

 

 

Ctrl + Shift + O to organize imports (it's gonna find the correct location) and you're done :P

Posted

Ctrl + Shift + O to organize imports (it's gonna find the correct location) and you're done :P

 

Well .. very nice trick btw , thank you for this <3 but didnt worked for me , Just added the same port as me xD so the problem remains haha D:

Posted (edited)

Your problem seems to be the operate type. Has not the same name in Freya and H5.

 

  set.set("operateType", "A1");
  <set name="operateType" val="OP_ACTIVE" />
Edited by ^Wyatt
Posted

Found a bug, if you finisht he event through mobs kill, every mob you kill after that you will receive rewards unless someone kills you or time runs out...

Seems that I missed something inside that method, try with this fix.

 

 public static void checkFinishByMobs(L2PcInstance killer)
       {
               if (PkHunterEvent.isPk(killer) && Config.ENABLE_PKHUNTEREVENT)
               {
                       if(killer.getKarma() == 0)
                       {
                               Announcements.getInstance().announceToAll("PkHunter Event ended. "+killer.getName()+" has survived.", true);
-                               PkHunterEvent.setPk(killer);
+                               PkHunterEvent.setPk(null);
                               PkHunterEvent.setActive(false);
                               killer.setTeam(0);
                               endTask();
                               rewardPk(killer);
                       }
               }
       }
Posted

Your problem seems to be the operate type. Has not the same name in Freya and H5.

 

  set.set("operateType", "A1");
  <set name="operateType" val="OP_ACTIVE" />

 

But if i will replace it , sure it will have error :D

                       if (PkHunterEvent.isActive())
                       {
                               StatsSet set = new StatsSet();
                               set.set("skill_id", "2525");
                               set.set("level", "1");
                               set.set("target", "TARGET_SELF");
                               set.set("name", "Scroll to move to PkHunter Event area");
                               set.set("isMagic", "2");
                               set.set("itemConsumeCount", "0");
                               set.set("hitTime", "10000");
                               set.set("operateType", "A1");
                               set.set("skillType", "TELEPORT");
                               set.set("teleCoords", PkHunterEvent.getPkLocation()[0]+","+PkHunterEvent.getPkLocation()[1]+","+PkHunterEvent.getPkLocation()[2]);
                               activeChar.useMagic(new L2SkillTeleport(set), false, true);
                               activeChar.sendMessage("Moving to PkHunter Event area...");
                       }

any idea how i can change it to compare my freya l2j? :)

Posted

But if i will replace it , sure it will have error :D

                       if (PkHunterEvent.isActive())
                       {
                               StatsSet set = new StatsSet();
                               set.set("skill_id", "2525");
                               set.set("level", "1");
                               set.set("target", "TARGET_SELF");
                               set.set("name", "Scroll to move to PkHunter Event area");
                               set.set("isMagic", "2");
                               set.set("itemConsumeCount", "0");
                               set.set("hitTime", "10000");
                               set.set("operateType", "A1");
                               set.set("skillType", "TELEPORT");
                               set.set("teleCoords", PkHunterEvent.getPkLocation()[0]+","+PkHunterEvent.getPkLocation()[1]+","+PkHunterEvent.getPkLocation()[2]);
                               activeChar.useMagic(new L2SkillTeleport(set), false, true);
                               activeChar.sendMessage("Moving to PkHunter Event area...");
                       }
any idea how i can change it to compare my freya l2j? :)

 

"sure" ? ? I mean just change "A1" with "OP_ACTIVE" . . .
Posted
Dec 13, 2013 3:06:39 PM com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket run
SEVERE: Client: [Character: asd[268489167] - Account: test - IP: 127.0.0.1] - Failed running: [C] 38 Say2 - L2J Server Version: ${l2j.revision} - DP Revision: ${l2jdp.revision} ; Enum value of type com.l2jserver.gameserver.model.L2Skill$SkillOpType required, but found: A1
java.lang.IllegalArgumentException: Enum value of type com.l2jserver.gameserver.model.L2Skill$SkillOpType required, but found: A1
	at com.l2jserver.gameserver.templates.StatsSet.getEnum(StatsSet.java:412)
	at com.l2jserver.gameserver.model.L2Skill.<init>(L2Skill.java:309)
	at com.l2jserver.gameserver.skills.l2skills.L2SkillTeleport.<init>(L2SkillTeleport.java:43)
	at handlers.voicedcommandhandlers.PkHunterVoiced.useVoicedCommand(PkHunterVoiced.java:60)
	at handlers.chathandlers.ChatAll.handleChat(ChatAll.java:72)
	at com.l2jserver.gameserver.network.clientpackets.Say2.runImpl(Say2.java:219)
	at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:62)
	at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1001)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

I did what you said , and the problem remains :D any otehr ideas?

Posted (edited)

your log says "e com.l2jserver.gameserver.model.L2Skill$SkillOpType required, but found: A1"->>> "found A1" ->>> that means that you didn't change A1 with OP_ACTIVE...

Edited by ^Wyatt
  • 2 weeks later...
Posted

I've got that error when compiling, any advise?

Compiling 1667 source files to G:\workspace\L2J_Server\build\bin
    [javac] G:\workspace\L2J_Server\java\com\l2jserver\Config.java:2818: error: cannot assign a value to final variable propertySplit
    [javac] 			propertySplit = L2JModSettings.getProperty("PKHunterEventRewards", "14720,5;14721,2").split(";");
Posted

probably you're missing "String [] propertySplit" I guess...

 

this is from original file, see below. I tried to add "String[] propertySplit but it didnt work

ENABLE_PKHUNTEREVENT = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePKHunterEvent", "True"));
			DROP_PKHUNTEREVENT = Boolean.parseBoolean(L2JModSettings.getProperty("PKHunterEventDrop", "False"));
			PKHUNTEREVENT_CHANCE = Integer.parseInt(L2JModSettings.getProperty("PKHunterEventChance", "20"));
			TIME_PKHUNTEREVENT = Integer.parseInt(L2JModSettings.getProperty("PKHunterEventTime", "5"));
			
			if (PKHUNTEREVENT_CHANCE < 1)
			{
				PKHUNTEREVENT_CHANCE = 1;
			}
			PKHUNTEREVENT_REWARD = new ArrayList<>();
			propertySplit = L2JModSettings.getProperty("PKHunterEventRewards", "14720,5;14721,2").split(";");
			
			for (String reward : propertySplit)
			{
				String[] rewardSplit = reward.split(",");
				if (rewardSplit.length != 2)
				{
					_log.warning(StringUtil.concat("PkHunterEvent: invalid config property ->PkHunterEventRewards \"", reward, "\""));
				}
				else
				{
					try
					{
						PKHUNTEREVENT_REWARD.add(new int[]
						{
							Integer.parseInt(rewardSplit[0]),
							Integer.parseInt(rewardSplit[1])
						});
					}
					catch (NumberFormatException nfe)
					{
						if (!reward.isEmpty())
						{
							_log.warning(StringUtil.concat("PkHunterEvent: invalid config property -> PkHunterEventRewards \"", reward, "\""));
						}
					}
				}
			}
			PKHUNTEREVENT_PK_REWARD = new ArrayList<>();
			propertySplit = L2JModSettings.getProperty("PKHunterEventPkRewards", "14720,5;14721,2").split(";");
			
			for (String reward : propertySplit)
			{
				String[] rewardSplit = reward.split(",");
				if (rewardSplit.length != 2)
				{
					_log.warning(StringUtil.concat("PkHunterEvent: invalid config property ->PkHunterEventPkRewards \"", reward, "\""));
				}
				else
				{
					try
					{
						PKHUNTEREVENT_PK_REWARD.add(new int[]
						{
							Integer.parseInt(rewardSplit[0]),
							Integer.parseInt(rewardSplit[1])
						});
					}
					catch (NumberFormatException nfe)
					{
						if (!reward.isEmpty())
						{
							_log.warning(StringUtil.concat("PkHunterEvent: invalid config property -> PkHunterEventPkRewards \"", reward, "\""));
						}
					}
				}
			}
Posted (edited)

try changing the name of that variable

sorry too lazy to open eclipse t.t

Edited by ^Wyatt

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

    • Rosyk or rusik or whatever u blaim me that my mouth stinks but I assume you the one who stinks and your perfect pack will be now shared and you can suck a DICK )  https://eu2.contabostorage.com/d4b39866f6bb4084b6c969ec8fe20063:kita/Lucera_Classic_Remaster/Lucera Classic Remaster Server and Datapack files.rar  https://eu2.contabostorage.com/d4b39866f6bb4084b6c969ec8fe20063:kita/Lucera_Classic_Remaster/Lucera Classic Remaster Eng Client.rar Drama link    For this crap u need Lucera 2 classic license ) people paying 300 euros for this shit  lol Some Shit will come out soon mxc website need shake it a bit coz getting boring here )    Whats happen rosyk lost speach  xD Your pack was downloded  29 times bussines  not going as plan xD?
    • @Huggo Thank you for asking! When you join our Discord, on the Nexus Marketing section there is a #work-showcase channel. There you can see a little bit of what we are able to produce as a final ready-to-post product.  There is also this link in my new personal montage YouTube channel, in which I will be uploading every recent work: https://youtube.com/playlist?list=PLkzBKexKw8Wj8dC2diYndd5yOWOXUQCJW&si=-HGxlovqzvD4qqy2 Two more videos are coming up this week, and a #reviews channel has opened for our clients to let other people know about their experience working with us. Feel free to join our Hub in Discord, and for any inquries you might have don't hesitate to contact me or post your suggestion at #suggestions channel.  
    • Следи за своим вонючим языком, мудак.   Your mouth stinks, go wash your mouth, it's a dump) I don't know who you are or what you are, and I don't recommend buying anything from people outside of my network, as they may sell garbage under the guise of my work. There have been cases where my sales have been compromised. Additionally, reselling below the purchase price has been prohibited. I wish you all the best and peace. I kindly request that the moderators close this topic, as it is no longer relevant and the contact information is outdated.    
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock