Jump to content
  • 0

Dm Spawns Revive Chars


Question

Posted
Good night, well, I'm trying to configure my DM so that it has more than 1 respawn for the players when they are reborn and so do not stay that zerg giving area skill in the respawn .. But the char is only being born in 1 place .. where I'm wrong ?
I want the players to be born in different respawns and not only 1 is the retail dm.
 
Retail Code:  

else if (_inEventDM && pk._inEventDM)
{
if (DM.is_teleport() || DM.is_started())
{
pk._countDMkills++;
final PlaySound ps = new PlaySound(0, "ItemSound.quest_itemget", 1, getObjectId(), getX(), getY(), getZ());
pk.setTitle("Kills: " + pk._countDMkills);
pk.sendPacket(ps);
pk.broadcastUserInfo();
 
if (Config.DM_ENABLE_KILL_REWARD)
{
 
final L2Item reward = ItemTable.getInstance().getTemplate(Config.DM_KILL_REWARD_ID);
pk.getInventory().addItem("DM Kill Reward", Config.DM_KILL_REWARD_ID, Config.DM_KILL_REWARD_AMOUNT, this, null);
pk.sendMessage("You have earned " + Config.DM_KILL_REWARD_AMOUNT + " item(s) of ID " + reward.getName() + ".");
 
}
 
sendMessage("You will be revived and teleported to spot in 20 seconds!");
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
@Override
public void run()
{
final Location p_loc = DM.get_playersSpawnLocation();
teleToLocation(p_loc._x, p_loc._y, p_loc._z, false);
doRevive();
}
}, Config.DM_REVIVE_DELAY);
}
}
else if (_inEventDM)
{
if (DM.is_teleport() || DM.is_started())
{
sendMessage("You will be revived and teleported to spot in 20 seconds!");
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
@Override
public void run()
{
final Location players_loc = DM.get_playersSpawnLocation();
teleToLocation(players_loc._x, players_loc._y, players_loc._z, false);
doRevive();
}
}, 20000);
}
}

 
Modified code

else if (_inEventDM && pk._inEventDM)
{
if (DM.is_teleport() || DM.is_started())
{
pk._countDMkills++;
final PlaySound ps = new PlaySound(0, "ItemSound.quest_itemget", 1, getObjectId(), getX(), getY(), getZ());
pk.setTitle("Kills: " + pk._countDMkills);
pk.sendPacket(ps);
pk.broadcastUserInfo();
 
if (Config.DM_ENABLE_KILL_REWARD)
{
 
final L2Item reward = ItemTable.getInstance().getTemplate(Config.DM_KILL_REWARD_ID);
pk.getInventory().addItem("DM Kill Reward", Config.DM_KILL_REWARD_ID, Config.DM_KILL_REWARD_AMOUNT, this, null);
pk.sendMessage("You have earned " + Config.DM_KILL_REWARD_AMOUNT + " item(s) of ID " + reward.getName() + ".");
 
}
 
sendMessage("You will be revived and teleported to spot in 20 seconds!");
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
@Override
public void run()
{
final Location p_loc = DM.get_playersSpawnLocation();
teleToLocation(150086, 46733, -3407);
teleToLocation(149473, 46774, -3438);
teleToLocation(148833, 46779, -3438);
doRevive();
}
}, Config.DM_REVIVE_DELAY);
}
}
else if (_inEventDM)
{
if (DM.is_teleport() || DM.is_started())
{
sendMessage("You will be revived and teleported to spot in 20 seconds!");
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
@Override
public void run()
{
final Location players_loc = DM.get_playersSpawnLocation();
teleToLocation(150086, 46733, -3407);
teleToLocation(149473, 46774, -3438);
teleToLocation(148833, 46779, -3438);
doRevive();
}
}, 20000);
}
}

 
Before you speak, I tried putting it like this:
 
teleToLocation(150086, 46733, -3407);
doRevive();
teleToLocation(149473, 46774, -3438);
doRevive();
teleToLocation(148833, 46779, -3438);
doRevive();

 

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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..