Problem With A Code

12/09/2009 03:36 Hitsugaya Toshiro#1
Hey guys i been trying to figure out the Weekly Pk Event for all the classes

But im not sure if i quite got it ._. heres what i got so far

Code:
#region Pk Event
                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                                    {

                                        GC.MyChar.OpenWindow("Class pk war is about to begin! Will you join it?");
                                        GC.AddSend(Packets.NPCLink("Yes", 2));
                                        GC.AddSend(Packets.NPCLink("No", 255));

                                    }
                                    if (Control == 2)

                                        GC.MyChar.(Class == 55);
                                        GC.MyChar.Teleport(MAP ID, CORDS, CORDS);

                                    {
                                 }
                                 break;
                             }
                                    #endregion
If anyone can help pleas do it would be nice ._.
12/09/2009 04:51 hunterman01#2
Here you go fixed it up a little bit

Code:
#region Pk Event
                            case 77777:
                                {
                                    if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
                                    {
                                        if (Control == 0)
                                        {

                                        GC.AddSend(Packets.NPCSay("Class pk war is about to begin! Will you join it?"));
                                        GC.AddSend(Packets.NPCLink("Yes", 1));
                                        GC.AddSend(Packets.NPCLink("No", 255));
                                        }

                                    }
                                    if (Control == 1)
                                    {

                                        GC.MyChar.Job = 55;
                                        GC.MyChar.Teleport(MAP ID, CORDS, CORDS);
                                    }
                                    break;
                                }
                                    #endregion
12/09/2009 06:34 Hitsugaya Toshiro#3
@Hunterman01 thanks man
12/09/2009 10:56 pro4never#4
That should work for the npc. To control scores and who is taking part in the actual event you can use a hashtable to link character UID with their score (if you are doing a kill/hit based event) or simply have a binary 1/0 score system to see if they are still qualified to be in the event (aka if they die they are out of the event and when only 1 player exists with a specified value in the hash table, they are the winner)

Then just use a for each loop based on all connected clients to control adding/reading who is taking part in the actual event.


Good luck. The basic system for it shouldn't be super complicated. Only part that bugged me when I was doing it was controlling all the timers/conditions... then again I think I was writing it at 4 am as a break from midterm studying... so that prob explains most of my problems :P
12/09/2009 17:17 Hitsugaya Toshiro#5
Quote:
Originally Posted by pro4never View Post
That should work for the npc. To control scores and who is taking part in the actual event you can use a hashtable to link character UID with their score (if you are doing a kill/hit based event) or simply have a binary 1/0 score system to see if they are still qualified to be in the event (aka if they die they are out of the event and when only 1 player exists with a specified value in the hash table, they are the winner)

Then just use a for each loop based on all connected clients to control adding/reading who is taking part in the actual event.


Good luck. The basic system for it shouldn't be super complicated. Only part that bugged me when I was doing it was controlling all the timers/conditions... then again I think I was writing it at 4 am as a break from midterm studying... so that prob explains most of my problems :P
Well i know im trying to make it work tight but as you can see im not so good ._.