Jump to content

Recommended Posts

Posted

well i will share with you something funny when the registration of a event will finish like tvt as you know players got teleported but with this it will be something like scroll of escape just the animation nothing else XD btw create a new at file net.sf.l2j.gameserver.model.entity;

call it GlobalEventTeleAnimation.java

/*
* 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.model.entity;

import java.util.Vector;

import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
import net.sf.l2j.gameserver.network.serverpackets.SetupGauge;

/**
* @author  Administrator
*/
public class GlobalEventTeleAnimation implements Runnable
{
private Vector<L2PcInstance> _players;
private int _hittime;

public GlobalEventTeleAnimation(Vector<L2PcInstance> players, int hittime)
{
	_players = players;
	_hittime = hittime;
}

/**
    * @see java.lang.Runnable#run()
    */
   @Override
   public void run()
   {
   	for(L2PcInstance activeChar : _players)
   	{
   		activeChar._inEventTeleport = true;
   		activeChar.setIsImmobilized(true);
        activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
        activeChar.setTarget(activeChar);
        activeChar.disableAllSkills();
        MagicSkillUse msu = new MagicSkillUse(activeChar, 2013, 1, _hittime, 0);
        activeChar.broadcastPacket(msu);
        SetupGauge sg = new SetupGauge(1, _hittime);
        activeChar.sendPacket(sg);
        activeChar.enableAllSkills();
        activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
   	}
   }
}

you will go at your event example tvt and the code will be (net.sf.l2j.gameserver.model.entinity.TvTEventTeleporter.java)something like that

/*
* 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.model.entity;

import java.util.Vector;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.model.actor.L2Summon;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.events.GlobalEventTeleAnimation;
import net.sf.l2j.util.Rnd;

public class TvTEventTeleporter implements Runnable
{
/** The instance of the player to teleport */
private L2PcInstance _playerInstance = null;
/** Coordinates of the spot to teleport to */
private int[] _coordinates = new int[3];
/** Admin removed this player from event */
private boolean _adminRemove = false;
private Vector<L2PcInstance> _players;

/**
 * Initialize the teleporter and start the delayed task<br><br>
 *
 * @param playerInstance as L2PcInstance<br>
 * @param coordinates as int[]<br>
 * @param fastShedule as boolean<br>
 * @param adminRemove as boolean<br>
 */
public TvTEventTeleporter(L2PcInstance playerInstance, int[] coordinates, boolean fastSchedule, boolean adminRemove)
{
	_playerInstance = playerInstance;
	_coordinates = coordinates;
	_adminRemove = adminRemove;


	AnnounceToPlayers(false, "Teleport to team spot in 20 seconds!");
	ThreadPoolManager.getInstance().executeTask(new GlobalEventTeleAnimation(_players, 20000));
	long delay = (TvTEvent.isStarted() ? Config.TVT_EVENT_RESPAWN_TELEPORT_DELAY : Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY) * 1000;

	ThreadPoolManager.getInstance().scheduleGeneral(this, fastSchedule ? 0 : delay);
}

/**
     * @param b
     * @param string
     */
    private void AnnounceToPlayers(boolean b, String string)
    {
    // TODO Auto-generated method stub
    
    }

/**
 * The task method to teleport the player<br>
 * 1. Unsummon pet if there is one<br>
 * 2. Remove all effects<br>
 * 3. Revive and full heal the player<br>
 * 4. Teleport the player<br>
 * 5. Broadcast status and user info<br><br>
 *
 * @see java.lang.Runnable#run()<br>
 */
public void run()
{
	if (_playerInstance == null)
		return;

	L2Summon summon = _playerInstance.getPet();

	if (summon != null)
		summon.unSummon(_playerInstance);

	if (Config.TVT_EVENT_EFFECTS_REMOVAL == 0
			|| (Config.TVT_EVENT_EFFECTS_REMOVAL == 1 && _playerInstance.getTeam() == 0))
		_playerInstance.stopAllEffectsExceptThoseThatLastThroughDeath();

	_playerInstance.doRevive();

	_playerInstance.setInstanceId(0);
	_playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(101)-50, _coordinates[ 1 ] + Rnd.get(101)-50, _coordinates[ 2 ], false );

	if (TvTEvent.isStarted() && !_adminRemove)
		_playerInstance.setTeam(TvTEvent.getParticipantTeamId(_playerInstance.getObjectId()) + 1);
	else
		_playerInstance.setTeam(0);

	_playerInstance.setCurrentCp(_playerInstance.getMaxCp());
	_playerInstance.setCurrentHp(_playerInstance.getMaxHp());
	_playerInstance.setCurrentMp(_playerInstance.getMaxMp());

	_playerInstance.broadcastStatusUpdate();
	_playerInstance.broadcastUserInfo();
}
}

the code where you need to add is

AnnounceToPlayers(false, "Teleport to team spot in 20 seconds!");

ThreadPoolManager.getInstance().executeTask(new GlobalEventTeleAnimation(_players, 20000));

btw for any problem leave a reply to find a solution

NOTE: it's not tested

Guest
This topic is now closed to further replies.


  • Posts

    • Another happy customer with custom Updater / Launcher for his server! Get one Yourself as well!
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions store
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions store
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions store
    • Where to buy Telegram Stars at low prices before September 1? The best solution is the SocNet Stars Telegram bot! Pavel Durov announced that new gifts are already near! And they may come out in early September. Stay ready together with our SocNet Stars Telegram bot! Cheap prices, best quality, fast delivery! You will have very little time before the next SOLD OUT. The opportunity to quickly earn and receive a valuable official NFT gift in Telegram is already close. Buy Telegram Stars quickly, profitably and safely - https://t.me/socnetstarsbot Many payment methods! Actual links to our projects: Telegram bot for buying Telegram Stars: Go Digital goods store: Go Telegram bot store: Go SMM Panel: Go We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via mail/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via mail — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via mail + active 2FA password — Instagram old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) — Facebook old accounts (2010-2023) | Full access via mail (possibly also connected 2FA password) | With friends and without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via mail (possibly also connected 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Write to the contacts below — we will discuss the terms! We are always open to other partnership offers as well. Contacts and support: Telegram: https://t.me/socnet_support  Telegram channel: https://t.me/accsforyou_shop WhatsApp: https://wa.me/79051904467 WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n Discord: socnet_support Discord server: https://discord.gg/y9AStFFsrh Email: solomonbog@socnet.store SocNet — digital goods and premium subscriptions 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