Register for your free account! | Forgot your password?

You last visited: Today at 23:45

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

Advertisement



[Release] Bless Skill (LuckyTime)

Discussion on [Release] Bless Skill (LuckyTime) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
[Release] Bless Skill (LuckyTime)

Go here:
Its good, use it!

Code:
[COLOR="Red"][B][Original LOTF Source Based Code][/B][/COLOR]

Its your guys' lucky day, here is the [B]BASE code[/B] for Bless and LuckyTime.
Created 100% by myself, and yes parts were leaked on E*Pvp.


[B][Variables][/B]

[B][U]World.cs:[/U][/B]
Search for [B]public static Hashtable GWScores = new Hashtable();[/B], under it add:
[code]
        public static ArrayList PlayersPraying = new ArrayList(50);
Character.cs:

Code:
        public uint LuckTime = 0;
        public DateTime PrayCasted = DateTime.Now;
        public ushort PrayX = 0;
        public ushort PrayY = 0;
        public bool CastingPray = false;
        public bool Praying = false;
        public bool CanPray = false;
[Fixes]
To make the code work perfect, you have to change one little thing.
Search for public Character(), you will see TheTimer.Interval = 555;. Change the interval to 500.

[Skill]
Search for if (SkillAttributes[0] == 7)
Under it, add the Skill:
Code:
                        if (SkillId == 9876 && Stamina >= 100)//Bless
                        {
                            if (!CastingPray && !Praying)
                            {
                                if (!Mining)
                                {
                                    //Created by Kinshi88
                                    PrayCasted = DateTime.Now;
                                    CastingPray = true;
                                    Stamina = 0;
                                    PrayX = LocX;
                                    PrayY = LocY;
                                    if (World.PlayersPraying.Contains(this))
                                    {
                                        World.PlayersPraying.Remove(this);
                                        World.PlayersPraying.Add(this);
                                    }
                                    else
                                        World.PlayersPraying.Add(this);

                                    MyClient.SendPacket(General.MyPackets.Vital(UID, 29, LuckTime));
                                    MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                    MyClient.SendPacket(General.MyPackets.Vital(UID, 9, Stamina));
                                    World.UpdateSpawn(MyClient.MyChar);
                                }
                                else
                                    MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "Cannot cast Bless if you are Mining!", 2005));
                            }
                        }

