Changeset 8630 for trunk/L2J_DataPack/dist/game/data/scripts/events/FreyaCelebration/FreyaCelebration.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/FreyaCelebration/FreyaCelebration.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/FreyaCelebration/FreyaCelebration.java
r8406 r8630 15 15 package events.FreyaCelebration; 16 16 17 import com.l2jserver.gameserver.instancemanager.QuestManager;18 17 import com.l2jserver.gameserver.model.L2Object; 19 18 import com.l2jserver.gameserver.model.L2Skill; 19 import com.l2jserver.gameserver.model.Location; 20 20 import com.l2jserver.gameserver.model.actor.L2Npc; 21 21 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; 22 import com.l2jserver.gameserver.model.itemcontainer.PcInventory; 22 23 import com.l2jserver.gameserver.model.quest.Quest; 23 24 import com.l2jserver.gameserver.model.quest.QuestState; … … 32 33 33 34 /** 34 ** @author Gnacik 35 ** 36 ** Retail Event : 'Freya Celebration' 35 * Retail Event : 'Freya Celebration' 36 * @author Gnacik 37 37 */ 38 38 public class FreyaCelebration extends Quest … … 43 43 private static final int _hours = 20; 44 44 45 private static final int[] _skills = { 9150, 9151, 9152, 9153, 9154, 9155, 9156 }; 45 private static final int[] _skills = 46 { 47 9150, 9151, 9152, 9153, 9154, 9155, 9156 48 }; 46 49 47 50 private static final NpcStringId[] _freya_texts = … … 54 57 }; 55 58 56 private static final int[][] _spawns = { 57 { -119494, 44882, 360, 24576 }, 58 { -117239, 46842, 360, 49151 }, 59 { -84023, 243051, -3728, 4096 }, 60 { -84411, 244813, -3728, 57343 }, 61 { 46908, 50856, -2992, 8192 }, 62 { 45538, 48357, -3056, 18000 }, 63 { -45372, -114104, -240, 16384 }, 64 { -45278, -112766, -240, 0 }, 65 { 9929, 16324, -4568, 62999 }, 66 { 11546, 17599, -4584, 46900 }, 67 { 115096, -178370, -880, 0 }, 68 { -13727, 122117, -2984, 16384 }, 69 { -14129, 123869, -3112, 40959 }, 70 { -83156, 150994, -3120, 0 }, 71 { -81031, 150038, -3040, 0 }, 72 { 16111, 142850, -2696, 16000 }, 73 { 17275, 145000, -3032, 25000 }, 74 { 111004, 218928, -3536, 16384 }, 75 { 81755, 146487, -3528, 32768 }, 76 { 82145, 148609, -3464, 0 }, 77 { 83037, 149324, -3464, 44000 }, 78 { 81987, 53723, -1488, 0 }, 79 { 147200, 25614, -2008, 16384 }, 80 { 148557, 26806, -2200, 32768 }, 81 { 147421, -55435, -2728, 49151 }, 82 { 148206, -55786, -2776, 61439 }, 83 { 85584, -142490, -1336, 0 }, 84 { 86865, -142915, -1336, 26000 }, 85 { 43966, -47709, -792, 49999 }, 86 { 43165, -48461, -792, 17000 } 59 private static final Location[] _spawns = 60 { 61 new Location(-119494, 44882, 360, 24576), 62 new Location(-117239, 46842, 360, 49151), 63 new Location(-84023, 243051, -3728, 4096), 64 new Location(-84411, 244813, -3728, 57343), 65 new Location(46908, 50856, -2992, 8192), 66 new Location(45538, 48357, -3056, 18000), 67 new Location(-45372, -114104, -240, 16384), 68 new Location(-45278, -112766, -240, 0), 69 new Location(9929, 16324, -4568, 62999), 70 new Location(11546, 17599, -4584, 46900), 71 new Location(115096, -178370, -880, 0), 72 new Location(-13727, 122117, -2984, 16384), 73 new Location(-14129, 123869, -3112, 40959), 74 new Location(-83156, 150994, -3120, 0), 75 new Location(-81031, 150038, -3040, 0), 76 new Location(16111, 142850, -2696, 16000), 77 new Location(17275, 145000, -3032, 25000), 78 new Location(111004, 218928, -3536, 16384), 79 new Location(81755, 146487, -3528, 32768), 80 new Location(82145, 148609, -3464, 0), 81 new Location(83037, 149324, -3464, 44000), 82 new Location(81987, 53723, -1488, 0), 83 new Location(147200, 25614, -2008, 16384), 84 new Location(148557, 26806, -2200, 32768), 85 new Location(147421, -55435, -2728, 49151), 86 new Location(148206, -55786, -2776, 61439), 87 new Location(85584, -142490, -1336, 0), 88 new Location(86865, -142915, -1336, 26000), 89 new Location(43966, -47709, -792, 49999), 90 new Location(43165, -48461, -792, 17000) 87 91 }; 88 92 … … 91 95 { 92 96 QuestState st = player.getQuestState(getName()); 93 Quest q = QuestManager.getInstance().getQuest(getName());94 if (st == null || q == null)97 if (st == null) 98 { 95 99 return null; 100 } 96 101 97 102 if (event.equalsIgnoreCase("give_potion")) 98 103 { 99 if (st.getQuestItemsCount( 57) > 1)104 if (st.getQuestItemsCount(PcInventory.ADENA_ID) > 1) 100 105 { 101 106 long _curr_time = System.currentTimeMillis(); 102 String value = q.loadGlobalQuestVar(player.getAccountName());107 String value = loadGlobalQuestVar(player.getAccountName()); 103 108 long _reuse_time = value == "" ? 0 : Long.parseLong(value); 104 109 … … 106 111 { 107 112 st.setState(State.STARTED); 108 st.takeItems( 57, 1);113 st.takeItems(PcInventory.ADENA_ID, 1); 109 114 st.giveItems(_freya_potion, 1); 110 q.saveGlobalQuestVar(player.getAccountName(), Long.toString(System.currentTimeMillis() + (_hours * 3600000)));115 saveGlobalQuestVar(player.getAccountName(), Long.toString(System.currentTimeMillis() + (_hours * 3600000))); 111 116 } 112 117 else … … 125 130 { 126 131 SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_UNIT_OF_THE_ITEM_S1_REQUIRED); 127 sm.addItemName( 57);132 sm.addItemName(PcInventory.ADENA_ID); 128 133 sm.addNumber(1); 129 134 player.sendPacket(sm); … … 137 142 { 138 143 if ((caster == null) || (npc == null)) 144 { 139 145 return null; 146 } 140 147 141 148 if ((npc.getNpcId() == _freya) && Util.contains(targets, npc) && Util.contains(_skills, skill.getId())) … … 145 152 CreatureSay cs = new CreatureSay(npc.getObjectId(), Say2.ALL, npc.getName(), NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERES_NOTHING_STRANGE_ABOUT_IT_ITS_JUST_A_BIT_OF_MY_CAPRICIOUSNESS); 146 153 cs.addStringParameter(caster.getName()); 147 154 148 155 npc.broadcastPacket(cs); 149 156 150 157 caster.addItem("FreyaCelebration", _freya_gift, 1, npc, true); 151 158 } … … 164 171 public String onFirstTalk(L2Npc npc, L2PcInstance player) 165 172 { 166 QuestState st = player.getQuestState(getName()); 167 if (st == null) 173 if (player.getQuestState(getName()) == null) 168 174 { 169 Quest q = QuestManager.getInstance().getQuest(getName()); 170 st = q.newQuestState(player); 175 newQuestState(player); 171 176 } 172 177 return "13296.htm"; … … 181 186 addTalkId(_freya); 182 187 addSkillSeeId(_freya); 183 for ( int[] _spawn: _spawns)188 for (Location loc : _spawns) 184 189 { 185 addSpawn(_freya, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);190 addSpawn(_freya, loc, false, 0); 186 191 } 187 192 }
Note: See TracChangeset
for help on using the changeset viewer.
