Changeset 5166
- Timestamp:
- Feb 6, 2012 3:33:55 AM (3 months ago)
- Location:
- branches/unstable/L2J_Server_BETA/java/com/l2jserver/gameserver/model
- Files:
-
- 3 edited
-
actor/L2Character.java (modified) (14 diffs)
-
quest/Quest.java (modified) (1 diff)
-
quest/QuestState.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/unstable/L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java
r5165 r5166 343 343 } 344 344 345 // Overrided in L2PcInstance 345 /** 346 * Overridden in L2PcInstance. 347 * @return the access level. 348 */ 346 349 public L2AccessLevel getAccessLevel() 347 350 { … … 349 352 } 350 353 351 // ========================================================= 352 // Constructor 353 /** 354 * Constructor of L2Character.<BR><BR> 355 * 354 /** 355 * Constructor of L2Character.<br> 356 356 * <B><U> Concept</U> :</B><BR><BR> 357 357 * Each L2Character owns generic and static properties (ex : all Keltir have the same number of HP...). … … 363 363 * <B><U> Actions</U> :</B><BR><BR> 364 364 * <li>Set the _template of the L2Character </li> 365 * <li>Set _overloaded to false (the char cater can take more items)</li><BR><BR>365 * <li>Set _overloaded to false (the character can take more items)</li><BR><BR> 366 366 * 367 367 * <li>If L2Character is a L2NPCInstance, copy skills from template to object</li> … … 391 391 else if (template != null && this instanceof L2Npc) 392 392 { 393 // Copy the Standard Calcul tors of the L2NPCInstance in _calculators393 // Copy the Standard Calculators of the L2NPCInstance in _calculators 394 394 _calculators = NPC_STD_CALCULATOR; 395 395 … … 751 751 * 752 752 * <B><U> Actions</U> :</B><BR><BR> 753 * <li>Get the active weapon (always equip ed in the right hand) </li><BR><BR>753 * <li>Get the active weapon (always equipped in the right hand) </li><BR><BR> 754 754 * <li>If weapon is a bow, check for arrows, MP and bow re-use delay (if necessary, equip the L2PcInstance with arrows in left hand)</li> 755 755 * <li>If weapon is a bow, consume MP and set the new period of bow non re-use </li><BR><BR> … … 854 854 L2ItemInstance weaponInst = getActiveWeaponInstance(); 855 855 856 // Get the active weapon item corresponding to the active weapon instance (always equip ed in the right hand)856 // Get the active weapon item corresponding to the active weapon instance (always equipped in the right hand) 857 857 L2Weapon weaponItem = getActiveWeaponItem(); 858 858 … … 1071 1071 { 1072 1072 if (target instanceof L2PcInstance && ((L2PcInstance) target).isCursedWeaponEquipped()) 1073 // If a cursed weapon is hit tedby a Hero, Cp is reduced to 01073 // If a cursed weapon is hit by a Hero, Cp is reduced to 0 1074 1074 target.setCurrentCp(0); 1075 1075 } … … 1536 1536 * 1537 1537 * <B><U> Actions</U> :</B><BR><BR> 1538 * <li>Verify the possibil ty of the the cast : skill is a spell, caster isn't muted... </li>1538 * <li>Verify the possibility of the the cast : skill is a spell, caster isn't muted... </li> 1539 1539 * <li>Get the list of all targets (ex : area effects) and define the L2Charcater targeted (its stats will be used in calculation)</li> 1540 1540 * <li>Calculate the casting time (base + modifier of MAtkSpd), interrupt time and re-use delay</li> 1541 * <li>Send a Server->Client packet MagicSkillUser (to di play casting animation), a packet SetupGauge (to display casting bar) and a system message </li>1541 * <li>Send a Server->Client packet MagicSkillUser (to display casting animation), a packet SetupGauge (to display casting bar) and a system message </li> 1542 1542 * <li>Disable all skills during the casting time (create a task EnableAllSkills)</li> 1543 1543 * <li>Disable the skill during the re-use delay (create a task EnableSkill)</li> … … 2051 2051 * @param skill 2052 2052 * @return True if casting is possible 2053 *2054 *2055 2053 */ 2056 2054 protected boolean checkDoCastConditions(L2Skill skill) … … 2869 2867 2870 2868 /** 2871 * Task lau ching the function onHitTimer().<BR><BR>2869 * Task launching the function onHitTimer().<BR><BR> 2872 2870 * 2873 2871 * <B><U> Actions</U> :</B><BR><BR> … … 2911 2909 } 2912 2910 2913 /** Task lau ching the magic skill phases */2911 /** Task launching the magic skill phases */ 2914 2912 class MagicUseTask implements Runnable 2915 2913 { … … 3021 3019 3022 3020 // ========================================================= 3023 /** Task lau ching the magic skill phases */3021 /** Task launching the magic skill phases */ 3024 3022 class FlyToLocationTask implements Runnable 3025 3023 { … … 3219 3217 public final void startSleeping() 3220 3218 { 3221 /* Aborts any attacks/casts if sleeped*/3219 /* Aborts any attacks/casts if asleep */ 3222 3220 abortAttack(); 3223 3221 abortCast(); … … 3593 3591 3594 3592 /** 3595 * Updates Effect Icons for this character(p alyer/summon) and his party if any<BR>3593 * Updates Effect Icons for this character(player/summon) and his party if any<BR> 3596 3594 * 3597 3595 * Overridden in:<BR> -
branches/unstable/L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java
r5146 r5166 91 91 private static final String DEFAULT_ALREADY_COMPLETED_MSG = 92 92 "<html><body>This quest has already been completed.</body></html>"; 93 94 private static final int RESET_HOUR = 6; 95 private static final int RESET_MINUTES = 30; 96 97 /** 98 * @return the reset hour for a daily quest, could be overridden on a script. 99 */ 100 public int getResetHour() 101 { 102 return RESET_HOUR; 103 } 104 105 /** 106 * @return the reset minutes for a daily quest, could be overridden on a script. 107 */ 108 public int getResetMinutes() 109 { 110 return RESET_MINUTES; 111 } 93 112 94 113 /** -
branches/unstable/L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/QuestState.java
r5146 r5166 18 18 import java.sql.PreparedStatement; 19 19 import java.sql.ResultSet; 20 import java.util.Calendar; 20 21 import java.util.Map; 21 22 import java.util.logging.Level; … … 48 49 import com.l2jserver.gameserver.network.serverpackets.TutorialEnableClientEvent; 49 50 import com.l2jserver.gameserver.network.serverpackets.TutorialShowHtml; 51 import com.l2jserver.gameserver.util.Util; 50 52 import com.l2jserver.gameserver.network.serverpackets.TutorialShowQuestionMark; 51 53 import com.l2jserver.util.Rnd; … … 72 74 /** boolean flag letting QuestStateManager know to exit quest when cleaning up */ 73 75 private boolean _isExitQuestOnCleanUp = false; 76 77 /** 78 * This enumerate represent the different quest types. 79 */ 80 public static enum QuestType 81 { 82 REPEATABLE, 83 ONE_TIME, 84 DAILY 85 } 74 86 75 87 /** … … 1097 1109 1098 1110 /** 1111 * @param type the type of the quest, {@link com.l2jserver.gameserver.model.quest.QuestState.QuestType}. 1112 * @return this quest state. 1113 */ 1114 public QuestState exitQuest(QuestType type) 1115 { 1116 switch (type) 1117 { 1118 case REPEATABLE: 1119 case ONE_TIME: 1120 { 1121 exitQuest(type == QuestType.REPEATABLE); 1122 break; 1123 } 1124 case DAILY: 1125 { 1126 exitQuest(false); 1127 setRestartTime(); 1128 break; 1129 } 1130 } 1131 return this; 1132 } 1133 1134 /** 1099 1135 * Destroy element used by quest when quest is exited 1100 1136 * @param repeatable … … 1178 1214 npc.dropItem(player, itemId, count); 1179 1215 } 1216 1217 /** 1218 * Set the restart time for the daily quests.<br> 1219 * The time is hardcoded at {@link Quest#getResetHour()} hours, {@link Quest#getResetMinutes()} minutes of the following day.<br> 1220 * It can be overridden in scripts (quests). 1221 */ 1222 public void setRestartTime() 1223 { 1224 final Calendar reDo = Calendar.getInstance(); 1225 if (reDo.get(Calendar.HOUR_OF_DAY) >= getQuest().getResetHour()) 1226 { 1227 reDo.add(Calendar.DATE, 1); 1228 } 1229 reDo.set(Calendar.HOUR_OF_DAY, getQuest().getResetHour()); 1230 reDo.set(Calendar.MINUTE, getQuest().getResetMinutes()); 1231 set("restartTime", String.valueOf(reDo.getTimeInMillis())); 1232 } 1233 1234 /** 1235 * @return {@code true} if the quest is available, for example daily quests, {@code false} otherwise. 1236 */ 1237 public boolean isNowAvailable() 1238 { 1239 final String val = get("restartTime"); 1240 return ((val == null) || !Util.isDigit(val)) || (Long.parseLong(val) <= System.currentTimeMillis()); 1241 } 1180 1242 }
Note: See TracChangeset
for help on using the changeset viewer.
