Jump to content
  • 0

Looking For Help


GoldenNightmare

Question

hello im using l2j i added this code is for when player participate in olympiad can also observe match while is registered i added this code i can see match while im register all good but when match is going to start and u are in observe mode match wont start and you are losing points please help

 

### Eclipse Workspace Patch 1.0
#P L2J_Server_BETA
Index: java/com/l2jserver/gameserver/model/olympiad/OlympiadGameTask.java
===================================================================
--- java/com/l2jserver/gameserver/model/olympiad/OlympiadGameTask.java  (revision 5214)
+++ java/com/l2jserver/gameserver/model/olympiad/OlympiadGameTask.java  (working copy)
@@ -19,6 +19,8 @@


 import com.l2jserver.Config;
 import com.l2jserver.gameserver.ThreadPoolManager;
+import com.l2jserver.gameserver.model.L2World;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.zone.type.L2OlympiadStadiumZone;
 import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
@@ -305,7 +307,19 @@
            // Checking for opponents and teleporting to arena
            if (_game.checkDefaulted())
                return false;
-
+          
+           String[] _task = _game.getPlayerNames();
+          
+           L2PcInstance Player1 = L2World.getInstance().getPlayer(_task[0]);
+          
+           L2PcInstance Player2 = L2World.getInstance().getPlayer(_task[1]);
+          
+           if(Player1.inObserverMode())
+               Player1.leaveOlympiadObserverMode();
+          
+           if(Player2.inObserverMode())
+               Player2.leaveOlympiadObserverMode();
+          
            _zone.closeDoors();
            if (_game.needBuffers())
                _zone.spawnBuffers();
### Eclipse Workspace Patch 1.0
#P L2J_DataPack_BETA
Index: dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java
===================================================================
--- dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (revision 8719)
+++ dist/game/data/scripts/handlers/bypasshandlers/OlympiadObservation.java (working copy)
@@ -24,8 +24,6 @@
 import com.l2jserver.gameserver.model.olympiad.Olympiad;
 import com.l2jserver.gameserver.model.olympiad.OlympiadGameManager;
 import com.l2jserver.gameserver.model.olympiad.OlympiadGameTask;
-import com.l2jserver.gameserver.model.olympiad.OlympiadManager;
-import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
 import com.l2jserver.util.StringUtil;


@@ -206,11 +204,11 @@
           
            if (isManager)
            {
-               if (OlympiadManager.getInstance().isRegisteredInComp(activeChar))
+               /*if (OlympiadManager.getInstance().isRegisteredInComp(activeChar))
                {
                    activeChar.sendPacket(SystemMessageId.WHILE_YOU_ARE_ON_THE_WAITING_LIST_YOU_ARE_NOT_ALLOWED_TO_WATCH_THE_GAME);
                    return false;
-               }
+               }*/
                if (!TvTEvent.isInactive() && TvTEvent.isPlayerParticipant(activeChar.getObjectId()))
                {
                    activeChar.sendMessage("You can not observe games while registered for TvT");

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You setted leaveOlympiadObserverMode() AFTER checkDefaulted(), which checks numerous things, notably observer mode. It has to be setted BEFORE, and the observer mode check must be deleted from checkDefaulted() too.

 

Secondly, you can use 

_playerOne.player
_playerTwo.player

(or maybe getPlayer() depending what L2J rev you use) to retrieve L2PcInstance, avoiding your L2World stuff.

Edited by Tryskell
Link to comment
Share on other sites

  • 0

need a small rework to use players out of abstractions

 

p.s. the patch can possible cause client errors and u can end just like him

doom-3.jpg

Edited by BruT
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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

    • Nexaslim Weight Loss Supplement Reviews (2024) – Experience the transformative power of Beta-hydroxybutyrate (BHB), a potent fat-burning ketone meticulously crafted to ignite natural weight loss. As the primary substrate that initiates ketosis, BHB swiftly propels your metabolism into action. Upon commencing your regimen, BHB promptly facilitates the transition into ketosis, fostering heightened energy levels and weight reduction advantages. NexaSlim groundbreaking formulation harnesses the unparalleled potential of this singular BHB, prompting a wave of excitement in the media. Benefits of Nexaslim Ketosis:   ·         Lose Weight ·         Burn Fat in Trouble Areas ·         Get into Ketosis Fast! ·         Burn Fat for Energy (without the jitters)! ·         Better Brain Health! ·         Faster Recovery from Exercise! ·         Maintain Lean Muscle! Ready to transform your body? Click here to buy your NexaSlim Weight Loss Pills! now!   The enduring presence of NexaSlim with BHB is a testament to its remarkable achievements, as individuals continue to experience unparalleled success, shedding up to 1 kg of fat daily! Nexa Slim is designed with a comprehensive approach to support your journey toward wellness. It aims to complement the body's natural process of energy utilization, focusing on supporting the metabolic state known as ketosis, where the body can use fat as an energy source. Nexaslim, Nexa Slim Reviews, Nexaslim Weight Loss Ingredients, Benefits, Works, Side Effects, Price & Buy from the Official Website   https://supplementrange.com/nexaslim-norway/   https://supplementrange.com/nexaslim-reviews/   https://supplementrange.com/lepticell-reviews/   https://supplementrange.com/nexalyn-male-enhancement/   https://supplementrange.com/cerebrozen-reviews/   https://supplementrange.com/sugar-defender/   https://supplementrange.com/
    • LGBTQ!! ⋐⋑ (209) 876-5519 Love Spells In Atlanta, GA Psychic Reading Black Magic Spells Marriage spells Divorce spells Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don’t think legitimate. Your lover has gone with someone else Don’t hesitate to break them up as this ritual and prayer is very powerful and will Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you.
    • Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don’t think legitimate. Your lover has gone with someone else Don’t hesitate to break them up as this ritual and prayer is very powerful and will Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you.
    • Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don’t think legitimate. Your lover has gone with someone else Don’t hesitate to break them up as this ritual and prayer is very powerful and will Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you.
    • Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you. BREAK UP A RELATIONSHIP The perfect service to break up a relationship you don’t think legitimate. Your lover has gone with someone else Don’t hesitate to break them up as this ritual and prayer is very powerful and will Psychic Readings | Astrology | Love Spells | Black Magic spells | Witchcraft Spells | Spell Caster | Voodoo spells | Marriage spells | Divorce spells | Attraction spells | Bring back lost lover spells REUNITE WITH AN EX LOVER IN 72 HOURS If your lover is gone, don’t be desperate anymore! You are a few clicks away from a prompt resolution of your problem: We will our spiritual powers to bring him/her back Let us show you our method with zero chances of rejection. Don’t waste your precious time; get your lover back NOW! MAKE HIM/HER LOVE ME Don’t wait for the deluge and make him or her love you now. This service will create a great alchemy between this person and you. In just a few weeks, you can make the person you dream of falling in love with you. We recommend you to combine this service with a Marriage ritual if you want this person to commit you.
  • Topics

×
×
  • Create New...