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); } }
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.
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); } }
[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.