Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2jFrozen_GameServer
- Index: head-src/com/l2jfrozen/gameserver/model/entity/event/CTF.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/entity/event/CTF.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/model/entity/event/CTF.java (working copy)
- @@ -2016,11 +2016,11 @@
- {
- NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
- - TextBuilder replyMSG = new TextBuilder("<html><title>"+_eventName+"</title><body>");
- - replyMSG.append("<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br1>");
- - replyMSG.append("<center><font color=\"3366CC\">Current event:</font></center><br1>");
- - replyMSG.append("<center>Name: <font color=\"00FF00\">" + _eventName + "</font></center><br1>");
- - replyMSG.append("<center>Description: <font color=\"00FF00\">" + _eventDesc + "</font></center><br><br>");
- + TextBuilder replyMSG = new TextBuilder("<html><title>CTF</title><body>");
- + replyMSG.append("<center><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"LEVEL\">Current event:</font></center><br1>");
- + replyMSG.append("<center>Name: <font color=\"0066CC\">" + _eventName + "</font></center><br1>");
- + replyMSG.append("<center>Description: <font color=\"0066CC\">" + _eventDesc + "</font></center><br>");
- if(!_started && !_joining)
- replyMSG.append("<center>Wait till the admin/gm start the participation.</center>");
- @@ -2028,14 +2028,14 @@
- {
- if(!_started)
- {
- - replyMSG.append("Currently participated: <font color=\"00FF00\">" + _playersShuffle.size() + ".</font><br>");
- - replyMSG.append("Max players: <font color=\"00FF00\">" + _maxPlayers + "</font><br><br>");
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
- + replyMSG.append("Currently participated: <font color=\"0066CC\">" + _playersShuffle.size() + ".</font><br>");
- + replyMSG.append("Max players: <font color=\"0066CC\">" + _maxPlayers + "</font><br>");
- + replyMSG.append("<font color=\"0066CC\">You can't participate to this event.</font><br>");
- }
- }
- else if(eventPlayer.isCursedWeaponEquiped() && !Config.CTF_JOIN_CURSED)
- {
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event with a cursed Weapon.</font><br>");
- + replyMSG.append("<font color=\"0066CC\">You can't participate to this event with a cursed Weapon.</font><br>");
- }
- else if(!_started && _joining && eventPlayer.getLevel()>=_minlvl && eventPlayer.getLevel()<=_maxlvl)
- {
- @@ -2043,21 +2043,22 @@
- if(_players.contains(eventPlayer) || _playersShuffle.contains(eventPlayer) || checkShufflePlayers(eventPlayer))
- {
- if(Config.CTF_EVEN_TEAMS.equals("NO") || Config.CTF_EVEN_TEAMS.equals("BALANCE"))
- - replyMSG.append("You participated already in team <font color=\"LEVEL\">" + eventPlayer._teamNameCTF + "</font><br><br>");
- + replyMSG.append("You participated already in team <font color=\"0066CC\">" + eventPlayer._teamNameCTF + "</font><br><br>");
- else if(Config.CTF_EVEN_TEAMS.equals("SHUFFLE"))
- - replyMSG.append("<center><font color=\"3366CC\">You participated already!</font></center><br><br>");
- -
- - replyMSG.append("<center>Joined Players: <font color=\"00FF00\">" + _playersShuffle.size() + "</font></center><br>");
- + replyMSG.append("<center><font color=\"0066CC\">You participated already!.</font></center><br>");
- +
- + replyMSG.append("<center>Joined Players: <font color=\"0066CC\">" + _playersShuffle.size() + "</font></center><br>");
- - replyMSG.append("<center><font color=\"3366CC\">Wait till event start or remove your participation!</font><center>");
- - replyMSG.append("<center><button value=\"Remove\" action=\"bypass -h npc_" + objectId+ "_ctf_player_leave\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center>");
- + replyMSG.append("<center><button value=\"Remove\" action=\"bypass -h npc_" + objectId+ "_ctf_player_leave\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"111111\">By Excalibur</font></center>");
- }
- else
- {
- - replyMSG.append("<center><font color=\"3366CC\">You want to participate in the event?</font></center><br>");
- - replyMSG.append("<center><td width=\"200\">Min lvl: <font color=\"00FF00\">" + _minlvl + "</font></center></td><br>");
- - replyMSG.append("<center><td width=\"200\">Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font></center></td><br><br>");
- - replyMSG.append("<center><font color=\"3366CC\">Teams:</font></center><br>");
- + replyMSG.append("<center><font color=\"LEVEL\">You want to participate in the event?</font></center><br>");
- + replyMSG.append("<center><td width=\"200\">Min. level: <font color=\"0066CC\">" + _minlvl + "</font></center></td><br>");
- + replyMSG.append("<center><td width=\"200\">Max. level: <font color=\"0066CC\">" + _maxlvl + "</font></center></td><br>");
- + replyMSG.append("<center><font color=\"LEVEL\">Teams: </font></center>");
- if(Config.CTF_EVEN_TEAMS.equals("NO") || Config.CTF_EVEN_TEAMS.equals("BALANCE"))
- {
- @@ -2065,9 +2066,9 @@
- for(String team : _teams)
- {
- - replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font> (" + teamPlayersCount(team) + " joined)</td>");
- + replyMSG.append("<tr><td width=\"100\"><font color=\"0066CC\">" + team + "</font> (" + teamPlayersCount(team) + " joined.)</td>");
- replyMSG.append("<center><td width=\"60\"><button value=\"Join\" action=\"bypass -h npc_" + objectId + "_ctf_player_join " + team
- - + "\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td></tr>");
- + + "\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center></td></tr>");
- }
- replyMSG.append("</table></center>");
- }
- @@ -2076,14 +2077,15 @@
- replyMSG.append("<center>");
- for(String team : _teams)
- - replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font> </td>");
- + replyMSG.append("<tr><td width=\"100\"><font color=\"0066CC\">" + team + "</font> </td>");
- replyMSG.append("</center><br>");
- - replyMSG.append("<center><button value=\"Join Event\" action=\"bypass -h npc_" + objectId + "_ctf_player_join eventShuffle\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center>");
- - replyMSG.append("<center><font color=\"3366CC\">Teams will be reandomly generated!</font></center><br>");
- - replyMSG.append("<center>Joined Players:</font> <font color=\"LEVEL\">" + _playersShuffle.size() + "</center></font><br>");
- + replyMSG.append("<center><button value=\"Join Event\" action=\"bypass -h npc_" + objectId + "_ctf_player_join eventShuffle\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center>");
- + replyMSG.append("<center><font color=\"0066CC\">Teams will be reandomly generated!</font></center><br>");
- + replyMSG.append("<center>Joined Players: </font><font color=\"0066CC\">" + _playersShuffle.size() + "</center></font><br>");
- replyMSG.append("<center>Reward: <font color=\"LEVEL\">" + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()+ "</center></font>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center>");
- }
- }
- }
- @@ -2093,10 +2095,12 @@
- replyMSG.append("<center>"+_eventName+" match is in progress.</center>");
- else if(eventPlayer.getLevel() < _minlvl || eventPlayer.getLevel() > _maxlvl)
- {
- - replyMSG.append("Your lvl: <font color=\"00FF00\">" + eventPlayer.getLevel() + "</font><br>");
- - replyMSG.append("Min lvl: <font color=\"00FF00\">" + _minlvl + "</font><br>");
- - replyMSG.append("Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font><br><br>");
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
- + replyMSG.append("<center>Your level: <font color=\"0066CC\">" + eventPlayer.getLevel() + "</font><br>");
- + replyMSG.append("<center>Min. level: <font color=\"0066CC\">" + _minlvl + "</font><br>");
- + replyMSG.append("<center>Max. level: <font color=\"0066CC\">" + _maxlvl + "</font><br><br>");
- + replyMSG.append("<center><font color=\"0066CC\">You can't participate to this event.</font><br>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=256 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"111111\">By Excalibur</font></center>");
- }
- replyMSG.append("</body></html>");
- Index: config/functions/physics.properties
- ===================================================================
- --- config/functions/physics.properties (revision 1004)
- +++ config/functions/physics.properties (working copy)
- @@ -117,46 +117,6 @@
- #Send Skills Chance to Players
- SendSkillsChanceToPlayers = false
- -#Disable Bow for classes: write here classes id
- -#that you dnt want allow to use BOW. Class id examples,
- -#you can find others into char_templates database table
- -#
- -# classId className
- -# 88 Duelist
- -# 89 DreadNought
- -# 90 Phoenix Knight
- -# 91 Hell Knight
- -# 92 Sagittarius
- -# 93 Adventurer
- -# 94 Archmage
- -# 95 Soultaker
- -# 96 Arcana Lord
- -# 97 Cardinal
- -# 98 Hierophant
- -# 99 Eva Templar
- -# 100 Sword Muse
- -# 101 Wind Rider
- -# 102 Moonlight Sentinel
- -# 103 Mystic Muse
- -# 104 Elemental Master
- -# 105 Eva Saint
- -# 106 Shillien Templar
- -# 107 Spectral Dancer
- -# 108 Ghost Hunter
- -# 109 Ghost Sentinel
- -# 110 Storm Screamer
- -# 111 Spectral Master
- -# 112 Shillen Saint
- -# 113 Titan
- -# 114 Grand Khauatari
- -# 115 Dominator
- -# 116 Doomcryer
- -# 117 Fortune Seeker
- -# 118 Maestro
- -#
- -# e.g. DisableBowForClasses=107,110
- -DisableBowForClasses =
- -
- # When you change/add subclass the weapon is unequipped
- # Default: False
- RemoveWeaponSubclass = False
- Index: head-src/com/l2jfrozen/gameserver/Restart.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/Restart.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/Restart.java (working copy)
- @@ -0,0 +1,120 @@
- +/*
- +* This program is free software: you can redistribute it and/or modify it under
- +* the terms of the GNU General Public License as published by the Free Software
- +* Foundation, either version 3 of the License, or (at your option) any later
- +* version.
- +*
- +* This program is distributed in the hope that it will be useful, but WITHOUT
- +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- +* details.
- +*
- +* You should have received a copy of the GNU General Public License along with
- +* this program. If not, see <http://www.gnu.org/licenses/>.
- +*/
- +package com.l2jfrozen.gameserver;
- +
- +import java.text.SimpleDateFormat;
- +import java.util.Calendar;
- +import java.util.logging.Logger;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +
- +/**
- +* This Config for Auto Restart GameServer
- +* Initialize class getInstance()
- +* Set Time in Config File
- +* Thank You L2JServer | L2JRussia
- +*
- +* @author L2JRussia
- +*
- +*/
- + public class Restart
- + {
- + //Variaveis globais
- + private static Restart _instance = null;
- + protected static final Logger _log = Logger.getLogger(Restart.class.getName());
- + private Calendar NextRestart;
- + private SimpleDateFormat format = new SimpleDateFormat("HH:mm");
- +
- + //Singleton
- + public static Restart getInstance()
- + {
- + if(_instance == null)
- + _instance = new Restart();
- + return _instance;
- + }
- +
- + public String getRestartNextTime()
- + {
- + if(NextRestart.getTime() != null)
- + return format.format(NextRestart.getTime());
- + else
- + return "Erro";
- + }
- +
- + //Connstrutor
- + private Restart()
- + {
- + //:D
- + }
- +
- + public void StartCalculationOfNextRestartTime()
- + {
- + _log.info("[Restart System]: Actived");
- + try
- + {
- + Calendar currentTime = Calendar.getInstance();
- + Calendar testStartTime = null;
- + long flush2 = 0,timeL = 0;
- + int count = 0;
- +
- + for (String timeOfDay : Config.RESTART_INTERVAL_BY_TIME_OF_DAY)
- + {
- + testStartTime = Calendar.getInstance();
- + testStartTime.setLenient(true);
- + String[] splitTimeOfDay = timeOfDay.split(":");
- + testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));
- + testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));
- + testStartTime.set(Calendar.SECOND, 00);
- + //Verifica a validade to tempo
- + if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
- + {
- + testStartTime.add(Calendar.DAY_OF_MONTH, 1);
- + }
- +
- + //TimeL Recebe o quanto falta de milisegundos para o restart
- + timeL = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();
- +
- + //Verifica qual horario sera o proximo restart
- + if(count == 0){
- + flush2 = timeL;
- + NextRestart = testStartTime;
- + }
- +
- + if(timeL < flush2){
- + flush2 = timeL;
- + NextRestart = testStartTime;
- + }
- +
- + count ++;
- + }
- + _log.info("[AutoRestart]: Next Restart Time: " + NextRestart.getTime().toString());
- + ThreadPoolManager.getInstance().scheduleGeneral(new StartRestartTask(), flush2);
- + }
- + catch (Exception e)
- + {
- + System.out.println("[AutoRestart]: The restart automated server presented error in load restarts period config !");
- + }
- + }
- +
- + class StartRestartTask implements Runnable
- + {
- + public void run()
- + {
- + _log.info("Start automated restart GameServer.");
- + Shutdown.getInstance().autoRestart(Config.RESTART_SECONDS);
- + }
- + }
- +}
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminAio.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminAio.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminAio.java (working copy)
- @@ -263,6 +263,8 @@
- connection.close();
- _player.lostAioSkills();
- + if(Config.ALLOW_AIO_EFFECT)
- + activeChar.stopAbnormalEffect(0x400000);
- _player.getAppearance().setNameColor(0xFFFFFF);
- _player.getAppearance().setTitleColor(0xFFFFFF);
- _player.broadcastUserInfo();
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -239,6 +239,7 @@
- import com.l2jfrozen.util.Point3D;
- import com.l2jfrozen.util.database.L2DatabaseFactory;
- import com.l2jfrozen.util.random.Rnd;
- +import com.l2jfrozen.gameserver.managers.PlayerKillsManager;
- /**
- * This class represents all player characters in the world.<br>
- @@ -330,6 +331,25 @@
- return _voteTimestamp;
- }
- + public void ClanSkills()
- + {
- + for(Iterator i$ = Config.CLAN_SKILLS.keySet().iterator(); i$.hasNext(); broadcastUserInfo())
- + {
- + Integer skillid = (Integer)i$.next();
- + int skilllvl = ((Integer)Config.CLAN_SKILLS.get(skillid)).intValue();
- + L2Skill skill = SkillTable.getInstance().getInfo(skillid.intValue(), skilllvl);
- + if(skill != null)
- + addSkill(skill, true);
- + getClan().addNewSkill(skill);
- + sendSkillList();
- + }
- +
- + L2Clan clan = getClan();
- + clan.setReputationScore(clan.getReputationScore() + Config.REPUTATION_QUANTITY, true);
- + sendMessage((new StringBuilder()).append("Admin give to you ").append(Config.REPUTATION_QUANTITY).append(" Reputation Points.").toString());
- + sendMessage("Admin give to you all Clan Skills");
- + }
- +
- /**
- * Sets the vote timestamp.
- *
- @@ -7589,6 +7609,7 @@
- final L2PcInstance pk = killer.getActingPlayer();
- if (pk != null)
- {
- + PlayerKillsManager.getInstance().onKill(this.getObjectId(), killer.getObjectId());
- if (Config.ENABLE_PK_INFO)
- {
- doPkInfo(pk);
- @@ -8068,11 +8089,11 @@
- increasePvpKills();
- if (target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL)
- {
- - Announcements.getInstance().announceToAll("Player " + getName() + " hunted Player " + target.getName());
- + Announcements.getInstance().announceNormal("Player " + getName() + " hunted Player " + target.getName());
- }
- else if (target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL)
- {
- - Announcements.getInstance().announceToAll("Player " + getName() + " killed Player " + target.getName());
- + Announcements.getInstance().announceNormal("Player " + getName() + " killed Player " + target.getName());
- }
- addItemReward(targetPlayer);
- return;
- @@ -8092,7 +8113,7 @@
- if (target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL)
- {
- - Announcements.getInstance().announceToAll("Player " + getName() + " hunted Player " + target.getName());
- + Announcements.getInstance().announceNormal("Player " + getName() + " hunted Player " + target.getName());
- }
- }
- else if (targetPlayer.getPvpFlag() == 0) // Target player doesn't have karma
- @@ -8100,14 +8121,14 @@
- increasePkKillsAndKarma(targetPlayer.getLevel());
- if (target instanceof L2PcInstance && Config.ANNOUNCE_PK_KILL)
- {
- - Announcements.getInstance().announceToAll("Player " + getName() + " has assassinated Player " + target.getName());
- + Announcements.getInstance().announceNormal("Player " + getName() + " has assassinated Player " + target.getName());
- }
- }
- }
- }
- if (target instanceof L2PcInstance && Config.ANNOUNCE_ALL_KILL)
- {
- - Announcements.getInstance().announceToAll("Player " + getName() + " killed Player " + target.getName());
- + Announcements.getInstance().announceNormal("Player " + getName() + " killed Player " + target.getName());
- }
- if (_inEventDM && DM.is_started())
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -26,6 +26,7 @@
- import com.l2jfrozen.Config;
- import com.l2jfrozen.crypt.nProtect;
- import com.l2jfrozen.crypt.nProtect.RestrictionType;
- +import com.l2jfrozen.gameserver.Restart;
- import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager;
- import com.l2jfrozen.gameserver.controllers.GameTimeController;
- import com.l2jfrozen.gameserver.datatables.CharSchemesTable;
- @@ -281,10 +282,6 @@
- // Welcome to Lineage II
- sendPacket(new SystemMessage(SystemMessageId.WELCOME_TO_LINEAGE));
- -
- - // Credits to L2jfrozen
- - activeChar.sendMessage("This server uses L2JFrozen, a project founded by L2Chef and");
- - activeChar.sendMessage("developed by the L2JFrozen Dev Team at l2jfrozen.com");
- SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
- Announcements.getInstance().showAnnouncements(activeChar);
- @@ -341,6 +338,21 @@
- if (Config.ANNOUNCE_CASTLE_LORDS)
- notifyCastleOwner(activeChar);
- +
- + if(Config.ANNOUNCE_AIO_LOGIN && activeChar.isAio())
- + Announcements.getInstance().announceToAll((new StringBuilder()).append("Player Aio: ").append(activeChar.getName()).append(" logged in the game").toString());
- +
- + if(Config.ANNOUNCE_HERO_LOGIN && activeChar.isHero())
- + Announcements.getInstance().announceToAll((new StringBuilder()).append("Player Hero: ").append(activeChar.getName()).append(" logged in the game").toString());
- +
- + if(Config.ANNOUNCE_NOBLE_LOGIN && activeChar.isNoble())
- + Announcements.getInstance().announceToAll((new StringBuilder()).append("Player Noble: ").append(activeChar.getName()).append(" logged in the game").toString());
- +
- + if(Config.ANNOUNCE_DONATOR_LOGIN && activeChar.isDonator())
- + Announcements.getInstance().announceToAll((new StringBuilder()).append("Player Donator: ").append(activeChar.getName()).append(" logged in the game").toString());
- +
- + if(Config.ANNOUNCE_NEWBIE_LOGIN && activeChar.isNewbie())
- + Announcements.getInstance().announceToAll((new StringBuilder()).append("Welcome ").append(activeChar.getName()).append(" to server!").toString());
- if (Olympiad.getInstance().playerInStadia(activeChar))
- {
- @@ -472,6 +484,11 @@
- }
- }
- }
- +
- + if(Config.RESTART_BY_TIME_OF_DAY)
- + {
- + ShowNextRestart(activeChar);
- + }
- // NPCBuffer
- if (PowerPakConfig.BUFFER_ENABLED)
- @@ -610,12 +627,12 @@
- if (Config.PM_MESSAGE_ON_START)
- {
- - activeChar.sendPacket(new CreatureSay(2, Say2.HERO_VOICE,Config.PM_TEXT1,Config.PM_SERVER_NAME));
- + activeChar.sendPacket(new CreatureSay(2, Say2.TELL,Config.PM_TEXT1,Config.PM_SERVER_NAME));
- activeChar.sendPacket(new CreatureSay(15, Say2.PARTYROOM_COMMANDER,activeChar.getName(),Config.PM_TEXT2));
- }
- if (Config.SERVER_TIME_ON_START)
- - activeChar.sendMessage("SVR time is " + fmt.format(new Date(System.currentTimeMillis())));
- + activeChar.sendMessage("Server time:" + fmt.format(new Date(System.currentTimeMillis())));
- }
- private void ColorSystem(L2PcInstance activeChar)
- @@ -709,6 +726,8 @@
- activeChar.sendMessage("[Aio System]: Left " + (int)hour + " hours to Aio period ends.");
- }
- }
- + if(Config.ALLOW_AIO_EFFECT && activeChar.isAio())
- + activeChar.startAbnormalEffect(0x400000);
- }
- /**
- @@ -820,12 +839,23 @@
- {
- Castle castle = CastleManager.getInstance().getCastleById(clan.getHasCastle());
- if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
- - Announcements.getInstance().announceToAll("Lord " + activeChar.getName() + " Ruler Of " + castle.getName() + " Castle is now Online!");
- + Announcements.getInstance().announceToAll((new StringBuilder()).append("Lord ").append(activeChar.getName()).append(" ruler of ").append(castle.getName()).append(" Castle logged in the game.").toString());
- }
- }
- }
- - @Override
- + /**
- + * Envia mensagem para o player do proximo restart
- + * NOTE: RESTART_BY_TIME_OF_DAY = TRUE
- + *
- + * @param activeChar
- + */
- + private void ShowNextRestart(L2PcInstance activeChar)
- + {
- + activeChar.sendMessage("Next Restart: " + Restart.getInstance().getRestartNextTime());
- + }
- +
- + @Override
- public String getType()
- {
- return "[C] 03 EnterWorld";
- Index: head-src/com/l2jfrozen/gameserver/GameServer.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/GameServer.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/GameServer.java (working copy)
- @@ -564,6 +564,14 @@
- if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
- OfflineTradeTable.restoreOfflineTraders();
- +
- + Util.printSection("Restart Manager");
- + if(Config.RESTART_BY_TIME_OF_DAY)
- + Restart.getInstance().StartCalculationOfNextRestartTime();
- + else
- + _log.info("# Auto Restart System is Disabled #");
- +
- + System.gc();
- Util.printSection("Info");
- _log.info("Operating System: " + Util.getOSName() + " " + Util.getOSVersion() + " " + Util.getOSArch());
- Index: head-src/com/l2jfrozen/FService.java
- ===================================================================
- --- head-src/com/l2jfrozen/FService.java (revision 1004)
- +++ head-src/com/l2jfrozen/FService.java (working copy)
- @@ -92,6 +92,9 @@
- public static final String LOG_CONF_FILE = "./config/others/log.cfg";
- public static final String BANNED_IP = "./config/others/banned_ip.cfg";
- public static final String SERVER_NAME_FILE = "./config/others/servername.xml";
- +
- + // By Excalibur
- + public static final String EXCALIBUR_FILE = "./config/Excalibur/Custom.properties";
- // Legacy others position
- public static final String LEGACY_LOG_CONF_FILE = "./log.cfg";
- Index: head-src/com/l2jfrozen/gameserver/managers/PlayerKillsManager.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/managers/PlayerKillsManager.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/managers/PlayerKillsManager.java (working copy)
- @@ -0,0 +1,342 @@
- +package com.l2jfrozen.gameserver.managers;
- +
- +import java.util.Map.Entry;
- +import java.util.logging.Logger;
- +
- +
- +import com.l2jfrozen.gameserver.model.entity.Announcements;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.gameserver.model.L2World;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.PcInventory;
- +
- +import javolution.util.FastList;
- +import javolution.util.FastMap;
- +
- +/**
- + * Класс управляет выдачей наград за убийство определенного игрока
- + * @author sednka
- + *
- + */
- +public class PlayerKillsManager {
- +
- + /** allowedItem */
- + public FastMap<Integer, String> allowedItems;
- +
- + /** Max orders count */
- + public static final int TASKS_MAX_COUNT = 60;
- +
- + /** Orders delete interval (0 - not delete)*/
- + public static final int TASKS_DELETE_INTERVAL = 45;
- +
- + /** Max kills count (0 - Unlimited) */
- + public static final int MAX_KILLS_COUNT = 5;
- +
- + /** Announce */
- + public static final boolean ANNOUNCE_ON_ADD = true;
- +
- + /** Announce */
- + public static final String ADD_MESSAGE = "Player %playername% has appointed the award for the player's head %aimname% %itemcount% %itemname%";
- +
- + /** Announce */
- + public static final boolean ANNOUNCE_ON_KILL = true;
- +
- + /** Announce */
- + public static final String KILL_MESSAGE = "Player %killer% has executed the order and has killed the player %aim%";
- +
- + /** Price (ID) */
- + public static final int PRICE_ITEMID = 4037;
- +
- + /** Price count; 0-off*/
- + public static final int PRICE_ITEMCOUNT = 1;
- +
- + public static final String PRICE_ITEMNAME = "Coin of Luck";
- +
- + private FastList<KillTask> _aims;
- +
- + private static final Logger _log = Logger.getLogger(PlayerKillsManager.class.getName());
- + private static PlayerKillsManager _instance;
- +
- + private static int lastTaskId;
- +
- + private PlayerKillsManager()
- + {
- + lastTaskId = 0;
- +
- + allowedItems = new FastMap<Integer, String>();
- + allowedItems.put(57, "Adena");
- + allowedItems.put(4037, "CoL");
- + allowedItems.put(6673, "FestivalAdena");
- +
- + _log.info("PlayerKillsManager: init (allowed items: " + allowedItems.keySet().size() + ", delete delay: " + TASKS_DELETE_INTERVAL + ", max tasks: " + TASKS_MAX_COUNT + ").");
- +
- + _aims = new FastList<KillTask>();
- + if(TASKS_DELETE_INTERVAL != 0)
- + ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new UpdateKillTasks(), TASKS_DELETE_INTERVAL*60*1000, TASKS_DELETE_INTERVAL*60*1000);
- + }
- +
- + /**
- + * Добавить "жертву" в список
- + * @param ownerObjId ObjectID того, кто создает заявку
- + * @param aimObjectId ObjectID "жертвы"
- + * @param killsCount Количество убийств
- + * @param rewardItemId ID айтема (награда)
- + * @param rewardItemCount Количество айтема
- + * @return Реузльтат добавления
- + */
- + public String addKillTask(int ownerObjId, int aimObjectId, int killsCount, int rewardItemId, int rewardItemCount)
- + {
- + if(getTasksCount() >= TASKS_MAX_COUNT)
- + return "There are currently too many orders, try again later.";
- +
- + if(getTaskForPlayer(aimObjectId) != null) return "This player has already ordered";
- +
- + if(MAX_KILLS_COUNT != 0 && killsCount > MAX_KILLS_COUNT) return "Limit is exceeded deaths for player";
- +
- + L2PcInstance owner = L2World.getInstance().getPlayer(ownerObjId);
- + PcInventory inv = owner.getInventory();
- +
- + if(checkItems(inv, killsCount, rewardItemId, rewardItemCount))
- + {
- + owner.destroyItemByItemId("l2killmanager", rewardItemId, (killsCount*rewardItemCount), null, true);
- + owner.destroyItemByItemId("l2killmanager", PRICE_ITEMID, PRICE_ITEMCOUNT, null, true);
- +
- + KillTask task = new KillTask(lastTaskId++, ownerObjId, aimObjectId, killsCount, rewardItemId, rewardItemCount, System.currentTimeMillis());
- + _aims.add(task);
- + if(ANNOUNCE_ON_ADD)
- + {
- + String itemName = getItemName(rewardItemId);
- + String playerName = owner.getName();
- + String aimName = L2World.getInstance().getPlayer(aimObjectId).getName();
- + Announcements.getInstance().announceToAll(ADD_MESSAGE.replace("%playername%", playerName).replace("%aimname%", aimName).replace("%itemcount%", String.valueOf(rewardItemCount)).replace("%itemname%", itemName));
- + }
- + return "Order has been successfully added!";
- + }
- + return "Insufficient items.";
- + }
- +
- + /**
- + * Удаляет заказ из списка и возвращает деньги заказчику
- + * @param player Игрок (заказчик)
- + * @param taskId Номер заказа
- + * @return Результат удаления
- + */
- + public String removeKillTask(L2PcInstance player, int taskId)
- + {
- + KillTask task = getTaskOfPlayer(player.getObjectId());
- + if(task != null && player.getObjectId() == task.ownerObjectId)
- + {
- + player.addItem("l2killmanager", task.rewardItemId, task.count * task.rewardItemCount, null, true);
- + _aims.remove(task);
- + return "Заказ успешно удален.";
- + }
- + return "Order was successfully removed..";
- + }
- +
- + public void onKill(int aimObjectId, int killerObjectId)
- + {
- + L2PcInstance aim = L2World.getInstance().getPlayer(aimObjectId);
- + L2PcInstance killer = L2World.getInstance().getPlayer(killerObjectId);
- +
- + KillTask task = getTaskForPlayer(aimObjectId);
- +
- + if(task == null) return;
- +
- + if(task.count > 0)
- + {
- + task.updateKills(killer.getName());
- +
- + killer.addItem("l2killmanager", task.rewardItemId, task.rewardItemCount, null, true);
- +
- + if(ANNOUNCE_ON_KILL) Announcements.getInstance().announceToAll(KILL_MESSAGE.replace("%killer%", killer.getName()).replace("%aim%", aim.getName()));
- +
- + }
- + }
- +
- + /**
- + * Проверяет наличее всех необходимых айтемов у чаров для оплаты
- + * Т.к. проверка объемная вынесена в отдельный метод
- + * @param inventory Инвентарь чара
- + * @param killsCount Количество убийств
- + * @param rewardItemId ID Айтема-награды за убийство
- + * @param rewardItemCount Количество айтема
- + */
- + public boolean checkItems(PcInventory inventory, int killsCount, int rewardItemId, int rewardItemCount)
- + {
- + if(!allowedItems.containsKey(rewardItemId))
- + return false;
- + if(inventory.getItemByItemId(rewardItemId) == null || (inventory.getItemByItemId(PRICE_ITEMID) == null))
- + return false;
- + if(rewardItemId == PRICE_ITEMID)
- + {
- + if(inventory.getItemByItemId(rewardItemId).getCount() < (killsCount*rewardItemCount)+PRICE_ITEMCOUNT)
- + return false;
- + }
- + else
- + {
- + if(inventory.getItemByItemId(rewardItemId).getCount() < (killsCount*rewardItemCount))
- + return false;
- + if(inventory.getItemByItemId(PRICE_ITEMID).getCount() < PRICE_ITEMCOUNT)
- + return false;
- + }
- + return true;
- + }
- +
- + /**
- + * Создает строку-список с разрешенными айтемами (для оплаты убийств)
- + * @return Строку, названия в которой разделены ";"
- + */
- + public String getPriceList()
- + {
- + StringBuilder res = new StringBuilder();
- + for(String name: allowedItems.values())
- + {
- + res.append(name).append(";");
- + }
- + return res.toString();
- + }
- +
- + /**
- + * Ищет и возвращает название айтема по его ID.
- + * Это нужно для сокращенных названий предметов
- + * @param name Имя предмета
- + * @return ID Предмета
- + */
- + public int getItemId(String name)
- + {
- + name.trim();
- + for(Entry<Integer, String> entry: allowedItems.entrySet())
- + {
- + if(entry.getValue().equalsIgnoreCase(name))
- + return entry.getKey();
- + }
- + return 0;
- + }
- +
- + public String getItemName(int id)
- + {
- + return allowedItems.get(id);
- + }
- +
- + /**
- + * Возвращает задачу по ObjectID жертвы
- + * @param aimObjId
- + * @return
- + */
- + public KillTask getTaskForPlayer(int aimObjId)
- + {
- + for(KillTask task: _aims)
- + {
- + if(task.aimObjectId == aimObjId)
- + return task;
- + }
- +
- + return null;
- + }
- +
- + public KillTask getTaskOfPlayer(int ownerObjId)
- + {
- + for(KillTask task: _aims)
- + {
- + if(task.ownerObjectId == ownerObjId)
- + return task;
- + }
- +
- + return null;
- + }
- +
- + public KillTask getTaskById(int id)
- + {
- + for(KillTask task: _aims)
- + {
- + if(task.id == id)
- + return task;
- + }
- + return null;
- + }
- +
- + public int getTasksCount()
- + {
- + return _aims.size();
- + }
- +
- + public FastList<KillTask> getKillTasks()
- + {
- + return _aims;
- + }
- +
- + public static PlayerKillsManager getInstance()
- + {
- + if(_instance == null)
- + _instance = new PlayerKillsManager();
- + return _instance;
- + }
- +
- + public class KillTask
- + {
- + public int id;
- + public int ownerObjectId;
- + public int aimObjectId;
- + public String ownerName;
- + public String aimName;
- + public int count;
- + public int rewardItemId;
- + public int rewardItemCount;
- + public long startTime;
- +
- + private FastMap<String, Integer> killers;
- +
- + public KillTask(int id, int ownerObjectId, int aimObjectId, int count, int rewardItemId, int rewardItemCount, long startTime)
- + {
- + this.id = id;
- + this.ownerObjectId = ownerObjectId;
- + this.aimObjectId = aimObjectId;
- + this.count = count;
- + this.rewardItemId = rewardItemId;
- + this.rewardItemCount = rewardItemCount;
- + this.startTime = startTime;
- + killers = new FastMap<String, Integer>();
- + this.aimName = L2World.getInstance().getPlayer(aimObjectId).getName();
- + this.ownerName = L2World.getInstance().getPlayer(ownerObjectId).getName();
- + }
- +
- + protected void updateKills(String killerName)
- + {
- + count--;
- + if(killers.get(killerName) == null)
- + killers.put(killerName, 1);
- + else
- + {
- + int count = killers.get(killerName);
- + killers.put(killerName, ++count);
- + }
- + if(count == 0) _aims.remove(this);
- + }
- +
- + public FastMap<String, Integer> getKillers()
- + {
- + return killers;
- + }
- + }
- +
- + class UpdateKillTasks implements Runnable
- + {
- + public UpdateKillTasks() {}
- +
- + @Override
- + public void run()
- + {
- + int count = 0;
- + for(KillTask task: _aims)
- + {
- + if((task.startTime + TASKS_DELETE_INTERVAL * 60 * 1000) <= System.currentTimeMillis())
- + {
- + count++;
- + _aims.remove(task);
- + }
- + }
- + _log.info("PlayerKillsManager: " + count + " aims deleted (time limit)");
- + }
- +
- + }
- +}
- Index: config/Excalibur/Custom.properties
- ===================================================================
- --- config/Excalibur/Custom.properties (revision 0)
- +++ config/Excalibur/Custom.properties (working copy)
- @@ -0,0 +1,102 @@
- +# ---------------------------------------
- +# Clan Full (Comand) -
- +# ---------------------------------------
- +# Enable and Disable Command //clanfull
- +EnableClanSystem = True
- +
- +# Clan Skills reward
- +# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
- +ClanSkills = 370,3;371,3;372,3;373,3;374,3;375,3;376,3;377,3;378,3;379,3;380,3;381,3;382,3;383,3;384,3;385,3;386,3;387,3;388,3;389,3;390,3;391,1;
- +
- +# Clan Level Reward
- +ClanSetLevel = 8
- +
- +# Clan Reputation Points reward
- +ReputationScore = 15000
- +
- +# ---------------------------------------
- +# Npc Crest -
- +# ---------------------------------------
- +# Show clan, alliance crests for territory NPC's.
- +# Default: False
- +ShowNpcCrest = True
- +
- +# ---------------------------------------
- +# All in One -
- +# ---------------------------------------
- +# Enable Aio Effect
- +AllowAioEffect = True
- +
- +# ---------------------------------------
- +# Announces -
- +# ---------------------------------------
- +# Announce Castle Lords on enter game. default = false
- +AnnounceCastleLords = True
- +
- +# Announce character Aio on enter game. default = false
- +AnnounceAioLogin = True
- +
- +# Announce character Hero on enter game. default = false
- +AnnounceHeroLogin = True
- +
- +# Announce character Noble on enter game. default = false
- +AnnounceNobleLogin = False
- +
- +# Announce character Donator on enter game. default = false
- +AnnounceDonatorLogin = True
- +
- +# Announce new char on enter game. default = false
- +AnnounceNewbieLogin = True
- +
- +# ---------------------------------------
- +# Auto Restart -
- +# ---------------------------------------
- +# Enable and Disable Auto Restart
- +EnableRestartSystem = True
- +
- +# If EnableRestartSystem = True Describe hours of the day
- +# Example: 00:00,12:00 (hh:mm,hh:mm...)
- +# NOTE: Separate ":" mm:hh and "," others restart time
- +RestartByTimeOfDay = 00:00,12:00,08:00
- +
- +# Seconds to restart the server ( 360 = 5 Minutes )
- +# default = 360
- +RestartSeconds = 360
- +
- +# ---------------------------------------
- +# Disable Weapons for Classes -
- +# ---------------------------------------
- +#Disable weapons for classes: write here classes id
- +# classId className
- +# 88 Duelist
- +# 89 DreadNought
- +# 90 Phoenix Knight
- +#you can find others into char_templates database table
- +# Example
- +#DisableBowForClasses = 88, 89, 90
- +AltDisableBow = True
- +DisableBowForClasses = 88,89,90,91,99,105,112,113,114
- +
- +AltDisableDagger = True
- +DisableDaggerForClasses =
- +
- +AltDisableSword = True
- +DisableSwordForClasses =
- +
- +AltDisableBlunt = True
- +DisableBluntForClasses =
- +
- +AltDisableDual = True
- +DisableDualForClasses =
- +
- +AltDisablePole = True
- +DisablePoleForClasses =
- +
- +AltDisableBigSword = True
- +DisableBigSwordForClasses =
- +
- +AltDisableBigblunt = True
- +DisableBigBluntForClasses =
- +
- +AltDisableDualfist = True
- +DisableDualFistForClasses =
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfo.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfo.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfo.java (working copy)
- @@ -19,12 +19,16 @@
- package com.l2jfrozen.gameserver.network.serverpackets;
- import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.datatables.sql.ClanTable;
- +import com.l2jfrozen.gameserver.managers.TownManager;
- import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.L2Clan;
- import com.l2jfrozen.gameserver.model.L2Summon;
- import com.l2jfrozen.gameserver.model.actor.instance.L2MonsterInstance;
- import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance;
- import com.l2jfrozen.gameserver.model.actor.instance.L2SummonInstance;
- +import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;
- /**
- * This class ...
- @@ -68,6 +72,11 @@
- /** The _title. */
- private String _title = "";
- +
- + int _clanCrest = 0;
- + int _allyCrest = 0;
- + int _allyId = 0;
- + int _clanId = 0;
- /**
- * Instantiates a new npc info.
- @@ -126,7 +135,32 @@
- _title = t;
- }
- -
- + if(Config.SHOW_NPC_CREST)
- + {
- + if(cha instanceof L2NpcInstance && cha.isInsideZone(L2Character.ZONE_PEACE) && cha.getCastle().getOwnerId() != 0)
- + {
- + int _x,_y,_z;
- + _x = cha.getX();
- + _y = cha.getY();
- + _z = cha.getZ();
- + L2TownZone Town;
- + Town = TownManager.getInstance().getTown(_x, _y, _z);
- + if(Town != null)
- + {
- + int townId = Town.getTownId();
- + if(townId != 33 && townId != 22)
- + {
- + L2Clan clan;
- + clan = ClanTable.getInstance().getClan(cha.getCastle().getOwnerId());
- + _clanCrest = clan.getCrestId();
- + _clanId = clan.getClanId();
- + _allyCrest = clan.getAllyCrestId();
- + _allyId = clan.getAllyId();
- + }
- + }
- + }
- + }
- +
- _x = _activeChar.getX();
- _y = _activeChar.getY();
- _z = _activeChar.getZ();
- @@ -231,11 +265,21 @@
- }
- writeD(_activeChar.getAbnormalEffect()); // C2
- - writeD(0000); // C2
- - writeD(0000); // C2
- - writeD(0000); // C2
- - writeD(0000); // C2
- - writeC(0000); // C2
- + if(Config.SHOW_NPC_CREST)
- + {
- + writeD(_clanId);
- + writeD(_clanCrest);
- + writeD(_allyId);
- + writeD(_allyCrest);
- + }
- + else
- + {
- + writeD(0000);
- + writeD(0000);
- + writeD(0000);
- + writeD(0000);
- + writeC(0000);
- + }
- writeC(0x00); // C3 team circle 1-blue, 2-red
- writeF(_collisionRadius);
- Index: head-src/com/l2jfrozen/gameserver/model/entity/event/DM.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/entity/event/DM.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/model/entity/event/DM.java (working copy)
- @@ -1755,12 +1755,11 @@
- {
- NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
- - TextBuilder replyMSG = new TextBuilder("<html><title>" + _eventName + "</title><body>");
- - replyMSG.append("<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br1>");
- - replyMSG.append("<center><font color=\"3366CC\">Current event:</font></center><br1>");
- - replyMSG.append("<center>Name: <font color=\"00FF00\">" + _eventName + "</font></center><br1>");
- - replyMSG.append("<center>Description: <font color=\"00FF00\">" + _eventDesc + "</font></center><br><br>");
- - replyMSG.append("<center>Event Type: <font color=\"00FF00\"> Full Buff Event!!! </font></center><br><br>");
- + TextBuilder replyMSG = new TextBuilder("<html><title>DM</title><body>");
- + replyMSG.append("<center><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"LEVEL\">Current event:</font></center><br1>");
- + replyMSG.append("<center>Name: <font color=\"0066CC\">" + _eventName + "</font></center><br1>");
- + replyMSG.append("<center>Description: <font color=\"0066CC\">" + _eventDesc + "</font></center><br>");
- // final Vector<L2PcInstance> players = getPlayers();
- synchronized (_players)
- @@ -1772,14 +1771,14 @@
- {
- if (!_started)
- {
- - replyMSG.append("Currently participated: <font color=\"00FF00\">" + _players.size() + ".</font><br>");
- - replyMSG.append("Max players: <font color=\"00FF00\">" + _maxPlayers + "</font><br><br>");
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
- + replyMSG.append("Currently participated: <font color=\"0066CC\">" + _players.size() + ".</font><br>");
- + replyMSG.append("Max players: <font color=\"0066CC\">" + _maxPlayers + "</font><br>");
- + replyMSG.append("<font color=\"0066CC\">You can't participate to this event.</font><br>");
- }
- }
- else if (eventPlayer.isCursedWeaponEquiped() && !Config.DM_JOIN_CURSED)
- {
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event with a cursed Weapon.</font><br>");
- + replyMSG.append("<font color=\"0066CC\">You can't participate to this event with a cursed Weapon.</font><br>");
- }
- else if (!_started && _joining && eventPlayer.getLevel() >= _minlvl && eventPlayer.getLevel() <= _maxlvl)
- {
- @@ -1787,31 +1786,33 @@
- {
- replyMSG.append("<center><font color=\"3366CC\">You participated already!</font></center><br><br>");
- - replyMSG.append("<center>Joined Players: <font color=\"00FF00\">" + _players.size() + "</font></center><br>");
- - replyMSG.append("<table border=\"0\"><tr>");
- - replyMSG.append("<td width=\"200\">Wait till event start or</td>");
- - replyMSG.append("<td width=\"60\"><center><button value=\"remove\" action=\"bypass -h npc_" + objectId + "_dmevent_player_leave\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></td>");
- - replyMSG.append("<td width=\"100\">your participation!</td>");
- - replyMSG.append("</tr></table>");
- + replyMSG.append("<center>Joined Players: <font color=\"0066CC\">" + _players.size() + "</font></center><br>");
- +
- + replyMSG.append("<center><button value=\"Remove\" action=\"bypass -h npc_" + objectId+ "_dmevent_player_leave\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"111111\">By Excalibur</font></center>");
- }
- else
- {
- - replyMSG.append("<center>Joined Players: <font color=\"00FF00\">" + _players.size() + "</font></center><br>");
- - replyMSG.append("<center><font color=\"3366CC\">You want to participate in the event?</font></center><br>");
- - replyMSG.append("<center><td width=\"200\">Min lvl: <font color=\"00FF00\">" + _minlvl + "</font></center></td><br>");
- - replyMSG.append("<center><td width=\"200\">Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font></center></td><br><br>");
- - replyMSG.append("<center><button value=\"Join\" action=\"bypass -h npc_" + objectId + "_dmevent_player_join\" width=50 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center><br>");
- -
- + replyMSG.append("<center><font color=\"LEVEL\">You want to participate in the event?</font></center><br>");
- + replyMSG.append("<center><td width=\"200\">Min. level: <font color=\"0066CC\">" + _minlvl + "</font></center></td><br>");
- + replyMSG.append("<center><td width=\"200\">Max. level: <font color=\"0066CC\">" + _maxlvl + "</font></center></td><br>");
- + replyMSG.append("<center><button value=\"Join Event\" action=\"bypass -h npc_" + objectId + "_dmevent_player_join\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center>");
- + replyMSG.append("<center>Joined Players: <font color=\"0066CC\">" + _players.size() + "</font></center><br>");
- + replyMSG.append("<center>Reward: <font color=\"LEVEL\">" + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()+ "</center></font>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center>");
- }
- }
- else if (_started && !_joining)
- replyMSG.append("<center>" + _eventName + " match is in progress.</center>");
- else if (eventPlayer.getLevel() < _minlvl || eventPlayer.getLevel() > _maxlvl)
- {
- - replyMSG.append("Your lvl: <font color=\"00FF00\">" + eventPlayer.getLevel() + "</font><br>");
- - replyMSG.append("Min lvl: <font color=\"00FF00\">" + _minlvl + "</font><br>");
- - replyMSG.append("Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font><br><br>");
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
- + replyMSG.append("<center>Your level: <font color=\"0066CC\">" + eventPlayer.getLevel() + "</font><br>");
- + replyMSG.append("<center>Min. level: <font color=\"0066CC\">" + _minlvl + "</font><br>");
- + replyMSG.append("<center>Max. level: <font color=\"0066CC\">" + _maxlvl + "</font><br><br>");
- + replyMSG.append("<center><font color=\"0066CC\">You can't participate to this event.</font><br>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"111111\">By Excalibur</font></center>");
- }
- }
- Index: head-src/com/l2jfrozen/Config.java
- ===================================================================
- --- head-src/com/l2jfrozen/Config.java (revision 1004)
- +++ head-src/com/l2jfrozen/Config.java (working copy)
- @@ -189,8 +189,203 @@
- public static boolean HIGH_RATE_SERVER_DROPS;
- public static boolean FORCE_COMPLETE_STATUS_UPDATE;
- -
- +
- //============================================================
- + public static boolean SHOW_NPC_CREST;
- + public static boolean ALLOW_AIO_EFFECT;
- + public static boolean ANNOUNCE_CASTLE_LORDS;
- + public static boolean ANNOUNCE_AIO_LOGIN;
- + public static boolean ANNOUNCE_HERO_LOGIN;
- + public static boolean ANNOUNCE_NOBLE_LOGIN;
- + public static boolean ANNOUNCE_DONATOR_LOGIN;
- + public static boolean ANNOUNCE_NEWBIE_LOGIN;
- + public static boolean RESTART_BY_TIME_OF_DAY;
- + public static int RESTART_SECONDS;
- + public static String[] RESTART_INTERVAL_BY_TIME_OF_DAY;
- + public static boolean ENABLE_CLAN_SYSTEM;
- + public static Map CLAN_SKILLS;
- + public static byte CLAN_LEVEL;
- + public static int REPUTATION_QUANTITY;
- + public static String DISABLE_BOW_CLASSES_STRING;
- + public static FastList DISABLE_BOW_CLASSES = new FastList();
- + public static String DISABLE_DAGGER_CLASSES_STRING;
- + public static FastList DISABLE_DAGGER_CLASSES = new FastList();
- + public static String DISABLE_SWORD_CLASSES_STRING;
- + public static FastList DISABLE_SWORD_CLASSES = new FastList();
- + public static String DISABLE_BLUNT_CLASSES_STRING;
- + public static FastList DISABLE_BLUNT_CLASSES = new FastList();
- + public static String DISABLE_DUAL_CLASSES_STRING;
- + public static FastList DISABLE_DUAL_CLASSES = new FastList();
- + public static String DISABLE_POLE_CLASSES_STRING;
- + public static FastList DISABLE_POLE_CLASSES = new FastList();
- + public static String DISABLE_BIGSWORD_CLASSES_STRING;
- + public static FastList DISABLE_BIGSWORD_CLASSES = new FastList();
- + public static String DISABLE_BIGBLUNT_CLASSES_STRING;
- + public static FastList DISABLE_BIGBLUNT_CLASSES = new FastList();
- + public static String DISABLE_DUALFIST_CLASSES_STRING;
- + public static FastList DISABLE_DUALFIST_CLASSES = new FastList();
- +
- +
- + //============================================================
- + public static void loadCustomConfig()
- + {
- + final String BYEXCALIBUR = FService.EXCALIBUR_FILE;
- +
- + try
- + {
- + Properties CustomSettings = new Properties();
- + InputStream is = new FileInputStream(new File(BYEXCALIBUR));
- + CustomSettings.load(is);
- + is.close();
- +
- + SHOW_NPC_CREST = Boolean.parseBoolean(CustomSettings.getProperty("ShowNpcCrest", "False"));
- + ALLOW_AIO_EFFECT = TypeFormat.parseBoolean(CustomSettings.getProperty("AllowAioEffect", "True"));
- + ANNOUNCE_AIO_LOGIN = Boolean.parseBoolean(CustomSettings.getProperty("AnnounceAioLogin", "False"));
- + ANNOUNCE_HERO_LOGIN = Boolean.parseBoolean(CustomSettings.getProperty("AnnounceHeroLogin", "False"));
- + ANNOUNCE_NOBLE_LOGIN = Boolean.parseBoolean(CustomSettings.getProperty("AnnounceNobleLogin", "False"));
- + ANNOUNCE_DONATOR_LOGIN = Boolean.parseBoolean(CustomSettings.getProperty("AnnounceDonatorLogin", "False"));
- + ANNOUNCE_NEWBIE_LOGIN = Boolean.parseBoolean(CustomSettings.getProperty("AnnounceNewbieLogin", "False"));
- + RESTART_BY_TIME_OF_DAY = Boolean.parseBoolean(CustomSettings.getProperty("EnableRestartSystem", "false"));
- + RESTART_SECONDS = Integer.parseInt(CustomSettings.getProperty("RestartSeconds", "360"));
- + RESTART_INTERVAL_BY_TIME_OF_DAY = CustomSettings.getProperty("RestartByTimeOfDay", "20:00").split(",");
- +
- + ENABLE_CLAN_SYSTEM = Boolean.parseBoolean(CustomSettings.getProperty("EnableClanSystem", "True"));
- + if(ENABLE_CLAN_SYSTEM)
- + {
- + String AioSkillsSplit[] = CustomSettings.getProperty("ClanSkills", "").split(";");
- + CLAN_SKILLS = new FastMap(AioSkillsSplit.length);
- + String arr$[] = AioSkillsSplit;
- + int len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String skill = arr$[i$];
- + String skillSplit[] = skill.split(",");
- + if(skillSplit.length != 2)
- + {
- + System.out.println((new StringBuilder()).append("[Clan System]: invalid config property in L2JDash.ini -> ClanSkills \"").append(skill).append("\"").toString());
- + continue;
- + }
- + try
- + {
- + CLAN_SKILLS.put(Integer.valueOf(Integer.parseInt(skillSplit[0])), Integer.valueOf(Integer.parseInt(skillSplit[1])));
- + continue;
- + }
- + catch(NumberFormatException nfe) { }
- + if(!skill.equals(""))
- + System.out.println((new StringBuilder()).append("[Clan System]: invalid config property in L2JDash.ini -> ClanSkills \"").append(skillSplit[0]).append("\"").append(skillSplit[1]).toString());
- + }
- +
- + }
- + CLAN_LEVEL = Byte.parseByte(CustomSettings.getProperty("ClanSetLevel", "8"));
- + REPUTATION_QUANTITY = Integer.parseInt(CustomSettings.getProperty("ReputationScore", "10000"));
- +
- + DISABLE_BOW_CLASSES_STRING = CustomSettings.getProperty("DisableBowForClasses", "");
- + DISABLE_BOW_CLASSES = new FastList();
- + String arr$[] = DISABLE_BOW_CLASSES_STRING.split(",");
- + int len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_BOW_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_DAGGER_CLASSES_STRING = CustomSettings.getProperty("DisableDaggerForClasses", "");
- + DISABLE_DAGGER_CLASSES = new FastList();
- + arr$ = DISABLE_DAGGER_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_DAGGER_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_SWORD_CLASSES_STRING = CustomSettings.getProperty("DisableSwordForClasses", "");
- + DISABLE_SWORD_CLASSES = new FastList();
- + arr$ = DISABLE_SWORD_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_SWORD_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_BLUNT_CLASSES_STRING = CustomSettings.getProperty("DisableBluntForClasses", "");
- + DISABLE_BLUNT_CLASSES = new FastList();
- + arr$ = DISABLE_BLUNT_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_BLUNT_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_DUAL_CLASSES_STRING = CustomSettings.getProperty("DisableDualForClasses", "");
- + DISABLE_DUAL_CLASSES = new FastList();
- + arr$ = DISABLE_DUAL_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_DUAL_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_POLE_CLASSES_STRING = CustomSettings.getProperty("DisablePoleForClasses", "");
- + DISABLE_POLE_CLASSES = new FastList();
- + arr$ = DISABLE_POLE_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_POLE_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_BIGSWORD_CLASSES_STRING = CustomSettings.getProperty("DisableBigSwordForClasses", "");
- + DISABLE_BIGSWORD_CLASSES = new FastList();
- + arr$ = DISABLE_BIGSWORD_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_BIGSWORD_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_BIGBLUNT_CLASSES_STRING = CustomSettings.getProperty("DisableBigBluntForClasses", "");
- + DISABLE_BIGBLUNT_CLASSES = new FastList();
- + arr$ = DISABLE_BIGBLUNT_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_BIGBLUNT_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + DISABLE_DUALFIST_CLASSES_STRING = CustomSettings.getProperty("DisableDualFistForClasses", "");
- + DISABLE_DUALFIST_CLASSES = new FastList();
- + arr$ = DISABLE_DUALFIST_CLASSES_STRING.split(",");
- + len$ = arr$.length;
- + for(int i$ = 0; i$ < len$; i$++)
- + {
- + String class_id = arr$[i$];
- + if(!class_id.equals(""))
- + DISABLE_DUALFIST_CLASSES.add(Integer.valueOf(Integer.parseInt(class_id)));
- + }
- +
- + }
- + catch(Exception e)
- + {
- + e.printStackTrace();
- + throw new Error("Failed to Load " + BYEXCALIBUR + " File.");
- + }
- + }
- + //============================================================
- public static void loadOptionsConfig()
- {
- final String OPTIONS = FService.OPTIONS_FILE;
- @@ -570,8 +765,7 @@
- public static int AIO_TCOLOR;
- public static boolean ALLOW_AIO_USE_GK;
- public static boolean ALLOW_AIO_USE_CM;
- - public static boolean ANNOUNCE_CASTLE_LORDS;
- -
- +
- /** Configuration to allow custom items to be given on character creation */
- public static boolean CUSTOM_STARTER_ITEMS_ENABLED;
- public static List<int[]> STARTING_CUSTOM_ITEMS_F = new ArrayList<int[]>();
- @@ -674,7 +868,6 @@
- AIO_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioTitleColor", "88AA88"));
- ALLOW_AIO_USE_GK = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseGk", "False"));
- ALLOW_AIO_USE_CM = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseClassMaster", "False"));
- - ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False"));
- if(ENABLE_AIO_SYSTEM) //create map if system is enabled
- {
- String[] AioSkillsSplit = otherSettings.getProperty("AioSkills", "").split(";");
- @@ -1135,9 +1328,6 @@
- public static byte BASE_SUBCLASS_LEVEL;
- public static byte MAX_SUBCLASS_LEVEL;
- - public static String DISABLE_BOW_CLASSES_STRING;
- - public static FastList<Integer> DISABLE_BOW_CLASSES = new FastList<Integer>();
- -
- public static boolean ALT_MOBS_STATS_BONUS;
- public static boolean ALT_PETS_STATS_BONUS;
- @@ -3642,14 +3832,6 @@
- REMOVE_WEAPON_SUBCLASS = Boolean.parseBoolean(PHYSICSSetting.getProperty("RemoveWeaponSubclass", "False"));
- REMOVE_CHEST_SUBCLASS = Boolean.parseBoolean(PHYSICSSetting.getProperty("RemoveChestSubclass", "False"));
- REMOVE_LEG_SUBCLASS = Boolean.parseBoolean(PHYSICSSetting.getProperty("RemoveLegSubclass", "False"));
- -
- - DISABLE_BOW_CLASSES_STRING = PHYSICSSetting.getProperty("DisableBowForClasses", "");
- - DISABLE_BOW_CLASSES = new FastList<Integer>();
- - for (String class_id : DISABLE_BOW_CLASSES_STRING.split(",")){
- - if(!class_id.equals(""))
- - DISABLE_BOW_CLASSES.add(Integer.parseInt(class_id));
- - }
- -
- LEAVE_BUFFS_ON_DIE = Boolean.parseBoolean(PHYSICSSetting.getProperty("LeaveBuffsOnDie", "True"));
- }
- @@ -4518,6 +4700,9 @@
- loadEnchantConfig();
- loadBossConfig();
- + // By Excalibur
- + loadCustomConfig();
- +
- // Head functions
- loadL2JFrozenConfig();
- loadPHYSICSConfig();
- @@ -4581,6 +4766,14 @@
- }
- }
- + /**
- + *
- + */
- + private static void loadCustomOptions()
- + {
- + // TODO Auto-generated method stub
- +
- + }
- public static boolean setParameterValue(String pName, String pValue)
- {
- if(pName.equalsIgnoreCase("GmLoginSpecialEffect"))
- Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminClanFull.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminClanFull.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminClanFull.java (working copy)
- @@ -0,0 +1,65 @@
- +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
- +import com.l2jfrozen.gameserver.model.L2Clan;
- +import com.l2jfrozen.gameserver.model.L2Object;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.network.SystemMessageId;
- +import com.l2jfrozen.gameserver.network.serverpackets.EtcStatusUpdate;
- +import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
- +
- +public class AdminClanFull
- + implements IAdminCommandHandler
- +{
- +
- + public AdminClanFull()
- + {
- + }
- +
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if(command.startsWith("admin_clanfull"))
- + try
- + {
- + adminAddClanSkill(activeChar);
- + activeChar.sendMessage("Sucessfull usage //clanfull !");
- + }
- + catch(Exception e)
- + {
- + activeChar.sendMessage("Usage: //clanfull");
- + }
- + return true;
- + }
- +
- + private void adminAddClanSkill(L2PcInstance activeChar)
- + {
- + L2Object target = activeChar.getTarget();
- + if(target == null)
- + target = activeChar;
- + L2PcInstance player = null;
- + if(target instanceof L2PcInstance)
- + {
- + player = (L2PcInstance)target;
- + } else
- + {
- + activeChar.sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
- + return;
- + }
- + if(!player.isClanLeader())
- + player.sendPacket((new SystemMessage(SystemMessageId.S1_IS_NOT_A_CLAN_LEADER)).addString(player.getName()));
- + player.getClan().changeLevel(Config.CLAN_LEVEL);
- + player.ClanSkills();
- + player.sendPacket(new EtcStatusUpdate(activeChar));
- + }
- +
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +
- + private static String ADMIN_COMMANDS[] = {
- + "admin_clanfull"
- + };
- +
- +}
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/Shutdown.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/Shutdown.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/Shutdown.java (working copy)
- @@ -171,6 +171,18 @@
- }
- }
- + public void autoRestart(int time)
- + {
- + _secondsShut = time;
- +
- + countdown();
- +
- + _shutdownMode = GM_RESTART;
- +
- + _instance.setMode(GM_RESTART);
- + System.exit(2);
- + }
- +
- /**
- * Default constructor is only used internal to create the shutdown-hook instance
- */
- Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminMassHero.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminMassHero.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminMassHero.java (working copy)
- @@ -0,0 +1,67 @@
- +/*
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2, or (at your option)
- + * any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
- +
- +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
- +import com.l2jfrozen.gameserver.model.L2World;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;
- +
- +/**
- + * @author RedHoT
- + */
- +public class AdminMassHero implements IAdminCommandHandler
- +{
- + private static String[] ADMIN_COMMANDS =
- + {
- + "admin_masshero"
- + };
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (activeChar == null)
- + return false;
- +
- + if (command.startsWith("admin_masshero"))
- + {
- + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
- + {
- + if (player == null)
- + return false;
- +
- + /* Check to see if the player already is Hero and if aren't in Olympiad Mode */
- + if (!player.isHero() || !player.isInOlympiadMode())
- + {
- + player.setHero(true);
- + player.sendMessage("Admin is rewarding all online players with Hero Status.");
- + player.broadcastPacket(new SocialAction(player.getObjectId(), 16));
- + player.broadcastUserInfo();
- + }
- + player = null;
- + }
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +}
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (working copy)
- @@ -475,12 +475,60 @@
- if (item.getItem() instanceof L2Weapon && ((L2Weapon) item.getItem()).getItemType() == L2WeaponType.BOW && !item.isCupidBow())
- {
- - if (Config.DISABLE_BOW_CLASSES.contains(activeChar.getClassId().getId()))
- - {
- - activeChar.sendMessage("This item can not be equipped by your class");
- - activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- - return;
- - }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.BOW && Config.DISABLE_BOW_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.DAGGER && Config.DISABLE_DAGGER_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.SWORD && Config.DISABLE_SWORD_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.BLUNT && Config.DISABLE_BLUNT_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.DUAL && Config.DISABLE_DUAL_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.POLE && Config.DISABLE_POLE_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.BIGSWORD && Config.DISABLE_BIGSWORD_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.BIGBLUNT && Config.DISABLE_BIGBLUNT_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + if((item.getItem() instanceof L2Weapon) && ((L2Weapon)item.getItem()).getItemType() == L2WeaponType.DUALFIST && Config.DISABLE_DUALFIST_CLASSES.contains(Integer.valueOf(activeChar.getClassId().getId())))
- + {
- + activeChar.sendMessage("This item can not be equipped by your class");
- + activeChar.sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- }
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2SiegeRegisterInstance.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2SiegeRegisterInstance.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2SiegeRegisterInstance.java (working copy)
- @@ -0,0 +1,128 @@
- +/* This program is free software; you can redistribute it and/or modify
- +* it under the terms of the GNU General Public License as published by
- +* the Free Software Foundation; either version 2, or (at your option)
- +* any later version.
- +*
- +* This program is distributed in the hope that it will be useful,
- +* but WITHOUT ANY WARRANTY; without even the implied warranty of
- +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- +* GNU General Public License for more details.
- +*
- +* You should have received a copy of the GNU General Public License
- +* along with this program; if not, write to the Free Software
- +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- +* 02111-1307, USA.
- +*
- +* http://www.gnu.org/copyleft/gpl.html
- +*/
- +package com.l2jfrozen.gameserver.model.actor.instance;
- +
- +import com.l2jfrozen.gameserver.ai.CtrlIntention;
- +import com.l2jfrozen.gameserver.ai.L2CharacterAI;
- +import com.l2jfrozen.gameserver.managers.CastleManager;
- +import com.l2jfrozen.gameserver.model.entity.siege.Castle;
- +import com.l2jfrozen.gameserver.network.serverpackets.*;
- +import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- +import javolution.text.TextBuilder;
- +
- +// Referenced classes of package com.l2jfrozen.gameserver.model.actor.instance:
- +// L2FolkInstance, L2PcInstance
- +
- +public class L2SiegeRegisterInstance extends L2FolkInstance
- +{
- +
- + public L2SiegeRegisterInstance(int objectId, L2NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + public void onAction(L2PcInstance player)
- + {
- + if(!canTarget(player))
- + return;
- + player.setLastFolkNPC(this);
- + if(this != player.getTarget())
- + {
- + player.setTarget(this);
- + MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
- + player.sendPacket(my);
- + my = null;
- + player.sendPacket(new ValidateLocation(this));
- + } else
- + if(!canInteract(player))
- + player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
- + else
- + showHtmlWindow(player);
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + }
- +
- + public void onBypassFeedback(L2PcInstance player, String command)
- + {
- + if(command.startsWith("gludio_castle"))
- + showSiegeInfoWindow(player, 1);
- + else
- + if(command.startsWith("dion_castle"))
- + showSiegeInfoWindow(player, 2);
- + else
- + if(command.startsWith("giran_castle"))
- + showSiegeInfoWindow(player, 3);
- + else
- + if(command.startsWith("oren_castle"))
- + showSiegeInfoWindow(player, 4);
- + else
- + if(command.startsWith("aden_castle"))
- + showSiegeInfoWindow(player, 5);
- + else
- + if(command.startsWith("innadril_castle"))
- + showSiegeInfoWindow(player, 6);
- + else
- + if(command.startsWith("goddard_castle"))
- + showSiegeInfoWindow(player, 7);
- + else
- + if(command.startsWith("rune_castle"))
- + showSiegeInfoWindow(player, 8);
- + else
- + if(command.startsWith("schuttgart_castle"))
- + showSiegeInfoWindow(player, 9);
- + else
- + super.onBypassFeedback(player, command);
- + }
- +
- + public void showHtmlWindow(L2PcInstance activeChar)
- + {
- + NpcHtmlMessage nhm = new NpcHtmlMessage(5);
- + TextBuilder replyMSG = new TextBuilder("");
- + replyMSG.append("<html><body><center><title>Kratos</title>");
- + replyMSG.append("<br><img src=\"l2font-e.replay_logo-e\" width=255 height=60>");
- + replyMSG.append("<br><br>Welcome adventurer.");
- + replyMSG.append("<br><br>Register your clan to conquer a castle and Good luck.");
- + replyMSG.append("<br><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32>");
- + replyMSG.append("<table width=280><tr>");
- + replyMSG.append((new StringBuilder()).append("<td><button value=Giran action=\"bypass -h npc_").append(getObjectId()).append("_giran_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append((new StringBuilder()).append("<td><button value=Aden action=\"bypass -h npc_").append(getObjectId()).append("_aden_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append((new StringBuilder()).append("<td><button value=Rune action=\"bypass -h npc_").append(getObjectId()).append("_rune_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append("</tr></table>");
- + replyMSG.append("<br><br>");
- + replyMSG.append("<table width=280><tr>");
- + replyMSG.append((new StringBuilder()).append("<td><button value=Goddard action=\"bypass -h npc_").append(getObjectId()).append("_goddard_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append((new StringBuilder()).append("<td><button value=Dion action=\"bypass -h npc_").append(getObjectId()).append("_dion_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append((new StringBuilder()).append("<td><button value=schuttgart action=\"bypass -h npc_").append(getObjectId()).append("_schuttgart_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append("</tr></table>");
- + replyMSG.append("<br><br>");
- + replyMSG.append("<table width=280><tr>");
- + replyMSG.append((new StringBuilder()).append("<td><button value=Innadril action=\"bypass -h npc_").append(getObjectId()).append("_innadril_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append((new StringBuilder()).append("<td><button value=Oren action=\"bypass -h npc_").append(getObjectId()).append("_oren_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append((new StringBuilder()).append("<td><button value=Gludio action=\"bypass -h npc_").append(getObjectId()).append("_gludio_castle\" width=75 height=21 back=L2UI_ch3.Btn1_normalOn fore=L2UI_ch3.Btn1_normalOn></td>").toString());
- + replyMSG.append("</tr></table>");
- + replyMSG.append("<br><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32>");
- + nhm.setHtml(replyMSG.toString());
- + activeChar.sendPacket(nhm);
- + }
- +
- + public void showSiegeInfoWindow(L2PcInstance player, int castleId)
- + {
- + Castle c = CastleManager.getInstance().getCastleById(castleId);
- + if(c != null)
- + player.sendPacket(new SiegeInfo(c));
- + }
- +}
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PKManagerInstance.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PKManagerInstance.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PKManagerInstance.java (working copy)
- @@ -0,0 +1,287 @@
- +package com.l2jfrozen.gameserver.model.actor.instance;
- +
- +import java.util.Map.Entry;
- +import java.util.StringTokenizer;
- +
- +import com.l2jfrozen.gameserver.managers.PlayerKillsManager;
- +import com.l2jfrozen.gameserver.managers.PlayerKillsManager.KillTask;
- +
- +import javolution.util.FastList;
- +
- +import com.l2jfrozen.gameserver.model.L2World;
- +import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
- +import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
- +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
- +import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
- +import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
- +
- +/**
- + * @author sednka
- + *
- + */
- +public class L2PKManagerInstance extends L2FolkInstance {
- +
- + public static final int TASKS_PER_PAGE = 5;
- +
- + public static final String HTML_FOLDER = "data/html/pkmanager/";
- + public static final String INDEX_PAGE = HTML_FOLDER + "index.htm";
- + public static final String AIM_PAGE = HTML_FOLDER + "makeaim.htm";
- + public static final String SHOW_AIMS_PAGE = HTML_FOLDER + "showaims.htm";
- + public static final String SHOW_AIM_PAGE = HTML_FOLDER + "showaim.htm";
- + public static final String RESULT_PAGE = HTML_FOLDER + "result.htm";
- +
- + public L2PKManagerInstance(int objectId, L2NpcTemplate template) {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance player, String command)
- + {
- + StringTokenizer st = new StringTokenizer(command, " ");
- + String curCommand = st.nextToken();
- + if(curCommand.startsWith("openpage"))
- + {
- +
- + String pageName = st.nextToken();
- + if(pageName.equalsIgnoreCase("showaims"))
- + {
- + int pageId = Integer.parseInt(st.nextToken());
- + showAimsPage(player, pageId);
- + }
- + else if(pageName.equalsIgnoreCase("showaim"))
- + {
- + int taskId = -1;
- + if(st.countTokens() > 0)
- + {
- + try
- + {
- + taskId = Integer.parseInt(st.nextToken());
- + }
- + catch(NumberFormatException e)
- + {
- + sendHtmlMessage(player, "Wrong order.");
- + return;
- + }
- + }
- + KillTask task = PlayerKillsManager.getInstance().getTaskById(taskId);
- +
- + if(task != null)
- + showAimPage(player, task);
- + }
- + else
- + openPage(player, pageName);
- + }
- + //TODO переписать этот ужас
- + else if(curCommand.startsWith("addaim"))
- + {
- + String result;
- + if(st.countTokens() >= 4)
- + {
- + try
- + {
- + int itemId = PlayerKillsManager.getInstance().getItemId(st.nextToken());
- + int count = Integer.parseInt(st.nextToken());
- + String aimName = st.nextToken();
- + int aimObjId = L2World.getInstance().getPlayer(aimName) != null ? L2World.getInstance().getPlayer(aimName).getObjectId() : -1;
- + int killsCount = Integer.parseInt(st.nextToken());
- + if(count > 0 && killsCount > 0)
- + {
- + if(aimObjId > 0)
- + result = PlayerKillsManager.getInstance().addKillTask(player.getObjectId(), aimObjId, killsCount, itemId, count);
- + else
- + result = "Incorrectly specified target.";
- + }
- + else
- + {
- + result = "Incorrectly entered data.";
- + }
- + }
- + catch(NumberFormatException e)
- + {
- + result = "Incorrectly entered data.";
- + }
- + }
- + else
- + {
- + result = "You have specified not all data.";
- + }
- + sendHtmlMessage(player, result);
- + }
- + else if(curCommand.startsWith("delaim"))
- + {
- + if(st.countTokens() >= 1)
- + {
- + try
- + {
- + int taskId = Integer.parseInt(st.nextToken());
- + String result = PlayerKillsManager.getInstance().removeKillTask(player, taskId);
- + sendHtmlMessage(player, result);
- + }
- + catch(NumberFormatException e)
- + {
- + sendHtmlMessage(player, "You can't remove this order.");
- + }
- + }
- + }
- +
- + }
- +
- + private void openPage(L2PcInstance player, String pageName)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + if(pageName.equalsIgnoreCase("index"))
- + {
- + html.setFile(INDEX_PAGE);
- + }
- + else if(pageName.equalsIgnoreCase("makeaim"))
- + {
- + html.setFile(AIM_PAGE);
- + html.replace("%serviceprice%", PlayerKillsManager.PRICE_ITEMCOUNT + " <font color=LEVEL>" + PlayerKillsManager.PRICE_ITEMNAME + "</font>");
- + html.replace("%values%", PlayerKillsManager.getInstance().getPriceList());
- + }
- + // попытаемся прогрузить по имени htm
- + else
- + {
- + html.setFile(HTML_FOLDER + pageName + ".htm");
- + }
- +
- + sendHtmlMessage(player, html);
- + }
- +
- + /**
- + * Показывает страницу со списком "заказанных игроков".
- + * @param player Игрок
- + * @param pageId Номер страницы
- + */
- + //TODO Переделать и этот ужас
- + private void showAimsPage(L2PcInstance player, int pageId)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + html.setFile(SHOW_AIMS_PAGE);
- +
- + StringBuilder sb = new StringBuilder();
- +
- + int tasksCount = PlayerKillsManager.getInstance().getTasksCount();
- +
- + FastList<KillTask> killTasks = PlayerKillsManager.getInstance().getKillTasks();
- +
- + int num = pageId*TASKS_PER_PAGE;
- + if(num > tasksCount) num = tasksCount;
- + if(tasksCount > 0)
- + {
- + sb.append("<table width=300>");
- + for(int i = pageId*TASKS_PER_PAGE-TASKS_PER_PAGE;i < num;i++)
- + {
- + KillTask task = killTasks.get(i);
- + sb.append("<tr><td align=center width=75>").append(task.ownerName).append("</td>").append("<td align=center width=75>").append(task.aimName).append("</td>");
- + sb.append("<td align=center width=75>").append("<a action=\"bypass -h npc_%objectId%_openpage showaim ").append(task.id).append("\">");
- + sb.append("More...").append("</a></td></tr>");
- + }
- + sb.append("</table><br><br><br>");
- + int pg = getPagesCount(tasksCount);
- + sb.append("Pages: ");
- + for(int i = 1;i <= pg;i++)
- + {
- + if(i == pageId)
- + sb.append(i).append(" ");
- + else
- + sb.append("<a action=\"bypass -h npc_%objectId%_openpage showaims ").append(i).append("\">").append(i).append("</a> ");
- + }
- + }
- + else
- + sb.append("Orders not found");
- + html.replace("%data%", sb.toString());
- +
- + sendHtmlMessage(player, html);
- + }
- +
- + private void showAimPage(L2PcInstance player, KillTask task)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + html.setFile(SHOW_AIM_PAGE);
- + html.replace("%owner%", task.ownerName);
- + html.replace("%aim%", task.aimName);
- + html.replace("%items%", task.rewardItemCount + " <font color=LEVEL>" + PlayerKillsManager.getInstance().getItemName(task.rewardItemId) + "</font>");
- + html.replace("%killscount%", String.valueOf(task.count));
- +
- + StringBuilder sb = new StringBuilder();
- +
- + if(task.getKillers().isEmpty())
- + sb.append("No one kill");
- + else
- + {
- + sb.append("<table width=150>");
- + for(Entry<String, Integer> entry: task.getKillers().entrySet())
- + {
- + sb.append("<tr><td width=100 align=center>").append(entry.getKey()).append("</td>");
- + sb.append("<td width=50 align=center>").append(entry.getValue()).append("</td></tr>");
- + }
- + sb.append("</table>");
- + }
- + if(player.getObjectId() == task.ownerObjectId)
- + {
- + sb.append("<center><a action=\"bypass -h npc_%objectId%_delaim ").append(task.id).append("\">Delete</a></center>");
- + }
- +
- + html.replace("%killstable%", sb.toString());
- + sendHtmlMessage(player, html);
- + }
- +
- + //TODO уверен что это велосипед...
- + public int getPagesCount(int tasksCount)
- + {
- + if(tasksCount % TASKS_PER_PAGE > 0)
- + return tasksCount / TASKS_PER_PAGE + 1;
- + return tasksCount / TASKS_PER_PAGE;
- + }
- +
- + private void sendHtmlMessage(L2PcInstance player, NpcHtmlMessage html)
- + {
- + html.replace("%backlink%", "<a action=\"bypass -h npc_%objectId%_openpage index\">Back</a>");
- + html.replace("%objectId%", String.valueOf(getObjectId()));
- + html.replace("%npcId%", String.valueOf(getNpcId()));
- + player.sendPacket(html);
- + }
- +
- + /**
- + * Посылка HTM с заменой %text% на текст
- + * @param text Текст
- + */
- + private void sendHtmlMessage(L2PcInstance player, String text)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + html.setFile(RESULT_PAGE);
- + html.replace("%text%", text);
- + sendHtmlMessage(player, html);
- + }
- +
- + @Override
- + public void onAction(L2PcInstance player)
- + {
- + player.setLastFolkNPC(this);
- + if(!canTarget(player))
- + return;
- + if(this != player.getTarget())
- + {
- + player.setTarget(this);
- + MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
- + player.sendPacket(my);
- + player.sendPacket(new ValidateLocation(this));
- + }
- + else
- + {
- + if(!canInteract(player))
- + {
- +
- + }
- + else
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(1);
- + html.setFile(INDEX_PAGE);
- + sendHtmlMessage(player, html);
- + }
- + }
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + }
- +
- +}
- Index: head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/model/entity/Announcements.java (working copy)
- @@ -312,4 +312,12 @@
- e.printStackTrace();
- }
- }
- +
- + public void announceNormal(String message)
- + {
- + for (L2PcInstance player : L2World.getInstance().getAllPlayers())
- + {
- + player.sendMessage(message);
- + }
- + }
- }
- Index: head-src/com/l2jfrozen/gameserver/model/entity/event/TvT.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/entity/event/TvT.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/model/entity/event/TvT.java (working copy)
- @@ -1916,11 +1916,11 @@
- {
- NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
- - TextBuilder replyMSG = new TextBuilder("<html><title>"+_eventName+"</title><body>");
- - replyMSG.append("<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center><br1>");
- - replyMSG.append("<center><font color=\"3366CC\">Current event:</font></center><br1>");
- - replyMSG.append("<center>Name: <font color=\"00FF00\">" + _eventName + "</font></center><br1>");
- - replyMSG.append("<center>Description: <font color=\"00FF00\">" + _eventDesc + "</font></center><br><br>");
- + TextBuilder replyMSG = new TextBuilder("<html><title>TvT</title><body>");
- + replyMSG.append("<center><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"LEVEL\">Current event:</font></center><br1>");
- + replyMSG.append("<center>Name: <font color=\"0066CC\">" + _eventName + "</font></center><br1>");
- + replyMSG.append("<center>Description: <font color=\"0066CC\">" + _eventDesc + "</font></center><br>");
- if(!_started && !_joining)
- replyMSG.append("<center>Wait till the admin/gm start the participation.</center>");
- @@ -1928,14 +1928,14 @@
- {
- if(!_started)
- {
- - replyMSG.append("Currently participated: <font color=\"00FF00\">" + _playersShuffle.size() + ".</font><br>");
- - replyMSG.append("Max players: <font color=\"00FF00\">" + _maxPlayers + "</font><br><br>");
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
- + replyMSG.append("Currently participated: <font color=\"0066CC\">" + _playersShuffle.size() + ".</font><br>");
- + replyMSG.append("Max players: <font color=\"0066CC\">" + _maxPlayers + "</font><br>");
- + replyMSG.append("<font color=\"0066CC\">You can't participate to this event.</font><br>");
- }
- }
- else if(eventPlayer.isCursedWeaponEquiped() && !Config.TVT_JOIN_CURSED)
- {
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event with a cursed Weapon.</font><br>");
- + replyMSG.append("<font color=\"0066CC\">You can't participate to this event with a cursed Weapon.</font><br>");
- }
- else if(!_started && _joining && eventPlayer.getLevel()>=_minlvl && eventPlayer.getLevel()<=_maxlvl)
- {
- @@ -1943,21 +1943,22 @@
- if(_players.contains(eventPlayer) || _playersShuffle.contains(eventPlayer) || checkShufflePlayers(eventPlayer))
- {
- if(Config.TVT_EVEN_TEAMS.equals("NO") || Config.TVT_EVEN_TEAMS.equals("BALANCE"))
- - replyMSG.append("You participated already in team <font color=\"LEVEL\">" + eventPlayer._teamNameTvT + "</font><br><br>");
- + replyMSG.append("You participated already in team <font color=\"0066CC\">" + eventPlayer._teamNameTvT + "</font><br><br>");
- else if(Config.TVT_EVEN_TEAMS.equals("SHUFFLE"))
- - replyMSG.append("<center><font color=\"3366CC\">You participated already!</font></center><br><br>");
- -
- - replyMSG.append("<center>Joined Players: <font color=\"00FF00\">" + _playersShuffle.size() + "</font></center><br>");
- + replyMSG.append("<center><font color=\"0066CC\">You participated already!.</font></center><br>");
- +
- + replyMSG.append("<center>Joined Players: <font color=\"0066CC\">" + _playersShuffle.size() + "</font></center><br>");
- - replyMSG.append("<center><font color=\"3366CC\">Wait till event start or remove your participation!</font><center>");
- - replyMSG.append("<center><button value=\"Remove\" action=\"bypass -h npc_" + objectId+ "_tvt_player_leave\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center>");
- + replyMSG.append("<center><button value=\"Remove\" action=\"bypass -h npc_" + objectId+ "_tvt_player_leave\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"111111\">By Excalibur</font></center>");
- }
- else
- {
- - replyMSG.append("<center><font color=\"3366CC\">You want to participate in the event?</font></center><br>");
- - replyMSG.append("<center><td width=\"200\">Min lvl: <font color=\"00FF00\">" + _minlvl + "</font></center></td><br>");
- - replyMSG.append("<center><td width=\"200\">Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font></center></td><br><br>");
- - replyMSG.append("<center><font color=\"3366CC\">Teams:</font></center><br>");
- + replyMSG.append("<center><font color=\"LEVEL\">You want to participate in the event?</font></center><br>");
- + replyMSG.append("<center><td width=\"200\">Min. level: <font color=\"0066CC\">" + _minlvl + "</font></center></td><br>");
- + replyMSG.append("<center><td width=\"200\">Max. level: <font color=\"0066CC\">" + _maxlvl + "</font></center></td><br>");
- + replyMSG.append("<center><font color=\"LEVEL\">Teams: </font></center>");
- if(Config.TVT_EVEN_TEAMS.equals("NO") || Config.TVT_EVEN_TEAMS.equals("BALANCE"))
- {
- @@ -1965,9 +1966,9 @@
- for(String team : _teams)
- {
- - replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font> (" + teamPlayersCount(team) + " joined)</td>");
- + replyMSG.append("<tr><td width=\"100\"><font color=\"0066CC\">" + team + "</font> (" + teamPlayersCount(team) + " joined.)</td>");
- replyMSG.append("<center><td width=\"60\"><button value=\"Join\" action=\"bypass -h npc_" + objectId + "_tvt_player_join " + team
- - + "\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center></td></tr>");
- + + "\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center></td></tr>");
- }
- replyMSG.append("</table></center>");
- }
- @@ -1976,14 +1977,15 @@
- replyMSG.append("<center>");
- for(String team : _teams)
- - replyMSG.append("<tr><td width=\"100\"><font color=\"LEVEL\">" + team + "</font> </td>");
- + replyMSG.append("<tr><td width=\"100\"><font color=\"0066CC\">" + team + "</font> </td>");
- replyMSG.append("</center><br>");
- - replyMSG.append("<center><button value=\"Join Event\" action=\"bypass -h npc_" + objectId + "_tvt_player_join eventShuffle\" width=85 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></center>");
- - replyMSG.append("<center><font color=\"3366CC\">Teams will be reandomly generated!</font></center><br>");
- - replyMSG.append("<center>Joined Players:</font> <font color=\"LEVEL\">" + _playersShuffle.size() + "</center></font><br>");
- + replyMSG.append("<center><button value=\"Join Event\" action=\"bypass -h npc_" + objectId + "_tvt_player_join eventShuffle\" width=140 height=21 back=\"L2UI_ch3.msnbutton_over\" fore=\"L2UI_ch3.msnbutton\"></center>");
- + replyMSG.append("<center><font color=\"0066CC\">Teams will be reandomly generated!</font></center><br>");
- + replyMSG.append("<center>Joined Players: </font><font color=\"0066CC\">" + _playersShuffle.size() + "</center></font><br>");
- replyMSG.append("<center>Reward: <font color=\"LEVEL\">" + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()+ "</center></font>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center>");
- }
- }
- }
- @@ -1993,10 +1995,12 @@
- replyMSG.append("<center>"+_eventName+" match is in progress.</center>");
- else if(eventPlayer.getLevel() < _minlvl || eventPlayer.getLevel() > _maxlvl)
- {
- - replyMSG.append("Your lvl: <font color=\"00FF00\">" + eventPlayer.getLevel() + "</font><br>");
- - replyMSG.append("Min lvl: <font color=\"00FF00\">" + _minlvl + "</font><br>");
- - replyMSG.append("Max lvl: <font color=\"00FF00\">" + _maxlvl + "</font><br><br>");
- - replyMSG.append("<font color=\"FFFF00\">You can't participate to this event.</font><br>");
- + replyMSG.append("<center>Your level: <font color=\"0066CC\">" + eventPlayer.getLevel() + "</font><br>");
- + replyMSG.append("<center>Min. level: <font color=\"0066CC\">" + _minlvl + "</font><br>");
- + replyMSG.append("<center>Max. level: <font color=\"0066CC\">" + _maxlvl + "</font><br><br>");
- + replyMSG.append("<center><font color=\"0066CC\">You can't participate to this event.</font><br>");
- + replyMSG.append("<center><img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32></center><br1>");
- + replyMSG.append("<center><font color=\"111111\">By Excalibur</font></center>");
- }
- replyMSG.append("</body></html>");
- Index: head-src/com/l2jfrozen/L2Frozen.java
- ===================================================================
- --- head-src/com/l2jfrozen/L2Frozen.java (revision 1004)
- +++ head-src/com/l2jfrozen/L2Frozen.java (working copy)
- @@ -30,12 +30,37 @@
- public static void info()
- {
- - _log.info(" ");
- - _log.info(" # ##### ##### ##### ##### ##### ##### ## # ");
- - _log.info(" # # # # # # # # # # # # ");
- - _log.info(" # ### #### ### # # # # # ### # # # ");
- - _log.info(" # # # ### # # # # # # # ");
- - _log.info(" ##### ##### # # ## ##### ##### ##### # ## ");
- - _log.info(" ");
- + _log.info("############################################################################");
- + _log.info("## ##");
- + _log.info("## ##");
- + _log.info("## ##");
- + _log.info(" # ##### ### ##### ##### ##### ##### ##### ## # ");
- + _log.info(" # # # # # # # # # # # # # ");
- + _log.info(" # ### # ### # # # # # ### # # # ");
- + _log.info(" # # # # # ### # # # # # # # ");
- + _log.info(" ##### ##### ##### # # ## ##### ##### ##### # ## ");
- + _log.info(" Custom Edition By Excalibur ");
- + _log.info(" Skype: tasos4444 ");
- + _log.info("## ##");
- + _log.info("## ##");
- + _log.info("## ##");
- + _log.info("############################################################################");
- }
- }
- \ No newline at end of file
- Index: head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (working copy)
- @@ -37,6 +37,7 @@
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminChangeAccessLevel;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminCharSupervision;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminChristmas;
- +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminClanFull;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminCreateItem;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminCursedWeapons;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminDMEngine;
- @@ -93,6 +94,7 @@
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminVIPEngine;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWho;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminZone;
- +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMassHero;
- /**
- * This class ...
- @@ -144,6 +146,7 @@
- registerAdminCommandHandler(new AdminRepairChar());
- registerAdminCommandHandler(new AdminChangeAccessLevel());
- registerAdminCommandHandler(new AdminChristmas());
- + registerAdminCommandHandler(new AdminClanFull());
- registerAdminCommandHandler(new AdminBan());
- registerAdminCommandHandler(new AdminPolymorph());
- // registerAdminCommandHandler(new AdminBanChat());
- @@ -186,6 +189,7 @@
- registerAdminCommandHandler(new AdminAio());
- registerAdminCommandHandler(new AdminCharSupervision());
- registerAdminCommandHandler(new AdminWho()); // L2OFF command
- + registerAdminCommandHandler(new AdminMassHero());
- // ATTENTION: adding new command handlers, you have to change the
- // sql file containing the access levels rights
- Index: build.xml
- ===================================================================
- --- build.xml (revision 1004)
- +++ build.xml (working copy)
- @@ -184,6 +184,12 @@
- </fileset>
- </copy>
- + <copy todir="${build.dist.game}/config/Excalibur">
- + <fileset dir="config/Excalibur">
- + <include name="*.properties" />
- + </fileset>
- + </copy>
- +
- <copy todir="${build.dist.game}/config/functions">
- <fileset dir="config/functions">
- <include name="*.properties" />
- Index: head-src/com/l2jfrozen/gameserver/model/entity/siege/Castle.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/entity/siege/Castle.java (revision 1004)
- +++ head-src/com/l2jfrozen/gameserver/model/entity/siege/Castle.java (working copy)
- @@ -92,6 +92,7 @@
- private int _taxPercent = 0;
- private double _taxRate = 0;
- private int _treasury = 0;
- + private boolean _showNpcCrest = false;
- private L2CastleZone _zone;
- private L2CastleTeleportZone _teleZone;
- private L2Clan _formerOwner = null;
- @@ -376,6 +377,7 @@
- }
- updateOwnerInDB(clan); // Update in database
- + setShowNpcCrest(false);
- if(getSiege().getIsInProgress())
- {
- @@ -565,6 +567,7 @@
- _taxPercent = rs.getInt("taxPercent");
- _treasury = rs.getInt("treasury");
- + _showNpcCrest = rs.getBoolean("showNpcCrest");
- }
- rs.close();
- @@ -867,6 +870,20 @@
- return _treasury;
- }
- + public final boolean getShowNpcCrest()
- + {
- + return _showNpcCrest;
- + }
- +
- + public final void setShowNpcCrest(boolean showNpcCrest)
- + {
- + if(_showNpcCrest != showNpcCrest)
- + {
- + _showNpcCrest = showNpcCrest;
- + updateShowNpcCrest();
- + }
- + }
- +
- public FastList<SeedProduction> getSeedProduction(int period)
- {
- return period == CastleManorManager.PERIOD_CURRENT ? _production : _productionNext;
- @@ -1337,6 +1354,36 @@
- }
- }
- + public void updateShowNpcCrest()
- + {
- + Connection con = null;
- + PreparedStatement statement;
- + try
- + {
- + con = L2DatabaseFactory.getInstance().getConnection();
- +
- + statement = con.prepareStatement("UPDATE castle SET showNpcCrest = ? WHERE id = ?");
- + statement.setString(1, String.valueOf(getShowNpcCrest()));
- + statement.setInt(2, getCastleId());
- + statement.execute();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + _log.info("Error saving showNpcCrest for castle " + getName() + ": " + e.getMessage());
- + }
- + finally
- + {
- + try
- + {
- + con.close();
- + }
- + catch (Exception e)
- + {
- + }
- + }
- + }
- +
- public boolean isNextPeriodApproved()
- {
- return _isNextPeriodApproved;
Add Comment
Please, Sign In to add comment