Changeset 8630 for trunk/L2J_DataPack/dist/game/data/scripts/retail/PriestOfBlessing/PriestOfBlessing.java
- Timestamp:
- Jan 16, 2012 7:56:19 AM (4 months ago)
- Location:
- trunk/L2J_DataPack
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
dist/game/data/scripts/retail/PriestOfBlessing/PriestOfBlessing.java (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/L2J_DataPack
- Property svn:mergeinfo changed
/branches/unstable/L2J_DataPack_BETA merged: 8407-8426,8428-8480,8482-8491,8493-8588,8590-8629
- Property svn:mergeinfo changed
-
trunk/L2J_DataPack/dist/game/data/scripts/retail/PriestOfBlessing/PriestOfBlessing.java
r7786 r8630 15 15 package retail.PriestOfBlessing; 16 16 17 import com.l2jserver.gameserver.instancemanager.QuestManager;18 17 import com.l2jserver.gameserver.model.actor.L2Npc; 19 18 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; … … 28 27 29 28 /** 30 * *@author Gnacik29 * @author Gnacik 31 30 */ 32 31 public class PriestOfBlessing extends Quest … … 38 37 // Prices 39 38 private static final int _price_voice = 100000; 40 // 39 // 41 40 private static final int _nevit_voice = 17094; 42 //43 private static final int[] _prices_hourglass = { 4000, 30000, 110000, 310000, 970000, 2160000, 5000000 };44 41 // 45 private static final int[][] _hourglasses = { 46 { 17095, 17096, 17097, 17098, 17099 }, 47 { 17100, 17101, 17102, 17103, 17104 }, 48 { 17105, 17106, 17107, 17108, 17109 }, 49 { 17110, 17111, 17112, 17113, 17114 }, 50 { 17115, 17116, 17117, 17118, 17119 }, 51 { 17120, 17121, 17122, 17123, 17124 }, 52 { 17125, 17126, 17127, 17128, 17129 } 42 private static final int[] _prices_hourglass = 43 { 44 4000, 30000, 110000, 310000, 970000, 2160000, 5000000 45 }; 46 // 47 private static final int[][] _hourglasses = 48 { 49 { 50 17095, 17096, 17097, 17098, 17099 51 }, 52 { 53 17100, 17101, 17102, 17103, 17104 54 }, 55 { 56 17105, 17106, 17107, 17108, 17109 57 }, 58 { 59 17110, 17111, 17112, 17113, 17114 60 }, 61 { 62 17115, 17116, 17117, 17118, 17119 63 }, 64 { 65 17120, 17121, 17122, 17123, 17124 66 }, 67 { 68 17125, 17126, 17127, 17128, 17129 69 } 53 70 }; 54 71 // Spawns 55 private static final int[][] _spawns = { 56 { -84139, 243145, -3704, 8473 }, 57 { -119702, 44557, 360, 33023 }, 58 { 45413, 48351, -3056, 50020 }, 59 { 115607, -177945, -896, 38058 }, 60 { 12086, 16589, -4584, 3355 }, 61 { -45032, -113561, -192, 32767 }, 62 { -83112, 150922, -3120, 2280 }, 63 { -13931, 121938, -2984, 30212 }, 64 { 87127, -141330, -1336, 49153 }, 65 { 43520, -47590, -792, 43738 }, 66 { 148060, -55314, -2728, 40961 }, 67 { 82801, 149381, -3464, 53707 }, 68 { 82433, 53285, -1488, 22942 }, 69 { 147059, 25930, -2008, 56399 }, 70 { 111171, 221053, -3544, 2058 }, 71 { 15907, 142901, -2688, 14324 }, 72 { 116972, 77255, -2688, 41951 } 72 private static final int[][] _spawns = 73 { 74 { 75 -84139, 243145, -3704, 8473 76 }, 77 { 78 -119702, 44557, 360, 33023 79 }, 80 { 81 45413, 48351, -3056, 50020 82 }, 83 { 84 115607, -177945, -896, 38058 85 }, 86 { 87 12086, 16589, -4584, 3355 88 }, 89 { 90 -45032, -113561, -192, 32767 91 }, 92 { 93 -83112, 150922, -3120, 2280 94 }, 95 { 96 -13931, 121938, -2984, 30212 97 }, 98 { 99 87127, -141330, -1336, 49153 100 }, 101 { 102 43520, -47590, -792, 43738 103 }, 104 { 105 148060, -55314, -2728, 40961 106 }, 107 { 108 82801, 149381, -3464, 53707 109 }, 110 { 111 82433, 53285, -1488, 22942 112 }, 113 { 114 147059, 25930, -2008, 56399 115 }, 116 { 117 111171, 221053, -3544, 2058 118 }, 119 { 120 15907, 142901, -2688, 14324 121 }, 122 { 123 116972, 77255, -2688, 41951 124 } 73 125 }; 74 75 126 76 127 @Override … … 78 129 { 79 130 String htmltext = event; 80 81 131 QuestState st = player.getQuestState(getName()); 82 Quest q = QuestManager.getInstance().getQuest(getName());83 if (st == null || q == null)132 if (st == null) 133 { 84 134 return null; 135 } 85 136 86 137 if (event.equalsIgnoreCase("buy_voice")) 87 138 { 88 if (st.getQuestItemsCount(57) >= _price_voice)139 if (st.getQuestItemsCount(57) >= _price_voice) 89 140 { 90 String value = q.loadGlobalQuestVar(player.getAccountName()+"_voice");141 String value = loadGlobalQuestVar(player.getAccountName() + "_voice"); 91 142 long _reuse_time = value == "" ? 0 : Long.parseLong(value); 92 143 … … 96 147 st.takeItems(57, _price_voice); 97 148 st.giveItems(_nevit_voice, 1); 98 q.saveGlobalQuestVar(player.getAccountName()+"_voice", Long.toString(System.currentTimeMillis() + (20 * 3600000)));149 saveGlobalQuestVar(player.getAccountName() + "_voice", Long.toString(System.currentTimeMillis() + (20 * 3600000))); 99 150 } 100 151 else … … 111 162 return null; 112 163 } 113 else 114 htmltext = "32783-adena.htm"; 164 htmltext = "32783-adena.htm"; 115 165 } 116 166 else if (event.equalsIgnoreCase("buy_hourglass")) … … 119 169 int _price_hourglass = _prices_hourglass[_index]; 120 170 121 if (st.getQuestItemsCount(57) >= _price_hourglass)171 if (st.getQuestItemsCount(57) >= _price_hourglass) 122 172 { 123 String value = q.loadGlobalQuestVar(player.getAccountName()+"_hg_"+_index);173 String value = loadGlobalQuestVar(player.getAccountName() + "_hg_" + _index); 124 174 long _reuse_time = value == "" ? 0 : Long.parseLong(value); 125 175 126 176 if (System.currentTimeMillis() > _reuse_time) 127 177 { 128 178 int[] _hg = _hourglasses[_index]; 129 int _nevit_hourglass = _hg[Rnd.get(0, _hg.length-1)];130 179 int _nevit_hourglass = _hg[Rnd.get(0, _hg.length - 1)]; 180 131 181 st.setState(State.STARTED); 132 182 st.takeItems(57, _price_hourglass); 133 183 st.giveItems(_nevit_hourglass, 1); 134 q.saveGlobalQuestVar(player.getAccountName()+"_hg_"+_index, Long.toString(System.currentTimeMillis() + (20 * 3600000)));184 saveGlobalQuestVar(player.getAccountName() + "_hg_" + _index, Long.toString(System.currentTimeMillis() + (20 * 3600000))); 135 185 } 136 186 else … … 147 197 return null; 148 198 } 149 else 150 htmltext = "32783-adena.htm"; 199 htmltext = "32783-adena.htm"; 151 200 } 152 201 return htmltext; … … 159 208 if (st == null) 160 209 { 161 Quest q = QuestManager.getInstance().getQuest(getName()); 162 st = q.newQuestState(player); 163 } 164 NpcHtmlMessage html = new NpcHtmlMessage(0); 165 String content = getHtm(player.getHtmlPrefix(), "32783.htm"); 210 st = newQuestState(player); 211 } 212 final NpcHtmlMessage html = new NpcHtmlMessage(0); 213 final String content = getHtm(player.getHtmlPrefix(), "32783.htm"); 166 214 html.setHtml(content); 167 215 html.replace("%donate%", Util.formatAdena(_prices_hourglass[getHGIndex(player.getLevel())])); … … 173 221 { 174 222 int index = 0; 175 if(lvl < 20) 223 if (lvl < 20) 224 { 176 225 index = 0; 177 else if(lvl < 40) 226 } 227 else if (lvl < 40) 228 { 178 229 index = 1; 230 } 179 231 else if (lvl < 52) 232 { 180 233 index = 2; 234 } 181 235 else if (lvl < 61) 236 { 182 237 index = 3; 238 } 183 239 else if (lvl < 76) 240 { 184 241 index = 4; 242 } 185 243 else if (lvl < 80) 244 { 186 245 index = 5; 246 } 187 247 else if (lvl < 86) 248 { 188 249 index = 6; 250 } 189 251 return index; 190 252 } … … 197 259 addFirstTalkId(_priest); 198 260 addTalkId(_priest); 199 if (!_spawned)261 if (!_spawned) 200 262 { 201 263 for (int[] _spawn : _spawns) 264 { 202 265 addSpawn(_priest, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0); 266 } 203 267 _spawned = true; 204 268 }
Note: See TracChangeset
for help on using the changeset viewer.
