Sync with L2jServer HighFive Feb 15th 2015.
This commit is contained in:
@ -396,23 +396,21 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
target = activeChar;
|
||||
}
|
||||
|
||||
L2NpcTemplate template1;
|
||||
L2NpcTemplate template;
|
||||
if (monsterId.matches("[0-9]*"))
|
||||
{
|
||||
// First parameter was an ID number
|
||||
int monsterTemplate = Integer.parseInt(monsterId);
|
||||
template1 = NpcData.getInstance().getTemplate(monsterTemplate);
|
||||
template = NpcData.getInstance().getTemplate(Integer.parseInt(monsterId));
|
||||
}
|
||||
else
|
||||
{
|
||||
// First parameter wasn't just numbers so go by name not ID
|
||||
monsterId = monsterId.replace('_', ' ');
|
||||
template1 = NpcData.getInstance().getTemplateByName(monsterId);
|
||||
template = NpcData.getInstance().getTemplateByName(monsterId.replace('_', ' '));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
L2Spawn spawn = new L2Spawn(template1);
|
||||
final L2Spawn spawn = new L2Spawn(template);
|
||||
if (Config.SAVE_GMSPAWN_ON_CUSTOM)
|
||||
{
|
||||
spawn.setCustom(true);
|
||||
@ -435,15 +433,15 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
// TODO add checks for GrandBossSpawnManager
|
||||
if (RaidBossSpawnManager.getInstance().isDefined(spawn.getId()))
|
||||
{
|
||||
activeChar.sendMessage("You cannot spawn another instance of " + template1.getName() + ".");
|
||||
activeChar.sendMessage("You cannot spawn another instance of " + template.getName() + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RaidBossSpawnManager.getInstance().getValidTemplate(spawn.getId()) != null)
|
||||
if (template.isType("L2RaidBoss"))
|
||||
{
|
||||
spawn.setRespawnMinDelay(43200);
|
||||
spawn.setRespawnMaxDelay(129600);
|
||||
RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template1.getBaseHpMax(), template1.getBaseMpMax(), permanent);
|
||||
RaidBossSpawnManager.getInstance().addNewSpawn(spawn, 0, template.getBaseHpMax(), template.getBaseMpMax(), permanent);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -454,7 +452,7 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
{
|
||||
spawn.stopRespawn();
|
||||
}
|
||||
activeChar.sendMessage("Created " + template1.getName() + " on " + target.getObjectId());
|
||||
activeChar.sendMessage("Created " + template.getName() + " on " + target.getObjectId());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -28,7 +28,6 @@ import java.util.logging.Logger;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jserver.gameserver.instancemanager.MapRegionManager;
|
||||
@ -41,7 +40,6 @@ import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2RaidBossInstance;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jserver.util.StringUtil;
|
||||
@ -544,15 +542,6 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
{
|
||||
L2Npc target = (L2Npc) obj;
|
||||
|
||||
int monsterTemplate = target.getTemplate().getId();
|
||||
L2NpcTemplate template1 = NpcData.getInstance().getTemplate(monsterTemplate);
|
||||
if (template1 == null)
|
||||
{
|
||||
activeChar.sendMessage("Incorrect monster template.");
|
||||
_log.warning("ERROR: NPC " + target.getObjectId() + " has a 'null' template.");
|
||||
return;
|
||||
}
|
||||
|
||||
L2Spawn spawn = target.getSpawn();
|
||||
if (spawn == null)
|
||||
{
|
||||
@ -568,9 +557,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
|
||||
try
|
||||
{
|
||||
// L2MonsterInstance mob = new L2MonsterInstance(monsterTemplate, template1);
|
||||
|
||||
spawn = new L2Spawn(template1);
|
||||
spawn = new L2Spawn(target.getTemplate().getId());
|
||||
if (Config.SAVE_GMSPAWN_ON_CUSTOM)
|
||||
{
|
||||
spawn.setCustom(true);
|
||||
@ -592,7 +579,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
SpawnTable.getInstance().addNewSpawn(spawn, true);
|
||||
spawn.init();
|
||||
|
||||
activeChar.sendMessage("Created " + template1.getName() + " on " + target.getObjectId() + ".");
|
||||
activeChar.sendMessage("Created " + target.getTemplate().getName() + " on " + target.getObjectId() + ".");
|
||||
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
@ -621,8 +608,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
||||
RaidBossSpawnManager.getInstance().deleteSpawn(spawn, true);
|
||||
try
|
||||
{
|
||||
L2NpcTemplate template = NpcData.getInstance().getTemplate(target.getId());
|
||||
L2Spawn spawnDat = new L2Spawn(template);
|
||||
final L2Spawn spawnDat = new L2Spawn(target.getId());
|
||||
if (Config.SAVE_GMSPAWN_ON_CUSTOM)
|
||||
{
|
||||
spawn.setCustom(true);
|
||||
|
@ -98,7 +98,7 @@ public class QuestLink implements IBypassHandler
|
||||
|
||||
for (Quest quest : quests)
|
||||
{
|
||||
final QuestState qs = player.getQuestState(quest.getScriptName());
|
||||
final QuestState qs = player.getQuestState(quest.getName());
|
||||
if ((qs == null) || qs.isCreated())
|
||||
{
|
||||
state = quest.isCustomQuest() ? "" : "01";
|
||||
|
@ -145,7 +145,7 @@ public final class SummonNpc extends AbstractEffect
|
||||
L2Spawn spawn;
|
||||
try
|
||||
{
|
||||
spawn = new L2Spawn(npcTemplate);
|
||||
spawn = new L2Spawn(_npcId);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user