Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 06:00

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

Advertisement



[Question]2vs2 PK match

Discussion on [Question]2vs2 PK match within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old 08/08/2010, 02:09   #31
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
nope, the timer still works.
only changes whats in it
as i said in the comment thing //what ever starts it
thats what to happen when is time for it
Fish* is offline  
Thanks
1 User
Old 08/08/2010, 02:14   #32
 
ftp4life's Avatar
 
elite*gold: 0
Join Date: Mar 2007
Posts: 130
Received Thanks: 9
ohhh lol aite i get it sumwhat now lol this is the first time i used a timer thanx to u i understand alot more
ftp4life is offline  
Thanks
1 User
Old 08/08/2010, 02:26   #33
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by ftp4life View Post
ohhh lol aite i get it sumwhat now lol this is the first time i used a timer thanx to u i understand alot more
Keep going.
And goodluck
Thanks for pressing thanks
Fish* is offline  
Old 08/08/2010, 02:39   #34
 
ftp4life's Avatar
 
elite*gold: 0
Join Date: Mar 2007
Posts: 130
Received Thanks: 9
np lol uhmmm btw you think if i used the exact same team death match from .Summer and recoded it with TeamPk would that work for it


okay grill mad time for you to fix meh errors this is what i got in a New Class called TeamPK.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;
using NewestCOServer.Game;

namespace NewestCOServer.Features
{
    public enum TeamPkStage
    {
        None,
        Inviting,
        Countdown,
        Fighting,
        Over
    }
    public enum BroadCast
    {
        World,
        Map
    }
    public static class TeamPk
    {
        public static ushort Map;
        public static ushort X, Y;
        public static TeamPkStage Stage2 = TeamPkStage.None;
        public static Dictionary<uint, Main.GameClient> TeamPkHash;
        public static int CountDown;
        private static Thread TeamPkThread;

        public static void StartTeamPk(Character Started)
        {
            if (Started.MyClient.GM)
            {
                TeamPkHash = new Dictionary<uint, Main.GameClient>();
                CountDown = 20;
                Stage2 = TeamPkStage.Inviting;
                Map = 1005;
                X = 51;
                Y = 71;

                TeamPkThread = new Thread(new ThreadStart(BeginElimination));
                TeamPkThread.IsBackground = true;
                TeamPkThread.Start();
            }
        }
        public static void StartTeamPk()
        {
            TeamPkHash = new Dictionary<uint, Main.GameClient>();
            CountDown = 20;
            Stage2 = TeamPkStage.Inviting;
            Map = 1005;
            X = 51;
            Y = 71;

            TeamPkThread = new Thread(new ThreadStart(BeginElimination));
            TeamPkThread.IsBackground = true;
            TeamPkThread.Start();
        }
        private static void Broadcast1(string msg, BroadCastLoc1 loc)
        {
            Console.WriteLine(msg);
            if (loc == BroadCastLoc1.World)
            {
                foreach (Character Char in World.H_Chars.Values)
                {
                    Char.MyClient.AddSend(Packets.ChatMessage(0, "[GM]", "All", msg, 2011, 0));
                    Char.MyClient.EndSend();
                }
            }
            else if (loc == BroadCastLoc1.Map)
            {
                foreach (Main.GameClient Char in TeamPkHash.Values)
                {
                    Char.AddSend(Packets.ChatMessage(0, "[GM]", "All", msg, 2011, 0));
                    Char.EndSend();
                }
            }
        }
        private static void TeamPkWinner(Character Winner1)
        {
            Broadcast1(Winner1.Name + " has won Elimination!", BroadCastLoc1.World);

            Winner1.StatEff.Add(StatusEffectEn.WeeklyPKChampion);
            Winner1.HonorPoints += 500;

            TeamPk.Stage2 = TeamPkStage.None;
            TeamPkThread.Abort();
            return;
        }
        public static void WaitForWinner2()
        {
            TeamPk.Stage2 = TeamPkStage.Fighting;
            uint Tick = (uint)Environment.TickCount;
            int InMapAlive = TeamPkHash.Count;
            while (true)
            {
                foreach (Main.GameClient _GC in TeamPkHash.Values)
                {
                    if (_GC.MyChar.InElimination)
                        if (!_GC.MyChar.Alive)
                        {
                            InMapAlive--;
                            _GC.MyChar.InElimination = false;
                        }
                        else if (!World.H_Chars.ContainsKey(_GC.MyChar.EntityID))
                        {
                            InMapAlive--;
                            _GC.MyChar.InElimination = false;
                        }
                }

                foreach (Main.GameClient _GC in TeamPkHash.Values)
                {
                    if (_GC.MyChar.InElimination)
                        if (_GC.MyChar.Alive && InMapAlive == 2)
                        {
                            _GC.MyChar.Teleport(1505, 154, 218);
                            TeamPkWinner(_GC.MyChar);
                            Stage2 = TeamPkStage.Over;
                            return;
                        }
                }

                if (InMapAlive != 2)
                {
                    Broadcast1("There are" + InMapAlive + "people left, kill them before they kill you!", BroadCastLoc1.Map);

                }
                Thread.Sleep(1000);
            }
        }


