#region First Blood Event
case 987899:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Do you want to sign-up for the First Blood event ?"));
GC.AddSend(Packets.NPCSay(" First Blood is an simple event coded by Paralyzer[PM]"));
GC.AddSend(Packets.NPCSay(" You will then be sent to a map and then the First Person"));
GC.AddSend(Packets.NPCSay(" To kill someone using ScentSword or FastBlade and you will"));
GC.AddSend(Packets.NPCSay(" Then be sent to a map with 2 NPCs and each NPC will have random"));
GC.AddSend(Packets.NPCSay(" Prizes they will have the same random prizes but not in the same order"));
GC.AddSend(Packets.NPCSay(" Prizes from 10-50CPs and/or 1DB to 5DB(s)."));
GC.AddSend(Packets.NPCLink("Sign up.", 1));
GC.AddSend(Packets.NPCLink("No.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.dmjoin == 0)
{
if (World.fb == true)
{
if (GC.MyChar.fbjoin == 0)
{
if (World.fb == true)
{
GC.MyChar.fbjoin = 1;
}
}
}
else
{
GC.AddSend(Packets.NPCSay("Sorry but the FirstBlood is not active"));
GC.AddSend(Packets.NPCLink("Ok", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
else
{
GC.AddSend(Packets.NPCSay("Sorry but you have signed up!"));
GC.AddSend(Packets.NPCLink("Ok...", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
here is my code in World.cs
Code:
public static bool fb = false;
public class Fb
{
public static int fbjoin = 0;
}
Here is my code in Character.cs
Code:
if (fbjoin == 1)
{
foreach (DictionaryEntry DE in Game.World.H_Chars)
{
Game.Character Chaar = (Game.Character)DE.Value;
if (Chaar.Name != MyClient.MyChar.Name)
{
if (Chaar.fbjoin == 1)
{
Damage = 0;
return;
}
}
}
}
and then my code in Chat.cs
Code:
if (Cmd[0] == "/fbtrue")
{
if (GC.AuthInfo.Status == "[PM]")
Game.World.fb = true;
Game.World.SendMsgToAll("Server", "First Blood start in 2 mins! Goto TwinCity at 424 361 to join the tornament!", 2011, 0);
new Thread(new ThreadStart(delegate()
{
Console.WriteLine("First Blood Activated (via Console).");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "First Blood will start in 1 minutes and 30 Seconds! Goto TwinCity at 424 361 to join the tornament!", 2011, 0);
Console.WriteLine("1 Minutes 30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "First Blood will start in 1 minutes! Goto TwinCity at 424 361 to join the tornament!", 2011, 0);
Console.WriteLine("1 Minutes Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "First Blood will start in 30 Seconds! Goto TwinCity at 424 361 to join the tornament!", 2011, 0);
Console.WriteLine("30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "First Blood has started ", 2011, 0);
Console.WriteLine("First Blood has started ");
foreach (DictionaryEntry DE in Game.World.H_Chars)
{
Game.Character Chaar = (Game.Character)DE.Value;
if (Chaar.fbjoin == 1)
{
if (Chaar.fbjoin == 1)
{
Chaar.Teleport(1950, 049, 148);
}
else if (Chaar.fbjoin == 0)
{
Chaar.Teleport(1950, 049, 148);
}
}
}
Game.World.sr = false;
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 9 minutes", 2011, 0);
Console.WriteLine("9 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 8 minutes", 2011, 0);
Console.WriteLine("8 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 7 minutes", 2011, 0);
Console.WriteLine("7 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 6 minutes", 2011, 0);
Console.WriteLine("6 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 5 minutes", 2011, 0);
Console.WriteLine("5 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 4 minutes", 2011, 0);
Console.WriteLine("4 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 3 minutes", 2011, 0);
Console.WriteLine("3 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 2 minutes", 2011, 0);
Console.WriteLine("2 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 1 minutes", 2011, 0);
Console.WriteLine("1 Minutes Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "First Blood will finish in 30 seconds! ", 2011, 0);
Console.WriteLine("Steed Race will finish in 30 seconds!");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "First Blood has finished! ", 2011, 0);
Console.WriteLine("First Blood has finished");
}
)).Start();
}
Ok so my problem is, is that this is a FirstBlood event ( Yeah pointless but I want to try and code it ) I need to be able to make it so the first person to kill someone using fastblase or scentsword gets teleported to a diffrent map and everybody else get teleported to TC any ideas ? do I need a .cs file or something ?
The easiest way imo to do it would be in your attack code.
Something along the lines of a world bool controlling if someone has been killed yet. When player death is handled, check if they are
-On the map your using for this event
-The event is on
-The attacker/killed player are in the event
-Anyone has gotten the first kill yet
If all of these checks pass, teleport the player to the 'winner' map and then teleport all other players from the event map to the 'looser' map.
You may also want to revive the player who was killed so they aren't stuck in the looser map as a ghost... you will also wanna disable all other skills and attack types such as melee, bows and magic skills on that map.
if (GC.MyChar.Loc.Map == 1004) //Not the real map <--- Just a test!
{
if GC.MyChar.Kill = 1;
GC.MyChar.Teleport(1002, 222, 222);
else
Char.Loc.Map == 1004; //Not real map
Char.Teleport(1004, 222, 222); //Not real map
}
I did try on the code but errors appear can anyone help me on that ?
if (GC.MyChar.Loc.Map == 1004) //Not the real map <--- Just a test!
{
if GC.MyChar.Kill = 1;
GC.MyChar.Teleport(1002, 222, 222);
else
Char.Loc.Map == 1004; //Not real map
Char.Teleport(1004, 222, 222); //Not real map
}
I did try on the code but errors appear can anyone help me on that ?
1. 'NewestCOServer.Game.Character' does not contain a definition for 'killmap' and no extension method 'killmap' accepting a first argument of type 'NewestCOServer.Game.Character' could be found (are you missing a using directive or an assembly reference?) In Character.cs
2. The name 'Killmap' does not exist in the current context Character.cs
3.Error 3 The name 'Killmap' does not exist in the current context Character.cs