Register for your free account! | Forgot your password?

You last visited: Today at 09:27

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

Advertisement



Elite Pk Tournament

Discussion on Elite Pk Tournament within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Elite Pk Tournament

Okay i am working on Elite PK Tournament , and i am trying to make it like real co.

its select two players from each map group to fight , the winner will be sent to Waiting map , and the loser will be sent to Twin City .

so i created it like that .

but till now i have 2 problems .

first one is its selecting 2 players from all game maps not only which i added it in the code ..

second one when player 1 kill player 2 , or The contrary .

the killer dose not sent to waiting map , and who was killed is stay in the map till revive it.


here is my code of it:


PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conquer_Online_Server.Database;
using Conquer_Online_Server.Client;
using Conquer_Online_Server.Network;
using System.IO;
using Conquer_Online_Server.Network.GamePackets;
using System.Threading;

namespace 
Conquer_Online_Server.Game.Tournaments
{
    public class 
EliteTournament
    
{
        public 
void Start()
        {
            foreach (
Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                if (
players.Entity.MapID == 1631)
                    
this.RandomSelect();
        }

        public static 
Map dynamicMap;
        public 
Client.GameState WinnerLoser;
        public 
Client.GameState pOnepTwo;
        public 
bool Done;
        public 
bool CanEnd;
        public 
Time32 DoneStamp;
        public 
uint pOneDamagepTwoDamage;
        public static 
SafeDictionary<uintGameStatePlayerList = new SafeDictionary<uintGameState>(10000);
        public 
void RandomSelect()
        {

            List<
Client.GameStateplayers = new List<Client.GameState>();
            foreach (
Client.GameState p in ServerBase.Kernel.GamePool.Values)
                
players.Add(p);
            
Random rand = new Random();
            
Client.GameState pOnepTwo;
            
int selectedIndex rand.Next(players.Count);
            
pOne players[selectedIndex];
            
players.RemoveAt(selectedIndex);
            
selectedIndex rand.Next(players.Count);
            
pTwo players[selectedIndex];
            
players.RemoveAt(selectedIndex);
            if (!
ServerBase.Kernel.Maps.ContainsKey(700))
                new 
Map(700Database.DMaps.MapPaths[700]);
            
Map origMap ServerBase.Kernel.Maps[700];
            
dynamicMap origMap.MakeDynamicMap();
            
pOne.Entity.Teleport(origMap.IDdynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(3570), (ushort)ServerBase.Kernel.Random.Next(3570));
            
pTwo.Entity.Teleport(origMap.IDdynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(3570), (ushort)ServerBase.Kernel.Random.Next(3570));
            if (
pOne.Map.ID == pTwo.Map.ID)
            {
                
pOne.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Ride);
                
pTwo.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Ride);
                
pTwo.Entity.PKMode pOne.Entity.PKMode;
                
pOne.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.PK;
                
pOne.Send(new Data(true) { UID pOne.Entity.UIDID Data.ChangePKModedwParam = (uint)pOne.Entity.PKMode });
                
pOne.Entity.PKMode pTwo.Entity.PKMode;
                
pTwo.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.PK;
                
pTwo.Send(new Data(true) { UID pTwo.Entity.UIDID Data.ChangePKModedwParam = (uint)pTwo.Entity.PKMode });
                
Conquer_Online_Server.Network.PacketHandler.WorldMessage("" pOne.Entity.Name " Is Meeting " pTwo.Entity.Name " in the Elite Pk Tournament");
                
Client.GameState[] Clients Conquer_Online_Server.ServerBase.Kernel.GamePool.Values.ToArray();
                foreach (
Client.GameState client in Clients)
                
this.End(client);
            }
        }

        public 
void End(Client.GameState client)
        {
            if (
pOneDamage pTwoDamage)
            {
                
Winner pOne;
                
Loser pTwo;
            }
            else
            {
                
Winner pTwo;
                
Loser pOne;
            }
            
Winner.Entity.Teleport(pOne.Entity.PreviousMapIDpOne.Entity.PrevXpOne.Entity.PrevY);
            
Loser.Entity.Teleport(1002444444);
            
pTwo.Entity.PKMode pOne.Entity.PKMode;
            
pOne.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.Capture;
            
pOne.Send(new Data(true) { UID pOne.Entity.UIDID Data.ChangePKModedwParam = (uint)pOne.Entity.PKMode });
            
pOne.Entity.PKMode pTwo.Entity.PKMode;
            
pTwo.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.Capture;
            
pTwo.Send(new Data(true) { UID pTwo.Entity.UIDID Data.ChangePKModedwParam = (uint)pTwo.Entity.PKMode });
            
Done true;
            
DoneStamp Time32.Now;
            
CanEnd true;
        }
    }

had i forgot something ? anything error ?

# edit :

please any moderator edit my thread to " I need Help With This "