        public static void BeginElimination()
        {
            foreach (Character Char in World.H_Chars.Values)
            {
                Char.MyClient.DialogNPC = 665611;
                PacketHandling.NPCDialog.Handle(Char.MyClient, null, 665611, 0);
                Char.MyClient.EndSend();
            }
            Stage2 = TeamPkStage.Inviting;
            while (CountDown > 0)
            {
                if (CountDown == 20)
                    Broadcast1("20 seconds until Elimination starts!", BroadCastLoc1.World);
                else if (CountDown == 10)
                {
                    Stage2 = TeamPkStage.Countdown;
                    if (TeamPkHash.Count < 2)
                    {
                        Broadcast1("Elimination requires atleast 2 people to start, Elimination Cancelled.", BroadCastLoc1.World);
                        Stage2 = TeamPkStage.None;
                        TeamPkHash = null;
                        return;
                    }
                    Broadcast1("10 seconds until Elimination starts!", BroadCastLoc1.World);
                }
                else if (CountDown < 10)
                    Broadcast1(CountDown + " seconds until Elimination starts, hurry your ass up!", BroadCastLoc1.World);

                CountDown--;
                Thread.Sleep(1000);
            }
            Stage2 = TeamPkStage.Fighting;
            Broadcast1("Fight!", BroadCastLoc1.World);
            WaitForWinner2();
        }
    }
}
ftp4life is offline  
Old 08/08/2010, 03:20   #35
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
The errors are?
test it please
Fish* is offline  
Old 08/08/2010, 03:23   #36
 
ftp4life's Avatar
 
elite*gold: 0
Join Date: Mar 2007
Posts: 130
Received Thanks: 9
was askin u if i needed to take something out cuz by a pro like u lookin at it before i make my self look stupid and takin the time to debug it when its not finished lol
ftp4life is offline  
Old 08/08/2010, 03:49   #37
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Well.
I dont know whats wrong with it, if i dont know what issues ur facing
And im diffently not a pro.
Im still learning =]
Fish* is offline  
Old 08/08/2010, 08:54   #38
 
ftp4life's Avatar
 
elite*gold: 0
Join Date: Mar 2007
Posts: 130
Received Thanks: 9
ahahah in my eyes ur pro and naw there isnt any errors i was just asking u if that is how it wuld be done

