Register for your free account! | Forgot your password?

You last visited: Today at 16:31

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

Advertisement



[RELEASE]Make people Halos by CMD

Discussion on [RELEASE]Make people Halos by CMD within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old 12/17/2009, 16:07   #16
 
WHITELIONX's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 532
Received Thanks: 66
I got this working with Victor in TC and you can only gain the halo if you have 10k CPs and you are the correct profession But I messed up somewhere and can`t use steed or FatalStrike hahahaha but that has to do with something else which I am not sure of >.< This is what I have just that it only tells you that you are not the correct profession if you do not have the CPs

#region Top Char
case 300006: //Victor
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hi, I can give honor halos for 10k CPs are you interested?"));
GC.AddSend(Packets.NPCLink("Would you like the Top FireTaoist?", 1));
GC.AddSend(Packets.NPCLink("Would you like the Top Trojan?", 2));
GC.AddSend(Packets.NPCLink("Would you like the Top WaterTaoist?", 3));
GC.AddSend(Packets.NPCLink("Would you like the Top Archer?", 4));
GC.AddSend(Packets.NPCLink("Would you like the Top Warrior?", 5));
GC.AddSend(Packets.NPCLink("Would you like the Top Ninja?", 6));
GC.AddSend(Packets.NPCLink("Would you like to remove your Halo?", 7));
GC.AddSend(Packets.NPCLink("Nah.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{

if (GC.MyChar.Job >= 140 && GC.MyChar.Job <= 145)
if (GC.MyChar.CPs >= 10000)
{
GC.MyChar.CPs -= 10000;

GC.MyChar.StatEff.Add(StatusEffectEn.TopFireTaoist );
GC.Message(2005, GC.MyChar.Name + " Has won the Top FireTaoist Halo");

}
else
{
GC.AddSend(Packets.NPCSay("You are not a FireTaoist or do not have enough CPs, so get lost, will you?"));
GC.AddSend(Packets.NPCLink("Sorry.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());


}
}
else if (Control == 7)
{
GC.MyChar.StatEff.Remove(StatusEffectEn.TopFireTao ist);


}

if (Control == 2)
{

if (GC.MyChar.Job >= 10 && GC.MyChar.Job <= 15)
if (GC.MyChar.CPs >= 10000)
{
GC.MyChar.CPs -= 10000;
GC.MyChar.StatEff.Add(StatusEffectEn.TopTrojan);
GC.Message(2005, GC.MyChar.Name + " Has won the Top Trojan Halo");

}
else
{
GC.AddSend(Packets.NPCSay("You are not a Trojan or do not have enough CPs, so get lost, will you?"));
GC.AddSend(Packets.NPCLink("Sorry.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
else if (Control == 7)
{
GC.MyChar.StatEff.Remove(StatusEffectEn.TopTrojan) ;


}

if (Control == 3)
{

if (GC.MyChar.Job >= 130 && GC.MyChar.Job <= 135)
if (GC.MyChar.CPs >= 10000)
{
GC.MyChar.CPs -= 10000;
GC.MyChar.StatEff.Add(StatusEffectEn.TopWaterTaois t);
GC.Message(2005, GC.MyChar.Name + " Has won the Top WaterTaoist Halo");

}
else
{
GC.AddSend(Packets.NPCSay("You are not a WaterTaoist or do not have enough CPs, so get lost, will you?"));
GC.AddSend(Packets.NPCLink("Sorry.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
else if (Control == 7)
{
GC.MyChar.StatEff.Remove(StatusEffectEn.TopWaterTa oist);


}
if (Control == 4)
{

if (GC.MyChar.Job >= 40 && GC.MyChar.Job <= 45)
if (GC.MyChar.CPs >= 10000)
{
GC.MyChar.CPs -= 10000;
GC.MyChar.StatEff.Add(StatusEffectEn.TopArcher);
GC.Message(2005, GC.MyChar.Name + " Has won the Top Archer Halo");

}
else
{
GC.AddSend(Packets.NPCSay("You are not a Archer or do not have enough CPs, so get lost, will you?"));
GC.AddSend(Packets.NPCLink("Sorry.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
else if (Control == 7)
{
GC.MyChar.StatEff.Remove(StatusEffectEn.TopArcher) ;


}
if (Control == 5)
{

if (GC.MyChar.Job >= 20 && GC.MyChar.Job <= 25)
if (GC.MyChar.CPs >= 10000)
{
GC.MyChar.CPs -= 10000;
GC.MyChar.StatEff.Add(StatusEffectEn.TopWarrior);
GC.Message(2005, GC.MyChar.Name + " Has won the Top Warrior Halo");
;
}
else
{
GC.AddSend(Packets.NPCSay("You are not a Warrior or do not have enough CPs, so get lost, will you?"));
GC.AddSend(Packets.NPCLink("Sorry.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
else if (Control == 7)
{
GC.MyChar.StatEff.Remove(StatusEffectEn.TopWarrior );


}
if (Control == 6)
{

if (GC.MyChar.Job >= 50 && GC.MyChar.Job <= 55)
if (GC.MyChar.CPs >= 10000)
{
GC.MyChar.CPs -= 10000;
GC.MyChar.StatEff.Add(StatusEffectEn.TopNinja);
GC.Message(2005, GC.MyChar.Name + " Has won the Top Ninja Halo");

}
else
{
GC.AddSend(Packets.NPCSay("You are not a Ninja or do not have enough CPs, so get lost, will you?"));
GC.AddSend(Packets.NPCLink("Sorry.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());

}
}
else if (Control == 7)
{
GC.MyChar.StatEff.Remove(StatusEffectEn.TopNinja);


}
}


break;

#endregion
WHITELIONX is offline  
Old 12/17/2009, 17:48   #17
 
sawickas's Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 617
Received Thanks: 38
How abaut save halos like in dat file.
sawickas is offline  
Old 12/17/2009, 18:07   #18
 
WHITELIONX's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 532
Received Thanks: 66
I wish I knew how to >.< it seems to delete the halo if you log the char off and even if you keep the the server running you still lose halo
WHITELIONX is offline  
Old 12/17/2009, 23:36   #19


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
@Whitelionx:

Heres your fixed commands, and a little note on if statements when brackets are not used.

Code:
            if (Cmd[0] == "/awardtoptrojan")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopTrojan);
            }
            if (Cmd[0] == "/awardtopwarrior")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopWarrior);
            }
            if (Cmd[0] == "/awardtopninja")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopNinja);
            }
            if (Cmd[0] == "/awardtoparcher")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopArcher);
            }
            if (Cmd[0] == "/awardtopfiretaoist")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopFireTaoist);
            }
            if (Cmd[0] == "/awardtopwatertaoist")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopWaterTaoist);
            }
            if (Cmd[0] == "/awardweeklypkchampion")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.WeeklyPKChampion);
            }
            if (Cmd[0] == "/awardtopguildleader")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopGuildLeader);
            }
            if (Cmd[0] == "/awardtopdeputyleader")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopDeputyLeader);
            }
Code:
            //When using if statements without brackets its important to realise that 
            //only the line immediately after the if statement will be called if the statement is true

            int Job = 55;

            if (Job == 55)
                Console.WriteLine("Yay! This line is called.");
            Console.WriteLine("This line is also called, but only because it would be the next line after the statement finshes");

            //This for example would not work out well if you dont want the contents of the if statement to be called

            if (Job == 100)
                Console.WriteLine("We dont want this line to be called, and it isnt, so Yay!");
            Console.WriteLine("Oh no! This line has been called because its not part of the if statement!");

            //If you want to have more than 1 line in the if statement then you HAVE to use brackets

            if (Job == 55)
            {
                Console.Write("All is good, the contents of this if statement");
                Console.Write(" is called and works exactly as we intended");
            }
Btw, i cant figure out where everyones fascination with regions came about, they are only cosmetic and dont atually structure your code at compilation, so having things in a region is purely to keep your code looking tidy and help you understand what you have written.

As a result i removed the Player region from your code, because it simply isnt needed, you could put a region around all of them i suppose and called it HaloComs, or something, but i dont think its really neccassery since the rest of the source will be cluttered as hell.
Korvacs is offline  
Thanks
2 Users
Old 12/18/2009, 00:14   #20
 
Mjnorman's Avatar
 
elite*gold: 0
Join Date: Oct 2007
Posts: 83
Received Thanks: 13
Nice

Nice Release Bro +++Thanks
Mjnorman is offline  
Old 12/19/2009, 05:38   #21
 
WHITELIONX's Avatar
 
elite*gold: 0
Join Date: Apr 2006
Posts: 532
Received Thanks: 66
Thank you Korvacs But how to save it? I mean I have been told to save it in the database but how? I assume I would create a new txt file in there and call it Halo? But what would I have to write in it to make it save the halos?
WHITELIONX is offline  
Old 12/19/2009, 13:23   #22


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Modify the Character database file to contain a new column called halo, you'll have to figure that out yourself tho since i dont use .ini files for databases.
Korvacs is offline  
Thanks
1 User
Old 02/03/2010, 04:07   #23
 
elite*gold: 0
Join Date: Aug 2007
Posts: 22
Received Thanks: 0
Quote:
Originally Posted by Korvacs View Post
@Whitelionx:

Heres your fixed commands, and a little note on if statements when brackets are not used.

Code:
            if (Cmd[0] == "/awardtoptrojan")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopTrojan);
            }
            if (Cmd[0] == "/awardtopwarrior")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopWarrior);
            }
            if (Cmd[0] == "/awardtopninja")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopNinja);
            }
            if (Cmd[0] == "/awardtoparcher")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopArcher);
            }
            if (Cmd[0] == "/awardtopfiretaoist")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopFireTaoist);
            }
            if (Cmd[0] == "/awardtopwatertaoist")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopWaterTaoist);
            }
            if (Cmd[0] == "/awardweeklypkchampion")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.WeeklyPKChampion);
            }
            if (Cmd[0] == "/awardtopguildleader")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopGuildLeader);
            }
            if (Cmd[0] == "/awardtopdeputyleader")
            {
                Game.World.CharacterFromName(Cmd[1]);
                GC.MyChar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.TopDeputyLeader);
            }
Code:
            //When using if statements without brackets its important to realise that 
            //only the line immediately after the if statement will be called if the statement is true

            int Job = 55;

            if (Job == 55)
                Console.WriteLine("Yay! This line is called.");
            Console.WriteLine("This line is also called, but only because it would be the next line after the statement finshes");

            //This for example would not work out well if you dont want the contents of the if statement to be called

            if (Job == 100)
                Console.WriteLine("We dont want this line to be called, and it isnt, so Yay!");
            Console.WriteLine("Oh no! This line has been called because its not part of the if statement!");

            //If you want to have more than 1 line in the if statement then you HAVE to use brackets

            if (Job == 55)
            {
                Console.Write("All is good, the contents of this if statement");
                Console.Write(" is called and works exactly as we intended");
            }
Btw, i cant figure out where everyones fascination with regions came about, they are only cosmetic and dont atually structure your code at compilation, so having things in a region is purely to keep your code looking tidy and help you understand what you have written.

As a result i removed the Player region from your code, because it simply isnt needed, you could put a region around all of them i suppose and called it HaloComs, or something, but i dont think its really neccassery since the rest of the source will be cluttered as hell.

Tried.. Is fail. It give you the one typing the command the halo even when u insert someone elses name..
liljon50 is offline  
Old 02/03/2010, 04:10   #24
 
elite*gold: 0
Join Date: Aug 2007
Posts: 22
Received Thanks: 0
Quote:
Originally Posted by Andrew.A View Post
Hey I dont think that airbourne knows much about thi s topic since it was orignally my release. Check out my thread, I have awarding halos fixed there. This "Fixed" version is a "fail" version.

Tell us to check out your thread.. and you cant post link for it even.?!
liljon50 is offline  
Reply


Similar Threads Similar Threads
[RELEASE] Giving Halos to others via CMD!!!
12/08/2009 - CO2 PServer Guides & Releases - 6 Replies
Lol figured it out by looking at other CMD's Put this in chat.cs to give halos like /awardtoptrojan Andrew.A xD if (Cmd == "/awardtoptrojan") { Game.Character C = Game.World.CharacterFromName(Cmd); if (C != null) C.StatEff.Add(NewestCOServer.Game.StatusEffectEn.T opTrojan); ...
[Release] [Untested] Awarding Halos
12/06/2009 - CO2 PServer Guides & Releases - 4 Replies
Im not entirely sure this works but its an idea. Someone try this out or tell me whats wrong please. Chat.cs if (Cmd == "/awardtopWarrior") #region Players try { foreach (Game.Character Player in Game.World.H_Chars.Values) #endregion ...
[Release] Patch 5165 Honor Halos
12/05/2009 - CO2 PServer Guides & Releases - 7 Replies
Eh very basic release, doesn't require much coding just C+P and some eyes. For those who dont already have it. Ill release it later when I'm feeling better. (Swine Flu)



All times are GMT +2. The time now is 16:31.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.