/**
* @author Anarchy
*
* This class should hold all the information of a player
* before he entered an event. It is used to restore
* players' status after an event, or after disconnection.
*/
public class PlayerData
{
private int playerId;
private int playerColor;
private String playerTitle;
private Location playerLocation;
public PlayerData(Player player)
{
playerId = player.getObjectId();
playerColor = player.getAppearance().getNameColor();
playerTitle = player.getTitle();
playerLocation = new Location(player.getX(), player.getY(), player.getZ());
}
public void restore(Player player)
{
if (player.isDead())
player.doRevive();
player.getAppearance().setNameColor(playerColor);
player.setTitle(playerTitle);
player.setTeam(TeamType.NONE);
player.teleportTo(playerLocation, 0);
player.sendMessage("Your status has been restored after leaving an event.");
// Increase the participated in tasks
int participates = PlayerMemo.getVarInt(player, "participated_automatic_events"); PlayerMemo.setVar(player, "participated_automatic_events", participates+1, -1);
}
public int getPlayerId()
{
return playerId;
}
public int getPlayerColor()
{
return playerColor;
}
public String getPlayerTitle()
{
return playerTitle;
}
}
Unlock Unlimited Access with GoProxy's Residential Proxies!
Experience seamless, secure, and unrestricted connectivity worldwide with GoProxy's Unlimited Residential Proxies.
Our service offers access to a global network of rotating residential IPs, ensuring top performance for your large-scale data collection, streaming, and more.
✔️Unlimited Traffic & IPs: Enjoy unrestricted access with our rotating residential proxies, delivering high performance through a vast global IP pool.
✔️High Success Rate: Achieve a 99.96% success rate with a rapid 0.6-second response time, ensuring efficient and reliable operations.
✔️Flexible Sessions: Customize IP rotation to fit your project needs, with options for automatic rotation and sticky sessions lasting up to 60 minutes.
✔️Global Coverage: Access IPs from over 120 countries, making it ideal for businesses requiring high bandwidth without region-specific constraints.
All plans include unlimited traffic and IPs, unlimited concurrent requests, and access to real residential IP addresses.
Elevate your online operations with GoProxy's Unlimited Residential Proxies—your smart choice for large-scale projects.
👉 Learn more and get started today: GoProxy Unlimited Proxies
Question
addx20
Hello Folks! again one more small problem! I need just to adapt the 2 red lines to acis 398 Thanks!!!
package net.sf.l2j.gameserver.eola.eventengine;
import net.sf.l2j.gameserver.model.location.Location;
import net.sf.l2j.gameserver.enums.TeamType;
import net.sf.l2j.gameserver.model.actor.Player;
import net.sf.l2j.gameserver.model.memo.PlayerMemo;
/**
* @author Anarchy
*
* This class should hold all the information of a player
* before he entered an event. It is used to restore
* players' status after an event, or after disconnection.
*/
public class PlayerData
{
private int playerId;
private int playerColor;
private String playerTitle;
private Location playerLocation;
public PlayerData(Player player)
{
playerId = player.getObjectId();
playerColor = player.getAppearance().getNameColor();
playerTitle = player.getTitle();
playerLocation = new Location(player.getX(), player.getY(), player.getZ());
}
public void restore(Player player)
{
if (player.isDead())
player.doRevive();
player.getAppearance().setNameColor(playerColor);
player.setTitle(playerTitle);
player.setTeam(TeamType.NONE);
player.teleportTo(playerLocation, 0);
player.sendMessage("Your status has been restored after leaving an event.");
// Increase the participated in tasks
int participates = PlayerMemo.getVarInt(player, "participated_automatic_events");
PlayerMemo.setVar(player, "participated_automatic_events", participates+1, -1);
}
public int getPlayerId()
{
return playerId;
}
public int getPlayerColor()
{
return playerColor;
}
public String getPlayerTitle()
{
return playerTitle;
}
}
3 answers to this question
Recommended Posts