SHOW:
|
|
- or go back to the newest paste.
1 | ### Eclipse Workspace Patch 1.0 | |
2 | #P L2jFrozen_GameServer | |
3 | Index: head-src/com/l2jfrozen/Config.java | |
4 | =================================================================== | |
5 | --- head-src/com/l2jfrozen/Config.java (revision 939) | |
6 | +++ head-src/com/l2jfrozen/Config.java (working copy) | |
7 | @@ -2121,8 +2121,11 @@ | |
8 | public static String PM_TEXT1; | |
9 | public static String PM_TEXT2; | |
10 | public static boolean NEW_PLAYER_EFFECT; | |
11 | - | |
12 | + public static boolean NEW_PLAYER_BUFFS; | |
13 | + public static Map<Integer, Integer> FIGHTER_BUFF_LIST; | |
14 | + public static Map<Integer, Integer> MAGE_BUFF_LIST; | |
15 | ||
16 | + | |
17 | //============================================================ | |
18 | public static void loadFrozenConfig() | |
19 | { | |
20 | @@ -2143,7 +2146,59 @@ | |
21 | PM_TEXT1 = frozenSettings.getProperty("PMText1", "Have Fun and Nice Stay on"); | |
22 | PM_TEXT2 = frozenSettings.getProperty("PMText2", "Vote for us every 24h"); | |
23 | NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True")); | |
24 | + NEW_PLAYER_BUFFS = Boolean.parseBoolean(frozenSettings.getProperty("AltNewCharBuffs", "False")); | |
25 | + if(NEW_PLAYER_BUFFS) | |
26 | + { | |
27 | + String[] fighterBuffSplit = frozenSettings.getProperty("FighterBuffList", "").split(";"); | |
28 | + FIGHTER_BUFF_LIST = new FastMap<Integer, Integer>(fighterBuffSplit.length); | |
29 | + for(String skill : fighterBuffSplit) | |
30 | + { | |
31 | + String[] skillSplit = skill.split(","); | |
32 | + if(skillSplit.length != 2) | |
33 | + { | |
34 | + System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skill + "\""); | |
35 | + } | |
36 | + else | |
37 | + { | |
38 | + try | |
39 | + { | |
40 | + FIGHTER_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1])); | |
41 | + } | |
42 | + catch(NumberFormatException nfe) | |
43 | + { | |
44 | + if(!skill.equals("")) | |
45 | + { | |
46 | + System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]); | |
47 | + } | |
48 | + } | |
49 | + } | |
50 | + } | |
51 | ||
52 | + String[] mageBuffSplit = frozenSettings.getProperty("MageBuffList", "").split(";"); | |
53 | + MAGE_BUFF_LIST = new FastMap<Integer, Integer>(mageBuffSplit.length); | |
54 | + for(String skill : mageBuffSplit) | |
55 | + { | |
56 | + String[] skillSplit = skill.split(","); | |
57 | + if(skillSplit.length != 2) | |
58 | + { | |
59 | + System.out.println("invalid config property in " + Frozen + " -> MageBuffList \"" + skill + "\""); | |
60 | + } | |
61 | + else | |
62 | + { | |
63 | + try | |
64 | + { | |
65 | + MAGE_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1])); | |
66 | + } | |
67 | + catch(NumberFormatException nfe) | |
68 | + { | |
69 | + if(!skill.equals("")) | |
70 | + { | |
71 | + System.out.println("invalid config property in" + Frozen + " -> MageBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]); | |
72 | + } | |
73 | + } | |
74 | + } | |
75 | + } | |
76 | + } | |
77 | } | |
78 | catch(Exception e) | |
79 | { | |
80 | Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java | |
81 | =================================================================== | |
82 | --- head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (revision 939) | |
83 | +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/EnterWorld.java (working copy) | |
84 | @@ -285,6 +285,9 @@ | |
85 | Announcements.getInstance().showAnnouncements(activeChar); | |
86 | ||
87 | loadTutorial(activeChar); | |
88 | + | |
89 | + if(activeChar.getFirstLog()) | |
90 | + onEnterNewbie(activeChar); | |
91 | ||
92 | // Check for crowns | |
93 | CrownManager.getInstance().checkCrowns(activeChar); | |
94 | @@ -543,20 +546,6 @@ | |
95 | if (Config.ONLINE_PLAYERS_ON_LOGIN) | |
96 | sendPacket(new SystemMessage(SystemMessageId.S1_S2).addString("There are " + L2World.getInstance().getAllPlayers().size() + " players online.")); | |
97 | ||
98 | - if (activeChar.getFirstLog() && Config.NEW_PLAYER_EFFECT) | |
99 | - { | |
100 | - L2Skill skill = SkillTable.getInstance().getInfo(2025,1); | |
101 | - if (skill != null) | |
102 | - { | |
103 | - MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2025, 1, 1, 0); | |
104 | - activeChar.sendPacket(MSU); | |
105 | - activeChar.broadcastPacket(MSU); | |
106 | - activeChar.useMagic(skill, false, false); | |
107 | - } | |
108 | - activeChar.setFirstLog(false); | |
109 | - activeChar.updateFirstLog(); | |
110 | - } | |
111 | - | |
112 | if (Config.WELCOME_HTM && isValidName(activeChar.getName())) | |
113 | { | |
114 | String Welcome_Path = "data/html/welcome.htm"; | |
115 | @@ -688,6 +677,50 @@ | |
116 | } | |
117 | ||
118 | /** | |
119 | + * @param activeChar | |
120 | + */ | |
121 | + private void onEnterNewbie(L2PcInstance activeChar) | |
122 | + { | |
123 | + if(Config.NEW_PLAYER_EFFECT) | |
124 | + { | |
125 | + L2Skill skill = SkillTable.getInstance().getInfo(2025, 1); | |
126 | + if(skill != null) | |
127 | + { | |
128 | + MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2025, 1, 1, 0); | |
129 | + activeChar.sendPacket(MSU); | |
130 | + activeChar.broadcastPacket(MSU); | |
131 | + activeChar.useMagic(skill, false, false); | |
132 | + } | |
133 | + } | |
134 | + | |
135 | + if(Config.NEW_PLAYER_BUFFS) | |
136 | + { | |
137 | + if(activeChar.isMageClass()) | |
138 | + { | |
139 | + for(Integer skillid : Config.MAGE_BUFF_LIST.keySet()) | |
140 | + { | |
141 | + int skilllvl = Config.MAGE_BUFF_LIST.get(skillid); | |
142 | + L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl); | |
143 | + if(skill != null) | |
144 | + skill.getEffects(activeChar, activeChar); | |
145 | + } | |
146 | + } | |
147 | + else | |
148 | + { | |
149 | + for(Integer skillid : Config.FIGHTER_BUFF_LIST.keySet()) | |
150 | + { | |
151 | + int skilllvl = Config.FIGHTER_BUFF_LIST.get(skillid); | |
152 | + L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl); | |
153 | + if(skill != null) | |
154 | + skill.getEffects(activeChar, activeChar); | |
155 | + } | |
156 | + } | |
157 | + } | |
158 | + activeChar.setFirstLog(false); | |
159 | + activeChar.updateFirstLog(); | |
160 | + } | |
161 | + | |
162 | + /** | |
163 | * @param cha | |
164 | */ | |
165 | private void engage(L2PcInstance cha) | |
166 | Index: config/frozen/frozen.properties | |
167 | =================================================================== | |
168 | --- config/frozen/frozen.properties (revision 939) | |
169 | +++ config/frozen/frozen.properties (working copy) | |
170 | @@ -21,4 +21,18 @@ | |
171 | ||
172 | # New players get fireworks the first time they log in | |
173 | # Default: False | |
174 | -NewPlayerEffect = False | |
175 | \ No newline at end of file | |
176 | +NewPlayerEffect = False | |
177 | + | |
178 | +# Give buffs to character on first game log in. | |
179 | +# Default: False | |
180 | +AltNewCharBuffs = False | |
181 | + | |
182 | +# The List of Fighter Buffs | |
183 | +# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln | |
184 | +FighterBuffList = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;\ | |
185 | +264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1 | |
186 | + | |
187 | +# The List of Mage Buffs | |
188 | +# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln | |
189 | +MageBuffList = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;\ | |
190 | +1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1 |