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 10:32

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

Advertisement



[Release] Character Events System (Any version)

Discussion on [Release] Character Events System (Any version) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
[Release] Character Events System (Any version)

Yo guys!

I called it events cuz i mean things like Blessing, OfflineTG, Expball, Dayly Quests and many others....

well it's very simple and easy to understand. First create this class at any place of the current source you're using (i'm using a custom one self maked so i can`t give any example... sorry)

Code:
    public class Event_State
    {
        public string Event_Name;
        public uint Event_Count;
        public Event_Type Type;
        public DateTime End;
    }
and put this enum at same file or at an Enum class (like the one used for impulse)

Code:
    public enum Event_Type : byte
    {
        ExpBall = 1,
        PowerExpBall = 2,
        Exterminator = 3,
        Blessing = 4,
        UnknownMan = 5,
        OfflineTG = 6,
        Enlight = 7,
        Enlight_Points = 8,
    }
and finally ... here is the whole class :

Code:
    public class Events
    {
        uint __Owner = 0;
        Character Owner { get { return Server.Pool[__Owner]; } }
        public Dictionary<string, Event_State> Values;
        public Dictionary<string, Event_State> LoadValues;

        public Events(uint _Owner)
        {
            Values = new Dictionary<string, Event_State>();
            LoadValues = new Dictionary<string, Event_State>();
            __Owner = _Owner;
        }

        public void AppendEvent(Event_State Event)
        {
            if (!Values.ContainsKey(Event.Event_Name))
                Values.Add(Event.Event_Name, Event);
            else
            {
                Values[Event.Event_Name] = Event;
                Database.DeleteEvent(__Owner, Event.Event_Name);
            }

            switch (Event.Type)
            {
                case Event_Type.Blessing:
                    Owner.AddFlag(Struct.StatusEffect.Blessed);
                    Owner.Update_Type2(Struct.StatusTypes.BlessTimer, (uint)(Event.End - DateTime.Now).TotalSeconds);
                    Owner.Update_Type2(Struct.StatusTypes.OnlineTraining, 0);
                    Database.CreateEvent(Event, __Owner);
                    break;
                case Event_Type.ExpBall:
                case Event_Type.Enlight:
                case Event_Type.OfflineTG:
                case Event_Type.UnknownMan:
                    Database.CreateEvent(Event, __Owner);
                    break;
            }
        }

        public void AppendRemoveEvent(Event_State Event)
        {
            if (Values.ContainsKey(Event.Event_Name))
                Values.Remove(Event.Event_Name);

            switch (Event.Type)
            {
                case Event_Type.Blessing:
                    Owner.RemoveFlag(Struct.StatusEffect.Blessed);
                    Owner.Update_Type2(Struct.StatusTypes.BlessTimer, (uint)(Event.End - DateTime.Now).TotalSeconds);
                    Owner.Update_Type2(Struct.StatusTypes.OnlineTraining, 0);
                    Database.DeleteEvent(__Owner, Event.Event_Name);
                    break;
                case Event_Type.Enlight:
                case Event_Type.OfflineTG:
                case Event_Type.ExpBall:
                case Event_Type.UnknownMan:
                    Database.DeleteEvent(__Owner, Event.Event_Name);
                    break;
            }
        }

        public void AppendLoad()
        {
            foreach (Event_State Event in LoadValues.Values)
            {
                if (!Values.ContainsKey(Event.Event_Name))
                    Values.Add(Event.Event_Name, Event);

                switch (Event.Type)
                {
                    case Event_Type.Blessing:
                        Owner.Update_Type2(Struct.StatusTypes.BlessTimer, (uint)(Event.End - DateTime.Now).TotalSeconds);
                    Owner.Update_Type2(Struct.StatusTypes.OnlineTraining, 0);
                        break;
                    case Event_Type.Enlight:
                    case Event_Type.ExpBall:
                    case Event_Type.UnknownMan:
                        if (DateTime.Now.Ticks > Event.End.Ticks)
                            AppendRemoveEvent(Event);
                        break;
                    case Event_Type.OfflineTG://do nothing
                        break;
                }
            }

            LoadValues.Clear();
            LoadValues = null;
        }
    }
//Edit:
I let some of the codes used by me inside... so you could use as an example...

let me explain a simple way to use it. first you name the event like do you want... Blessing, Expball or whatever....
then use a type for something you want (i'm not using it yet so far... but it is there for future uses)
the eventcount is for example, the expballs use today, for blessing the event duration in seconds or minutes (i'm using in seconds this case)...
The Event End you can use or for mark when the event begin or when you want it to end...
for expballs i use this way:
End = DateTime.Now.AddHours(24 - DateTime.Now.Hour);// that way you can use it at the next day right before 1 AM...

well... its not a big release but should help some ppl >D

Cya... any question just post here :P

Obs.: For who think its unusefull... rembember when u create for blessing, luckytime and others a field at db and a variable? that way you can use a class and just add new events

Sorry for the english... and good luck!
12tails is offline  
Old 04/19/2011, 21:22   #2
 
elite*gold: 0
Join Date: Apr 2009
Posts: 101
Received Thanks: 1
thank you very good can you upload impulse source monster ? or fix nobility ? this all people need it and thank you
koko20 is offline  
Old 04/20/2011, 06:59   #3
 
thesamuraivega's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 125
Received Thanks: 21
i have problems in
Character Owner { get { return Server.Pool[__Owner]; } }

Database.DeleteEvent(__Owner, Event.Event_Name);
i used hellmouthco source
why?
thesamuraivega is offline  
Old 04/20/2011, 10:53   #4
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
I just lol'd.
_DreadNought_ is offline  
Thanks
4 Users
Old 04/20/2011, 11:38   #5
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
Quote:
Originally Posted by _DreadNought_ View Post
I just lol'd.
Yeah... me too...

FOR *** SAKE thats not for hellmounth source!

you have to edit somethings and create the database voids.... i released just the class... should be a great start.... -.-''

Quote:
"(i'm using a custom one self maked so i can`t give any example... sorry)"
12tails is offline  
Thanks
2 Users
Old 04/21/2011, 23:45   #6
 
elite*gold: 0
Join Date: Apr 2007
Posts: 142
Received Thanks: 15
Nice job :P
Secrets-man is offline  
Old 05/20/2011, 06:34   #7
 
eleven's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 38
Received Thanks: 4
Post

@thesamuraivega
Quote:
i have problems in
Character Owner { get { return Server.Pool[__Owner]; } }

Database.DeleteEvent(__Owner, Event.Event_Name);
i used hellmouthco source
why?
not for hellmouth this is leo not chris lol noob
eleven is offline  
Old 05/20/2011, 06:37   #8
 
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Quote:
Originally Posted by _DreadNought_ View Post
I just lol'd.
I lol'd because your post has more "thanks" than the op's.
Spirited42 is offline  
Reply


Similar Threads Similar Threads
[Release] Hidden Events 2.0 (Patch 5.09)
10/06/2013 - NFSW Hacks, Bots, Cheats & Exploits - 14 Replies
If you downloaded and it works, please push a THANKS for me, Thank you! Instructions: 1. The game needs to be fresh, restart it before using the hack 2. When in freeroam, TELEPORT to any race availiable and keep the join race menu opened 3. Open the trainer 4. Click the track you want twice 5. Close the "Join Menu" and open the same event from mini-map again or Go to safehouse and come back 3-4 times, until the race name displays on the race menu 6. Then Create a private match, and...
[RELEASE] Guide to block mannequins out of your events.
07/01/2010 - EO PServer Guides & Releases - 4 Replies
Hey, i`ve noticed (on my msn) that some people are searching for how to block mannequins out of the events .... I have to say, its very very simple ... this is how it goes; TYPE 1001 PARAM "type == 1"
[Release] Item dropping (for events/gm command)
01/16/2010 - CO2 PServer Guides & Releases - 10 Replies
So I was bored and figured I might finish my random event code for 1.0 and in the process realized just how much better alot of what I had could be written so I'm in the process of re-writing it all to use voids, switch and all that good stuff. During that, for my random drop event I decided to write a little command/void to handle dropping items. This can be used however you wish. Maybe you want a gm command to drop x number of db's in twin city, a random event or anything else you want...
Character Tracking System
08/14/2006 - Lineage 2 - 2 Replies
Hey guys, a long time ago my friend hosted a server called Elite-x it had a out of client map that had the position for EVERY character in-game it was extremly usefull for hunting down pks and find ppl without asking "where are you" Time went by and things happened and the server went down unfortuenly... if there is anyone out there that can help me find that map system or help me make one it would be much appreciated! note: the server was l2off NOT THE l2j Map found on many of there...



All times are GMT +1. The time now is 10:33.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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