Jump to content
  • 0

Save the place before teleportation aCis


Question

Posted

Hello, I wanted to know how I can save a coordinate, because on my tvt when the event ends I'm teleported to giran I would like to know how I can get where I was

 

This instead of putting me where I was, leaves me in the same place after the event ends.

 


int[] playerCoordinates = new int[]
                        {
                        player.getPosition().getX(),
                        player.getPosition().getY(),
                        player.getPosition().getZ(),
                        player.getPosition().getHeading()
                        };
                    
                    new EventTeleporter(player, playerCoordinates, false);
 

                   

Recommended Posts

  • 0
Posted
1 hour ago, Nightw0lf said:

newbie approach, if they get dc this info is lost xD

That's why I said later to change return into teleport to town. There is no real need to store place they were, just fancy crap. So, if it exists teleport to the same place, otherwise tele to town. It's enough :p

 

It's bad code, but WORKS! :D

  • 0
Posted
On 18/4/2018 at 6:30 AM, melron said:

before the teleport begins (to the arena) , store their location in a map

  • 0
Posted
3 hours ago, l2jkain said:

 

no matter what place it does not work

 

I removed all restriction of the same only let the tvt and the npc register does not always work that message should be aCis bug

No Isn't acis bug. It works for me. Players teleporting on their saved location normally. Use eclipse search for this error. Probably something goes wrong on Player.java
By default, while you use observer in game (Observer or oly maches) you cannot target/hit players etc. That's your "bug", when you try to save the location the player automatic get _observerMode = true;

  • 0
Posted

He had there an (new class, which is lol) teleportation method. Probably that's the issue. Anyway, we can't help him when he fail with provided, working, code.

  • 0
Posted (edited)
5 horas atrás, 'Baggos' disse:

Não é um bug acis. Funciona para mim. Jogadores que se teletransportam em sua localização salva normalmente. Use a pesquisa do eclipse para este erro. Provavelmente algo dá errado no Player.java
Por padrão, enquanto você usa o observador no jogo (Observer ou oly maches) você não pode mirar / acertar jogadores, etc. Esse é o seu "bug", quando você tenta salvar a localização automática do player _observerMode = verdade;

 

5 horas atrás, SweeTs disse:

Ele tinha lá um método de teletransporte (nova classe, que é lol). Provavelmente é esse o problema. De qualquer forma, não podemos ajudá-lo quando ele falha com o código fornecido, funcionando.

 

plMrr1E.png

 

Meu código, eu não consigo encontrar o erro de qualquer maneira eu vou remover o teleport e fazer alguns testes para ver o que eu posso fazer melhor.

 

https://pastebin.com/raw/x9GwZugx

 

não há nada errado com o erro Player.java é gerado por

 

player.getSavedLocation (). set (player.getPosition ());

 

// / implementa Runnable e inicia-se no construtor
+ new EventTeleport (player, team.getCoordinates (), false, false); << --- está salvando o local desde o início, mas entra no modo de exibição

 

There is nothing wrong here Player.java that gives this error

 


Index: java/net/sf/l2j/gameserver/model/actor/instance/Player.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/Player.java    (revision 2)
+++ java/net/sf/l2j/gameserver/model/actor/instance/Player.java    (working copy)
@@ -105,6 +105,7 @@
 import net.sf.l2j.gameserver.model.entity.Hero;
 import net.sf.l2j.gameserver.model.entity.Siege;
 import net.sf.l2j.gameserver.model.entity.Siege.SiegeSide;
+import net.sf.l2j.gameserver.model.entity.engine.TeamVsTeam;
 import net.sf.l2j.gameserver.model.group.CommandChannel;
 import net.sf.l2j.gameserver.model.group.Party;
 import net.sf.l2j.gameserver.model.group.Party.LootRule;
@@ -578,6 +579,9 @@
     
     private Door _requestedGate;
     
