Jump to content

Recommended Posts

  • 2 weeks later...
Posted

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
Posted

 

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?

Posted

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. 

Posted

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?

Posted

This project lindvior cannot play online, only play localhost... -.-

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

Posted

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?
Guest
This topic is now closed to further replies.



  • Posts

    • Want to promote your projects, scale traffic, or launch unrestricted campaigns? Ready-made Telegram groups and channels are the perfect solution for marketing, lead generation, and service promotion. ➡ High quality, affordable prices — from $1.8 Promo code: TGJULY (10% discount) Payment methods: bank cards · crypto · other popular options How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Available options: ✉ Groups IMPORT and REAL | From 2014 to 2024 to choose from! | For safe invites | Affordable and high quality! | Price from $1.8 ✉ Telegram Real Old Channels (2022–2023: choose the year) | Real channels | Ownership transferred to your account | Price from $3 Regular customers receive additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ ✉ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Discuss wholesale orders — Propose partnerships (current list: https://socnet.bgng.io/partners) — Become a supplier SocNet — Digital Goods & Premium Subscriptions Store
    • Want to promote your projects, scale traffic, or launch unrestricted campaigns? Ready-made Telegram groups and channels are the perfect solution for marketing, lead generation, and service promotion. ➡ High quality, affordable prices — from $1.8 Promo code: TGJULY (10% discount) Payment methods: bank cards · crypto · other popular options How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Available options: ✉ Groups IMPORT and REAL | From 2014 to 2024 to choose from! | For safe invites | Affordable and high quality! | Price from $1.8 ✉ Telegram Real Old Channels (2022–2023: choose the year) | Real channels | Ownership transferred to your account | Price from $3 Regular customers receive additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ ✉ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Discuss wholesale orders — Propose partnerships (current list: https://socnet.bgng.io/partners) — Become a supplier SocNet — Digital Goods & Premium Subscriptions Store
    • Lots of RUSaCis in your project, they all buy and sell the same thing.  
  • 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