Changeset 8630 for trunk/L2J_DataPack/dist/game/data/scripts/events/GiftOfVitality/GiftOfVitality.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/events/GiftOfVitality/GiftOfVitality.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/events/GiftOfVitality/GiftOfVitality.java
r7720 r8630 16 16 17 17 import com.l2jserver.gameserver.datatables.SkillTable; 18 import com.l2jserver.gameserver. instancemanager.QuestManager;18 import com.l2jserver.gameserver.model.Location; 19 19 import com.l2jserver.gameserver.model.actor.L2Npc; 20 20 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; … … 27 27 28 28 /** 29 ** @author Gnacik 30 ** 31 ** Retail Event : 'Gift of Vitality' 29 * Retail Event : 'Gift of Vitality' 30 * @author Gnacik 32 31 */ 33 32 public class GiftOfVitality extends Quest … … 38 37 private static final int _jack = 4306; 39 38 40 private static final int[][] _spawns =39 private static final Location[] _spawns = 41 40 { 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) 58 57 }; 59 58 … … 64 63 addFirstTalkId(_jack); 65 64 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 } 68 69 } 69 70 … … 71 72 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) 72 73 { 73 String htmltext = "";74 String htmltext = event; 74 75 QuestState st = player.getQuestState(getName()); 75 htmltext = event;76 76 77 77 if (event.equalsIgnoreCase("vitality")) … … 79 79 long _reuse = 0; 80 80 String _streuse = st.get("reuse"); 81 if(_streuse != null) 81 if (_streuse != null) 82 { 82 83 _reuse = Long.parseLong(_streuse); 83 if(_reuse > System.currentTimeMillis()) 84 } 85 if (_reuse > System.currentTimeMillis()) 84 86 { 85 87 long remainingTime = (_reuse - System.currentTimeMillis()) / 1000; 86 88 int hours = (int) (remainingTime / 3600); 87 int minutes = (int) ((remainingTime %3600) / 60);89 int minutes = (int) ((remainingTime % 3600) / 60); 88 90 SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.AVAILABLE_AFTER_S1_S2_HOURS_S3_MINUTES); 89 91 sm.addSkillName(23179); … … 96 98 { 97 99 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)); 99 102 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))); 101 104 htmltext = "4306-okvitality.htm"; 102 105 } … … 110 113 else 111 114 { 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 112 119 if (player.isMageClass()) 113 120 { 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 122 125 } 123 126 else 124 127 { 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 133 132 } 134 133 htmltext = "4306-okbuff.htm"; … … 141 140 htmltext = "4306-nolevel.htm"; 142 141 } 143 else if ( player.getPet() == null|| !(player.getPet() instanceof L2SummonInstance))142 else if ((player.getPet() == null) || !(player.getPet() instanceof L2SummonInstance)) 144 143 { 145 144 htmltext = "4306-nosummon.htm"; … … 148 147 { 149 148 npc.setTarget(player.getPet()); 150 npc.doCast(SkillTable.getInstance().getInfo(5627, 1));// Wind Walk151 npc.doCast(SkillTable.getInstance().getInfo(5628, 1));// Shield152 npc.doCast(SkillTable.getInstance().getInfo(5637, 1));// Magic Barrier153 npc.doCast(SkillTable.getInstance().getInfo(5629, 1));// Bless the Body154 npc.doCast(SkillTable.getInstance().getInfo(5633, 1));// Bless the Soul155 npc.doCast(SkillTable.getInstance().getInfo(5630, 1));// Vampiric Rage156 npc.doCast(SkillTable.getInstance().getInfo(5634, 1));// Acumen157 npc.doCast(SkillTable.getInstance().getInfo(5631, 1));// Regeneration158 npc.doCast(SkillTable.getInstance().getInfo(5635, 1));// Concentration159 npc.doCast(SkillTable.getInstance().getInfo(5632, 1));// Haste160 npc.doCast(SkillTable.getInstance().getInfo(5636, 1));// Empower149 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 161 160 htmltext = "4306-okbuff.htm"; 162 161 } 163 162 } 164 165 163 return htmltext; 166 164 } … … 169 167 public String onFirstTalk(L2Npc npc, L2PcInstance player) 170 168 { 171 QuestState st = player.getQuestState(getName()); 172 if (st == null) 169 if (player.getQuestState(getName()) == null) 173 170 { 174 Quest q = QuestManager.getInstance().getQuest(getName()); 175 st = q.newQuestState(player); 171 newQuestState(player); 176 172 } 177 173 return "4306.htm";
Note: See TracChangeset
for help on using the changeset viewer.
