Ok so this is going to be a scattered release as I don't plan on going through my source and finding every possible thing you could ever need. If there are problems post away and I may help but for the most part you will be on your own to get this working.
What is this?
This is a quest/event I designed at like 4 am one night when I couldn't sleep after getting pissed off at all the BAD quests released (not pointing fingers... but you all gotta admit there have been some very pointless quests)
What does it do?
This event consists of treasure boxes (currently using Lotto boxes as I didn't feel like searching through all the possible npcs, you can change them to whatever you want though).
These treasure boxes spawn randomly around the game world producing a msg to all the server telling people what town it's near (Note: added a system to convert map ID to Name for use with this type of thing... if there is such functionality built into CoEmu I didn't see it.. again it was 4 am though). When used the box will despawn and award the user with a random prize and (assuming the event is still in progress), respawn somewhere else in the game world.
Locations are stored in a SQL database (refer to my random teleport release, it's the same system. This is the type of stuff I designed it for, I just didn't feel like coding anything past the actual db itself at that point)
Well that's cool, how do I customize it?
Simple enough, everything is somewhat labled and I've included some handy commands to start/stop the event (doing it via times of day or counting how many boxes are allowed to be spawned per event is up to you. It's simple enough to do but I'm done coding for a little while), commands to add new points easily to the random location database as well as being rather easy to customize in the first place.
The Release:
Note: CoEmu 5095, not releasing or converting it for lotf, that's up to you guys.
Part 1: Refer to my Random teleport release for further instructions on how to set this up but for extra help I'll release what I can remember of it here.
Database>Database.Cs
nano.cs
and
and down @
put
Now: I have a handler file called functions to store any new stuff I'm adding so you will wanna add one. Name it what you want but mine is Handlers>Functions.cs. Here is the full file with the applicable info in it
Handlers>NpcTalk.cs
Note: You may need to modify your add item void. This source has no real modifications to it so has no progress/free item/lock/etc
under Handlers>Chat.cs
Command to start the event
Commands to add new points to the database
Ooh and just so you have it, here's a command to teleport to one of the locations in the database (remove if you don't want people being able to use it to get to the npcs super fast)
Ooh, and here's the VERY basic file to convert map ID to a map name.
Mine is Calculations>MapToName.cs but you can rename it, easiest if you just go with that though.
Also for convenience, here is the backup of my rand tele database file
note: it's nearly empty. I just added a few points for testing. Give it a try though, everything should work just great.
For the record, to start it (unless you code it to auto start which is easy enough to do)
/huntnpc (amount for quest)
To add new locations to the database
Current character location
/newrandme
or
/newrand map x y
<edit>
Update: tested with the new upgrade. Everything works fine now
Update: removed box when event ended (it was not a problem as it only gives prize once regardless of if it moves but still, it's better that way)
Note: The whole teleporting the clear the screen thing was again my own lazyness. It was not updating my screen properly (I tried a few methods) and instead of looking into it more I decided to just leave it as it works now.
What is this?
This is a quest/event I designed at like 4 am one night when I couldn't sleep after getting pissed off at all the BAD quests released (not pointing fingers... but you all gotta admit there have been some very pointless quests)
What does it do?
This event consists of treasure boxes (currently using Lotto boxes as I didn't feel like searching through all the possible npcs, you can change them to whatever you want though).
These treasure boxes spawn randomly around the game world producing a msg to all the server telling people what town it's near (Note: added a system to convert map ID to Name for use with this type of thing... if there is such functionality built into CoEmu I didn't see it.. again it was 4 am though). When used the box will despawn and award the user with a random prize and (assuming the event is still in progress), respawn somewhere else in the game world.
Locations are stored in a SQL database (refer to my random teleport release, it's the same system. This is the type of stuff I designed it for, I just didn't feel like coding anything past the actual db itself at that point)
Well that's cool, how do I customize it?
Simple enough, everything is somewhat labled and I've included some handy commands to start/stop the event (doing it via times of day or counting how many boxes are allowed to be spawned per event is up to you. It's simple enough to do but I'm done coding for a little while), commands to add new points easily to the random location database as well as being rather easy to customize in the first place.
The Release:
Note: CoEmu 5095, not releasing or converting it for lotf, that's up to you guys.
Part 1: Refer to my Random teleport release for further instructions on how to set this up but for extra help I'll release what I can remember of it here.
Database>Database.Cs
nano.cs
Code:
public static Dictionary<int, Struct.RandomPortal> RandomPortals = new Dictionary<int, Struct.RandomPortal>();
PHP Code:
public static bool HuntNpcUsed = false;
public static int HutnNpcToSpawn = 0;
public static bool NpcHuntOn = false;
public static bool NpcHuntSpawned = false;
Code:
Struct.LoadTNpcs();
Code:
Database.Database.GetRandomPortal();
Handlers>NpcTalk.cs
Note: You may need to modify your add item void. This source has no real modifications to it so has no progress/free item/lock/etc
under Handlers>Chat.cs
Command to start the event
Code:
case "huntnpc":
{
Handler.Functions.SpawnHuntNpc(Convert.ToInt32(Command[1]));
break;
}
Ooh and just so you have it, here's a command to teleport to one of the locations in the database (remove if you don't want people being able to use it to get to the npcs super fast)
Code:
case "rantele":
{
int RandToUse = Nano.Rand.Next(0, (Nano.RandomPortals.Count));
Struct.RandomPortal RandPortData = Nano.RandomPortals[RandToUse];
Handler.Teleport(RandPortData.PortalMap, RandPortData.PortalX, RandPortData.PortalY, 0, CSocket);
Console.WriteLine("Map: " + RandPortData.PortalMap + " X: " + RandPortData.PortalX + " Y: " + RandPortData.PortalY);
break;
}
Mine is Calculations>MapToName.cs but you can rename it, easiest if you just go with that though.
Also for convenience, here is the backup of my rand tele database file
note: it's nearly empty. I just added a few points for testing. Give it a try though, everything should work just great.
For the record, to start it (unless you code it to auto start which is easy enough to do)
/huntnpc (amount for quest)
To add new locations to the database
Current character location
/newrandme
or
/newrand map x y
<edit>
Update: tested with the new upgrade. Everything works fine now
Update: removed box when event ended (it was not a problem as it only gives prize once regardless of if it moves but still, it's better that way)
Note: The whole teleporting the clear the screen thing was again my own lazyness. It was not updating my screen properly (I tried a few methods) and instead of looking into it more I decided to just leave it as it works now.