B0rEd0
Posts : 5 Join date : 2010-02-20
| Subject: [Guide] Randomly Sommons Monster Code Mon Mar 01, 2010 6:59 pm | |
| Hehe, I just couldn't wait to be coder so I'm release this to ShinyMS. What this does is randomly sommons an Annaversary Cake in either Henesy,Perion,Ellinia, or Kerning City. So what you wanna do is go to your repack folder, then go into scripts. From there, you should see a folder called "Event". When your in the "Event" folder, you gonna want to select one of the files in there, any file it doesn't matter. Right click the file and click copy. Then go to your desktop and paste the file there. Then your gonna right click the file and press "edit". Something should pop-up and it's gonna look like a text document. Then your gonna delete everything thats in the file and replace it with; - Code:
-
/* @ Boss spawn in town event */
var i = 5; var setupTask;
function init() { scheduleNew(); }
function scheduleNew() { var cal = java.util.Calendar.getInstance(); cal.set(java.util.Calendar.HOUR, 0); cal.set(java.util.Calendar.MINUTE, 55); // offset cal.set(java.util.Calendar.SECOND, 0); var nextTime = cal.getTimeInMillis(); while (nextTime <= java.lang.System.currentTimeMillis()) { nextTime += 1000 * 60 * 60; // 4 hours } setupTask = em.scheduleAtTimestamp("setup", nextTime); }
function cancelSchedule() { setupTask.cancel(true); }
function setup() { var x; for (x = 0; x < 5; x++) { em.schedule("announce", 5 * 60000 + x * 60000); } em.schedule("start", 5 * 60000 + (x + 1) * 60000); }
function announce() { if (i == 0) i = 5; em.getChannelServer().broadcastPacket( net.sf.odinms.tools.MaplePacketCreator.serverNotice(6, "[Event] A boss will spawn in " + i + " minutes")); i--; }
function start() { scheduleNew(); var maps = [100000000,101000000,102000000,103000000,104000000]; var truemap = maps[Math.floor(Math.random(0.2,0.4,0.6,0.8,1) * maps.length)] var map = em.getChannelServer().getMapFactory().getMap(truemap); var guess = ""; var snail = net.sf.odinms.server.life.MapleLifeFactory.getMonster(9400570); if (truemap == 100000000) guess = "Henesys"; if (truemap == 102000000) guess = "Perion"; if (truemap == 103000000) guess = "Kerning"; if (truemap == 104000000) guess = "Lith Harbor"; if (truemap == 101000000) guess = "Ellinia"; em.getChannelServer().broadcastPacket(net.sf.odinms.tools.MaplePacketCreator.serverNotice(6, "[Event] A boss was spawned in "+ guess)); map.spawnMonsterOnGroudBelow(snail, new java.awt.Point( randX(), randY())); }
function randX() { return 500 + Math.floor(Math.random() * 500); }
function randY() { return 100 + Math.floor(Math.random() * 50); } Then your gonna save and close it.Then your going to rename it to "TownBoss". Please remember to put the capital letters. Then your gonna put it back into your event folder that was in your repack folder. Then your going to go to your world.properties file and look for; - Code:
-
# active event scripts net.sf.odinms.channel.events=lolcastle,3rdjob,ZakumPQ,KerningPQ,GuildQuest,AutoMsg
(Warning; The code above may change with different repacks, the one I am using; ArberSourceV2, has that) and where it says; - Code:
-
net.sf.odinms.channel.events=lolcastle,3rdjob,ZakumPQ,KerningPQ,GuildQuest,AutoMsg
just add - Code:
-
TownBoss
into the list. (Warning; Don't forget your correct grammars and put a comma(,) when adding "TownBoss" into the list ) oh and don't forget the capitalized letters must be capitalized when added to the list. If anytime you want to change the monster that is going to be sommon, look for; - Code:
-
var snail = net.sf.odinms.server.life.MapleLifeFactory.getMonster(9400570);
and change the "9400570" to the monster ID you want. If anytime you want to change the map that the monster is sommoned, just ask me because that is just a lil' more complicated. Additional Notes; People like this event a lot because it allows them to fight a monster randomly. Oh and I usaully change the monster everytime I restart the server. | |
|
ISuper Guest
| Subject: Re: [Guide] Randomly Sommons Monster Code Wed Mar 03, 2010 4:44 pm | |
| Wouldn't it be faster and better to edit the server's wz xml map files? |
|
B0rEd0
Posts : 5 Join date : 2010-02-20
| Subject: Re: [Guide] Randomly Sommons Monster Code Wed Mar 03, 2010 7:53 pm | |
| - ISuper wrote:
- Wouldn't it be faster and better to edit the server's wz xml map files?
No because that only sommons the monster every time the server restarts. Waht this code does is randomly sommons a monster by it self. | |
|
ISuper Guest
| Subject: Re: [Guide] Randomly Sommons Monster Code Thu Mar 04, 2010 1:33 pm | |
| It's like the same thing they did with the FM mobs. You can time the mobs when you want it to spawn.
for example.. spawning a snail every second.
<imgdir name="0"> <string name="type" value="m"/> <string name="id" value="100100"/> <int name="x" value="-1646"/> <int name="y" value="102"/> <int name="mobTime" value="1"/> <int name="f" value="0"/> <int name="hide" value="0"/> <int name="fh" value="86"/> <int name="cy" value="42"/> <int name="rx0" value="-1596"/> <int name="rx1" value="-1696"/> </imgdir> |
|
B0rEd0
Posts : 5 Join date : 2010-02-20
| Subject: Re: [Guide] Randomly Sommons Monster Code Thu Mar 04, 2010 6:15 pm | |
| - ISuper wrote:
- It's like the same thing they did with the FM mobs. You can time the mobs when you want it to spawn.
for example.. spawning a snail every second.
<imgdir name="0"> <string name="type" value="m"/> <string name="id" value="100100"/> <int name="x" value="-1646"/> <int name="y" value="102"/> <int name="mobTime" value="1"/> <int name="f" value="0"/> <int name="hide" value="0"/> <int name="fh" value="86"/> <int name="cy" value="42"/> <int name="rx0" value="-1596"/> <int name="rx1" value="-1696"/> </imgdir> Ok let me explain to you what this code does, what this does is randomly summons an Anniversary Cake in Kerning City, Henesy, Ellinia, or Lith Harbor. When the monster is summoned, a messenge will display in everyones chat box say "A monster has been summoned in (Kerning City, Henesy, Ellinia, or Lith Harbor)" What your saying is edit the XML WZ. That means your going to have to go to 5 different XML WZ files and paste the code in. Plus your way doesn't display a messenge tell people that the monster is summoned. The heck, your way is like just adding a permanent mob spawning. You see the difference? | |
|
ISuper Guest
| Subject: Re: [Guide] Randomly Sommons Monster Code Thu Mar 04, 2010 9:42 pm | |
| word... but it seems useless since there's fm bosses |
|
B0rEd0
Posts : 5 Join date : 2010-02-20
| Subject: Re: [Guide] Randomly Sommons Monster Code Fri Mar 05, 2010 6:18 pm | |
| - ISuper wrote:
- word... but it seems useless since there's fm bosses
Well, that's true but this is Anniversary Cake. There is no Anniversary Cake in the FM. | |
|
Claudia
Posts : 66 Join date : 2010-03-21 Age : 31 Location : Maryland
| Subject: Re: [Guide] Randomly Sommons Monster Code Tue Mar 30, 2010 7:35 am | |
| So basically anyone could just randomly summon an anniversary cake? Can they spam it? Cuz then it'll be a lag problem. :/ | |
|
Claudia
Posts : 66 Join date : 2010-03-21 Age : 31 Location : Maryland
| Subject: Re: [Guide] Randomly Sommons Monster Code Tue Mar 30, 2010 7:36 am | |
| - Claudia wrote:
- So basically anyone could just randomly summon an anniversary cake? Can they spam it? Cuz then it'll be a lag problem. :/
Also, by spam, I mean summon more than neccessary | |
|
Claudia
Posts : 66 Join date : 2010-03-21 Age : 31 Location : Maryland
| Subject: Re: [Guide] Randomly Sommons Monster Code Sat Apr 03, 2010 12:49 pm | |
| So yeah.. I didn't really like this post o_o
Sorry (: | |
|
vi3tgrlcindy Admin
Posts : 103 Join date : 2010-01-30
| Subject: Re: [Guide] Randomly Sommons Monster Code Thu Apr 22, 2010 9:42 pm | |
| i don't neither ! *high five Claudia* | |
|
vi3tgrlcindy Admin
Posts : 103 Join date : 2010-01-30
| Subject: Re: [Guide] Randomly Sommons Monster Code Thu Apr 22, 2010 9:42 pm | |
| | |
|
Sponsored content
| Subject: Re: [Guide] Randomly Sommons Monster Code | |
| |
|