Replaced movie task with a more instant method.

This commit is contained in:
MobiusDev 2016-12-25 10:54:05 +00:00
parent a31d99f6f8
commit bc07aef87f
2 changed files with 11 additions and 56 deletions

View File

@ -166,7 +166,6 @@ import com.l2jmobius.gameserver.model.actor.tasks.player.DismountTask;
import com.l2jmobius.gameserver.model.actor.tasks.player.FameTask;
import com.l2jmobius.gameserver.model.actor.tasks.player.GameGuardCheckTask;
import com.l2jmobius.gameserver.model.actor.tasks.player.InventoryEnableTask;
import com.l2jmobius.gameserver.model.actor.tasks.player.MovieTask;
import com.l2jmobius.gameserver.model.actor.tasks.player.PetFeedTask;
import com.l2jmobius.gameserver.model.actor.tasks.player.PvPFlagTask;
import com.l2jmobius.gameserver.model.actor.tasks.player.RecoGiveTask;
@ -281,6 +280,7 @@ import com.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import com.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
import com.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
import com.l2jmobius.gameserver.network.serverpackets.ExSetCompassZoneCode;
import com.l2jmobius.gameserver.network.serverpackets.ExStartScenePlayer;
import com.l2jmobius.gameserver.network.serverpackets.ExStopScenePlayer;
import com.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
import com.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
@ -10186,6 +10186,12 @@ public final class L2PcInstance extends L2Playable
s.setInstance(getInstanceWorld());
s.updateAndBroadcastStatus(0);
});
// show movie if available
if (_movieHolder != null)
{
sendPacket(new ExStartScenePlayer(_movieHolder.getMovie()));
}
}
@Override
@ -12089,7 +12095,10 @@ public final class L2PcInstance extends L2Playable
// abortCast(); Confirmed in retail, playing a movie does not abort cast.
stopMove(null);
setMovieHolder(holder);
ThreadPoolManager.getInstance().scheduleGeneral(new MovieTask(this, holder.getMovie()), 100);
if (!isTeleporting())
{
sendPacket(new ExStartScenePlayer(holder.getMovie()));
}
}
public void stopMovie()

View File

@ -1,54 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 com.l2jmobius.gameserver.model.actor.tasks.player;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.enums.Movie;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.ExStartScenePlayer;
/**
* @author Mobius
*/
public class MovieTask implements Runnable
{
private final L2PcInstance _player;
private final Movie _movie;
public MovieTask(L2PcInstance player, Movie movie)
{
_player = player;
_movie = movie;
}
@Override
public void run()
{
if (_player == null)
{
return;
}
if (_player.isTeleporting())
{
ThreadPoolManager.getInstance().scheduleGeneral(new MovieTask(_player, _movie), 300);
}
else
{
_player.sendPacket(new ExStartScenePlayer(_movie));
}
}
}