Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 19:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HELP] FirstBlood event

Discussion on [HELP] FirstBlood event within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
[HELP] FirstBlood event

Ok so here is my code:

NPC:
Code:
#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 ?
Paralyzer[GM] is offline  
Old 03/30/2010, 17:07   #2
 
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 82
find where the FB/SS skill gets executed and add some checks.

on top of that horrid code, you're probably going to come into concurrency issues.
ChingChong23 is offline  
Old 03/30/2010, 17:15   #3
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Why do you call that code *horrid* when it is the simple way to code an event!

I have been here longer then you! I know a BAD or HORRID code when I see one! as you can see in my Thanks unlike urs!
Paralyzer[GM] is offline  
Old 03/30/2010, 23:53   #4
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
First of allI'm confused on what the fuh this is.
Code:
public static bool fb = false;
        public class Fb
        {
            public static int fbjoin = 0;
        }
Arcо is offline  
Thanks
1 User
Old 03/31/2010, 00:21   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
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.
pro4never is offline  
Thanks
1 User
Old 03/31/2010, 18:40   #6
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
so in Attack.cs I can add this ?

Code:
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 ?
Paralyzer[GM] is offline  
Old 03/31/2010, 19:04   #7
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Quote:
Originally Posted by Paralyzer[GM] View Post
so in Attack.cs I can add this ?

Code:
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 ?
Tons of syntax errors.
Code:
if(GC.MyChar.Kill == 1)
  GC.MyChar.Teleport(1002, 222, 222);
else
{
   Char.Loc.Map = 1004;
   Char.Teleport(1004, 222, 222);
}
Nullable is offline  
Old 03/31/2010, 19:26   #8
 
elite*gold: 0
Join Date: Feb 2009
Posts: 262
Received Thanks: 161
find for
if (BlessingLasts > 0 && DateTime.Now > LastPts.AddMinutes(1))

up add

if (Killmap == 1)
{
Teleport(1002, 444, 444);
Killmap = 0;
}

now find in character.cs for

InitAngry(true);
Attacker.AtkMem.Attacking = false;
Attacker.AtkMem.Target = 0;
AtkMem.Attacking = false;
AtkMem.Target = 0;

down add

if (Loc.Map == you map)
{
Attacker.killmap += 1;
}


You change, for you event...
teroareboss1 is offline  
Thanks
1 User
Old 03/31/2010, 19:29   #9
 
elite*gold: 0
Join Date: Sep 2008
Posts: 178
Received Thanks: 62
Why don't use as a reference?...

Then just add anythink like : "GC.MyChar.FirstBlood = true;" and "World.FirstBloodDone = true;"
.Kob is offline  
Old 03/31/2010, 19:35   #10
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
Ok THANK YOU!

But a few errors

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

Any help ?
Paralyzer[GM] is offline  
Old 03/31/2010, 19:36   #11
 
elite*gold: 0
Join Date: Feb 2009
Posts: 262
Received Thanks: 161
fiind for
public DateTime AtackTime = DateTime.Now;

up add

public byte Killmap = 0;
teroareboss1 is offline  
Old 03/31/2010, 19:45   #12
 
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
lol I am a better cops coder then you

I managed to code the OFFICIAL steedrace map + event so be quiet don't POST HERE AGAIN!

Quote:
Originally Posted by teroareboss1 View Post
fiind for
public DateTime AtackTime = DateTime.Now;

up add

public byte Killmap = 0;
I cannot find that.

EDIT: Fixed and found no errors. THANKS!
Paralyzer[GM] is offline  
Closed Thread


Similar Threads Similar Threads
EXP & GP BONUS EVENT & Champion's Patriot Mask Event
07/09/2010 - Combat Arms - 28 Replies
Hier sind die Details vom Event: 1. EXP & GP BONUS EVENT Wann: 08.07.2010 / 18.00 - 24.00 Uhr 10.07.2010 / 18.00 - 24.00 Uhr 11.07.2010 / 18.00 - 24.00 Uhr
[Event]Sniper Event wird verschoben auf unbestimmte zeit
06/04/2010 - WarRock - 6 Replies
titel... MfGAwzumKittey



All times are GMT +1. The time now is 19:46.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.