Register for your free account! | Forgot your password?

Go Back   elitepvpers › MMORPGs › Conquer Online 2 › CO2 Private Server › CO2 PServer Guides & Releases
You last visited: Today at 09:14

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Random treasure event

Discussion on [Release] Random treasure event within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,385
[Release] Random treasure event

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

Code:
public static Dictionary<int, Struct.RandomPortal> RandomPortals = new Dictionary<int, Struct.RandomPortal>();
and

PHP Code:
public static bool HuntNpcUsed = false;
        public static 
int HutnNpcToSpawn = 0;
        public static 
bool NpcHuntOn = false;
        public static 
bool NpcHuntSpawned = false; 
and down @
Code:
Struct.LoadTNpcs();
put
Code:
Database.Database.GetRandomPortal();
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

Code:
case "huntnpc":
                            {
                                Handler.Functions.SpawnHuntNpc(Convert.ToInt32(Command[1]));
                                break;
                            }
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)

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;
                            }
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.
Attached Files
File Type: rar randomportal.rar (692 Bytes, 27 views)
pro4never is offline  
Thanks
6 Users
Old   #2
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Haven't tried it out yet, but looks nice. Keep up the good work :P
walmartboi is offline  
Old   #3
 
sawickas's Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 617
Received Thanks: 38
*** job! I am not wery well in converting so if any can convert i to 1565 it will by nice xD
sawickas is offline  
Old   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,385
Honestly to convert it to new lotf would be alot of work. You'd be best off re-writing the entire thing for it. The systems themselves would be good reference to code these features in lotf though.

Note: I just realized... this basically combines everything I've released in the past few weeks into one actually useful feature instead of a vague concept when I first released them.
pro4never is offline  
Old   #5
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 459
this new system sounds very good.... i'll test it : P

good job bro : D

@offtopic
hey... i've maked a new system for lottery... that is mostly the same as binaryes.....

the chances to take something VERY HARD....

i've tryied 60 times....

i've got 20 garments, 10 expballs, 5 healthwines, 7 bombs, 3 meteortearpack, 10 mets, 1 elite 2 socks longhammer and some ***** more.... haha
12tails is offline  
Old   #6
 
renetjuuh's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 97
Received Thanks: 9
im got 1565 loft , im still happy about this very usefull guild with that i cant find oud how to do it for loft realy like it thanks bro
renetjuuh is offline  
Old   #7
 
elite*gold: 0
Join Date: Jan 2010
Posts: 116
Received Thanks: 33
good release pro
Jedex is offline  
Reply


Similar Threads Similar Threads
[Release]Random S4 Hacks
05/20/2013 - S4 League Hacks, Bots, Cheats & Exploits - 53 Replies
smth
Daily Quests & Divac`s Treasure Map Event
06/15/2010 - Battle of the Immortals - 2 Replies
There are 4 Daily Quests in Battle of Immortals You can get them with Level 65 in Hall of Illusions. Just go to the Hall of Illusions Teleporter in Atlantic Square. For one of this Daily Quest you obtain 90000 Exp and 10000 Coins. So 40000 Coins for this Quests are not bad. You can find the Teleporter in Atlantic Square "Expedition Union"
[RELEASE] SEA 0.1.17 Random TP
07/17/2009 - Dragonica Hacks, Bots, Cheats & Exploits - 4 Replies
Just because I can :P This serves no purpose whatsoever but to randomly teleport you around the map once per second for lulz.



All times are GMT +2. The time now is 09:15.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.