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.
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)
... 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);
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;
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)
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