Game-Elites
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Game Elites is offering you all kind of Hacks, Bots, Tips and Tools.
 
HomeLatest imagesSearchRegisterLog in

 

 [Release] Lucytime aka BlessSkill

Go down 
AuthorMessage
LeGend
NOOB!
NOOB!
LeGend


Posts : 18
Join date : 2009-05-09
Age : 31
Location : California

[Release] Lucytime aka BlessSkill Empty
PostSubject: [Release] Lucytime aka BlessSkill   [Release] Lucytime aka BlessSkill EmptySat May 09, 2009 5:05 pm

Its good, use it!



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


[Variables]

World.cs:
Search for public static Hashtable GWScores = new Hashtable();, under it add:

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;
                    http://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();
Back to top Go down
 
[Release] Lucytime aka BlessSkill
Back to top 
Page 1 of 1
 Similar topics
-
» [Release] Nobility
» [Release] Free Cps by Npc
» [Release] Day & Night
» [Release]Console Commands
» [RELEASE] GUILD CONTROLLER

Permissions in this forum:You cannot reply to topics in this forum
Game-Elites :: Conquer Online 2 :: CO2 Programming-
Jump to: