낚시 시스템 구현
public void cancelFishingTask() {
if (fishing != null) {
fishing.cancel(false);
}
}
public void getFishing() {
if (getMapId() == 100000000) { //낚시 맵
taskFishing();
} else {
}
}
public void cancelFishing() {
if (this.fishings != null) {
this.fishings.cancel();
if (!check) {
dropMessage(1, "[알림] 낚시를 종료합니다. 낚시 성공횟수:" + fishCount + "입니다.");
check = false;
} else {
dropMessage(1, "[알림] 미끼가 떨어졌습니다.\r\n미끼를 구매해주세요.");
check = false;
}
fishCount = -1;
fishings = null;
}
}
public void cancelFishing1() {
if (this.fishings != null) {
this.fishings.cancel();
if (!check) {
dropMessage(1, "[알림] 낚시를 종료합니다. 낚시 성공횟수:" + fishCount + "입니다.");
check = false;
} else {
dropMessage(1, "[알림] 미끼가 떨어졌습니다.\r\n미끼를 구매해주세요.");
check = false;
}
fishCount = -1;
fishings = null;
}
}
public void taskFishing() {
this.fishings = new java.util.Timer();
this.fishings.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
int[] itemList = {2022174, 2002004, 2022175, 2020015, 4001126, 2000017, 4000298, 2020002};
int randItem = itemList[Randomizer.nextInt(itemList.length)];
short quantity = (short) Randomizer.rand(1, 5);
if (getMapId() == 100000000) { // 낚시터 맵
if (getInventory(MapleInventoryType.SETUP).findById(3010432) != null) {
if (haveItem(4000010, 1, false, true)) { //미끼로 사용할 아이템
if (fishCount > -1) {
if (Randomizer.nextInt(101) > 10) {
dropMessage(5, "[알림] 알수없는 아이템이 흭득되었습니다.");
gainItem(4000010, (short)-1,false, 4000010, 0, null, client);
gainItem(randItem, quantity);
fishCount++;
} else if (Randomizer.nextInt(101) > 20) {
int a = Randomizer.rand(1, 2);
gainExp(a == 1 ? 1298 : 2000,false,false,false);
dropMessage(5,"[알림] 경험치 " + (a == 1 ? 1298 : 2000) + " 를 획득 하였습니다.");
gainItem(4000010, (short)-1,false, 4000010, 0, null, client);
} else if (Randomizer.nextInt(101) > 30) {
int a = Randomizer.rand(1,2);
gainMeso(a==1 ? 12567 : 24567,false);
dropMessage(5,"[알림] " + (a ==1 ? 1256 : 5456) + "메소 를 획득 하였습니다.");
gainItem(4000010, (short)-1,false, 4000010, 0, null, client);
} else {
dropMessage(5,"[알림] 물고기가 미끼만 먹고 도망갔습니다.");
gainItem(4000010, (short)-1,false, 4000010, 0, null, client);
fishCount++;
}
} else {
dropMessage(1,"낚시를 시작합니다.");
fishCount++;
}
} else {
if (fishCount == -1) {
fishCount = 0;
}
check = true;
cancelFishing1();
}
}
} else if (!check) {
return;
}
}
}, 0, 2 * (1000 * 15));
}
public boolean check() {
return this.check;
}
}
MapleCharacter.java 에서
|
private transient PlayerRandomStream random3; 을 검색하시구
밑에
private java.util.Timer fishings;
추가해줍시다. |
|
Public static final void UseChair 를 검색해주세요.
검색후 이것으로 바꿔주세요
public static final void UseChair(final int itemId, final MapleClient c, final MapleCharacter chr) { |
|
Public static final void UseChair 추가하셨나요?
밑에보시면 CancelChair 도 있을껀데요.
그것도 아래와 같이 바꿔줍니다.
public static final void CancelChair(final short id, final MapleClient c, final MapleCharacter chr) { |

피카츄염 님의 최근 댓글
ㅋㅋ 2018 05.29 클라 안되는대ㅔ여 2018 02.16 감사합니다 2018 02.12 클라 보내주세요 go_to_r@naver.com 2018 02.09 ㄳ 2018 02.01