|
You last visited: Today at 09:27
Advertisement
Elite Pk Tournament
Discussion on Elite Pk Tournament within the CO2 Private Server forum part of the Conquer Online 2 category.
10/23/2011, 04:13
|
#1
|
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 Winner, Loser; public Client.GameState pOne, pTwo; public bool Done; public bool CanEnd; public Time32 DoneStamp; public uint pOneDamage, pTwoDamage; public static SafeDictionary<uint, GameState> PlayerList = new SafeDictionary<uint, GameState>(10000); public void RandomSelect() {
List<Client.GameState> players = new List<Client.GameState>(); foreach (Client.GameState p in ServerBase.Kernel.GamePool.Values) players.Add(p); Random rand = new Random(); Client.GameState pOne, pTwo; 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(700, Database.DMaps.MapPaths[700]); Map origMap = ServerBase.Kernel.Maps[700]; dynamicMap = origMap.MakeDynamicMap(); pOne.Entity.Teleport(origMap.ID, dynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(35, 70), (ushort)ServerBase.Kernel.Random.Next(35, 70)); pTwo.Entity.Teleport(origMap.ID, dynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(35, 70), (ushort)ServerBase.Kernel.Random.Next(35, 70)); 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.UID, ID = Data.ChangePKMode, dwParam = (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.UID, ID = Data.ChangePKMode, dwParam = (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.PreviousMapID, pOne.Entity.PrevX, pOne.Entity.PrevY); Loser.Entity.Teleport(1002, 444, 444); pTwo.Entity.PKMode = pOne.Entity.PKMode; pOne.Entity.PKMode = Conquer_Online_Server.Game.Enums.PKMode.Capture; pOne.Send(new Data(true) { UID = pOne.Entity.UID, ID = Data.ChangePKMode, dwParam = (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.UID, ID = Data.ChangePKMode, dwParam = (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
|
|
|
10/23/2011, 10:43
|
#2
|
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.
|
|
|
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.
|
|
|
10/23/2011, 11:19
|
#4
|
elite*gold: 0
Join Date: Mar 2009
Posts: 228
Received Thanks: 47
|
this is map id "2068"
|
|
|
10/23/2011, 18:50
|
#5
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
Quote:
Originally Posted by dego4ever
this is map id "2068"
|
Thanks Dego4Ever i`ll try it , thanks for help !
Quote:
Originally Posted by Fаng
so... many... threads... and .... questions....
|
So what ?
Quote:
Originally Posted by -Sensei-
Why dont you ask TQ for there cq_map. That should fixed your problem.
|
Sure, i will
Quote:
Originally Posted by BaussHacker
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 .
|
|
|
10/25/2011, 00:43
|
#6
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
Quote:
Originally Posted by Deсker
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 ?
|
|
|
10/25/2011, 01:22
|
#7
|
elite*gold: 0
Join Date: Oct 2011
Posts: 267
Received Thanks: 59
|
Quote:
Originally Posted by abdeen
Each thread with a different problem , so could you help me with it ?
|
Hey what source are you using?
|
|
|
10/25/2011, 01:26
|
#8
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
Quote:
Originally Posted by -Sensei-
Hey what source are you using?
|
5518+
|
|
|
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.
|
|
|
10/26/2011, 17:37
|
#10
|
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 14
|
Quote:
Originally Posted by pro4never
#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
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 Winner, Loser; public Client.GameState pOne, pTwo; public bool Done; public bool CanEnd; public Time32 DoneStamp; public uint pOneDamage, pTwoDamage; public static SafeDictionary<uint, GameState> PlayerList = new SafeDictionary<uint, GameState>(10000); public void RandomSelect() {
List<Client.GameState> players = new List<Client.GameState>(); foreach (Client.GameState p in ServerBase.Kernel.GamePool.Values) players.Add(p); Random rand = new Random(); Client.GameState pOne, pTwo; 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(700, Database.DMaps.MapPaths[700]); Map origMap = ServerBase.Kernel.Maps[700]; dynamicMap = origMap.MakeDynamicMap(); pOne.Entity.Teleport(origMap.ID, dynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(35, 70), (ushort)ServerBase.Kernel.Random.Next(35, 70)); pTwo.Entity.Teleport(origMap.ID, dynamicMap.ID, (ushort)ServerBase.Kernel.Random.Next(35, 70), (ushort)ServerBase.Kernel.Random.Next(35, 70)); 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.UID, ID = Data.ChangePKMode, dwParam = (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.UID, ID = Data.ChangePKMode, dwParam = (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.PreviousMapID, pOne.Entity.PrevX, pOne.Entity.PrevY); Loser.Entity.Teleport(1002, 444, 444); pTwo.Entity.PKMode = pOne.Entity.PKMode; pOne.Entity.PKMode = Conquer_Online_Server.Game.Enums.PKMode.Capture; pOne.Send(new Data(true) { UID = pOne.Entity.UID, ID = Data.ChangePKMode, dwParam = (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.UID, ID = Data.ChangePKMode, dwParam = (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 ??
|
|
|
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
5518+
|
hey bro i want to help you coding it
please add my msn and we can start any time
|
|
|
11/25/2011, 19:34
|
#12
|
elite*gold: 0
Join Date: Feb 2007
Posts: 240
Received Thanks: 22
|
Quote:
Originally Posted by nikito157
hey bro i want to help you coding it
please add my msn and we can start any time
|
|
|
|
11/26/2011, 03:36
|
#13
|
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
|
|
|
|
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.
|
|