Excellzone

Forum and disscussions since 2010


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

#1
Excell

avatar
Head Administer
Head Administer
Hello there guys, I
noticed a lot of people asking for a Boss Spawner/Monster Spawner that
works proper in the help section so I decide to release this one. This
is my first release and i think it has been released before im not sure
but please do not FLAME.


Okay this is what you do first, Open up Netbeans and go to NPCConversationManager.java, and below this
PHP Code:
package net.sf.odinms.scripting.npc;



insert this:
PHP Code:
import net.sf.odinms.server.maps.MapleMap;
import net.sf.odinms.server.life.MapleMonsterInformationProvider;



Then put this anywhere in NPCConversationManager.java
PHP Code:
public void summonMob(int mobid, int customHP, int customEXP, int amount) {
MapleMonsterStats newStats = new MapleMonsterStats();
if (
customHP > 0) {
newStats.setHp(customHP);
}
if (
customEXP >= 0) {
newStats.setExp(customEXP);
}
if (
amount <= 1) {
MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);
npcmob.setOverrideStats(newStats);
npcmob.setHp(npcmob.getMaxHp());
getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, getPlayer().getPosition());
} else {
for (
int i = 0; i < amount; i++) {
MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);
npcmob.setOverrideStats(newStats);
npcmob.setHp(npcmob.getMaxHp());
getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, getPlayer().getPosition());
}
}
}



And below it add this:
PHP Code:
public void cleardrops() {
MapleMonsterInformationProvider.getInstance().clearDrops();
}



Ill also add the killAllMonsters Method, once i am done fixing it

Okay almost done! Now go to MapleMap.java,
and insert this anywhere in MapleMap.java:

PHP Code:
public void spawnMonsterOnGroudBelow(MapleMonster mob, Point pos) {
spawnMonsterOnGroundBelow(mob, pos);
}



Save then compile, now time for the NPC Script,
Here it is: (Credits go to Jung for making this NPC Script)


PHP Code:
/* Jung/sadfasd of FantasyStory
* Boss Summoning NPC
* Bboy242 for re editing a error
* cm.summonMob(mobID, mobHP, mobEXP, mobAMOUNT);
*/

var status = 0;

function
start() {
status = -1;
action(1, 0, 0);
}

function
action(mode, type, selection) {

if (
mode == -1) {
cm.dispose();
}
else {
if (
status >= 2 && mode == 0) {
cm.sendOk("Goodbye");
cm.dispose();
return;
}

if (
mode == 1) {
status++;
}
else {
status--;
}

if (
status == 0) {
cm.sendNext("I summon Bosses for #bFantasyStory#l. I summon 10 monsters at a time for free.");
}
else if (
status == 1) {
cm.sendSimple("Please remember I will summon 10. \r\nPlease choose #b\r\n#L0#Papulatus clock#l\r\n#L1#Headless Horseman#l\r\n#L2#Black Crow#l\r\n#L3#Anego#l\r\n#L4#Rooster#l\r\n#L5#BigFoot#l\r\n#L6#MushMom#l#r\r\n#L7#Clear Drops#l\r\n#L8#Kill All Monsters#l");
}
else if (
status == 2) {

if (
selection == 0) {
cm.summonMob(8500001, 23000000, 596000, 10);
cm.dispose();
}

else if (
selection == 1) {
cm.summonMob(9400549, 3500000, 300000, 10);
cm.dispose();
}
else if (
selection == 2) {
cm.summonMob(9400014, 35000000, 1780000, 10);
cm.dispose();
}
else if (
selection == 3) {
cm.summonMob(9400121, 75000000, 3900000, 10);
cm.dispose();
}
else if (
selection == 4) {
cm.summonMob(9600001, 340, 33, 10);
cm.dispose();
}
else if (
selection == 5) {
cm.summonMob(9400575, 32000000, 2660000, 10);
cm.dispose();
}
else if (
selection == 6) {
cm.summonMob(9500124, 20000, 1200, 10);
cm.dispose();
}
else if (
selection == 7) {
cm.cleardrops();
cm.dispose();
}
else if (
selection == 8) {
cm.killAllMonsters(true);
cm.dispose();
}
}
}
}



Ahh
well thats it, I dont think Clear Drops or the kill all the monsters
function properly, so ill have to fix that, but pretty much every thing
should work.
And ah PLEASE DO NOT FLAME!!!

Thanks
~Roy

View user profile http://excellzone.mrforum.net

View previous topic View next topic Back to top Message [Page 1 of 1]


Permissions in this forum:
You cannot reply to topics in this forum