Ignore:
Timestamp:
Jan 16, 2012 7:56:19 AM (4 months ago)
Author:
MELERIX
Message:

STABLE: Sync with BETA [8629]

Location:
trunk/L2J_DataPack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/L2J_DataPack

  • trunk/L2J_DataPack/dist/game/data/scripts/retail/PriestOfBlessing/PriestOfBlessing.java

    r7786 r8630  
    1515package retail.PriestOfBlessing; 
    1616 
    17 import com.l2jserver.gameserver.instancemanager.QuestManager; 
    1817import com.l2jserver.gameserver.model.actor.L2Npc; 
    1918import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; 
     
    2827 
    2928/** 
    30  ** @author Gnacik 
     29 * @author Gnacik 
    3130 */ 
    3231public class PriestOfBlessing extends Quest 
     
    3837        // Prices 
    3938        private static final int _price_voice = 100000; 
    40         //  
     39        // 
    4140        private static final int _nevit_voice = 17094; 
    42         //  
    43         private static final int[] _prices_hourglass = { 4000, 30000, 110000, 310000, 970000, 2160000, 5000000 }; 
    4441        // 
    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                } 
    5370        }; 
    5471        // 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                } 
    73125        }; 
    74          
    75126         
    76127        @Override 
     
    78129        { 
    79130                String htmltext = event; 
    80                  
    81131                QuestState st = player.getQuestState(getName()); 
    82                 Quest q = QuestManager.getInstance().getQuest(getName()); 
    83                 if (st == null || q == null) 
     132                if (st == null) 
     133                { 
    84134                        return null; 
     135                } 
    85136                 
    86137                if (event.equalsIgnoreCase("buy_voice")) 
    87138                { 
    88                         if(st.getQuestItemsCount(57) >= _price_voice) 
     139                        if (st.getQuestItemsCount(57) >= _price_voice) 
    89140                        { 
    90                                 String value = q.loadGlobalQuestVar(player.getAccountName()+"_voice"); 
     141                                String value = loadGlobalQuestVar(player.getAccountName() + "_voice"); 
    91142                                long _reuse_time = value == "" ? 0 : Long.parseLong(value); 
    92143                                 
     
    96147                                        st.takeItems(57, _price_voice); 
    97148                                        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))); 
    99150                                } 
    100151                                else 
     
    111162                                return null; 
    112163                        } 
    113                         else 
    114                                 htmltext = "32783-adena.htm"; 
     164                        htmltext = "32783-adena.htm"; 
    115165                } 
    116166                else if (event.equalsIgnoreCase("buy_hourglass")) 
     
    119169                        int _price_hourglass = _prices_hourglass[_index]; 
    120170                         
    121                         if(st.getQuestItemsCount(57) >= _price_hourglass) 
     171                        if (st.getQuestItemsCount(57) >= _price_hourglass) 
    122172                        { 
    123                                 String value = q.loadGlobalQuestVar(player.getAccountName()+"_hg_"+_index); 
     173                                String value = loadGlobalQuestVar(player.getAccountName() + "_hg_" + _index); 
    124174                                long _reuse_time = value == "" ? 0 : Long.parseLong(value); 
    125                                                                  
     175                                 
    126176                                if (System.currentTimeMillis() > _reuse_time) 
    127177                                { 
    128178                                        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                                         
    131181                                        st.setState(State.STARTED); 
    132182                                        st.takeItems(57, _price_hourglass); 
    133183                                        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))); 
    135185                                } 
    136186                                else 
     
    147197                                return null; 
    148198                        } 
    149                         else 
    150                                 htmltext = "32783-adena.htm"; 
     199                        htmltext = "32783-adena.htm"; 
    151200                } 
    152201                return htmltext; 
     
    159208                if (st == null) 
    160209                { 
    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"); 
    166214                html.setHtml(content); 
    167215                html.replace("%donate%", Util.formatAdena(_prices_hourglass[getHGIndex(player.getLevel())])); 
     
    173221        { 
    174222                int index = 0; 
    175                 if(lvl < 20) 
     223                if (lvl < 20) 
     224                { 
    176225                        index = 0; 
    177                 else if(lvl < 40) 
     226                } 
     227                else if (lvl < 40) 
     228                { 
    178229                        index = 1; 
     230                } 
    179231                else if (lvl < 52) 
     232                { 
    180233                        index = 2; 
     234                } 
    181235                else if (lvl < 61) 
     236                { 
    182237                        index = 3; 
     238                } 
    183239                else if (lvl < 76) 
     240                { 
    184241                        index = 4; 
     242                } 
    185243                else if (lvl < 80) 
     244                { 
    186245                        index = 5; 
     246                } 
    187247                else if (lvl < 86) 
     248                { 
    188249                        index = 6; 
     250                } 
    189251                return index; 
    190252        } 
     
    197259                addFirstTalkId(_priest); 
    198260                addTalkId(_priest); 
    199                 if(!_spawned) 
     261                if (!_spawned) 
    200262                { 
    201263                        for (int[] _spawn : _spawns) 
     264                        { 
    202265                                addSpawn(_priest, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0); 
     266                        } 
    203267                        _spawned = true; 
    204268                } 
Note: See TracChangeset for help on using the changeset viewer.