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/events/GiftOfVitality/GiftOfVitality.java

    r7720 r8630  
    1616 
    1717import com.l2jserver.gameserver.datatables.SkillTable; 
    18 import com.l2jserver.gameserver.instancemanager.QuestManager; 
     18import com.l2jserver.gameserver.model.Location; 
    1919import com.l2jserver.gameserver.model.actor.L2Npc; 
    2020import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; 
     
    2727 
    2828/** 
    29  ** @author Gnacik 
    30  ** 
    31  ** Retail Event : 'Gift of Vitality' 
     29 * Retail Event : 'Gift of Vitality' 
     30 * @author Gnacik 
    3231 */ 
    3332public class GiftOfVitality extends Quest 
     
    3837        private static final int _jack = 4306; 
    3938         
    40         private static final int[][] _spawns = 
     39        private static final Location[] _spawns = 
    4140        { 
    42                 {  82766,  149438, -3464, 33865 }, 
    43                 {  82286,   53291, -1488, 15250 }, 
    44                 { 147060,   25943, -2008, 18774 }, 
    45                 { 148096,  -55466, -2728, 40541 }, 
    46                 {  87116, -141332, -1336, 52193 }, 
    47                 {  43521,  -47542,  -792, 31655 }, 
    48                 {  17203,  144949, -3024, 18166 }, 
    49                 { 111164,  221062, -3544,  2714 }, 
    50                 { -13869,  122063, -2984, 18270 }, 
    51                 { -83161,  150915, -3120, 17311 }, 
    52                 {  45402,   48355, -3056, 49153 }, 
    53                 { 115616, -177941,  -896, 30708 }, 
    54                 { -44928, -113608,  -192, 30212 }, 
    55                 { -84037,  243194, -3728,  8992 }, 
    56                 {-119690,   44583,   360, 29289 }, 
    57                 {  12084,   16576, -4584, 57345 } 
     41                new Location(82766, 149438, -3464, 33865), 
     42                new Location(82286, 53291, -1488, 15250), 
     43                new Location(147060, 25943, -2008, 18774), 
     44                new Location(148096, -55466, -2728, 40541), 
     45                new Location(87116, -141332, -1336, 52193), 
     46                new Location(43521, -47542, -792, 31655), 
     47                new Location(17203, 144949, -3024, 18166), 
     48                new Location(111164, 221062, -3544, 2714), 
     49                new Location(-13869, 122063, -2984, 18270), 
     50                new Location(-83161, 150915, -3120, 17311), 
     51                new Location(45402, 48355, -3056, 49153), 
     52                new Location(115616, -177941, -896, 30708), 
     53                new Location(-44928, -113608, -192, 30212), 
     54                new Location(-84037, 243194, -3728, 8992), 
     55                new Location(-119690, 44583, 360, 29289), 
     56                new Location(12084, 16576, -4584, 57345) 
    5857        }; 
    5958         
     
    6463                addFirstTalkId(_jack); 
    6564                addTalkId(_jack); 
    66                 for(int[] _spawn : _spawns) 
    67                         addSpawn(_jack, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0); 
     65                for (Location loc : _spawns) 
     66                { 
     67                        addSpawn(_jack, loc, false, 0); 
     68                } 
    6869        } 
    6970         
     
    7172        public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) 
    7273        { 
    73                 String htmltext = ""; 
     74                String htmltext = event; 
    7475                QuestState st = player.getQuestState(getName()); 
    75                 htmltext = event; 
    7676                 
    7777                if (event.equalsIgnoreCase("vitality")) 
     
    7979                        long _reuse = 0; 
    8080                        String _streuse = st.get("reuse"); 
    81                         if(_streuse != null) 
     81                        if (_streuse != null) 
     82                        { 
    8283                                _reuse = Long.parseLong(_streuse); 
    83                         if(_reuse > System.currentTimeMillis()) 
     84                        } 
     85                        if (_reuse > System.currentTimeMillis()) 
    8486                        { 
    8587                                long remainingTime = (_reuse - System.currentTimeMillis()) / 1000; 
    8688                                int hours = (int) (remainingTime / 3600); 
    87                                 int minutes = (int) ((remainingTime%3600) / 60); 
     89                                int minutes = (int) ((remainingTime % 3600) / 60); 
    8890                                SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.AVAILABLE_AFTER_S1_S2_HOURS_S3_MINUTES); 
    8991                                sm.addSkillName(23179); 
     
    9698                        { 
    9799                                npc.setTarget(player); 
    98                                 npc.doCast(SkillTable.getInstance().getInfo(23179,1));  // Gift of Vitality 
     100                                // Gift of Vitality 
     101                                npc.doCast(SkillTable.getInstance().getInfo(23179, 1)); 
    99102                                st.setState(State.STARTED); 
    100                                 st.set("reuse", String.valueOf(System.currentTimeMillis() + _hours*60*60*1000)); 
     103                                st.set("reuse", String.valueOf(System.currentTimeMillis() + (_hours * 3600000))); 
    101104                                htmltext = "4306-okvitality.htm"; 
    102105                        } 
     
    110113                        else 
    111114                        { 
     115                                npc.setTarget(player); 
     116                                npc.doCast(SkillTable.getInstance().getInfo(5627, 1)); // Wind Walk 
     117                                npc.doCast(SkillTable.getInstance().getInfo(5628, 1)); // Shield 
     118                                npc.doCast(SkillTable.getInstance().getInfo(5637, 1)); // Magic Barrier 
    112119                                if (player.isMageClass()) 
    113120                                { 
    114                                         npc.setTarget(player); 
    115                                         npc.doCast(SkillTable.getInstance().getInfo(5627,1));   // Wind Walk 
    116                                         npc.doCast(SkillTable.getInstance().getInfo(5628,1));   // Shield 
    117                                         npc.doCast(SkillTable.getInstance().getInfo(5637,1));   // Magic Barrier 
    118                                         npc.doCast(SkillTable.getInstance().getInfo(5633,1));   // Bless the Soul 
    119                                         npc.doCast(SkillTable.getInstance().getInfo(5634,1));   // Acumen 
    120                                         npc.doCast(SkillTable.getInstance().getInfo(5635,1));   // Concentration 
    121                                         npc.doCast(SkillTable.getInstance().getInfo(5636,1));   // Empower 
     121                                        npc.doCast(SkillTable.getInstance().getInfo(5633, 1)); // Bless the Soul 
     122                                        npc.doCast(SkillTable.getInstance().getInfo(5634, 1)); // Acumen 
     123                                        npc.doCast(SkillTable.getInstance().getInfo(5635, 1)); // Concentration 
     124                                        npc.doCast(SkillTable.getInstance().getInfo(5636, 1)); // Empower 
    122125                                } 
    123126                                else 
    124127                                { 
    125                                         npc.setTarget(player); 
    126                                         npc.doCast(SkillTable.getInstance().getInfo(5627,1));   // Wind Walk 
    127                                         npc.doCast(SkillTable.getInstance().getInfo(5628,1));   // Shield 
    128                                         npc.doCast(SkillTable.getInstance().getInfo(5637,1));   // Magic Barrier 
    129                                         npc.doCast(SkillTable.getInstance().getInfo(5629,1));   // Bless the Body 
    130                                         npc.doCast(SkillTable.getInstance().getInfo(5630,1));   // Vampiric Rage 
    131                                         npc.doCast(SkillTable.getInstance().getInfo(5631,1));   // Regeneration 
    132                                         npc.doCast(SkillTable.getInstance().getInfo(5632,1));   // Haste 
     128                                        npc.doCast(SkillTable.getInstance().getInfo(5629, 1)); // Bless the Body 
     129                                        npc.doCast(SkillTable.getInstance().getInfo(5630, 1)); // Vampiric Rage 
     130                                        npc.doCast(SkillTable.getInstance().getInfo(5631, 1)); // Regeneration 
     131                                        npc.doCast(SkillTable.getInstance().getInfo(5632, 1)); // Haste 
    133132                                } 
    134133                                htmltext = "4306-okbuff.htm"; 
     
    141140                                htmltext = "4306-nolevel.htm"; 
    142141                        } 
    143                         else if (player.getPet() == null || !(player.getPet() instanceof L2SummonInstance)) 
     142                        else if ((player.getPet() == null) || !(player.getPet() instanceof L2SummonInstance)) 
    144143                        { 
    145144                                htmltext = "4306-nosummon.htm"; 
     
    148147                        { 
    149148                                npc.setTarget(player.getPet()); 
    150                                 npc.doCast(SkillTable.getInstance().getInfo(5627,1));   // Wind Walk 
    151                                 npc.doCast(SkillTable.getInstance().getInfo(5628,1));   // Shield 
    152                                 npc.doCast(SkillTable.getInstance().getInfo(5637,1));   // Magic Barrier 
    153                                 npc.doCast(SkillTable.getInstance().getInfo(5629,1));   // Bless the Body 
    154                                 npc.doCast(SkillTable.getInstance().getInfo(5633,1));   // Bless the Soul 
    155                                 npc.doCast(SkillTable.getInstance().getInfo(5630,1));   // Vampiric Rage 
    156                                 npc.doCast(SkillTable.getInstance().getInfo(5634,1));   // Acumen 
    157                                 npc.doCast(SkillTable.getInstance().getInfo(5631,1));   // Regeneration 
    158                                 npc.doCast(SkillTable.getInstance().getInfo(5635,1));   // Concentration 
    159                                 npc.doCast(SkillTable.getInstance().getInfo(5632,1));   // Haste 
    160                                 npc.doCast(SkillTable.getInstance().getInfo(5636,1));   // Empower 
     149                                npc.doCast(SkillTable.getInstance().getInfo(5627, 1)); // Wind Walk 
     150                                npc.doCast(SkillTable.getInstance().getInfo(5628, 1)); // Shield 
     151                                npc.doCast(SkillTable.getInstance().getInfo(5637, 1)); // Magic Barrier 
     152                                npc.doCast(SkillTable.getInstance().getInfo(5629, 1)); // Bless the Body 
     153                                npc.doCast(SkillTable.getInstance().getInfo(5633, 1)); // Bless the Soul 
     154                                npc.doCast(SkillTable.getInstance().getInfo(5630, 1)); // Vampiric Rage 
     155                                npc.doCast(SkillTable.getInstance().getInfo(5634, 1)); // Acumen 
     156                                npc.doCast(SkillTable.getInstance().getInfo(5631, 1)); // Regeneration 
     157                                npc.doCast(SkillTable.getInstance().getInfo(5635, 1)); // Concentration 
     158                                npc.doCast(SkillTable.getInstance().getInfo(5632, 1)); // Haste 
     159                                npc.doCast(SkillTable.getInstance().getInfo(5636, 1)); // Empower 
    161160                                htmltext = "4306-okbuff.htm"; 
    162161                        } 
    163162                } 
    164                  
    165163                return htmltext; 
    166164        } 
     
    169167        public String onFirstTalk(L2Npc npc, L2PcInstance player) 
    170168        { 
    171                 QuestState st = player.getQuestState(getName()); 
    172                 if (st == null) 
     169                if (player.getQuestState(getName()) == null) 
    173170                { 
    174                         Quest q = QuestManager.getInstance().getQuest(getName()); 
    175                         st = q.newQuestState(player); 
     171                        newQuestState(player); 
    176172                } 
    177173                return "4306.htm"; 
Note: See TracChangeset for help on using the changeset viewer.