Plant The Bomb from Fallenheroes 5071.
PacketProcessor -> Revive
Code:
public static void Revive(GameClient Hero, bool OnSpot)
{
if (!Hero.Entity.Dead)
return;
Hero.Entity.Dead = false;
Hero.Entity.Hitpoints = Hero.Entity.MaxHitpoints;
Hero.Entity.SpawnProtection = true;
if (!OnSpot)
{
RevivePoint rPoint;
#region RevPTB
else if (Hero.Entity.MapID == 1037)
{
Hero.Teleport(1002, 400, 400);
Hero.Entity.PTBBlack = false;
Hero.Entity.PTBWhite = false;
Hero.Entity.GotBomb = false;
Hero.Entity.Signed = false;
Hero.Entity.Garment = false;
Hero.Entity.BombTick = 0;
}
#endregion
else
{
if (Kernel.RevivePoints.TryGetValue(Hero.Entity.MapID, out rPoint))
Hero.Teleport(rPoint.RevMap, rPoint.RevX, rPoint.RevY);
else
Hero.Teleport(1002, 430, 380);
}
}
else
Hero.Teleport(Hero.Entity.MapID, Hero.Entity.X, Hero.Entity.Y);
Hero.Stamina = 100;
Hero.LoadEquipment();
Sync.HP(Hero);
Sync.Stamina(Hero);
Sync.Revive(Hero);
GetSurroundings(Hero);
Screen screen = new Screen(Hero);
screen.Reload(true, null);
}
Attack -> Physical -> case EntityFlag.Player -> if (Damage >= hero.Attacked.Hitpoints)
Code:
#region PTB
if (hero.Entity.GotBomb == true)
{
foreach (GameClient Charrr in Kernel.GamePool.Values)
{
PTB.PTBs = false;
PTB.TheBombIsTaken = false;
Charrr.Entity.PTBBlack = false;
Charrr.Entity.GotBomb = false;
Charrr.Entity.Signed = false;
Charrr.Entity.Garment = false;
Charrr.Entity.BombTick = 0;
ActionTimer.TournyOn = false;
Message.Global(hero.Entity.Name + " has died, the bomb got lost. The White Team Has Won And Gained 200HeroPoints.", MessagePacket.Teal, MessagePacket.Center);
if (Charrr.Entity.MapID == 1037)
{
Charrr.Teleport(1002, 400, 400);
}
if (Charrr.Entity.PTBWhite == true)
{
Charrr.HeroPoints += 200;
Charrr.Entity.PTBWhite = false;
}
}
}
if (hero.Entity.MapID == 1037)
{
hero.Entity.PTBBlack = false;
hero.Entity.PTBWhite = false;
hero.Entity.GotBomb = false;
hero.Entity.Signed = false;
hero.Entity.Garment = false;
hero.Entity.BombTick = 0;
hero.Teleport(1002, 400, 400);
}
#endregion
PacketProcessor -> PlayerGroundMovment
Code:
public static void PlayerGroundMovment(GameClient Hero, GroundMovementPacket Packet)
{
Hero.Entity.SpawnProtection = false;
#region PTB
if (Hero.Entity.BombTick >= 50 && Hero.Entity.GotBomb == true && Hero.Entity.X == 228 && Hero.Entity.Y == 232 || Hero.Entity.BombTick >= 50 && Hero.Entity.GotBomb == true && Hero.Entity.X == 227 && Hero.Entity.Y == 231 || Hero.Entity.BombTick >= 50 && Hero.Entity.GotBomb == true && Hero.Entity.X == 228 && Hero.Entity.Y == 229 || Hero.Entity.BombTick >= 50 && Hero.Entity.GotBomb == true && Hero.Entity.X == 229 && Hero.Entity.Y == 233 || Hero.Entity.BombTick >= 50 && Hero.Entity.GotBomb == true && Hero.Entity.X == 226 && Hero.Entity.Y == 233)
{
foreach (GameClient Char in Kernel.GamePool.Values)
{
if (Char.Entity.MapID == 1037)
{
if (Char.Entity.PTBBlack == true)
{
Char.HeroPoints += 200;
}
PTB.PTBs = false;
PTB.TheBombIsTaken = false;
Char.Entity.PTBBlack = false;
Char.Entity.PTBWhite = false;
Hero.Entity.GotBomb = false;
Hero.Entity.BombTick = 0;
Char.Entity.Signed = false;
Char.Entity.Garment = false;
ActionTimer.TournyOn = false;
Message.Send(Char, "Plant The Bomb have ended and The Black Team have won!!!!", MessagePacket.Teal, MessagePacket.Center);
Char.Teleport(1002, 400, 400);
}
}
}
if (Hero.Entity.GotBomb == true && Hero.Entity.X == 228 && Hero.Entity.Y == 232 || Hero.Entity.GotBomb == true && Hero.Entity.X == 227 && Hero.Entity.Y == 231 || Hero.Entity.GotBomb == true && Hero.Entity.X == 228 && Hero.Entity.Y == 229 || Hero.Entity.GotBomb == true && Hero.Entity.X == 229 && Hero.Entity.Y == 233 || Hero.Entity.GotBomb == true && Hero.Entity.X == 226 && Hero.Entity.Y == 233)
{
Random r = new Random();
int up = r.Next(1, 3);
Hero.Entity.BombTick += up;
}
#endregion
Hero.SendScreen(Packet, true);
Hero.Entity.Move(Packet.Direction);
Hero.Screen.Reload(false, null);
if (Hero.Attacking)
Hero.Attacking = false;
}
PlantTheBomb
Code:
public class PTB
{
public static bool PTT = false;
public static bool PTBs = false;
public static bool TheBombIsTaken = false;
public static void PTBStart()
{
foreach (GameClient Char in Kernel.GamePool.Values)
{
Message.Send(Char, "Plant The Bomb have started, please sign up. You have 1minute!!", MessagePacket.Teal, MessagePacket.Center);
}
PTT = true;
PTBs = true;
}
public static void PTBGO()
{
PTBs = false;
foreach (GameClient Char in Kernel.GamePool.Values)
{
Message.Send(Char, "PLANT THE BOMB!!!!!!!!!!!!!!!!!!", MessagePacket.Teal, MessagePacket.Center);
if (Char.Entity.PTBBlack == true)
{
Char.Teleport(1037, 392, 280);
}
if (Char.Entity.PTBWhite == true)
{
Char.Teleport(1037, 232, 236);
}
}
}
public static void PTBEND()
{
ActionTimer.TournyOn = false;
PTT = false;
PTBs = false;
foreach (GameClient Char in Kernel.GamePool.Values)
{
Message.Send(Char, "Plant The Bomb Have AutoEnded. If the bomb wasn't planted, White wins!", MessagePacket.Teal, MessagePacket.Center);
if (Char.Entity.MapID == 1037)
{
Char.Teleport(1002, 400, 400);
}
if (Char.Entity.PTBWhite == true)
{
//Reward
Char.Nobility.Donation += 50;
}
PTBs = false;
TheBombIsTaken = false;
Char.Entity.PTBBlack = false;
Char.Entity.PTBWhite = false;
Char.Entity.GotBomb = false;
Char.Entity.Garment = false;
Char.Entity.Signed = false;
Char.Entity.BombTick = 0;
}
}
}
This is from the Fallenheroes source v5071. Never finished it. You should be able to convert it, else just don't use it.