+    private int _eventkills;
+    private short _points = 0;
+    
     /**
      * Constructor of Player (use Creature constructor).
      * <ul>
@@ -2897,6 +2901,13 @@
     @Override
     public void onAction(Player player)
     {
+        // Check if this Player is in an event
+        if (!TeamVsTeam.onAction(player.getName(), getName())) 
+        {
+            player.sendPacket(ActionFailed.STATIC_PACKET);
+            return;
+        }
+        
         // Set the target of the player
         if (player.getTarget() != this)
             player.setTarget(this);
@@ -2908,7 +2919,7 @@
                 player.getAI().setIntention(CtrlIntention.INTERACT, this);
                 return;
             }
-            
+    
             // Check if this Player is autoAttackable
             if (isAutoAttackable(player))
             {
@@ -2941,6 +2952,13 @@
     {
         if (player.isGM())
             AdminEditChar.showCharacterInfo(player, this);
+
+        // Check if this Player is in an event
+        if (!TeamVsTeam.onAction(player.getName(), getName())) 
+        {
+            player.sendPacket(ActionFailed.STATIC_PACKET);
+            return;
+        }
         
         super.onActionShift(player);
     }
@@ -3649,16 +3667,21 @@
         if (isMounted())
             stopFeed();
         
+        // kill the player in event
+        getEventKills();
+        
         synchronized (this)
         {
             if (isFakeDeath())
                 stopFakeDeath(true);
         }
         
+        TeamVsTeam.onKill(killer, this);
+        
         if (killer != null)
         {
             Player pk = killer.getActingPlayer();
-            
+
             // Clear resurrect xp calculation
             setExpBeforeDeath(0);
             
@@ -3896,6 +3919,9 @@
         if (player == null)
             return;
         
+        if (isInFunEvent() == false)
+            return;
+        
         if (isInDuel() && player.getDuelId() == getDuelId())
             return;
         
@@ -6296,6 +6322,10 @@
         if (attacker instanceof Monster)
             return true;
         
+        // Check if the attacker is in events started
+        if (isInFunEvent())
+            return true;
+        
         // Check if the attacker is not in the same party
         if (_party != null && _party.containsPlayer(attacker))
             return false;
@@ -9278,6 +9308,9 @@
                 
                 if (OlympiadManager.getInstance().isRegisteredInComp(this))
                     OlympiadManager.getInstance().removeDisconnectedCompetitor(this);
+
+                if (isInFunEvent())
+                    TeamVsTeam.removeParticipant(getName());
                 
                 // Open a Html message to inform the player
                 final NpcHtmlMessage html = new NpcHtmlMessage(0);
@@ -9425,7 +9458,7 @@
         if (_deathPenaltyBuffLevel >= 15) // maximum level reached
             return;
         
-        if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof Player) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE)))
+        if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof Player) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE)) && isInFunEvent())
         {
             if (_deathPenaltyBuffLevel != 0)
                 removeSkill(5076, false);
@@ -9808,7 +9841,7 @@
         if (summonerChar == null)
             return false;
         
-        if (summonerChar.isInOlympiadMode() || summonerChar.isInObserverMode() || summonerChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND) || summonerChar.isMounted())
+        if (summonerChar.isInFunEvent() || summonerChar.isInOlympiadMode() || summonerChar.isInObserverMode() || summonerChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND) || summonerChar.isMounted())
             return false;
         
         return true;
@@ -9845,7 +9878,7 @@
             return false;
         }
         
-        if (targetChar.isFestivalParticipant() || targetChar.isMounted())
+        if (targetChar.isFestivalParticipant() || targetChar.isMounted() || targetChar.isInFunEvent())
         {
             summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
             return false;
@@ -10237,4 +10270,34 @@
             }
         }
     }
+
+    public int getEventKills()
+    {
+        return _eventkills;
+    }
+
+    public void increaseKills()
+    {
+        _eventkills++;
+    }
+    
+    public short getScore()
+    {
+        return _points;
+    }
+
+    public void clearPoints()
+    {
+        _points = 0;
+    }
+    
+    public void increaseScore()
+    {
+        _points++;
+    }
+    
+    public boolean isInFunEvent()
+    {
+        return ((TeamVsTeam.isStarted() && TeamVsTeam.isPlayerParticipant(getName())) && !isGM());
+    }
 }

Edited by l2jkain

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

    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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