Jump to content

Question

Posted (edited)

Hi everybody ! i need some help with the TVT event, is working everything fine but the teleport to arena is not .

i have set te coords in events.properities but when event start the characters stay in the same place, 

 

i think the problem is here, but i dont know ...  im working with an old rev of Acis... hope you can help me guys .. 

 

Thank you !
 

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.events;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.L2Summon;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

public class TvTEventTeleport implements Runnable
{
   /** Gives Noblesse to players */
   static L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
   /** The instance of the player to teleport */
   public L2PcInstance _playerInstance;
   /** Coordinates of the spot to teleport to */
   public int[] _coordinates = new int[3];
   /** Admin removed this player from event */
   private boolean _adminRemove;
  
   /**
    * Initialize the teleporter and start the delayed task
    * @param playerInstance
    * @param coordinates
    * @param fastSchedule
    * @param adminRemove
    */
   public TvTEventTeleport(L2PcInstance playerInstance, int[] coordinates, boolean fastSchedule, boolean adminRemove)
   {
       _playerInstance = playerInstance;
       _coordinates = coordinates;
       _adminRemove = adminRemove;
      
       // in config as seconds
       long delay = (TvTEvent.isStarted() ? Config.TVT_EVENT_RESPAWN_TELEPORT_DELAY : Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY) * 1000;
      
       if (fastSchedule)
           delay = 0;
      
       ThreadPoolManager.getInstance().scheduleGeneral(this, delay);
   }
  
   /**
    * The task method to teleport the player<br>
    * 1. Unsummon pet if there is one 2. Remove all effects 3. Revive and full heal the player 4. Teleport the player 5. Broadcast status and user info
    * @see java.lang.Runnable#run()
    */
   @Override
   public void run()
   {
       if (_playerInstance == null)
           return;
      
       L2Summon summon = _playerInstance.getPet();
      
       if (summon != null)
           summon.unSummon(_playerInstance);
      
       for (L2Effect effect : _playerInstance.getAllEffects())
       {
           if (Config.TVT_EVENT_REMOVE_BUFFS && effect != null)
               effect.exit();
       }
      
       ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
       {
           @Override
           public void run()
           {
               _playerInstance.doRevive();
               _playerInstance.setCurrentHp(_playerInstance.getMaxHp());
               _playerInstance.setCurrentCp(_playerInstance.getMaxCp());
               _playerInstance.setCurrentMp(_playerInstance.getMaxMp());
               noblesse.getEffects(_playerInstance, _playerInstance);
               _playerInstance.teleToLocation(_coordinates[0], _coordinates[1], _coordinates[2], 0);
               
           }
       }, 4000);
      
       if (TvTEvent.isStarted() && !_adminRemove)
           _playerInstance.setTeam(TvTEvent.getParticipantTeamId(_playerInstance.getName()) + 1);
       else
           _playerInstance.setTeam(0);
      
       _playerInstance.broadcastStatusUpdate();
       _playerInstance.broadcastUserInfo();
   }
   
}

 

Edited by Kotegaeshi92

3 answers to this question

Recommended Posts

  • 0
Posted
2 minutes ago, @IcathiaLord said:

Change 


 _playerInstance.teleToLocation

to 


 _playerInstance.teleportTo

I dont have that metod , maybe i have to import it ? or creating it in l2pcinstance ?

  • 0
Posted

Solved tnx for the answers: just changed 

_playerInstance.teleToLocation(_coordinates[0], _coordinates[1], _coordinates[2], 0);

to

_playerInstance.teleToLocation(_coordinates[0], _coordinates[1], _coordinates[2]);

 

Please close. 

Guest
This topic is now closed to further replies.


  • Posts

    • NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE   **Earn While You Spend - Introducing HS Cashback!**   Every purchase on our site now rewards you with **HS Keys cashback**   EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE   Here's how it works:       **1 USD = 1000 HS Keys**   **Get 3% cashback** on every purchase   **Use your HS Keys to **save on your next order**   ---   ### ⚡ Why this is awesome   * Every order gives you value back   * Stack it with promos & HS usage   * Turn your spending into future discounts   ---   ### Example   Spend **$10** → Get **300 HS Keys** back   Spend **$50** → Get **1500 HS Keys** back   ---   ### Smart system (built for fairness)   * Cashback is rounded to keep things balanced   * Prevents abuse from tiny orders   * Rewards real buyers   ---   ### Start earning now   Every purchase = progress toward your next discount   Shop now and build your HS balance!   #cashback #gamingdeals #d2r #rewards #loyalty   Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com     We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys.   Invite your friends using your personal link.   Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link.   Get your referral link here: www.d2rhiddenstash.com/profile     Start earning today
    • https://jumpshare.com/share/L45ApA5PVrGN2O5Ua5pQ   Skill synchronization with the server: Launching and synchronizing animations, launching and synchronizing effects. All of this is tied to the server's timing  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..