Jump to content

L2J-Mobius (Interlude - HighFive - Goddess of Destruction)


Recommended Posts

  • 2 weeks later...

can some1 help me adapt this code to mobius? ill be glad 

### Eclipse Workspace Patch 1.0
#P aaEpilogue Core Synched
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 11)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -89,6 +89,7 @@
import com.l2jserver.gameserver.instancemanager.ItemsOnGroundManager;
import com.l2jserver.gameserver.instancemanager.QuestManager;
import com.l2jserver.gameserver.instancemanager.SiegeManager;
+import com.l2jserver.gameserver.instancemanager.SoundManager.Versus;
import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
import com.l2jserver.gameserver.model.BlockList;
import com.l2jserver.gameserver.model.Elementals;
@@ -5811,12 +5812,18 @@
}
}
 
+ Versus vs;
+
/**
* Increase the pvp kills count and send the info to the player
*
*/
public void increasePvpKills(L2Character target)
{
+ if (vs == null)
+ vs = new Versus(this);
+ else
+ vs.increaseKills();
if (target instanceof L2PcInstance
&& AntiFeedManager.getInstance().check(this, target))
{
Index: java/com/l2jserver/gameserver/instancemanager/SoundManager.java
===================================================================
--- java/com/l2jserver/gameserver/instancemanager/SoundManager.java (revision 0)
+++ java/com/l2jserver/gameserver/instancemanager/SoundManager.java (working copy)
@@ -0,0 +1,96 @@
+package com.l2jserver.gameserver.instancemanager;
+
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
+import com.l2jserver.gameserver.network.serverpackets.PlaySound;
+import com.l2jserver.util.Rnd;
+
+
+
+public class SoundManager //by xdem
+{
+ final static int MilisBetweenMultiKills = 5000;
+
+ public static enum SoundFile
+ {
+ DUMMY("null"),//1 kill, not used
+ DOUBLE_KILL("doublekill"),
+ TRIPLE_KILL("triplekill"),
+ QUADRA_KILL("quadrakill"),
+ PENTA_KILL("pentakill"),
+ LEGENDARY_KILL("legendary");
+
+ private final String FileName;
+
+ SoundFile(String FileName)
+ {
+ this.FileName = FileName;
+ }
+
+ public String getFileName()
+ {
+ return FileName;
+ }
+
+
+ public static SoundFile getSoundFile(int i)
+ {
+ return SoundFile.values()[i];
+ }
+ }
+
+ public static void playSound(Versus vs)
+ {
+ PlaySound sound;
+ int level = vs.getKillLevel();
+ level = level > 5 ? 5 : level;
+ String s = SoundFile.getSoundFile(level).getFileName()+Rnd.get(1, 3);
+ sound = new PlaySound(1, s, 0, 0, 0, 0, 0);
+ExShowScreenMessage msg = new ExShowScreenMessage(vs.getPlayer().getName() +" has scored a "+SoundFile.getSoundFile(level).toString().replace("_", " ")+"!", 4000);
+ vs.getPlayer().sendPacket(msg);
+ vs.getPlayer().sendPacket(sound);
+ for (L2Character ch : vs.getPlayer().getKnownList().getKnownCharacters())
+ {
+ if (ch instanceof L2PcInstance)
+ {
+ ch.sendPacket(msg);
+ ch.sendPacket(sound);
+ }
+ }
+ }
+
+ public static class Versus
+ {
+ private long _lastKillMs;
+ private int _killLevel;
+ final L2PcInstance _player;
+
+ public Versus(L2PcInstance player)
+ {
+ _player = player;
+ _lastKillMs = System.currentTimeMillis();
+ }
+
+ public void increaseKills()
+ {
+ if (_lastKillMs + MilisBetweenMultiKills > System.currentTimeMillis())
+ _killLevel++;
+ else
+ _killLevel = 0;
+ _lastKillMs = System.currentTimeMillis();
+ if (_killLevel > 0)
+ playSound(this);
+ }
+
+ public int getKillLevel()
+ {
+ return _killLevel;
+ }
+
+ public L2PcInstance getPlayer()
+ {
+ return _player;
+ }
+ }
+}
\ No newline at end of file
Link to comment
Share on other sites

 

can some1 help me adapt this code to mobius? ill be glad 

### Eclipse Workspace Patch 1.0
#P aaEpilogue Core Synched
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 11)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -89,6 +89,7 @@
import com.l2jserver.gameserver.instancemanager.ItemsOnGroundManager;
import com.l2jserver.gameserver.instancemanager.QuestManager;
import com.l2jserver.gameserver.instancemanager.SiegeManager;
+import com.l2jserver.gameserver.instancemanager.SoundManager.Versus;
import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
import com.l2jserver.gameserver.model.BlockList;
import com.l2jserver.gameserver.model.Elementals;
@@ -5811,12 +5812,18 @@
}
}
 
