[Release] Monster spawn void

01/20/2010 16:43 pro4never#1
Ok so be warned, this is messy as I haven't cleaned up most of it. Also note: as far as I'm aware, all mesh sizeadds are controlled by the client so I wasn't able to add that into this (the whole reason I started messing around with this was to easily change mob names/custom quest mobs without having to edit client)

Anyways, I have no use for it and I have no reason to clean up the code at all so I'm gonna go ahead and post what I have done.

Current version works perfectly to spawn mobs. I added some very poorly written code to save monster names when you go offscreen (if you just spawn them with the name it will default back to the old name/display info when you leave screen and come back)

Also added some basic code to control monster spread, number of mobs and some other simple stuff.



NOTE: COEMU 5095! I WILL NOT CONVERT IT FOR LOTF!


First off, for simplicity create a new .cs file under handlers (mine is Handlers.SpawnVoid.cs. Add this into it



Now to spawn monsters via a command (you can add this into quests/conditionals, random events and all sorts of other good stuff.) open Handlers>Chat.cs and add this command

Code:
case "mobtest":
                            {
                              
                                int Amount = Convert.ToInt32(Command[7]);

                                while (Amount > 0)
                                {
                                Handler.SpawnVoid.SpawnMonster(Convert.ToInt32(Command[1]), Command[2], Convert.ToInt32(Command[3]), Convert.ToInt32(Command[4]), Convert.ToInt32(Command[5]), Convert.ToInt32(Command[6]));
                                    Amount -= 1;
                                }                            
                                break;
                            }

I didn't implement changing monster max hp/level (useful for exp monsters! All you have to do for that is edit the first code.

CustomInfo.MaxHP = MobInfo.MaxHP;
CustomInfo.Level = MobInfo.Level;

To be whatever you want (I'd simply change the void so that you can edit the monster hp/level easily as they are the most common things you will wanna change)


Anyways, I know it's not pretty but it works just fine. As far as I know, no such thing has been released and it can be used for alot of interesting stuff (eg: spawning boss monster at a certain spot for quests such as dis city or 2nd reborn quest)


To use the command

/mobtest MobId(mesh) mobname map x y spread amount

Eg: /mobtest 3311 Epvp 1002 500 501 10 2

would spawn 2 bunnies named "Epvp" at 500, 501 twin city (with 10 spread, meaning randomness of where they actually spawn. useful for spawning more than 1 so they aren't all stacked up)


Screenshot of it: [Only registered and activated users can see links. Click Here To Register...]


Enjoy,
P4N
01/20/2010 17:08 ~Yuki~#2
nice done
01/20/2010 21:18 |xabi|#3
what is it?
01/20/2010 21:46 pro4never#4
... it lets you spawn any monster while the server is running wherever you want it with any name you want.

I included a command with it (summon a monster by command) but it makes it simple to spawn a monster under any server conditions (such as time, quest conditions, etc)


So lets say you have a quest that you want a boss monster to spawn at a specific point under certain conditions (such as player has 100 kills on that map) you could use it for that.

Or lets say you have an item you want to summon a monster. Code it into the item use code and you can have it summon a monster at your current position.


It has a ton of applications, you just have to use some imagination. Basically, if you need/want a monster to spawn for any reason, you can use this by using Handler.SpawnVoid.SpawnMonster(mobmesh, mob name, mob mab, mob x, mob y, spread);

Hope that clears up some of your questions.
01/20/2010 21:48 |xabi|#5
thx
01/20/2010 22:17 .Ryu#6
Goodjob chris
01/20/2010 23:02 Metapod#7
Good release man.
01/29/2010 23:01 copz1337#8
Sigh. Um could you convert just this little part for 5165?

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using CoEmu_v2_GameServer;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Entities;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Packets;
using CoEmu_v2_GameServer.Calculations;
using CoEmu_v2_GameServer.Database;
using System.Threading;
01/29/2010 23:15 pro4never#9
That's what sections of the source it includes.

Look at other files in your source, they most likely have some sort of "using" statements up at the top.
01/29/2010 23:33 Olodady#10
You do nice work with that CoEmu source :) congratz
01/29/2010 23:56 copz1337#11
Quote:
Originally Posted by pro4never View Post
That's what sections of the source it includes.

Look at other files in your source, they most likely have some sort of "using" statements up at the top.
Yeah I know and I tried but I can't figure it out man.
01/30/2010 00:05 pro4never#12
What problems are you having specifically? Just follow how other files are structured in your source (I assume it has some sort of handler section at least?)

Either way, you will just wanna copy/paste the basic structure from your source. Honestly lotf probably spawns monsters in completely different way (as the structure of the dictionary and or struct is controlled by the source)
01/30/2010 14:25 yukito1305#13
HEY idk where the fuck is CO emu i can't find but there one but isn't it down?
01/30/2010 16:23 Jedex#14
Do you mean the source?
You can't find the source?
01/30/2010 23:26 pro4never#15
CoEmu is not a server (anymore). It's a source code that people can use to create their own server.

This is just some coding people can add to THEIR OWN servers to add extra functionality (in this case, spawning mobs on demand for quests/via items/via commands/events etc