Jump to content
  • 0

Dm Spawns Revive Chars


nortim

Question

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();

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...