DoubleCardHandler.java
资源名称:src.rar [点击查看]
上传用户:gwt600
上传日期:2021-06-03
资源大小:704k
文件大小:4k
源码类别:
游戏
开发平台:
Java
- /*
- This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
- Matthias Butz <matze@odinms.de>
- Jan Christian Meyer <vimes@odinms.de>
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License version 3
- as published by the Free Software Foundation. You may not use, modify
- or distribute this program under any other version of the
- GNU Affero General Public License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package net.sf.odinms.net.channel.handler;
- import java.util.Calendar;
- import net.sf.odinms.client.MapleCharacter;
- import net.sf.odinms.client.MapleClient;
- /**
- *
- * @author iamSTEVE
- */
- public class DoubleCardHandler { //handling for 2x EXP and drop cards
- private MapleClient c;
- MapleCharacter player = c.getPlayer();
- Calendar cal = Calendar.getInstance();
- int day = cal.get(Calendar.DAY_OF_WEEK);
- int hour = cal.get(Calendar.HOUR_OF_DAY);
- //int hour = cal.get(Calendar.HOUR_OF_DAY);
- private boolean weekend = false; //shorter form
- private boolean weekday = false;
- public DoubleCardHandler() {
- }
- public int getEXPCard() {
- updateDay(); //all thats missing is instanced ones
- if (player.haveItem(5211000, 1, false, true) && hour >= 18 && hour <= 20) {
- return 2;
- } else if (player.haveItem(5211014, 1, false, true) && hour >= 7 && hour <= 11) {
- return 2;
- } else if (player.haveItem(5211015, 1, false, true) && hour >= 10 && hour <= 14) {
- return 2;
- } else if (player.haveItem(5211016, 1, false, true) && hour >= 13 && hour <= 17) {
- return 2;
- } else if (player.haveItem(5211017, 1, false, true) && hour >= 16 && hour <= 20) {
- return 2;
- } else if (player.haveItem(5211018, 1, false, true) && hour >= 15 && hour <= 23) {
- return 2;
- } else if (player.haveItem(5211039, 1, false, true) && hour >= 0 && hour <= 4) {
- return 2;
- } else if (player.haveItem(5211042, 1, false, true) && hour >= 3 && hour <= 7) {
- return 2;
- } else if (player.haveItem(5211045, 1, false, true) && hour >= 6 && hour <= 10) {
- return 2;
- } else if (player.haveItem(5211044, 1, false, true) && hour >= 6 && hour <= 12 && weekend) {
- return 2;
- } else if (player.haveItem(5211043, 1, false, true) && hour >= 6 && hour <= 12 && weekday) {
- return 2;
- } else if (player.haveItem(5211041, 1, false, true) && hour >= 3 && hour <= 9 && weekend) {
- return 2;
- } else if (player.haveItem(5211041, 1, false, true) && hour >= 3 && hour <= 9 && weekday) {
- return 2;
- } else if (player.haveItem(5211038, 1, false, true) && hour >= 0 && hour <= 4 && weekend) {
- return 2;
- } else if (player.haveItem(5211037, 1, false, true) && hour >= 0 && hour <= 4 && weekend) {
- return 2;
- }
- return 1;
- }
- public int getDropCard() { //drop card handling
- //todo: all drop cards
- if (player.haveItem(5360001, 1, false, true) && hour >= 7 && hour <= 11) {
- return 2;
- } else if (player.haveItem(5360002, 1, false, true) && hour >= 10 && hour <= 14) {
- return 2;
- } else if (player.haveItem(5360003, 1, false, true) && hour >= 13 && hour <= 17) {
- return 2;
- } else if (player.haveItem(5360004, 1, false, true) && hour >= 16 && hour <= 20) {
- return 2;
- } else if (player.haveItem(5360005, 1, false, true) && hour >= 19 && hour <= 23) {
- return 2;
- } else if (player.haveItem(5360006, 1, false, true) && hour >= 0 && hour <= 4) {
- return 2;
- } else if (player.haveItem(5360007, 1, false, true) && hour >= 3 && hour <= 7) {
- return 2;
- } else if (player.haveItem(5360008, 1, false, true) && hour >= 6 && hour <= 10) {
- return 2;
- }
- return 1;
- } //TODO: get it to double the mesos correctly without glitching >.<
- public void updateDay () { //updates day.
- switch(day){
- case 1: this.weekend = true;
- case 2: this.weekday = true;
- case 3: this.weekday = true;
- case 4: this.weekday = true;
- case 5: this.weekday = true;
- case 6: this.weekday = true;
- case 7: this.weekend = true;
- }
- }
- }