Register for your free account! | Forgot your password?

You last visited: Today at 07:09

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


[Release] Heaven Blessing

Closed Thread
 
Old   #1
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
[Release] Heaven Blessing

Time to release heavingblessing, so my HB benefits actually works,ha-ha

Okay,before we start,I have to give Kinshi credits :
Kinshi - Got the effectname from him.


Okay,lets go folks!

First,we define,thats a smart option,huh?
In Character.cs, search for
public bool Alive = false;

Above it, add:
Code:
public byte WhichBless = 0;
public bool Blessed = false;
public DateTime HBEnd;
public DateTime HBStart;
public string HBEnd2 = "";
Done!
Now,search for :
else if (ItemParts[0] == "723017")

Above it , add :

Code:
else if (ItemParts[0] == "1200000")//PrayingStone(S)
            {
                if (!Blessed)
                {
                    HBStart = DateTime.Now;
                    HBEnd = DateTime.Now.AddDays(3);
                    WhichBless = 1;
                    Blessed = true;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 18, (3 * 24 * 60 * 60)));
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                    World.UpdateSpawn(this);
                    RemoveItem(ItemUID);
                    SaveHB();
                    MyClient.SendPacket(General.MyPackets.String(UID, 10, "zf2-e128"));
                }
                else
                {
                    MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You are already blessed by Heaven Blessing!", 2005));
                }
            }
            else if (ItemParts[0] == "1200001")//PrayingStone(M)
            {
                if (!Blessed)
                {
                    HBStart = DateTime.Now;
                    HBEnd = DateTime.Now.AddDays(7);
                    WhichBless = 2;
                    Blessed = true;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 18, (3 * 24 * 60 * 60)));
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                    World.UpdateSpawn(this);
                    RemoveItem(ItemUID);
                    SaveHB();
                    MyClient.SendPacket(General.MyPackets.String(UID, 10, "zf2-e128"));
                }
                else
                {
                    MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You are already blessed by Heaven Blessing!", 2005));
                }
            }
            else if (ItemParts[0] == "1200002")//PrayingStone(L)
            {
                if (!Blessed)
                {
                    HBStart = DateTime.Now;
                    HBEnd = DateTime.Now.AddDays(30);
                    WhichBless = 3;
                    Blessed = true;
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 18, (3 * 24 * 60 * 60)));
                    MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                    World.UpdateSpawn(this);
                    RemoveItem(ItemUID);
                    SaveHB();
                    MyClient.SendPacket(General.MyPackets.String(UID, 10, "zf2-e128"));
                }
                else
                {
                    MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You are already blessed by Heaven Blessing!", 2005));
                }
            }

Done!
Now,search for :
if (DateTime.Now > GotBlueName.AddMilliseconds(35000))

Above it , add:


Code:
if (DateTime.Now >= HBEnd)
            {
                Blessed = false;
                HBEnd2 = "";
                WhichBless = 0;
                SaveHB();
                MyClient.SendPacket(General.MyPackets.Vital(UID, 18, 0));
                MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
                World.UpdateSpawn(this);
            }

Now, search for:
public static void SaveChar(Character Charr)
Above it ,add:


Code:
public static void SaveHB(Character Charr)
        {
            try
            {
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `HeavenBless` = '" + Charr.HBEnd.ToString() + "',`WhichBless` = '" + Charr.WhichBless + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
Search for:
public void Save()

Above it , add:

Code:
public void SaveHB()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveHB(this);
        }


Now,go to your welcome message,and above it,add:


Code:
if (MyChar.WhichBless > 0)
                                    {
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Heaven's Blessing will end on: " + MyChar.HBEnd2.ToString(), 2011));
                                        MyChar.Blessed = true;
                                        MyChar.HBEnd = DateTime.Parse(MyChar.HBEnd2);
                                        SendPacket(General.MyPackets.String(MyChar.UID, 10, "zf2-e128"));
                                        if (MyChar.WhichBless == 1)
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (3 * 24 * 60 * 60)));
                                        if (MyChar.WhichBless == 2)
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (7 * 24 * 60 * 60)));
                                        if (MyChar.WhichBless == 3)
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (30 * 24 * 60 * 60)));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                        World.UpdateSpawn(MyChar);
                                    }

Now,search for:
Charr.RealModel = Charr.Model;

Above it ,add:
Code:
Charr.HBEnd2 = (string)DR["HeavenBless"];
                    Charr.WhichBless = (byte)DR["WhichBless"];

Last part,add this into your Character table in database :

Field: HeavenBless
Type : VARCHAR
Lenght : 32
null : not null

Forgot one thing!

Add another shit in Character in database table, this:


Field: WhichBless
Type : TINYINT
Lenght : 10
Attribute : UNSIGNED
null : not null
Default : 0





