|
You last visited: Today at 05:55
Advertisement
[Request] How to make a wishes tree
Discussion on [Request] How to make a wishes tree within the CO2 Private Server forum part of the Conquer Online 2 category.
06/05/2010, 21:11
|
#16
|
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
|
Code:
bool someEventIsTriggered = true;
if (someEventIsTriggered)
{
foreach(Game.Character Char in Game.World.H_Chars)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
fixed the brackets
|
|
|
06/05/2010, 21:12
|
#17
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by .Summer
Code:
bool someEventIsTriggered = true;
if (someEventIsTriggered)
{
foreach(Game.Character Char in Game.World.H_Chars)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
fixed the brackets
|
When he pastes it in C# it's going to fix the brackets automatically.
That was just a waste of a post.
|
|
|
06/05/2010, 21:57
|
#18
|
elite*gold: 0
Join Date: Dec 2005
Posts: 231
Received Thanks: 85
|
Quote:
Originally Posted by .Summer
Code:
bool someEventIsTriggered = true;
if (someEventIsTriggered)
{
foreach(Game.Character Char in Game.World.H_Chars)
{
Char.MyClient.DialogNPC = 666111;
PacketHandling.NPCDialog.Handle(Char.MyClient, null, 666111, 0);
Char.MyClient.EndSend();
}
}
fixed the brackets
|
what's wrong with the brackets? o.0 You can code all that in 1 line and it'd still work.
|
|
|
06/05/2010, 22:12
|
#19
|
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
|
Quote:
Originally Posted by dragon89928
what's wrong with the brackets? o.0 You can code all that in 1 line and it'd still work.
|
looking better.
but whatever XD
|
|
|
06/05/2010, 22:19
|
#20
|
elite*gold: 0
Join Date: Oct 2009
Posts: 128
Received Thanks: 50
|
Quote:
Originally Posted by .Summer
looking better.
but whatever XD
|
It's all a matter of style. Unless you're working for a company that strictly enforcing certain coding conventions...
|
|
|
06/05/2010, 22:33
|
#21
|
elite*gold: 0
Join Date: Dec 2005
Posts: 231
Received Thanks: 85
|
Quote:
Originally Posted by s.bat
It's all a matter of style. Unless you're working for a company that strictly enforcing certain coding conventions...
|
Personally I don't like how C# express does the brackets. IMO its a waste of space to have the starting "{" on its own line
|
|
|
06/05/2010, 22:46
|
#22
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Java's bracket setup is way better.
|
|
|
06/05/2010, 23:39
|
#23
|
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 29
|
done, it by myself, thank you rly much
|
|
|
06/06/2010, 02:48
|
#24
|
elite*gold: 0
Join Date: Dec 2005
Posts: 231
Received Thanks: 85
|
Quote:
Originally Posted by .Arco
Java's bracket setup is way better.
|
yep i second that
|
|
|
06/06/2010, 06:56
|
#25
|
elite*gold: 0
Join Date: Feb 2010
Posts: 80
Received Thanks: 29
|
I realized that It doesn't show the name of person who wrote the wish on the file.
Code:
#region wish tree
case 999999: // make sure you change this to the npc you want to use
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("What is your wish?"));
GC.AddSend(Packets.NPCLink2("Type in your wish", 1));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
[COLOR="Magenta"]foreach (DictionaryEntry DE in World.H_Chars)
{
Character Chaar = (Game.Character)DE.Value;[/COLOR]
string wish = ReadString(Data);
if (wish != null)
{
string path = "C:\\OldCODB\\wish.txt";
StreamWriter SW;
if (File.Exists(path))
{
SW = File.AppendText(path);
SW.WriteLine([COLOR="Magenta"]Chaar.Name +[/COLOR] ": " + wish);
//will write -- Name: My wish
SW.Close();
Console.WriteLine("A new wish has been made!");
}
else
{
SW = File.CreateText(path);
SW.WriteLine(wish);
SW.Close();
Console.WriteLine("A new wish has been made!");
}
}
GC.AddSend(Packets.NPCSay("Your Wish has been added into the file"));
GC.AddSend(Packets.NPCLink2("Thanks", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
#endregion
Add/Change the codes with pink ones. =]
|
|
|
06/06/2010, 07:42
|
#26
|
elite*gold: 0
Join Date: Dec 2005
Posts: 231
Received Thanks: 85
|
Quote:
Originally Posted by xSynthesis
I realized that It doesn't show the name of person who wrote the wish on the file.
|
it doesn't? I'm pretty sure it will. What you're doing right there is cycling through characters, which is unnecessary since you already know that the person that pressed the npc is already gc.mychar.
edit: Okay, I took another look at the code and I think what's gonna happen if you do that is it will write all the names of the people with the same wish in the file x.x Because you didn't add any checks.
|
|
|
06/06/2010, 08:10
|
#27
|
elite*gold: 0
Join Date: Oct 2009
Posts: 128
Received Thanks: 50
|
Quote:
Originally Posted by xSynthesis
I realized that It doesn't show the name of person who wrote the wish on the file.
|
Did you test to see if it doesn't write the player's name to the file, or are you just guessing? It looks like it should write the player's name to the file. Your code on the other hand, looks like it will write every single player's name in the file with the single player's wish, but I didn't look too closely into it.
|
|
|
06/06/2010, 08:20
|
#28
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by xSynthesis
I realized that It doesn't show the name of person who wrote the wish on the file.
|
Uhm...
SW.WriteLine(GC.MyChar.Name + ": " + wish);
Yes it does?
|
|
|
06/06/2010, 08:22
|
#29
|
elite*gold: 0
Join Date: Feb 2010
Posts: 80
Received Thanks: 29
|
Quote:
Originally Posted by s.bat
Did you test to see if it doesn't write the player's name to the file, or are you just guessing? It looks like it should write the player's name to the file. Your code on the other hand, looks like it will write every single player's name in the file with the single player's wish, but I didn't look too closely into it.
|
Yep I tested it and all I seen was wishes. There was no names. The first code which is
Code:
foreach (DictionaryEntry DE in World.H_Chars)
{
Character Chaar = (Game.Character)DE.Value;
allows you to use "Chaar" at NPCDialog.cs otherwise you will get errors. I don't really know why but it seems GC.MyChar.Name doesn't work for some reason. But Chaar.Name does. I have tested my code aswell. And it works for me. D=
Edit:
Quote:
Originally Posted by .Arco
Uhm...
SW.WriteLine(GC.MyChar.Name + ": " + wish);
Yes it does?
|
Well, It might work on you but it doesnt for me. I got ConquerSX's source and it's kinda different than normal one. It might because of that. I dunno D=
|
|
|
06/07/2010, 11:10
|
#30
|
elite*gold: 0
Join Date: Dec 2006
Posts: 94
Received Thanks: 29
|
yes, there are names, but thx for try helping xsynthesis
|
|
|
Similar Threads
|
[Request] NAGC Skill Tree Uncap?
04/16/2010 - Grand Chase - 7 Replies
Title says. Is there any possible hack to uncap the 35 limit to infinity?
|
Best Wishes from Hungary
07/14/2008 - Say Hello - 2 Replies
Hi to ALL ! :D enjoy the life's goods :cool:
|
Druid Tree form buff without tree Form
11/11/2007 - WoW Exploits, Hacks, Tools & Macros - 5 Replies
My buddy and i were screwing around the other day in Mech and we figured out a way to have a working tree form buff for the party but not be in tree form. Which if anyone knows about druids allows them to cast all their other high healing spells. Anyway follow the instructions below its a bit tricky
1. Change your chest item to something else
2. Get into Combat.. Queue your chestpiece to switch back to your original
3. When the fights finishing, Get ready.. The second the...
|
All times are GMT +2. The time now is 05:55.
|
|