+ Versus vs;
+
/**
* Increase the pvp kills count and send the info to the player
*
*/
public void increasePvpKills(L2Character target)
{
+ if (vs == null)
+ vs = new Versus(this);
+ else
+ vs.increaseKills();
if (target instanceof L2PcInstance
&& AntiFeedManager.getInstance().check(this, target))
{
Index: java/com/l2jserver/gameserver/instancemanager/SoundManager.java
===================================================================
--- java/com/l2jserver/gameserver/instancemanager/SoundManager.java (revision 0)
+++ java/com/l2jserver/gameserver/instancemanager/SoundManager.java (working copy)
@@ -0,0 +1,96 @@
+package com.l2jserver.gameserver.instancemanager;
+
+import com.l2jserver.gameserver.model.actor.L2Character;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
+import com.l2jserver.gameserver.network.serverpackets.PlaySound;
+import com.l2jserver.util.Rnd;
+
+
+
+public class SoundManager //by xdem
+{
+ final static int MilisBetweenMultiKills = 5000;
+
+ public static enum SoundFile
+ {
+ DUMMY("null"),//1 kill, not used
+ DOUBLE_KILL("doublekill"),
+ TRIPLE_KILL("triplekill"),
+ QUADRA_KILL("quadrakill"),
+ PENTA_KILL("pentakill"),
+ LEGENDARY_KILL("legendary");
+
+ private final String FileName;
+
+ SoundFile(String FileName)
+ {
+ this.FileName = FileName;
+ }
+
+ public String getFileName()
+ {
+ return FileName;
+ }
+
+
+ public static SoundFile getSoundFile(int i)
+ {
+ return SoundFile.values()[i];
+ }
+ }
+
+ public static void playSound(Versus vs)
+ {
+ PlaySound sound;
+ int level = vs.getKillLevel();
+ level = level > 5 ? 5 : level;
+ String s = SoundFile.getSoundFile(level).getFileName()+Rnd.get(1, 3);
+ sound = new PlaySound(1, s, 0, 0, 0, 0, 0);
+ExShowScreenMessage msg = new ExShowScreenMessage(vs.getPlayer().getName() +" has scored a "+SoundFile.getSoundFile(level).toString().replace("_", " ")+"!", 4000);
+ vs.getPlayer().sendPacket(msg);
+ vs.getPlayer().sendPacket(sound);
+ for (L2Character ch : vs.getPlayer().getKnownList().getKnownCharacters())
+ {
+ if (ch instanceof L2PcInstance)
+ {
+ ch.sendPacket(msg);
+ ch.sendPacket(sound);
+ }
+ }
+ }
+
+ public static class Versus
+ {
+ private long _lastKillMs;
+ private int _killLevel;
+ final L2PcInstance _player;
+
+ public Versus(L2PcInstance player)
+ {
+ _player = player;
+ _lastKillMs = System.currentTimeMillis();
+ }
+
+ public void increaseKills()
+ {
+ if (_lastKillMs + MilisBetweenMultiKills > System.currentTimeMillis())
+ _killLevel++;
+ else
+ _killLevel = 0;
+ _lastKillMs = System.currentTimeMillis();
+ if (_killLevel > 0)
+ playSound(this);
+ }
+
+ public int getKillLevel()
+ {
+ return _killLevel;
+ }
+
+ public L2PcInstance getPlayer()
+ {
+ return _player;
+ }
+ }
+}
\ No newline at end of file

 

thats my code and for your info its coded in a way that needs the least of adaption, could even work on a different mmo with 2-3 edits and you can't apply it by urself?

Link to comment
Share on other sites

thats my code and for your info its coded in a way that needs the least of adaption, could even work on a different mmo with 2-3 edits and you can't apply it by urself?

Like i said i cant.  :(  

I just take this code from one spanish ( i think) forum posted by You. Unfortunately i dont have skills to adapt it :)) mby if i know actual and correct names of .java to import. 

Link to comment
Share on other sites

Like i said i cant.   :(

I just take this code from one spanish ( i think) forum posted by You. Unfortunately i dont have skills to adapt it :)) mby if i know actual and correct names of .java to import. 

 

I dont have acc on spanish forums, probably a wannabe/leecher pretends my work as his, can you give me a link?

Link to comment
Share on other sites

No, you can use it for an online server as well, not just localhost.

 

 

 

This is error that persisted from several days with external ip. In localhost not have problem.

 

 

 

 

Starting LoginServer.
 
[13:08:37]  INFO Loaded 127 server names
Exception in thread "main" java.net.BindException: Cannot assign requested addre
ss: JVM_Bind
        at java.net.DualStackPlainSocketImpl.bind0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
        at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
        at java.net.PlainSocketImpl.bind(Unknown Source)
        at java.net.ServerSocket.bind(Unknown Source)
        at java.net.ServerSocket.<init>(Unknown Source)
        at lineage2.loginserver.LoginServer.checkFreePorts(LoginServer.java:100)
 
        at lineage2.loginserver.LoginServer.main(LoginServer.java:127)
 
Server terminated abnormaly ...
 
 
Server terminated ...
 
Press any key to continue . . .
 
 
 
 
I've test other servers, HI5 and many datapack and working properly. if you say that can work online, can you help me please?
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...