And you're done! Enjoy and please press thanks,seems like all things I release I only get like 10 thank's for,and tons use it anyways=[

Emme, the one and only!



UPDATED:
Blessed1 should be just Blessed. Please change your row:
public bool Blessed1 = false;

TO

public bool Blessed = false;

Thanks



_Emme_ is offline  
Thanks
50 Users
Old 10/30/2008, 18:13   #2
 
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
i love u emme!


reborn666 is offline  
Old 10/30/2008, 18:15   #3
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
are u sure the "OfflineTG Button" works with this code?
alexbigfoot is offline  
Old 10/30/2008, 18:42   #4
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
No , it wont ( I think ). I explained in OfflineTG thread how to make that work.


_Emme_ is offline  
Thanks
1 User
Old 10/30/2008, 19:06   #5
 
elite*gold: 0
Join Date: May 2007
Posts: 46
Received Thanks: 0
OK dude, Thansk ur u (M)*
lolex is offline  
Old 10/30/2008, 19:15   #6
 
elite*gold: 0
Join Date: Apr 2008
Posts: 470
Received Thanks: 264
again a nice release emme
+thanks for your work

(added to my all-in-1 thread)
XxArcherMasterxX is offline  
Old 10/30/2008, 19:33   #7
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,293
Received Thanks: 919
I kinda miss the definitions from:

BlessEnd2 and PrayStone
Kiyono is offline  
Old 10/30/2008, 19:38   #8
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
Really sorry,my bad! Updated now,it should be:

Code:
Charr.HBEnd2 = (string)DR["HeavenBless"];
                    Charr.WhichBless = (byte)DR["WhichBless"];
EDIT 2!!
Forgot to add another thing in Character table in database: This:


Quote:
Field: WhichBless
Type : TINYINT
Lenght : 10
Attribute : UNSIGNED
null : not null
Default : 0
_Emme_ is offline  
Thanks
3 Users
Old 10/30/2008, 19:56   #9
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,293
Received Thanks: 919
ok that fixed 2 errors but i still miss the definition of PrayStone in this block

Code:
                                    if (MyChar.PrayStone > 0)
                                    {
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Heaven's Blessing will end on: " + MyChar.HBEnd2.ToString(), 2011));
                                        MyChar.Blessed = true;
                                        MyChar.HBEnd = DateTime.Parse(MyChar.HBEnd2);
                                        SendPacket(General.MyPackets.String(MyChar.UID, 10, "zf2-e128"));
                                        if (MyChar.WhichBless == 1)
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (3 * 24 * 60 * 60)));
                                        if (MyChar.WhichBless == 2)
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (7 * 24 * 60 * 60)));
                                        if (MyChar.WhichBless == 3)
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (30 * 24 * 60 * 60)));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                        World.UpdateSpawn(MyChar);
                                    }
nvm after looking at your edit it seems that "PrayStone" got changed into "WhichBless" so i just edited and it works.
Kiyono is offline  
Old 10/30/2008, 20:13   #10
 
elite*gold: 0
Join Date: Jun 2005
Posts: 686
Received Thanks: 338
Quote:
Originally Posted by EmmeTheCoder View Post
Really sorry,my bad! Updated now,it should be:

Code:
Charr.HBEnd2 = (string)DR["HeavenBless"];
                    Charr.WhichBless = (byte)DR["WhichBless"];
EDIT 2!!
Forgot to add another thing in Character table in database: This:
Once again, a TINYINT cannot ever be 10 digits long. A TINYINT is the equivalent of sbyte/byte in C#.

Code:
TINYINT[(M)] [UNSIGNED] [ZEROFILL]

A very small integer. The signed range is -128 to 127. The unsigned
range is 0 to 255.
nTL3fTy is offline  
Old 10/30/2008, 21:11   #11
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
Quote:
Originally Posted by nTL3fTy View Post
Once again, a TINYINT cannot ever be 10 digits long. A TINYINT is the equivalent of sbyte/byte in C#.

Code:
TINYINT[(M)] [UNSIGNED] [ZEROFILL]

A very small integer. The signed range is -128 to 127. The unsigned
range is 0 to 255.
This code works,even tho you dont want it like that =]
_Emme_ is offline  
Old 10/30/2008, 21:40   #12
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
u got a thanks from me as usual cause this release really works (ofcourse it does XD its one of emme's releases)

i had 10 errors easy to fix just had to add internaldatabase or external
~jochemke~ is offline  
Old 10/30/2008, 22:04   #13
 
elite*gold: 0
Join Date: Feb 2008
Posts: 240
Received Thanks: 10
Yo thanks once again i added my thanks man!

DIDN'T MEAN FOR THIS ONE PUTER WENT PHYCO AND STUF LOL
Bottingpunk is offline  
Old 10/31/2008, 01:37   #14
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,159
UPDATED:
Blessed1 should be just Blessed. Please change your row:
public bool Blessed1 = false;

TO

public bool Blessed = false;

Thanks




Btw,glad you liked it,if anyone use this ,atleast press thanks?<.<
_Emme_ is offline  
Thanks
4 Users
Old 10/31/2008, 08:35   #15
 
elite*gold: 0
Join Date: Sep 2008
Posts: 259
Received Thanks: 64
i used it before u told it but i'll give ya a thanks cause u just deserve it


~jochemke~ is offline  
Closed Thread



« Editable web release | [Release] Mr.Free for 5017 Pvp »

Similar Threads
How to get Heaven Blessing without spending money at all!!
of course, many of u wishes to get heaven blessing but they don't have the money to buy it. well, i figured a way for u to get free heaven blessing...
19 Replies - CO2 Guides & Templates
Exp Pot and Heaven Blessing
I followed the guides, both were by Emme, and everything seems to work fine. However, when a character logs in I get an error message in LOTF saying...
5 Replies - CO2 PServer - Discussions / Questions
Heaven Blessing
I recently tried a heaven blessing, and I found that the rez where you are button doesn&#39;t work for me. It tells me I don&#39;t have heaven blessing. ...
2 Replies - CO2 Main - Discussions / Questions
Question about Heaven Blessing
Does anyone know how to take the curse effect out so it does not lag no more?
4 Replies - CO2 Main - Discussions / Questions



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


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

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.