Ir para conteúdo
  • Cadastre-se
  • 0

Mod Pop-up Accept Event para Acis


Weyne Castro

Pergunta

 

 

Estou com esse mod do l2mega mas nao sei adaptar para o acis. Alguem teria ele ou poderia adaptar? Agradeco demais

 

diff --git a/java/com/l2jmega/events/TvT.java b/java/com/l2jmega/events/TvT.java
index 4339c75..e5ed611 100644
--- a/java/com/l2jmega/events/TvT.java
+++ b/java/com/l2jmega/events/TvT.java
@@ -762,7 +762,8 @@
         _inProgress = true;
         _joining = true;
         spawnEventNpc();
-        Announcement.Announce("TvT: " + _eventDesc + "!");
+        
+        Announcement.TvTAnnounce("TvT: " + _eventDesc + "!");
         
         Announcement.Announce("TvT: Joinable in " + _joiningLocationName);
         
diff --git a/java/com/l2jmega/gameserver/model/Announcement.java b/java/com/l2jmega/gameserver/model/Announcement.java
index 53c580b..e1906e7 100644
--- a/java/com/l2jmega/gameserver/model/Announcement.java
+++ b/java/com/l2jmega/gameserver/model/Announcement.java
@@ -5,7 +5,9 @@
 import com.l2jmega.commons.concurrent.ThreadPool;
 
 import com.l2jmega.Config;
+import com.l2jmega.events.TvT;
 import com.l2jmega.gameserver.model.actor.instance.Player;
+import com.l2jmega.gameserver.model.base.ClassId;
 import com.l2jmega.gameserver.model.location.SpawnLocation;
 import com.l2jmega.gameserver.model.zone.ZoneId;
 import com.l2jmega.gameserver.network.SystemMessageId;
@@ -58,7 +60,7 @@
                     _task = ThreadPool.scheduleAtFixedRate(this, _initialDelay * 1000, _delay * 1000); // self schedule at fixed rate
                     _unlimited = true;
                     break;
-                
+                    
                 default:
                     _task = ThreadPool.schedule(this, _initialDelay * 1000); // self schedule (initial)
                     _tempLimit = _limit;
@@ -132,7 +134,7 @@
                     _task = ThreadPool.scheduleAtFixedRate(this, _initialDelay * 1000, _delay * 1000); // self schedule at fixed rate
                     _unlimited = true;
                     break;
-                
+                    
                 default:
                     _task = ThreadPool.schedule(this, _initialDelay * 1000); // self schedule (initial)
                     _tempLimit = _limit;
@@ -216,6 +218,47 @@
         }
     }
     
+    public static boolean tvt_register = false;
+    
+    public static void TvTAnnounce(String text)
+    {
+        tvt_register = true;
+        
+        CreatureSay cs = new CreatureSay(0, 18, "", "" + text);
+        
+        for (Player player : World.getInstance().getPlayers())
+        {
+            if (player != null && player.isOnline())
+            {
+                player.sendPacket(cs);
+                
+                ThreadPool.schedule(new Runnable()
+                {
+                    @Override
+                    public void run()
+                    {
+                        tvt_register = false;
+                    }
+                }, 46000);
+                
+                final boolean bishop = (player.getClassId() == ClassId.BISHOP || player.getClassId() == ClassId.CARDINAL || player.getClassId() == ClassId.SHILLIEN_ELDER || player.getClassId() == ClassId.SHILLIEN_SAINT || player.getClassId() == ClassId.EVAS_SAINT || player.getClassId() == ClassId.ELVEN_ELDER);
+                
+                if (!(player.isOlympiadProtection() || player.getLevel() < TvT.get_minlvl() || player.getLevel() > TvT.get_maxlvl() || player.isCursedWeaponEquipped() || player.isInObserverMode() || player.getFirstLog() || player._inEventCTF || player.isAio() || bishop) && Config.SCREN_MSG)
+                {
+                    SpawnLocation _position = new SpawnLocation(TvT._npcX, TvT._npcY, TvT._npcX, 0);
+                    ConfirmDlg confirm = new ConfirmDlg(SystemMessageId.EVENT.getId());
+                    confirm.addString("~~> Team VS Team, Want to register? ");
+                    confirm.addZoneName(_position);
+                    confirm.addTime(45000);
+                    confirm.addRequesterId(player.getObjectId());
+                    player.sendPacket(confirm);
+                }
+            }
+        }
+        
+        cs = null;
+    }
+    
     public static boolean isSummoning = false;
     
     public static void ArenaAnnounce(String text)
@@ -229,33 +272,33 @@
             if (player != null && player.isOnline())
             {
                 player.sendPacket(cs);

         
diff --git a/java/com/l2jmega/gameserver/network/SystemMessageId.java b/java/com/l2jmega/gameserver/network/SystemMessageId.java
index 9c89f48..77a5c12 100644
--- a/java/com/l2jmega/gameserver/network/SystemMessageId.java
+++ b/java/com/l2jmega/gameserver/network/SystemMessageId.java
@@ -11798,6 +11798,8 @@
      */
     public static final SystemMessageId PLEASE_WAIT_A_MOMENT;
     
+    public static final SystemMessageId EVENT;
+    
     /**
      * Array containing all SystemMessageIds<br>
      * Important: Always initialize with a length of the highest SystemMessageId + 1!!!
@@ -13766,6 +13768,7 @@
         S1_CANNOT_PARTICIPATE_IN_OLYMPIAD_DURING_TELEPORT = new SystemMessageId(2029);
         CURRENTLY_LOGGING_IN = new SystemMessageId(2030);
         PLEASE_WAIT_A_MOMENT = new SystemMessageId(2031);
+        EVENT = new SystemMessageId(2500);
         
         buildFastLookupTable();
     }
diff --git a/java/com/l2jmega/gameserver/network/clientpackets/DlgAnswer.java b/java/com/l2jmega/gameserver/network/clientpackets/DlgAnswer.java
index eb4a65d..e3cfd55 100644
--- a/java/com/l2jmega/gameserver/network/clientpackets/DlgAnswer.java
+++ b/java/com/l2jmega/gameserver/network/clientpackets/DlgAnswer.java
@@ -2,6 +2,7 @@
 
 import com.l2jmega.Config;
 import com.l2jmega.gameserver.handler.admincommandhandlers.AdminRecallAll;
+import com.l2jmega.gameserver.handler.voicedcommandhandlers.VoicedEvent;
 import com.l2jmega.gameserver.model.Announcement;
 import com.l2jmega.gameserver.model.actor.instance.Player;
 import com.l2jmega.gameserver.network.SystemMessageId;
@@ -42,6 +43,11 @@
                 activeChar.teleportAnswer(this._answer, this._requesterId);
               } 
         }
+        else if (_messageId == SystemMessageId.EVENT.getId())
+        {
+            if (Announcement.tvt_register == true && _answer == 1)
+                VoicedEvent.JoinTvT(activeChar);
+        }
         else if (_messageId == 1983 && Config.ALLOW_WEDDING)
             activeChar.engageAnswer(_answer);
         else if (_messageId == SystemMessageId.WOULD_YOU_LIKE_TO_OPEN_THE_GATE.getId())
        
 

 

weyneeeee

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts recomendados

Até agora não há respostas para essa pergunta

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.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  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.

Processando...



×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.