Bora, Como Adicionar isso na sua Source 5530+
Game/Entity.cs Procure por : #region Variables ,
Adicione DEPOIS do #region Variables
public Time32 WaitingTimeFB;
public Time32 WinnerWaiting;
public bool aWinner = false;
ServerBase/Constants.cs Procure por : public static readonly System.Collections.Generic.List<ulong> PKForbiddenMaps
Adicione DEPOIS do Código Acima:
public static readonly System.Collections.Generic.List<ulong> FBandSSEvent = new System.Collections.Generic.List<ulong>()
{
1543,
1544,
1545,
1546,
1547,
1548
};
Game/Attacking/Calculate.cs Procure Por :
public static uint Melee(Entity attacker, Entity attacked, Database.SpellInformation spell, ref Attack Packet){
int Damage = 0;
Adicione os Códigos a Seguir DEPOIS de int Damage = 0;
if (ServerBase.Constants.FBandSSEvent.Contains(attacker.MapID)) //FB and SS only!
{
Damage = (int)attacked.Hitpoints + 1;
return (uint)Damage;
}
Game/Attacking/Handle.cs Procure Por :
public static bool CanUseSpell(Database.SpellInformation spell, Client.GameState client)
{
if (client.WatchingGroup != null)
return false;
Adicione o Código a Seguir DEPOIS de return false
if (ServerBase.Constants.FBandSSEvent.Contains(client.Entity.MapID))
{
if (spell.ID != 1045 && spell.ID != 1046)//SS and FB only to attack!
{
client.Send(new Message("You can't use any skills here Except FB And SS!", System.Drawing.Color.Red, 0x7dc));
return false;
}
}
Database/EntityTable.cs Procure Por :
if (client.Map.BaseID == 1844)
{
client.Entity.MapID = 1002;
client.Entity.X = 428;
client.Entity.Y = 378;
}
Adicione o Código a Seguir DEPOIS do Código Mostrado Acima:
if (ServerBase.Constants.FBandSSEvent.Contains(client.Entity.MapID)) //FB and SS only!
{
client.Entity.MapID = 1002;
client.Entity.X = 428;
client.Entity.Y = 378;
}
Program.cs Procure Por : ShekoProject é o nome de um projeto, antes de pesquisar sobre o código, mude para o nome do seu projeto (Ex: Conquer_Online_Server ... etc)
using ShekoProject.ServerBase;
Se você não encontrá-lo, em seguida, adicioná-lo. (Não se esqueça de alterar o nome do projeto)
No mesmo arquivo, procure por este código:
public static ServerBase.Threads SystemMessages = new ServerBase.Threads(1000);
Adicione este Código DEPOIS:
public static bool Room1 = false;
public static bool Room2 = false;
public static bool Room3 = false;
public static bool Room4 = false;
public static bool Room5 = false;
public static bool Room6 = false;
public static uint Room1Price = 0;
public static uint Room2Price = 0;
public static uint Room3Price = 0;
public static uint Room4Price = 0;
public static uint Room5Price = 0;
public static uint Room6Price = 0;
public static ServerBase.Threads GHRooms = new ServerBase.Threads(1000);
Em Seguida, no Mesmo Arquivo, Procure por :
ServerStuff.Execute += new Action(ServerStuff_Execute);
ServerStuff.Start();
Adicione Este Código DEPOIS do Código Mostrado Acima :
GHRooms.Execute += new Action(GHRooms_Execute);
GHRooms.Start();
Ele lhe dará um erro, não há problema, Continuar ...
No mesmo arquivo, Procure por:
static void ServerStuff_Execute() {A Seguir Adicione esse Código ANTES do código mostrado acima:
static void GHRooms_Execute()
{
#region Rooms FBandSS
#region Room1
if (Room1 == false)
{
int entered1 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1543 && (!Player.Entity.Dead))
{
entered1++;
}
}
if (entered1 > 1)
{
Room1 = true;
}
else if (entered1 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1543 && (!Player.Entity.Dead))
{
if (Time32.Now > Player.Entity.WaitingTimeFB.AddSeconds(20))
{
Player.Entity.ConquerPoints += Room1Price;
Room1Price = 0;
Player.Entity.Teleport(1002, 427, 378);
}
}
}
}
}
else
{
int alive1 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1543 && (!Player.Entity.Dead))
{
alive1++;
}
}
if (alive1 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1543)
{
if (!Player.Entity.Dead)//winner
{
Player.Entity.ConquerPoints += Room1Price * 2;
Player.Entity.WaitingTimeFB = Time32.Now;
Room1 = false;
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Congratulations! ", Player.Entity.Name, " has won ", Room1Price * 2, " CPs FB/SS in Room 1." }), System.Drawing.Color.Black, 0x7db), Kernel.GamePool.Values);
Room1Price = 0;
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_victory");
Player.SendScreen(str, true);
Player.Entity.WinnerWaiting = Time32.Now;
Player.Entity.aWinner = true;
}
else//loser
{
Player.Entity.Teleport(1002, 439, 392);
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_failure");
Player.SendScreen(str, true);
Player.Entity.Action = Game.Enums.ConquerAction.None;
Player.ReviveStamp = Time32.Now;
Player.Attackable = false;
Player.Entity.TransformationID = 0;
Player.Entity.RemoveFlag(Update.Flags.Dead);
Player.Entity.RemoveFlag(Update.Flags.Ghost);
Player.Entity.Hitpoints = Player.Entity.MaxHitpoints;
Player.Entity.Ressurect();
}
}
}
}
}
#endregion
#region Room2
if (Room2 == false)
{
int entered2 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1544 && (!Player.Entity.Dead))
{
entered2++;
}
}
if (entered2 > 1)
{
Room2 = true;
}
else if (entered2 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1544 && (!Player.Entity.Dead))
{
if (Time32.Now > Player.Entity.WaitingTimeFB.AddSeconds(20))
{
Player.Entity.ConquerPoints += Room2Price;
Room2Price = 0;
Player.Entity.Teleport(1002, 427, 378);
}
}
}
}
}
else
{
int alive2 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1544 && (!Player.Entity.Dead))
{
alive2++;
}
}
if (alive2 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1544)
{
if (!Player.Entity.Dead)//winner
{
Player.Entity.ConquerPoints += Room2Price * 2;
Player.Entity.WaitingTimeFB = Time32.Now;
Room2 = false;
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Congratulations! ", Player.Entity.Name, " has won ", Room2Price * 2, " CPs FB/SS in Room 2." }), System.Drawing.Color.Black, 0x7db), Kernel.GamePool.Values);
Room2Price = 0;
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_victory");
Player.SendScreen(str, true);
Player.Entity.WinnerWaiting = Time32.Now;
Player.Entity.aWinner = true;
}
else//loser
{
Player.Entity.Teleport(1002, 439, 392);
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_failure");
Player.SendScreen(str, true);
Player.Entity.Action = Game.Enums.ConquerAction.None;
Player.ReviveStamp = Time32.Now;
Player.Attackable = false;
Player.Entity.TransformationID = 0;
Player.Entity.RemoveFlag(Update.Flags.Dead);
Player.Entity.RemoveFlag(Update.Flags.Ghost);
Player.Entity.Hitpoints = Player.Entity.MaxHitpoints;
Player.Entity.Ressurect();
}
}
}
}
}
#endregion
#region Room3
if (Room3 == false)
{
int entered3 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1545 && (!Player.Entity.Dead))
{
entered3++;
}
}
if (entered3 > 1)
{
Room3 = true;
}
else if (entered3 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1545 && (!Player.Entity.Dead))
{
if (Time32.Now > Player.Entity.WaitingTimeFB.AddSeconds(20))
{
Player.Entity.ConquerPoints += Room3Price;
Room3Price = 0;
Player.Entity.Teleport(1002, 427, 378);
}
}
}
}
}
else
{
int alive3 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1545 && (!Player.Entity.Dead))
{
alive3++;
}
}
if (alive3 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1545)
{
if (!Player.Entity.Dead)//winner
{
Player.Entity.ConquerPoints += Room3Price * 2;
Player.Entity.WaitingTimeFB = Time32.Now;
Room3 = false;
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Congratulations! ", Player.Entity.Name, " has won ", Room3Price * 2, " CPs FB/SS in Room 3." }), System.Drawing.Color.Black, 0x7db), Kernel.GamePool.Values);
Room3Price = 0;
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_victory");
Player.SendScreen(str, true);
Player.Entity.WinnerWaiting = Time32.Now;
Player.Entity.aWinner = true;
}
else//loser
{
Player.Entity.Teleport(1002, 439, 392);
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_failure");
Player.SendScreen(str, true);
Player.Entity.Action = Game.Enums.ConquerAction.None;
Player.ReviveStamp = Time32.Now;
Player.Attackable = false;
Player.Entity.TransformationID = 0;
Player.Entity.RemoveFlag(Update.Flags.Dead);
Player.Entity.RemoveFlag(Update.Flags.Ghost);
Player.Entity.Hitpoints = Player.Entity.MaxHitpoints;
Player.Entity.Ressurect();
}
}
}
}
}
#endregion
#region Room4
if (Room4 == false)
{
int entered4 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1546 && (!Player.Entity.Dead))
{
entered4++;
}
}
if (entered4 > 1)
{
Room4 = true;
}
else if (entered4 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1546 && (!Player.Entity.Dead))
{
if (Time32.Now > Player.Entity.WaitingTimeFB.AddSeconds(20))
{
Player.Entity.ConquerPoints += Room4Price;
Room4Price = 0;
Player.Entity.Teleport(1002, 427, 378);
}
}
}
}
}
else
{
int alive4 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1546 && (!Player.Entity.Dead))
{
alive4++;
}
}
if (alive4 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1546)
{
if (!Player.Entity.Dead)//winner
{
Player.Entity.ConquerPoints += Room4Price * 2;
Player.Entity.WaitingTimeFB = Time32.Now;
Room4 = false;
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Congratulations! ", Player.Entity.Name, " has won ", Room4Price * 2, " CPs FB/SS in Room 4." }), System.Drawing.Color.Black, 0x7db), Kernel.GamePool.Values);
Room4Price = 0;
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_victory");
Player.SendScreen(str, true);
Player.Entity.WinnerWaiting = Time32.Now;
Player.Entity.aWinner = true;
}
else//loser
{
Player.Entity.Teleport(1002, 439, 392);
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_failure");
Player.SendScreen(str, true);
Player.Entity.Action = Game.Enums.ConquerAction.None;
Player.ReviveStamp = Time32.Now;
Player.Attackable = false;
Player.Entity.TransformationID = 0;
Player.Entity.RemoveFlag(Update.Flags.Dead);
Player.Entity.RemoveFlag(Update.Flags.Ghost);
Player.Entity.Hitpoints = Player.Entity.MaxHitpoints;
Player.Entity.Ressurect();
}
}
}
}
}
#endregion
#region Room5
if (Room5 == false)
{
int entered5 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1547 && (!Player.Entity.Dead))
{
entered5++;
}
}
if (entered5 > 1)
{
Room5 = true;
}
else if (entered5 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1547 && (!Player.Entity.Dead))
{
if (Time32.Now > Player.Entity.WaitingTimeFB.AddSeconds(20))
{
Player.Entity.ConquerPoints += Room5Price;
Room5Price = 0;
Player.Entity.Teleport(1002, 427, 378);
}
}
}
}
}
else
{
int alive5 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1547 && (!Player.Entity.Dead))
{
alive5++;
}
}
if (alive5 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1547)
{
if (!Player.Entity.Dead)//winner
{
Player.Entity.ConquerPoints += Room5Price * 2;
Player.Entity.WaitingTimeFB = Time32.Now;
Room5 = false;
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Congratulations! ", Player.Entity.Name, " has won ", Room5Price * 2, " CPs FB/SS in Room 5." }), System.Drawing.Color.Black, 0x7db), Kernel.GamePool.Values);
Room5Price = 0;
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_victory");
Player.SendScreen(str, true);
Player.Entity.WinnerWaiting = Time32.Now;
Player.Entity.aWinner = true;
}
else//loser
{
Player.Entity.Teleport(1002, 439, 392);
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_failure");
Player.SendScreen(str, true);
Player.Entity.Action = Game.Enums.ConquerAction.None;
Player.ReviveStamp = Time32.Now;
Player.Attackable = false;
Player.Entity.TransformationID = 0;
Player.Entity.RemoveFlag(Update.Flags.Dead);
Player.Entity.RemoveFlag(Update.Flags.Ghost);
Player.Entity.Hitpoints = Player.Entity.MaxHitpoints;
Player.Entity.Ressurect();
}
}
}
}
}
#endregion
#region Room6
if (Room6 == false)
{
int entered6 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1548 && (!Player.Entity.Dead))
{
entered6++;
}
}
if (entered6 > 1)
{
Room6 = true;
}
else if (entered6 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1548 && (!Player.Entity.Dead))
{
if (Time32.Now > Player.Entity.WaitingTimeFB.AddSeconds(20))
{
Player.Entity.ConquerPoints += Room6Price;
Room6Price = 0;
Player.Entity.Teleport(1002, 427, 378);
}
}
}
}
}
else
{
int alive6 = 0;
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1548 && (!Player.Entity.Dead))
{
alive6++;
}
}
if (alive6 == 1)
{
foreach (Client.GameState Player in ServerBase.Kernel.GamePool.Values)
{
if (Player.Entity.MapID == 1548)
{
if (!Player.Entity.Dead)//winner
{
Player.Entity.ConquerPoints += Room6Price * 2;
Player.Entity.WaitingTimeFB = Time32.Now;
Room6 = false;
Kernel.SendWorldMessage(new Network.GamePackets.Message(string.Concat(new object[] { "Congratulations! ", Player.Entity.Name, " has won ", Room6Price * 2, " CPs FB/SS in Room 6." }), System.Drawing.Color.Black, 0x7db), Kernel.GamePool.Values);
Room6Price = 0;
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_victory");
Player.SendScreen(str, true);
Player.Entity.WinnerWaiting = Time32.Now;
Player.Entity.aWinner = true;
}
else//loser
{
Player.Entity.Teleport(1002, 439, 392);
_String str = new _String(true)
{
UID = Player.Entity.UID,
TextsCount = 1,
Type = 10
};
str.Texts.Add("sports_failure");
Player.SendScreen(str, true);
Player.Entity.Action = Game.Enums.ConquerAction.None;
Player.ReviveStamp = Time32.Now;
Player.Attackable = false;
Player.Entity.TransformationID = 0;
Player.Entity.RemoveFlag(Update.Flags.Dead);
Player.Entity.RemoveFlag(Update.Flags.Ghost);
Player.Entity.Hitpoints = Player.Entity.MaxHitpoints;
Player.Entity.Ressurect();
}
}
}
}
}
#endregion
#endregion
}
Erro Corrigido =), Procure Por : #region Minning
Adicione Antes do Código Mostrado Acima.
#region Winners for FB and SS
if (client.Entity.aWinner == true)
{
if (Time32.Now > client.Entity.WinnerWaiting.AddSeconds(2))
{
/* switch (client.Entity.MapID)
{
case 1543://room 1
{
Room1 = false;
break;
}
case 1544://room 2
{
Room2 = false;
break;
}
case 1545://room 3
{
Room3 = false;
break;
}
case 1546://room 4
{
Room4 = false;
break;
}
case 1547://room 5
{
Room5 = false;
break;
}
case 1548://room 6
{
Room6 = false;
break;
}
}*/
client.Entity.Teleport(1002, 439, 384);
client.Entity.aWinner = false;
}
}
#endregion
Acabamos a Parte em Program.cs.
Agora Vamos Add o NPC, Add este NPC : Clique Aqui
Agora a Parte da Database,Add as Salas no Navicat, como ja sabemos, Navicat bla bla bla : Clique Aqui (Já vem em Formato SQL e só fazer upload no Navicat)
Artigo Encontrado em ElitePvPers.com Traduzido por WarZone-Tutoriais no dia 1/12/2013 e Artigo Original Criado e Publicado por GameHacker-PM-. Bom Uso.