showQuestWindow(player, quest);
}
}
else if(command.startsWith("Registration"))
{
L2Clan playerClan = player.getClan();
NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
String str;
str = "<html><body>Newspaper!<br>";
switch(getTemplate().getNpcId())
{
case 35437:
if(!BanditStrongholdSiege.getInstance().isRegistrationPeriod())
{
showMessageWindow(player, 3);
return;
}
if(playerClan == null || !playerClan.getLeaderName().equalsIgnoreCase(player.getName()) || playerClan.getLevel() < 4)
{
showMessageWindow(player, 1);
return;
}
if(BanditStrongholdSiege.getInstance().clanhall.getOwnerClan() == playerClan)
{
str += "Your clan is already registered for the siege, what more do you want from me?<br>";
str += "<a action=\"bypass -h npc_%objectId%_PlayerList\">Add / remove a member of the siege</a><br>";
}
else
{
if(BanditStrongholdSiege.getInstance().isClanOnSiege(playerClan))
{
str += "Your clan is already registered for the siege, what more do you want from me?<br>";
str += "<a action=\"bypass -h npc_%objectId%_UnRegister\">Unsubscribe</a><br>";
str += "<a action=\"bypass -h npc_%objectId%_PlayerList\">Add / remove a member of the siege</a><br>";
}
else
{
int res = BanditStrongholdSiege.getInstance().registerClanOnSiege(player, playerClan);
if(res == 0)
{
str += "Your clan : <font color=\"LEVEL\">" + player.getClan().getName() + "</font>, successfully registered for the siege clan hall.<br>";
str += "Now you need to select no more than 18 igokov who will take part in the siege, a member of your clan.<br>";
str += "<a action=\"bypass -h npc_%objectId%_PlayerList\">Select members of the siege</a><br>";
}
else if(res == 1)
{
str += "You have not passed the test and did not qualify for participation in the siege of Robbers<br>";
str += "Come back when you're done.";
}
else if(res == 2)
{
str += "Unfortunately, you are late. Five tribal leaders have already filed an application for registration.<br>";
str += "Next time be more powerful";
}
}
}
break;
case 35627:
if(!WildBeastFarmSiege.getInstance().isRegistrationPeriod())
{
showMessageWindow(player, 3);
return;
}
if(playerClan == null || !playerClan.getLeaderName().equalsIgnoreCase(player.getName()) || playerClan.getLevel() < 4)
{
showMessageWindow(player, 1);
return;
}
if(WildBeastFarmSiege.getInstance().clanhall.getOwnerClan() == playerClan)
{
str += "Your clan is already registered for the siege, what more do you want from me?<br>";
str += "<a action=\"bypass -h npc_%objectId%_PlayerList\">Add / remove a member of the siege</a><br>";
}
else
{
if(WildBeastFarmSiege.getInstance().isClanOnSiege(playerClan))
{
str += "Your clan is already registered for the siege, what more do you want from me?<br>";
str += "<a action=\"bypass -h npc_%objectId%_UnRegister\">Unsubscribe</a><br>";
str += "<a action=\"bypass -h npc_%objectId%_PlayerList\">Add / remove a member of the siege</a><br>";
}
else
{
int res = WildBeastFarmSiege.getInstance().registerClanOnSiege(player, playerClan);
if(res == 0)
{
str += "Your clan : <font color=\"LEVEL\">" + player.getClan().getName() + "</font>, successfully registered for the siege clan hall.<br>";
str += "Now you need to select no more than 18 igokov who will take part in the siege, a member of your clan.<br>";
str += "<a action=\"bypass -h npc_%objectId%_PlayerList\">Select members of the siege</a><br>";
}
else if(res == 1)
{
str += "You have not passed the test and did not qualify for participation in the siege of Robbers<br>";
str += "Come back when you're done.";
}
else if(res == 2)
{
str += "Unfortunately, you are late. Five tribal leaders have already filed an application for registration.<br>";
str += "Next time be more raztoropny.";
}
}
}
break;
}
str += "</body></html>";
html.setHtml(str);
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
}
else if(command.startsWith("UnRegister"))
{
L2Clan playerClan = player.getClan();
if(playerClan == null || !playerClan.getLeaderName().equalsIgnoreCase(player.getName()) || playerClan.getLevel() < 4)
{
_log.warning("Attention!!! player " + player.getName() + " use packet hack, try unregister clan.");
return;
}
if(!BanditStrongholdSiege.getInstance().isRegistrationPeriod())
{
showMessageWindow(player, 3);
return;
}
NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
String str;
if(BanditStrongholdSiege.getInstance().isClanOnSiege(playerClan))
{
if(BanditStrongholdSiege.getInstance().unRegisterClan(playerClan))
{
str = "<html><body>Newspaper!<br>";
str += "Your clan : <font color=\"LEVEL\">" + player.getClan().getName() + "</font>, successfully removed from the register at the siege clan hall.<br>";
str += "</body></html>";
html.setHtml(str);
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
}
}
else
{
_log.warning("Attention!!! player " + player.getName() + " use packet hack, try unregister clan.");
}
}
else if(command.startsWith("PlayerList"))
{
L2Clan playerClan = player.getClan();
if(playerClan == null || !playerClan.getLeaderName().equalsIgnoreCase(player.getName()) || playerClan.getLevel() < 4)
return;
if(!BanditStrongholdSiege.getInstance().isRegistrationPeriod())
{
showMessageWindow(player, 3);
return;
}
if(BanditStrongholdSiege.getInstance().isClanOnSiege(playerClan))
{
showPlayersList(playerClan, player);
}
}
else if(command.startsWith("addPlayer"))
{
L2Clan playerClan = player.getClan();
if(playerClan == null || !playerClan.getLeaderName().equalsIgnoreCase(player.getName()) || playerClan.getLevel() < 4)
return;
if(!BanditStrongholdSiege.getInstance().isRegistrationPeriod())
{
showMessageWindow(player, 3);
return;
}
String val = command.substring(10);
if(playerClan.getClanMember(val) == null)
return;
BanditStrongholdSiege.getInstance().addPlayer(playerClan, val);
if(BanditStrongholdSiege.getInstance().isClanOnSiege(playerClan))
{
showPlayersList(playerClan, player);
}
}
else if(command.startsWith("removePlayer"))
{
L2Clan playerClan = player.getClan();
if(playerClan == null || !playerClan.getLeaderName().equalsIgnoreCase(player.getName()) || playerClan.getLevel() < 4)
return;
if(!BanditStrongholdSiege.getInstance().isRegistrationPeriod())
{
showMessageWindow(player, 3);
return;
}
String val = command.substring(13);
if(playerClan.getClanMember(val) != null)
{
BanditStrongholdSiege.getInstance().removePlayer(playerClan, val);
}
if(BanditStrongholdSiege.getInstance().isClanOnSiege(playerClan))
{