Coding Help

10/08/2008 04:20 kinshi88#1
If you are currently working on a script for your server, and need help with it, feel free to ask for some help.

Be advised, I won't code the whole thing for you, but I will help you along the way.
10/08/2008 08:38 YukiXian#2
Quote:
Originally Posted by kinshi88 View Post
If you are currently working on a script for your server, and need help with it, feel free to ask for some help.

Be advised, I won't code the whole thing for you, but I will help you along the way.
When you are 2nd reborn, you got the effect, When you use Tornado or something like that, It will spawn the Effect again, So ya got 10 2nd reborn effects or more, You know how to fix this?
10/08/2008 10:18 © Haydz#3
Quote:
Originally Posted by YukiXian View Post
When you are 2nd reborn, you got the effect, When you use Tornado or something like that, It will spawn the Effect again, So ya got 10 2nd reborn effects or more, You know how to fix this?
its not an effect its a flag in the spawnpacket
10/08/2008 16:16 YukiXian#4
Quote:
Originally Posted by © Haydz View Post
its not an effect its a flag in the spawnpacket

Well, How to fix it?
10/08/2008 17:44 _Emme_#5
Rewrite effect packet
10/08/2008 22:36 tao4229#6
Quote:
Originally Posted by emildayan1 View Post
Rewrite effect packet
No, the flag for reborn is in the spawn/characterinfo packets. If you include it in there, the clients will do the effect for you.

Off the top of my head, in spawn entity, i THINK reborn goes in the next byte after direction.
10/09/2008 15:59 _Emme_#7
But,look into the effect packet,dont you think its badly written?
10/09/2008 18:03 adz06676#8
Quote:
Originally Posted by emildayan1 View Post
But,look into the effect packet,dont you think its badly written?
this problem has completely nothing to do with the effect packet.
10/11/2008 06:58 kinshi88#9
Quote:
Originally Posted by YukiXian View Post
When you are 2nd reborn, you got the effect, When you use Tornado or something like that, It will spawn the Effect again, So ya got 10 2nd reborn effects or more, You know how to fix this?
I guess one way to fix this, and this is just off the top of my head.

But in Character.cs, in void TimerElapsed(object source, ElapsedEventArgs e), you can make a if statement;
Code:
if (!SecRBEff)
{
      SecRBEff = true;
      (send effect)
}
Hmm.. donno if that would fix it =P, never actually seen this "bug".
Lol, now that I think about it, it probobly won't.

Maybe I'll look into it more.
But I'm not too keen on "looks", more fundamental "workingness" =P
10/11/2008 18:35 © Haydz#10
Quote:
Originally Posted by kinshi88 View Post
I guess one way to fix this, and this is just off the top of my head.

But in Character.cs, in void TimerElapsed(object source, ElapsedEventArgs e), you can make a if statement;
Code:
if (!SecRBEff)
{
      SecRBEff = true;
      (send effect)
}
Hmm.. donno if that would fix it =P, never actually seen this "bug".
Lol, now that I think about it, it probobly won't.

Maybe I'll look into it more.
But I'm not too keen on "looks", more fundamental "workingness" =P
its not an effect.. don't ever send the 2nd rb effect
10/11/2008 19:13 BoboDundo#11
What's a good source code base to start with for your own Pserver? Preferrably one that works with the latest CO client.

Quote:
Originally Posted by kinshi88 View Post
If you are currently working on a script for your server, and need help with it, feel free to ask for some help.

Be advised, I won't code the whole thing for you, but I will help you along the way.
10/11/2008 20:45 InfamousNoone#12
Quote:
Originally Posted by BoboDundo View Post
What's a good source code base to start with for your own Pserver? Preferrably one that works with the latest CO client.
You won't find one with that works with the latest client, because to obtain one of those, well; You just won't.
10/11/2008 21:17 kinshi88#13
Quote:
Originally Posted by BoboDundo View Post
What's a good source code base to start with for your own Pserver? Preferrably one that works with the latest CO client.
Gotta code that urself, which you won't.
So, you won't get one.
10/12/2008 13:13 emogoth213#14
sorry for double post

remove
10/12/2008 13:21 emogoth213#15
How do i fixed this codes problem,to avoid bringing the pharmacist anywhere...
sorry for bad english... thanks in advance ...:D:handsdown:

here is the codes below... :bandit:



Code:
MyChar.Ready = false;
                                    uint ItemID = (uint)((Data[0x0b] << 24) + (Data[0x0a] << 16) + (Data[0x09] << 8) + Data[0x08]);
                                    uint CPsVal = Data[18];
                                    uint Value = (uint)((Data[0x07] << 24) + (Data[0x06] << 16) + (Data[0x05] << 8) + Data[0x04]);
                                    byte Amount = Data[20];
                                    int Money = Data[5];
                                    if (Amount == 0)
                                        Amount = 1;

                                    string TehShop = System.IO.File.ReadAllText(System.Windows.Forms.Application.StartupPath + @"\Shop.dat");

                                    try
                                    {
                                        if (Other.CharExist(Convert.ToString(ItemID), TehShop))
                                        {
                                            foreach (uint[] item in DataBase.Items)
                                            {
                                                if (ItemID == item[0])
                                                {
                                                    Value = item[7];
                                                    CPsVal = item[15];
                                                }
                                            }
                                            for (int i = 0; i < Amount; i++)
                                            {
                                                if (MyChar.ItemsInInventory > 39)
                                                    return;
                                                if (MyChar.Silvers >= Value && CPsVal == 0 || MyChar.CPs > CPsVal && CPsVal != 0)
                                                {
                                                    if (CPsVal == 0)
                                                        MyChar.Silvers -= Value;
                                                    if (CPsVal > 0)
                                                        MyChar.CPs -= CPsVal;

                                                    if (MyChar.Silvers < 0)
                                                        MyChar.Silvers = 0;
                                                    if (MyChar.CPs < 0)
                                                        MyChar.CPs = 0;

                                                    byte WithPlus = 0;
                                                    if (ItemID == 730003)
                                                        WithPlus = 3;
                                                    if (ItemID == 730004)
                                                        WithPlus = 4;
                                                    if (ItemID == 730005)
                                                        WithPlus = 5;
                                                    if (ItemID == 730006)
                                                        WithPlus = 6;
                                                    if (ItemID == 730007)
                                                        WithPlus = 7;

                                                    MyChar.AddItem(Convert.ToString(ItemID) + "-" + WithPlus + "-0-0-0-0", 0, (uint)General.Rand.Next(10000000));
                                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                                }
                                                else
                                                {
                                                    SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You don't have " + Value + " silvers or " + CPsVal + " CPs.", 2005));
                                                    break;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            General.WriteLine("There is no such item in Shop.dat.(" + ItemID + ")");
                                        }
                                    }
                                    catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
                                    MyChar.Ready = true;
                                    break;
                                }