Save Guild Enemies/Allies

08/28/2010 17:35 killersub#16
Quote:
Originally Posted by copz1337 View Post
I get an error on these 2 lines:
Code:
            G.Allies.Add(0, "");
            G.Enemies.Add(0, "");
The error is "Cannot use local variable 'G' before it is declared".
look for:

Code:
class Guilds
in Guilds.cs

and add what .Arco said under

Code:
public static Hashtable AllTheGuilds = new Hashtable();

add this under there:

Code:
public Dictionary<uint, string> Allies = new Dictionary<uint, string>();
        public Dictionary<uint, string> Enemies = new Dictionary<uint, string>();
I also had dis problem :).
08/28/2010 19:44 _DreadNought_#17
Im tired, but it did look like your using a var before you have made it.
ex:
Code:
G = "ohai";
string G;
Would not work were as
Code:
string G;
G = "ohai";
Would work.
08/28/2010 22:13 Arcо#18
IT looks as if he added it to the top of the void, rather than the bottom as I directed.
08/28/2010 22:40 killersub#19
Quote:
Originally Posted by .Arco View Post
IT looks as if he added it to the top of the void, rather than the bottom as I directed.
its not that its just that u told him to put it in
Code:
class Guild
rather than
Code:
class Guilds
becuz once u put it under that it wont find the reference as directed...:rolleyes: :D
08/29/2010 07:35 koko425#20
Quote:
Originally Posted by .Arco View Post
Make sure your server is off, delete guilds.dat. and then start the server, create a guild, and see if it works.

And as of adding the enemies via npc, just make the npc add the enemy ID and Name.
COULD YOU EXPLAIN MORE ABOUT NPC AND PACKET TO ADD...
08/29/2010 07:42 Arcо#21
Actually I did tell him
Quote:
Code:
        public static void CreateNewGuild(string GName, ushort GID, Character Creator)
And at the bottom of this void, put this
Code:
            G.Allies.Add(0, "");
            G.Enemies.Add(0, "");
08/30/2010 16:47 2087#22
Well, you released how to ADD them...

tried to write it for myself ( didnt work ... ^^ )...

I'd like to see you releasing how to REMOVE them again?
08/30/2010 18:22 .Beatz#23
Quote:
Originally Posted by 2087 View Post
Well, you released how to ADD them...

tried to write it for myself ( didnt work ... ^^ )...

I'd like to see you releasing how to REMOVE them again?
He has given you the basis for this. To remove them is quite simple I coded one myself in a short amount of time. Try making it again it is quite simple to do.
08/30/2010 21:55 Arcо#24
Quote:
Originally Posted by 2087 View Post
Well, you released how to ADD them...

tried to write it for myself ( didnt work ... ^^ )...