because its " Hep " O.o
abdeen is offline  
Old 10/23/2011, 10:43   #2
 
-Sensei-'s Avatar
 
elite*gold: 0
Join Date: Oct 2011
Posts: 267
Received Thanks: 59
Why dont you ask TQ for there cq_map. That should fixed your problem.
-Sensei- is offline  
Old 10/23/2011, 10:50   #3
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
The map does not auto invite. You have to code it yourself, it's a npcdialog subtype or whatever the name is.
BaussHacker is offline  
Thanks
1 User
Old 10/23/2011, 11:19   #4
 
elite*gold: 0
Join Date: Mar 2009
Posts: 228
Received Thanks: 47
this is map id "2068"
dego4ever is offline  
Thanks
1 User
Old 10/23/2011, 18:50   #5
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Quote:
Originally Posted by dego4ever View Post
this is map id "2068"
Thanks Dego4Ever i`ll try it , thanks for help !

Quote:
Originally Posted by Fаng View Post
so... many... threads... and .... questions....
So what ?

Quote:
Originally Posted by -Sensei- View Post
Why dont you ask TQ for there cq_map. That should fixed your problem.
Sure, i will

Quote:
Originally Posted by BaussHacker View Post
The map does not auto invite. You have to code it yourself, it's a npcdialog subtype or whatever the name is.
i am just asking about map id and thanks i got it .
abdeen is offline  
Thanks
1 User
Old 10/25/2011, 00:43   #6
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Quote:
Originally Posted by Deсker View Post
This is like your 3rd or 4th thread about Elite PK Tournament. I'm not flaming, but I suggest you keep it all in the same thread.
Each thread with a different problem , so could you help me with it ?
abdeen is offline  
Old 10/25/2011, 01:22   #7
 
-Sensei-'s Avatar
 
elite*gold: 0
Join Date: Oct 2011
Posts: 267
Received Thanks: 59
Quote:
Originally Posted by abdeen View Post
Each thread with a different problem , so could you help me with it ?
Hey what source are you using?
-Sensei- is offline  
Old 10/25/2011, 01:26   #8
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Quote:
Originally Posted by -Sensei- View Post
Hey what source are you using?
5518+
abdeen is offline  
Old 10/25/2011, 02:47   #9
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
#Merging threads.

Please stop spamming the forum with incredibly similar threads or ones which ask single small questions. Use a single thread for all your questions as it avoids SO much hassle for everyone involved.


#Cleaned

Try to stay on topic guys.
pro4never is offline  
Old 10/26/2011, 17:37   #10
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
Quote:
Originally Posted by pro4never View Post
#Merging threads.

Please stop spamming the forum with incredibly similar threads or ones which ask single small questions. Use a single thread for all your questions as it avoids SO much hassle for everyone involved.


#Cleaned

Try to stay on topic guys.
Yes Sir.

Quote:
Originally Posted by abdeen View Post
Okay i am working on Elite PK Tournament , and i am trying to make it like real co.

its select two players from each map group to fight , the winner will be sent to Waiting map , and the loser will be sent to Twin City .

so i created it like that .

but till now i have 2 problems .

first one is its selecting 2 players from all game maps not only which i added it in the code ..

second one when player 1 kill player 2 , or The contrary .

the killer dose not sent to waiting map , and who was killed is stay in the map till revive it.


here is my code of it:


PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conquer_Online_Server.Database;
using Conquer_Online_Server.Client;
using Conquer_Online_Server.Network;
using System.IO;
using Conquer_Online_Server.Network.GamePackets;
using System.Threading;

namespace 
Conquer_Online_Server.Game.Tournaments
{
    public class 
EliteTournament
    
{
        public 
void Start()
        {
            foreach (
Conquer_Online_Server.Client.GameState players in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
                if (
players.Entity.MapID == 1631)
                    
this.RandomSelect();
        }

        public static 
Map dynamicMap;
        public 
Client.GameState WinnerLoser;
        public 
Client.GameState pOnepTwo;
        public 
bool Done;
        public 
bool CanEnd;
        public 
Time32 DoneStamp;
        public 
uint pOneDamagepTwoDamage;
        public static 
SafeDictionary<uintGameStatePlayerList = new SafeDictionary<uintGameState>(10000);
        public 
void RandomSelect()
        {

            List<
Client.GameStateplayers = new List<Client.GameState>();
            foreach (
Client.GameState p in ServerBase.Kernel.GamePool.Values)
                
players.Add(p);
            
Random rand = new Random();
            
Client.GameState pOnepTwo;
            
int selectedIndex rand.Next(players.Count);
            
pOne players[selectedIndex];
            
players.RemoveAt(selectedIndex);
            
selectedIndex rand.Next(players.Count);
            
pTwo players[selectedIndex];
            
players.RemoveAt(selectedIndex);
            if (!
ServerBase.Kernel.Maps.ContainsKey(700))
                new 
Map(700Database.DMaps.MapPaths[700]);
            
Map origMap ServerBase.Kernel.Maps[700];
            
dynamicMap origMap.MakeDynamicMap();
            
pOne.Entity.Teleport(origMap.IDdynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(3570), (ushort)ServerBase.Kernel.Random.Next(3570));
            
pTwo.Entity.Teleport(origMap.IDdynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(3570), (ushort)ServerBase.Kernel.Random.Next(3570));
            if (
pOne.Map.ID == pTwo.Map.ID)
            {
                
pOne.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Ride);
                
pTwo.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Ride);
                
pTwo.Entity.PKMode pOne.Entity.PKMode;
                
pOne.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.PK;
                
pOne.Send(new Data(true) { UID pOne.Entity.UIDID Data.ChangePKModedwParam = (uint)pOne.Entity.PKMode });
                
pOne.Entity.PKMode pTwo.Entity.PKMode;
                
pTwo.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.PK;
                
pTwo.Send(new Data(true) { UID pTwo.Entity.UIDID Data.ChangePKModedwParam = (uint)pTwo.Entity.PKMode });
                
Conquer_Online_Server.Network.PacketHandler.WorldMessage("" pOne.Entity.Name " Is Meeting " pTwo.Entity.Name " in the Elite Pk Tournament");
                
Client.GameState[] Clients Conquer_Online_Server.ServerBase.Kernel.GamePool.Values.ToArray();
                foreach (
Client.GameState client in Clients)
                
this.End(client);
            }
        }

        public 
void End(Client.GameState client)
        {
            if (
pOneDamage pTwoDamage)
            {
                
Winner pOne;
                
Loser pTwo;
            }
            else
            {
                
Winner pTwo;
                
Loser pOne;
            }
            
Winner.Entity.Teleport(pOne.Entity.PreviousMapIDpOne.Entity.PrevXpOne.Entity.PrevY);
            
Loser.Entity.Teleport(1002444444);
            
pTwo.Entity.PKMode pOne.Entity.PKMode;
            
pOne.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.Capture;
            
pOne.Send(new Data(true) { UID pOne.Entity.UIDID Data.ChangePKModedwParam = (uint)pOne.Entity.PKMode });
            
pOne.Entity.PKMode pTwo.Entity.PKMode;
            
pTwo.Entity.PKMode Conquer_Online_Server.Game.Enums.PKMode.Capture;
            
pTwo.Send(new Data(true) { UID pTwo.Entity.UIDID Data.ChangePKModedwParam = (uint)pTwo.Entity.PKMode });
            
Done true;
            
DoneStamp Time32.Now;
            
CanEnd true;
        }
    }

had i forgot something ? anything error ?

# edit :

please any moderator edit my thread to " I need Help With This "

because its " Hep " O.o


hey guys , so what ?

any help ?????


So what , no one will help me ??
abdeen is offline  
Old 11/25/2011, 04:16   #11
 
elite*gold: 0
Join Date: Aug 2010
Posts: 11
Received Thanks: 3
I want to help u to code Elite pk

Quote:
Originally Posted by abdeen View Post
5518+

hey bro i want to help you coding it
please add my msn and we can start any time

nikito157 is offline  
Old 11/25/2011, 19:34   #12
 
elite*gold: 0
Join Date: Feb 2007
Posts: 240
Received Thanks: 22
Quote:
Originally Posted by nikito157 View Post
hey bro i want to help you coding it
please add my msn and we can start any time

agathom is offline  
Old 11/26/2011, 03:36   #13
 
thesamuraivega's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 125
Received Thanks: 21
Maybe i can help you
i worck in same proyects
example: killtheterrorist fixed :P
add me
or facebook : @javier.vargasruiz
thesamuraivega is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Help]Fix PK tournament
07/16/2011 - EO PServer Hosting - 1 Replies
How to Fix PK tournament for db menequin :rtfm::rtfm: please!!
CO2 World Elite PK Tournament Voting Stage Begins!
10/21/2010 - User Submitted News - 3 Replies
Hello epvp co2 Voting Event will be running from Oct. 15th to Oct. 29th.! Apart from the winners of the WEPT, we will be giving prizes to the players who participate in this grand event by casting their votes to support their favorite contestants! The rewards are werry good they include Dragon Balls you can see them here! Also you can vote for the WEPT here! Don't wait! Show your support and take your votes now!
[HELP] PK Tournament
09/02/2010 - EO PServer Hosting - 4 Replies
I am using the revo-DB at the moment and have found that there is a bug with the weekly and monthly pk tournaments. There is never a winner because the final map transition never happens. The people who compete are simply stuck in pkt map. I'm not sure whether I did this by accident or whether its just another bug in the Revo-DB but does anyone know the problem? If not could you point in me in the right direction (cq_action wise) so that I can solve the problem myself.



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


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.