[RELEASE]Make people Halos by CMD

12/17/2009 16:07 WHITELIONX#16
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 :D 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
12/17/2009 17:48 sawickas#17
How abaut save halos like in dat file.
12/17/2009 18:07 WHITELIONX#18
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 :(
12/17/2009 23:36 Korvacs#19
@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.
12/18/2009 00:14 Mjnorman#20
Nice Release Bro +++Thanks
12/19/2009 05:38 WHITELIONX#21
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?
12/19/2009 13:23 Korvacs#22
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.
02/03/2010 04:07 liljon50#23
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..
02/03/2010 04:10 liljon50#24
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.?!