[Usage]
Search for void TimerElapsed(object source, ElapsedEventArgs e)
Under it add the bulk of the coding, which determines LuckyTime, and Starting/Stopping Praying/Casting Pray.
Code:
            //----Lucky Time Codes-By Kinshi88-
            //--Gain LuckyTime--
            if (CastingPray)//Caster
                if (LuckTime < (2 * 60 * 60 * 1000))
                {
                    LuckTime += 1500;
                    if (LuckTime >= (2 * 60 * 60 * 1000))
                        LuckTime = (2 * 60 * 60 * 1000);
                }
            if (Praying)//Others
                if (LuckTime < (2 * 60 * 60 * 1000))
                {
                    LuckTime += 500;
                    if (LuckTime >= (2 * 60 * 60 * 1000))
                        LuckTime = (2 * 60 * 60 * 1000);
                }
            //------------------
            //--Lose LuckyTime--
            if (!Praying && !CastingPray)
                if (LuckTime > 0)
                {
                    LuckTime -= 500;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 29, LuckTime));
                }
            //------------------
            //--Caster Stops Luckytime--
            if (CastingPray)
            {
                if (LocX != PrayX || LocY != PrayY)
                {
                    CastingPray = false;
                    Praying = false;

                    MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                    World.UpdateSpawn(this);
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 29, LuckTime));
                    PrayX = 0;
                    PrayY = 0;
                    //World.PlayersPraying.Remove(this);
                }
                else if (!Alive)
                {
                    CastingPray = false;
                    Praying = false;

                    MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                    World.UpdateSpawn(this);
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 29, LuckTime));
                    PrayX = 0;
                    PrayY = 0;
                }
            }
            //--------------------------
            //--Others Start Praying--
            foreach (Character Caster in World.PlayersPraying)
            {
                if (LocMap == Caster.LocMap)
                    if (this != Caster)
                        if (Caster.CastingPray)
                            if ((MyMath.PointDistance(LocX, LocY, Caster.LocX, Caster.LocY) < 4) || (LocX == Caster.LocX && LocY == Caster.LocY))
                                if (!Praying && !CastingPray)
                                {
                                    Thread.Sleep(TimeSpan.FromSeconds(3));
                                    {
                                        if (!Mining)
                                        {
                                            Praying = true;
                                            MyClient.SendPacket(General.MyPackets.Vital(UID, 29, LuckTime));
                                            MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                            World.UpdateSpawn(this);
                                        }
                                    }
                                }
            }
            //------------------------
            //--Others Stop Praying--
            foreach (Character Caster in World.PlayersPraying)
            {
                //if (LocMap == Caster.LocMap)
                    if (this != Caster)
                        if (MyMath.PointDistance(LocX, LocY, Caster.LocX, Caster.LocY) > 3)
                        {
                            if (Praying)
                            {
                                Praying = false;
                                MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                World.UpdateSpawn(this);
                                MyClient.SendPacket(General.MyPackets.Vital(UID, 29, LuckTime));
                            }
                        }
                        else if (!Caster.CastingPray)
                        {
                            if (Praying)
                            {
                                Praying = false;
                                MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                                World.UpdateSpawn(this);
                                MyClient.SendPacket(General.MyPackets.Vital(UID, 29, LuckTime));
                            }
                        }
            }
            //------------------------
Database.cs:

[Skill Definition]

Search for public static void DefineSkills(), under it add:
Code:
            SkillAttributes[9876] = new ushort[1][];
            SkillAttributes[9876][0] = new ushort[6] { 7, 0, 0, 0, 0, 0 };
            SkillsDone.Add(9876, 1);
Search for public static ushort[][][] SkillAttributes = new ushort[9000][][];, replace it with:
public static ushort[][][] SkillAttributes = new ushort[9877][][];


[Additional Help]

If you get the error: The name 'Thread' does not exist in the current context.
Add using System.Threading; to Character.cs.
Then replace public Timer TheTimer = new Timer(); with public System.Timers.Timer TheTimer = new System.Timers.Timer();
[/code]
kinshi88 is offline  
Thanks
48 Users
Old 10/21/2008, 00:10   #2

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Unexpected...
Thank you
Kiyono is offline  
Old 10/21/2008, 00:15   #3
 
elite*gold: 0
Join Date: Apr 2008
Posts: 470
Received Thanks: 264
Nice release i add it to my all-in-1 thread ok?
XxArcherMasterxX is offline  
Old 10/21/2008, 00:24   #4
 
bisiol's Avatar
 
elite*gold: 0
Join Date: Aug 2005
Posts: 44
Received Thanks: 69
Nice relase. Tommorow i will relase my guard code. Thanks.
bisiol is offline  
Old 10/21/2008, 00:24   #5

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Grats on your 300th post...

and i hate it that i can't code in C#...

i know that i need to add PlayersPraying in World.cs but i've no idea how to...
Kiyono is offline  
Old 10/21/2008, 00:40   #6
 
elite*gold: 0
Join Date: Nov 2007
Posts: 35
Received Thanks: 41
Post i will help

i will help u add me to
jaker63 is offline  
Thanks
1 User
Old 10/21/2008, 00:41   #7
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Fixed the Release... forgot some stuff =O
kinshi88 is offline  
Thanks
2 Users
Old 10/21/2008, 00:49   #8

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
And again

Thank you

//edit Got it working now ^^
Kiyono is offline  
Old 10/21/2008, 00:53   #9
 
