モンスターレイド実装方法 簡単ver

Go down

モンスターレイド実装方法 簡単ver

投稿 by 構築さん on 2014-05-31, 17:37

AbstractPlayerInteraction.java



Code:
public void summonMobAtPosition(int mapid, int mobid, int amount, int posx, int posy) {
if (amount <= 1) {
MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);
npcmob.setHp(npcmob.getMaxHp());
c.getChannelServer().getMapFactory().getMap(mapid).spawnMonsterOnGroudBelow(npcmob, new Point(posx, posy));
} else {
for (int i = 0; i < amount; i++) {
MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);
npcmob.setHp(npcmob.getMaxHp());
c.getChannelServer().getMapFactory().getMap(mapid).spawnMonsterOnGroudBelow(npcmob, new Point(posx, posy));
}
}
}



Code:
public int getMonsterSize(int mapid) {
List<MapleMapObject> monsters = c.getChannelServer().getMapFactory().getMap(mapid).getMapObjectsInRange(getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
return monsters.size();
}

を追加

SavedLocationType.java



Code:
MONSTER_RAID

を追加

SCRIPT

Code:
/*

9500337 - Mano
9500338 - Stumpy
9500339 - Deo
9500340 - King Slime
9500341 - Faust
9500342 - King Clang
9500343 - Alishar
9500344 - Timer
9500345 - Mushmom
9500346 - Dyle
9500347 - Zeno
9500348 - Nona-Tailed Fox
9500349 - Lord Pirate
9500350 - Tae Roon
9500351 - Papa Pixie
9500352 - King Sage Cat
9500353 - Jr. Balrog
9500354 - Frankenroid
9500355 - Eliza
9500356 - Kimera
9500357 - Snow Yeti
9500358 - Crimson Balrog
9500359 - Manon
9500360 - Griffey
9500361 - Leviathan
9500362 - Papulatus
9500363 - Pianus

*/

function enter(pi) {

if (pi.getPlayer().getMapId() == 970030100 && pi.getMonsterSize(970030100) == 0) {
pi.warp(970030200,0);
pi.summonMobAtPosition(970030200, 9500338, 1, 1419, 2189);
return true;
} else if (pi.getPlayer().getMapId() == 970030200 && pi.getMonsterSize(970030200) == 0) {
pi.warp(970030300,0);
pi.summonMobAtPosition(970030300, 9500339, 1, 738, 267);
return true;
} else if (pi.getPlayer().getMapId() == 970030300 && pi.getMonsterSize(970030300) == 0) {
pi.warp(970030400,0);
pi.summonMobAtPosition(970030400, 9500340, 1, 154, -444);
return true;
} else if (pi.getPlayer().getMapId() == 970030400 && pi.getMonsterSize(970030400) == 0) {
pi.warp(970030500,0);
pi.summonMobAtPosition(970030500, 9500341, 1, 1069, -148);
return true;
} else if (pi.getPlayer().getMapId() == 970030500 && pi.getMonsterSize(970030500) == 0) {
pi.warp(970030001,0);
return true;
} else if (pi.getPlayer().getMapId() == 970030600 && pi.getMonsterSize(970030600) == 0) {
pi.warp(970030700,0);
pi.summonMobAtPosition(970030700, 9500343, 1, 917, 175);
return true;
} else if (pi.getPlayer().getMapId() == 970030700 && pi.getMonsterSize(970030700) == 0) {
pi.warp(970030800,0);
pi.summonMobAtPosition(970030800, 9500344, 1, -21, 1028);
return true;
} else if (pi.getPlayer().getMapId() == 970030800 && pi.getMonsterSize(970030800) == 0) {
pi.warp(970030900,0);
pi.summonMobAtPosition(970030900, 9500345, 1, -623, 209);
return true;
} else if (pi.getPlayer().getMapId() == 970030900 && pi.getMonsterSize(970030900) == 0) {
pi.warp(970031000,0);
pi.summonMobAtPosition(970031000, 9500346, 1, -648, 114);
return true;
} else if (pi.getPlayer().getMapId() == 970031000 && pi.getMonsterSize(970031000) == 0) {
pi.warp(970030002,0);
return true;
} else if (pi.getPlayer().getMapId() == 970031100 && pi.getMonsterSize(970031100) == 0) {
pi.warp(970031200,0);
pi.summonMobAtPosition(970031200, 9500348, 1, -92, 81);
return true;
} else if (pi.getPlayer().getMapId() == 970031200 && pi.getMonsterSize(970031200) == 0) {
pi.warp(970031300,0);
pi.summonMobAtPosition(970031300, 9500349, 1, 774, 229);
return true;
} else if (pi.getPlayer().getMapId() == 970031300 && pi.getMonsterSize(970031300) == 0) {
pi.warp(970031400,0);
pi.summonMobAtPosition(970031400, 9500350, 1, -199, 384);
return true;
} else if (pi.getPlayer().getMapId() == 970031400 && pi.getMonsterSize(970031400) == 0) {
pi.warp(970031500,0);
pi.summonMobAtPosition(970031500, 9500351, 1, -343, 549);
return true;
} else if (pi.getPlayer().getMapId() == 970031500 && pi.getMonsterSize(970031500) == 0) {
pi.warp(970030003,0);
return true;
} else if (pi.getPlayer().getMapId() == 970031600 && pi.getMonsterSize(970031600) == 0) {
pi.warp(970031700,0);
pi.summonMobAtPosition(970031700, 9500353, 1, -10, 124);
return true;
} else if (pi.getPlayer().getMapId() == 970031700 && pi.getMonsterSize(970031700) == 0) {
pi.warp(970031800,0);
pi.summonMobAtPosition(970031800, 9500354, 1, 251, 138);
return true;
} else if (pi.getPlayer().getMapId() == 970031800 && pi.getMonsterSize(970031800) == 0) {
pi.warp(970031900,0);
pi.summonMobAtPosition(970031900, 9500355, 1, 143, 72);
return true;
} else if (pi.getPlayer().getMapId() == 970031900 && pi.getMonsterSize(970031900) == 0) {
pi.warp(970032000,0);
pi.summonMobAtPosition(970032000, 9500356, 1, -218, -120);
return true;
} else if (pi.getPlayer().getMapId() == 970032000 && pi.getMonsterSize(970032000) == 0) {
pi.warp(970030004,0);
return true;
} else if (pi.getPlayer().getMapId() == 970032100 && pi.getMonsterSize(970032100) == 0) {
pi.warp(970032200,0);
pi.summonMobAtPosition(970032200, 9500358, 1, 239, 44);
return true;
} else if (pi.getPlayer().getMapId() == 970032200 && pi.getMonsterSize(970032200) == 0) {
pi.warp(970032300,0);
pi.summonMobAtPosition(970032300, 9500359, 1, 37, 445);
return true;
} else if (pi.getPlayer().getMapId() == 970032300 && pi.getMonsterSize(970032300) == 0) {
pi.warp(970032400,0);
pi.summonMobAtPosition(970032400, 9500360, 1, -3, 445);
return true;
} else if (pi.getPlayer().getMapId() == 970032400 && pi.getMonsterSize(970032400) == 0) {
pi.warp(970032500,0);
pi.summonMobAtPosition(970032500, 9500361, 1, -15, 2463);
return true;
} else if (pi.getPlayer().getMapId() == 970032500 && pi.getMonsterSize(970032500) == 0) {
pi.warp(970030005,0);
return true;
} else if (pi.getPlayer().getMapId() == 970032600 && pi.getMonsterSize(970032600) == 0) {
pi.warp(970032700,0);
pi.summonMobAtPosition(970032700, 9500363, 1, 281, 135);
return true;
} else if (pi.getPlayer().getMapId() == 970032700 && pi.getMonsterSize(970032700) == 0) {
pi.warp(970030000,0);
return true;
} else {
pi.playerMessage("モンスタ・#91;を倒さないと、 先へ進むことはできません。");
return false;
}
}

を自分のRepackのPortalと言うところにいれてください。

Code:
importPackage(net.sf.odinms.server.maps);
importPackage(net.sf.odinms.net.channel);

function enter(pi) {
var returnMap = pi.getPlayer().getSavedLocation(SavedLocationType.MONSTER_RAID);
if (returnMap < 0) {
returnMap = 100000000;
}
var target = pi.getPlayer().getClient().getChannelServer().getMapFactory().getMap(returnMap);
var targetPortal;
if (targetPortal == null) {
targetPortal = target.getPortal(0);
}
pi.getPlayer().clearSavedLocation(SavedLocationType.MONSTER_RAID);
pi.getPlayer().changeMap(target, targetPortal);
return true;
}

をPortalと言うところに入れてください。
最後の意味は 自分のRepack-Script-Portalと言う所に上記をコピーして.jsを作成していれるということです。
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可