{
if (!player.consumeItem(ITEM_ID, count))
{
return;
}
CMGSiegeClanObject siegeClanObject = new CMGSiegeClanObject(SiegeEvent.ATTACKERS, clan, count);
miniGameEvent.addObject(SiegeEvent.ATTACKERS, siegeClanObject);
SiegeClanDAO.getInstance().insert(clanHall, siegeClanObject);
showChatWindow(player, "residence2/clanhall/messenger_yetti009.htm");
}
}
else if (command.equalsIgnoreCase("cancel"))
{
if (miniGameEvent.isRegistrationOver())
{
showChatWindow(player, "residence2/clanhall/messenger_yetti017.htm");
return;
}
Clan clan = player.getClan();
if ((clan == null) || (clan.getLevel() < 3))
{
showChatWindow(player, "residence2/clanhall/messenger_yetti011.htm");
return;
}
if (clan.getLeaderId() != player.getObjectId())
{
showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
return;
}
SiegeClanObject siegeClanObject = miniGameEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
if (siegeClanObject == null)
{
showChatWindow(player, "residence2/clanhall/messenger_yetti016.htm");
}
else
{
miniGameEvent.removeObject(SiegeEvent.ATTACKERS, siegeClanObject);
SiegeClanDAO.getInstance().delete(clanHall, siegeClanObject);
ItemFunctions.addItem(player, ITEM_ID, siegeClanObject.getParam() / 2L, true);
showChatWindow(player, "residence2/clanhall/messenger_yetti005.htm");
}
}
else if (command.equalsIgnoreCase("refund"))
{
if (miniGameEvent.isRegistrationOver())
{
showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
return;
}
Clan clan = player.getClan();
if ((clan == null) || (clan.getLevel() < 3))
{
showChatWindow(player, "residence2/clanhall/messenger_yetti011.htm");
return;
}
if (clan.getLeaderId() != player.getObjectId())
{
showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
return;
}
SiegeClanObject siegeClanObject = miniGameEvent.getSiegeClan(ClanHallMiniGameEvent.REFUND, clan);
if (siegeClanObject == null)
{
showChatWindow(player, "residence2/clanhall/messenger_yetti020.htm");
}
else
{
miniGameEvent.removeObject(ClanHallMiniGameEvent.REFUND, siegeClanObject);
SiegeClanDAO.getInstance().delete(clanHall, siegeClanObject);
ItemFunctions.addItem(player, ITEM_ID, siegeClanObject.getParam(), true);
showChatWindow(player, "residence2/clanhall/messenger_yetti019.htm");
}
}
else
{