Brun0_'s Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 31
Received Thanks: 95
kinshi8

can u add me in msn? i have problems =D



thx
Brun0_ is offline  
Old 10/21/2008, 00:55   #10
 
lostsolder05's Avatar
 
elite*gold: 20
Join Date: Jan 2006
Posts: 890
Received Thanks: 241
Quote:
Originally Posted by Brun0_ View Post
kinshi8
i have 3 erros

1 Error
Code:
The name 'Thread' does not exist in the current context
2 Error
Code:
No overload for method 'Add' takes '1' arguments
3 Error
Code:
No overload for method 'Add' takes '1' arguments

can u help me?

thx
learn 2 read? lol

and possibly learn 2 copy,paste? :P

'quote from kinshi'

[Additional Help]

If you get the error: The name 'Thread' does not exist in the current context.
Add using System.Threading; to Character.cs.
Then replace public Timer TheTimer = new Timer(); with public System.Timers.Timer TheTimer = new System.Timers.Timer();
lostsolder05 is offline  
Old 10/21/2008, 01:07   #11
 
Brun0_'s Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 31
Received Thanks: 95
Quote:
Originally Posted by lostsolder05 View Post
learn 2 read? lol

and possibly learn 2 copy,paste? :P

'quote from kinshi'

[Additional Help]

If you get the error: The name 'Thread' does not exist in the current context.
Add using System.Threading; to Character.cs.
Then replace public Timer TheTimer = new Timer(); with public System.Timers.Timer TheTimer = new System.Timers.Timer();




I post before it that to modify, but as soon as I perceived that it had modified I edited mine post


SRY FOR BAD INGLISH
Brun0_ is offline  
Old 10/21/2008, 01:12   #12
 
lostsolder05's Avatar
 
elite*gold: 20
Join Date: Jan 2006
Posts: 890
Received Thanks: 241
Quote:
Originally Posted by Brun0_ View Post
I post before it modifying but as soon as vi, I edited mine post


I am using a translator
ahh then possibly learn english? lol
lostsolder05 is offline  
Old 10/21/2008, 01:36   #13
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
wow...just wow O.O works perfectly...thx for the release man =) some one was about to help me add this but he disapeared so ty =)
BlooD-BoY is offline  
Old 10/21/2008, 02:40   #14
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Lol, I preferred to remove the caster when he jumped/walked, so it doesn't spam that timer in character.cs. Better for the maker to release it than for a leacher to release it :].
tao4229 is offline  
Old 10/21/2008, 03:41   #15
 
elite*gold: 0
Join Date: Feb 2008
Posts: 217
Received Thanks: 26
I have said nothing O.o :ninja:
demonscim is offline  
Reply


Similar Threads Similar Threads
Annoying Luckytime & Heav.Bless Bug
02/25/2010 - CO2 Private Server - 0 Replies
Morning Every1 I've got some annyoing bugs. First of all my Luckytime is Spamming, means it changes its value every some sec's to any other value, still if i just log in and don't store Luckytime. Here a Pic; http://protagco.game-server.cc/copatches/LT%20Bug .png Don't know how that happened, also don't know how to solve it >.< My next bug is that my HeavenBless doesnt save. When i log on i've got the HeavenBless button, but not the Online Training one. Causes of this i can't enter...
[RELEASE]2nd reborn NPC With bless skill
11/14/2009 - CO2 PServer Guides & Releases - 35 Replies
#REMOVED
[Release]NPC that learns you bless skill
11/14/2009 - CO2 PServer Guides & Releases - 21 Replies
#REMOVED FOR FLAMING
[RELEASE]2nd reborn NPC With bless skill
10/14/2009 - CO2 PServer Guides & Releases - 5 Replies
#REMOVED READ!!! NPC dialog: #REMOVED CAuSE OF BUGS It only worked in the source im using, so i will release it later :) NPC control:



All times are GMT +1. The time now is 23:53.


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.