okay so i made the NPC and it went something like this
Code:
                           #region JoinTPKDialog
                            case 10021:
                                {
                                    if (Control == 0)
                                    {
                                        if (Features.TeamPk.Stage2 == Features.TeamPkStage.Inviting)
                                        {
                                            GC.AddSend(Packets.NPCSay("Would you like to join the TeamPk tournament in the PKArena? You have " + (Features.TeamPk.CountDown - 10) + " seconds to join."));
                                            GC.AddSend(Packets.NPCLink("Sure, I'll join!", 1));
                                            GC.AddSend(Packets.NPCLink("What're the rules?", 2));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                            return;
                                        }
                                        else if (Features.TeamPk.Stage2 != Features.TeamPkStage.None)
                                        {
                                            GC.AddSend(Packets.NPCSay("You're too late, " + GC.MyChar.Name + ", the tournament has already started!"));
                                            GC.AddSend(Packets.NPCLink("Darn", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("No TeamPK tournament is going on at this time."));
                                            GC.AddSend(Packets.NPCLink("Darn", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 1)
                                    {
                                        if (GC.MyChar.MyTeam.Members.Count >= 2)
                                        {
                                            GC.MyChar.Team2Joined += 1;
                                            GC.MyChar.Team1Joined += 1;
                                            GC.MyChar.Teleport(1005, 51, 71);
                                            GC.AddSend(Packets.NPCSay("Goodluck, " + GC.MyChar.Name + "."));
                                            GC.AddSend(Packets.NPCLink("Thanks", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                            GC.MyChar.InTPK = true;
                                            GC.MyChar.CurHP = 50000;
                                            Features.TeamPk.TeamPkHash.Add(GC.MyChar.EntityID, GC);
                                        }
                                        else if (GC.MyChar.Team1Joined <= 2)
                                        {
                                            GC.AddSend(Packets.NPCSay("Sorry There is a Match Already?"));
                                            GC.AddSend(Packets.NPCLink("Okay.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    return;
                                }
                            #endregion
ftp4life is offline  
Old 08/08/2010, 20:21   #39
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
u should make a check for wich team the person is on.
because else there can only be one on each team.
as it goes +1 in both teams everytime 1 palyer join

Goodluck
Fish* is offline  
Old 08/08/2010, 20:37   #40
 
ftp4life's Avatar
 
elite*gold: 0
Join Date: Mar 2007
Posts: 130
Received Thanks: 9
would this work
Code:
                                        #region JoinTPKDialog
                            case 10021:
                                {
                                    if (Control == 0)
                                    {
                                        if (Features.TeamPk.Stage2 == Features.TeamPkStage.Inviting)
                                        {
                                            GC.AddSend(Packets.NPCSay("Would you like to join the TeamPk tournament in the PKArena? You have " + (Features.TeamPk.CountDown - 10) + " seconds to join."));
                                            GC.AddSend(Packets.NPCLink("Sure, I'll join!", 1));
                                            GC.AddSend(Packets.NPCLink("What're the rules?", 2));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                            return;
                                        }
                                        else if (Features.TeamPk.Stage2 != Features.TeamPkStage.None)
                                        {
                                            GC.AddSend(Packets.NPCSay("You're too late, " + GC.MyChar.Name + ", the tournament has already started!"));
                                            GC.AddSend(Packets.NPCLink("Darn", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("No TeamPK tournament is going on at this time."));
                                            GC.AddSend(Packets.NPCLink("Darn", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    else if (Control == 1)
                                    {
                                    if (GC.MyChar.MyTeam.Members.Count >= 2)
                                        {
                                            GC.MyChar.Team1Joined += 1;
                                            GC.MyChar.Team2Joined += 1;
                                            GC.MyChar.Teleport(1005, 51, 71);
                                            GC.AddSend(Packets.NPCSay("Goodluck, " + GC.MyChar.Name + "."));
                                            GC.AddSend(Packets.NPCLink("Thanks", 255));
                                            GC.AddSend(Packets.NPCSetFace(30));
                                            GC.AddSend(Packets.NPCFinish());
                                            GC.MyChar.InTPK = true;
                                            GC.MyChar.CurHP = 50000;
                                            Features.TeamPk.TeamPkHash.Add(GC.MyChar.EntityID, GC);
                                        }
                                        [COLOR="Red"]else if (GC.MyChar.Team1Joined <= 2 || GC.MyChar.Team2Joined <= 2)[/COLOR]
                                        {
                                            GC.AddSend(Packets.NPCSay("Sorry There is a Match Already?"));
                                            GC.AddSend(Packets.NPCLink("Okay.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                    return;
                                }
                            #endregion
ftp4life is offline  
Old 08/09/2010, 09:13   #41
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
why do you put a return;
and this:
else if (GC.MyChar.Team1Joined <= 2 || GC.MyChar.Team2Joined <= 2)
should be
else if (GC.MyChar.Team1Joined <= 2 && GC.MyChar.Team2Joined <= 2)
i think
Fish* is offline  
Old 08/09/2010, 22:04   #42
 
ftp4life's Avatar
 
elite*gold: 0
Join Date: Mar 2007
Posts: 130
Received Thanks: 9
true true lol... well imma go test this out and if it works ill release it and have credits wit ur name
ftp4life is offline  
Thanks
1 User
Old 08/09/2010, 22:22   #43
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by ftp4life View Post
true true lol... well imma go test this out and if it works ill release it and have credits wit ur name
Goodluck on it. Im always interested in help
Fish* is offline  
Old 08/13/2010, 03:49   #44
 
ftp4life's Avatar
 
elite*gold: 0
Join Date: Mar 2007
Posts: 130
Received Thanks: 9
lol well for some reason when i wuld kill everyone it wuld keep spamming 4 people left.. in the team pk turny and it wont go away till i restart the server
ftp4life is offline  
Reply


Similar Threads Similar Threads
2vs2 Partner gesucht...
08/04/2010 - Starcraft 2 - 3 Replies
Hey mir gehen diese Randoms total auf die Nüsse. Entweder immer dc oder leaven oder oder oder -.- (3vs3 - 16Games - 1win...) Gibt es hier jemand der 2vs2 noch kein Partner hat und in noch keiner Liga ist? Weil ich hab 2vs2 noch frei und will mir das net versauen :/
1vs1 o 2vs2
05/29/2010 - WarRock - 8 Replies
na hat jemand hier lust zu zocken?? 1gg1 oder 2gg2 meldet euch einfach mal^^
Arena 2vs2 Guide!
12/27/2006 - WoW Guides & Templates - 6 Replies
Hi there, found this: 2v2 ~Druid & Rogue~ Probably the best duo for arena's. Since they both can stealth, you can take a limited amount of time walking around and waiting for the perfect chance to jump the two. If there is a healer on the team, target them first. Same with any type of casters, because they get in the way. Once they are down, close in on the other. If the rogue is starting to become low on health, the druid should go out of cat/bear form and start healing. Thats the main...



All times are GMT +1. The time now is 06:00.


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.