I'd like to see you releasing how to REMOVE them again?
if (GC.MyChar.MyGuild.Allies.Contains(ReadString))
{
Remove;
}
08/31/2010 01:09 2087#25
I added it to a NPC, but it didnt work at all .Arco ... :(

Here's the code and the erros.


Marked the underlined things red.
08/31/2010 06:01 Arcо#26
I was giving you a psuedo code.
You have to do the rest on your own.
That was only an example.
08/31/2010 09:15 koko425#27
Quote:
Originally Posted by .Arco View Post
I was giving you a psuedo code.
You have to do the rest on your own.
That was only an example.
WHY THIS NPC NOT WORK CAN YOU FIX IT PLZ
PHP Code:
#region Expotionm and allies
                            
case 33363:
                                {
                                    if (
option == 0)
                                    {
                                        
OptionText("The Traning is start i will give you Double Expotion enjoy and come back to take another"GC);

                                        
OptionLink("Got it."1GC);
                                        
OptionLink("make allies."21GC);
                                        
OptionLink("no Thanks."255GC);
                                        
GC.AddSend(Packets.NPCSetFace(50));
                                        
GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (
option == 1)
                                    {
                                        
GC.MyChar.ExpPotionUsed DateTime.Now;
                                        
GC.MyChar.DoubleExp true;
                                        
GC.MyChar.DoubleExpLeft 3600;

                                        
// MyClient.AddSend(Packets.Status(EntityID, Status.flower, pote));
                                        //MyClient.AddSend(Packets.Status(EntityID, Status.PotFromMentor, pote));
                                        
GC.MyChar.MyClient.AddSend(Packets.Status(GC.MyChar.EntityIDStatus.DoubleExpTime, (ulong)GC.MyChar.DoubleExpLeft));
                                    }
                                if (
option == 21)
                                    {
                                        if (
GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            
string Ally ReadString(Data);
                                            foreach (
Features.Guild g in Features.Guilds.AllTheGuilds.Values)
                                            {
                                                if (
g.GuildName == Ally)
                                                {
                                                    if (
g.Creator.Info != null)
                                                    {
                                                        if (
g.Creator.Info.MyTeam.Members.Contains(GC.MyChar.EntityID))
                                                        {
                                                            if (!
GC.MyChar.MyGuild.Allies.ContainsValue(Ally))
                                                            {
                                                                
GC.MyChar.MyGuild.Allies.Add(0Ally);
                                                                
GC.AddSend(Packets.String(g.GuildID21Ally));
                                                                
OptionText(g.GuildName " is now your ally!"GC);
                                                                
OptionLink("Thanks."255GC);
                                                            }
                                                            else
                                                            {
                                                                
OptionText(g.GuildName " is already your ally."GC);
                                                                
OptionLink("Damn."255GC);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            
OptionText("blah blah"GC);
                                                            
OptionLink("Okay"255GC);
                                                        }
                                                       }
                                                        else
                                                        {
                                                            
OptionText("Make sure lolo."GC);
                                                            
OptionLink("Okay"255GC);
                                                        }

                                                    
                                                }
                                            }
                                            }
                                    }
 
                                    break;
                                }
                            
#endregion 
08/31/2010 09:17 dowhatuwant#28
Quote:
Originally Posted by koko425 View Post
WHY THIS NPC NOT WORK CAN YOU FIX IT PLZ
PHP Code:
#region Expotionm and allies
                            
case 33363:
                                {
                                    if (
option == 0)
                                    {
                                        
OptionText("The Traning is start i will give you Double Expotion enjoy and come back to take another"GC);

                                        
OptionLink("Got it."1GC);
                                        
OptionLink("make allies."21GC);
                                        
OptionLink("no Thanks."255GC);
                                        
GC.AddSend(Packets.NPCSetFace(50));
                                        
GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (
option == 1)
                                    {
                                        
GC.MyChar.ExpPotionUsed DateTime.Now;
                                        
GC.MyChar.DoubleExp true;
                                        
GC.MyChar.DoubleExpLeft 3600;

                                        
// MyClient.AddSend(Packets.Status(EntityID, Status.flower, pote));
                                        //MyClient.AddSend(Packets.Status(EntityID, Status.PotFromMentor, pote));
                                        
GC.MyChar.MyClient.AddSend(Packets.Status(GC.MyChar.EntityIDStatus.DoubleExpTime, (ulong)GC.MyChar.DoubleExpLeft));
                                    }
                                if (
option == 21)
                                    {
                                        if (
GC.MyChar.MyGuild != null && GC.MyChar.GuildRank == NewestCOServer.Features.GuildRank.GuildLeader)
                                        {
                                            
string Ally ReadString(Data);
                                            foreach (
Features.Guild g in Features.Guilds.AllTheGuilds.Values)
                                            {
                                                if (
g.GuildName == Ally)
                                                {
                                                    if (
g.Creator.Info != null)
                                                    {
                                                        if (
g.Creator.Info.MyTeam.Members.Contains(GC.MyChar.EntityID))
                                                        {
                                                            if (!
GC.MyChar.MyGuild.Allies.ContainsValue(Ally))
                                                            {
                                                                
GC.MyChar.MyGuild.Allies.Add(0Ally);
                                                                
GC.AddSend(Packets.String(g.GuildID21Ally));
                                                                
OptionText(g.GuildName " is now your ally!"GC);
                                                                
OptionLink("Thanks."255GC);
                                                            }
                                                            else
                                                            {
                                                                
OptionText(g.GuildName " is already your ally."GC);
                                                                
OptionLink("Damn."255GC);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            
OptionText("blah blah"GC);
                                                            
OptionLink("Okay"255GC);
                                                        }
                                                       }
                                                        else
                                                        {
                                                            
OptionText("Make sure lolo."GC);
                                                            
OptionLink("Okay"255GC);
                                                        }

                                                    
                                                }
                                            }
                                            }
                                    }
 
                                    break;
                                }
                            
#endregion 
YOU NEED TO CONVERT IT MENG

HOPE IT HELPED
08/31/2010 12:51 .Beatz#29
Quote:
Originally Posted by ☆★Zuper★☆ View Post
YOU NEED TO CONVERT IT MENG

HOPE IT HELPED
Not necessarily a conversion problem. Looked at that and it would work on my source with no problems.

@koko425 What are the problems you are having? Does it just not make allies? or does it not work at all? A little more information helps.
08/31/2010 12:54 dowhatuwant#30
Quote:
Originally Posted by mattyc2580 View Post
Not necessarily a conversion problem. Looked at that and it would work on my source with no problems.

@koko425 What are the problems you are having? Does it just not make allies? or does it not work at all? A little more information helps.
option to control
aint that a convert? :)

and later I will take the npc and make it work real.
Like you need to be in team with the one you want to allie.