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

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
Reply to this topic...

×   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

    • Hello, I'm working with custom Icons and noticed that you can use 64x64 icons and the client will handle them without problems in the Inventory and when you Drag them, they look HD so it's really cool, the problem starts when you move them to the shortcut bar, when they're placed there instead of rescaling the icon it just show the upper left corner (so it's 32x32 but showing only the part that fits in that space). I tried checking interface.u but can't find the line where the size for the icons in the shortcut bar are handled.   When in Inventory the item shows in a 32x32 size, if I use a 64x64 icon it re-scales so the icon looks great When dragging the item the image becomes 64x64 which looks pretty big, but it works good When placing the item in the shortcut bar only the top left of the icon is visible   Is there a way I can adjust the shortcut bar so that it re-scales the icon?
    • If you want to edit a large amount of entries in the L2 File-edit I recommend using excel, since both work with columns you can copy the entire file or just a few lines and paste it in excel and it will copy without problems, after you're done with editing you just select the cells and paste them in the .dat file making sure you're formatting correctly. I'm currently doing a massive edit on all gear and that's how i'm handling the .dat work
    • the logic is the "stacking" that is a filter if you use it then the item cannot co-exist (stack)
    • [Exclusive L2Gold Weekend Server] Available ONLY on Saturdays & Sundays – nowhere else, no other time ! Custom Armors (Dynasty, Apella) Custom Weapons (L2Gold Weapons) Custom Jewelry (L2Gold Jewelry) Custom Teleport System Custom AIO Buffer Custom Zones & NPCs Custom Raidboss … and much more waiting for you every weekend! This is not just another private server – it’s a limited-time battleground. When the weekend comes, everyone gathers in one place for the ultimate L2 experience. 👉 Online: Saturday–Sunday only 👉 Contact / Info: [https://www.facebook.com/profile.php?id=61578869175323]
    • ⏳ The price drops like sand slipping down in an hourglass.   📉 USA numbers are already at the lowest 💸 🌍 Next in line: Europe, Asia, and dozens of other countries.     All next week we’ll be actively working on lowering prices. The process has already started  soon costs will be much cheaper. 🔥 Get ready: the price drop will affect every country!   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
  • 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