Jump to content
  • 0

TVT Teleport


Kotegaeshi92

Question

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
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

If you are using 380 and after

 

Change 

 _playerInstance.teleToLocation

to 

 _playerInstance.teleportTo
Edited by @IcathiaLord
Link to comment
Share on other sites

  • 0
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 ?

Link to comment
Share on other sites

  • 0

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. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...