منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   حل مشكلة الجيلدات الناس مش بينه فيها (https://code.vpscairo.com/showthread.php?t=3562)

ElSaher 2020-02-02 08:03 PM

حل مشكلة الجيلدات الناس مش بينه فيها
 

نخوش علي الحل علي طول

هتروح علي كلاس
Npc
هتبحث عن
كود PHP:

#region GuildDirector 

او
كود PHP:

case 10003

هتقفله من السالب وتبدله بي دا
كود PHP:

                #region GuildDirector
                
case 10003:
                    {
                        
dialog.Avatar(7);
                        switch (
npcRequest.OptionID)
                        {
                            case 
0:
                                {
                                    
dialog.Text("Greetings! I am the guild director, in charge of administrating and managing guilds. What business do you have with me?");
                                    
dialog.Text("Guild leaders can post up a guild recruitment ad to recruit new blood for their guilds! Soldiers without a guild can get the latest guild recruitment information from me, and then find a good guild to join!");
                                    
dialog.Option("Create~a~guild"1);
                                    
dialog.Option("Disband~my~guild"6);
                                    
dialog.Option("Inquire~about~a~guild"4);
                                    
dialog.Option("Guild~Recruitment"3);
                                    
dialog.Option("Change~my~Guild`s~name."8);
                                    
dialog.Option("Union~Operation."51);
                                    
dialog.Option("Change~my~Union`s~name."67);
                                    
dialog.Option("Close."255);
                                    
dialog.Send();
                                    break;
                                }
                            case 
51:
                                {
                                    if (
client.Union == null && client.Guild != null && client.AsMember.Rank == Enums.GuildMemberRank.GuildLeader && client.Guild.Level >= && client.Entity.ConquerPoints >= 3000)
                                    {
                                        
dialog.Text("A great war which involves millions of heroes is about to fire. If you have a Level 9+ Guild ranking Top 8 in Capture the Flag of your server,");
                                        
dialog.Text("~you can pay me 3000 CPs to create a Union. It`s time to gather the elites and picture a new world in your hands.");

                                        
dialog.Option("Create~a~Union."66);
                                        
dialog.Option("It`s~time~to~strike!"0);
                                        
dialog.Avatar(7);
                                        
dialog.Send();
                                    }
                                    else
                                    {
                                        
dialog.Text("Sorry, you don`t have 3,000 CPs or Guild Level 1 or Have Union to create a Union.");

                                        
dialog.Option("Hard~times..."255);
                                        
dialog.Avatar(7);
                                        
dialog.Send();
                                    }
                                    break;
                                }
                            case 
67:
                                {
                                    if (
client.Guild != null && client.Union != null && client.Union.LeaderUID == client.Entity.UID && client.AsMember.Rank == Enums.GuildMemberRank.GuildLeader && client.Entity.ConquerPoints >= 3000)
                                    {
                                        
client.Entity.ConquerPoints -= 3000;
                                        
client.Union.SengGui(client6);
                                    }
                                    else
                                    {
                                        
dialog.Text("Sorry, you don`t have 3,000 CPs to Change Name Of a Union.");

                                        
dialog.Option("Hard~times..."255);
                                        
dialog.Avatar(7);
                                        
dialog.Send();
                                    }
                                    break;
                                }
                            case 
66:
                                {
                                    
client.Entity.ConquerPoints -= 3000;
                                    
client.Send(new Data(true) { UID client.Entity.UIDID Data.OpenWindowdwParam 693wParam1 client.Entity.XwParam2 client.Entity.});
                                    break;
                                }
                            case 
1:
                                {
                                    if (
client.Entity.Level 90)
                                    {
                                        
dialog.Text("Sorry,~you~cannot~create~a~guild~before~you~reach~level~90.~Please~train~harder.");
                                        
dialog.Option("I~see."255);
                                        
dialog.Send();
                                    }
                                    else if (
client.Entity.Money 1000000)
                                    {
                                        
dialog.Text("To~create~a~guild,~1,000,000~silver~will~be~charged.~You~do~not~have~the~required~money.");
                                        
dialog.Option("I~see."255);
                                        
dialog.Send();
                                    }
                                    else
                                    {
                                        
dialog.Text("What~would~you~like~to~name~your~guild?~A~good~name~is~better~than~great~riches.");
                                        
dialog.Input("I name my guild..."216);
                                        
dialog.Option("Let~me~think~it~over."255);
                                        
dialog.Send();
                                    }
                                    break;
                                }
                            case 
2:
                                {
                                    if (
client.Guild != null) return;
                                    if (
client.Guild == null && client.Entity.Level >= 90 && client.Entity.Money >= 1000000)
                                    {
                                        if (
npcRequest.Input != "" && npcRequest.Input.Length && npcRequest.Input.Length 16)
                                        {
                                            if (!
Guild.CheckNameExist(npcRequest.Input))
                                            {
                                                
client.Entity.Money -= 1000000;
                                                
Guild guild = new Guild(client.Entity.Name);
                                                
guild.ID Guild.GuildCounter.Next;
                                                
guild.SilverFund 1000000;
                                                
client.AsMember = new Game.ConquerStructures.Society.Guild.Member(guild.ID)
                                                {
                                                    
ID client.Entity.UID,
                                                    
Level client.Entity.Level,
                                                    
Name client.Entity.Name,
                                                    
Rank ElSaher.Game.Enums.GuildMemberRank.GuildLeader,
                                                };
                                                
Database.EntityTable.SaveGuildID(clientguild.ID);
                                                
Database.EntityTable.SaveGuildR(clientGame.Enums.GuildMemberRank.GuildLeader);
                                                if (
client.NobilityInformation != null)
                                                {
                                                    
client.AsMember.Gender client.NobilityInformation.Gender;
                                                    
client.AsMember.NobilityRank client.NobilityInformation.Rank;
                                                }
                                                
client.Entity.GuildID = (ushort)guild.ID;
                                                
client.Entity.GuildRank = (ushort)Game.Enums.GuildMemberRank.GuildLeader;
                                                
guild.Leader client.AsMember;
                                                
client.Guild guild;
                                                
guild.Create(npcRequest.Input);
                                                
guild.Name npcRequest.Input;
                                                
guild.MemberCount++;
                                                
guild.SendGuild(client);
                                                
guild.SendName(client);
                                                
client.Screen.FullWipe();
                                                
client.Screen.Reload(null);
                                                new 
Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration").Set("GuildID"Game.ConquerStructures.Society.Guild.GuildCounter.Now).Where("Server"Constants.ServerName).Execute();
                                            }
                                            else
                                            {
                                                
client.Send(new Message("This Guild name cannot be used."System.Drawing.Color.RedMessage.System));
                                            }
                                        }
                                    }
                                    break;
                                }
                            case 
3:
                                {
                                    
Data data = new Data(true);
                                    
data.UID client.Entity.UID;
                                    
data.ID Data.OpenCustom;
                                    
data.dwParam Data.CustomCommands.Advertise;
                                    
client.Send(data);
                                    break;
                                }
                            case 
4:
                                {
                                    
dialog.Text("Which~guild~would~you~like~to~inquire~about?");
                                    
dialog.Input("I wnat to inquire about  -"516);
                                    
dialog.Option("Let~me~think~it~over."255);
                                    
dialog.Send();
                                    break;
                                }
                            case 
5:
                                {
                                    if (!
Guild.CheckNameExist(npcRequest.Input))
                                    {
                                        
dialog.Text("This~guild~does~not~exist.");
                                        
dialog.Option("Thanks."255);
                                        
dialog.Send();
                                    }
                                    else
                                    {
                                        var 
selectedguild Kernel.Guilds.Values.Where(=> p.Name == npcRequest.Input).FirstOrDefault();
                                        if (
selectedguild != null)
                                        {
                                            
dialog.Text(" Guild~Name: " selectedguild.Name ";");
                                            
dialog.Text(" Guild~Leader: " selectedguild.LeaderName ";");
                                            
dialog.Text(" Guild~Members: " selectedguild.MemberCount ";");
                                            
dialog.Text(" Guild~Fund: " selectedguild.SilverFund ";");
                                            
dialog.Option("I see."255);
                                            
dialog.Send();
                                        }
                                    }
                                    break;
                                }
                            case 
6:
                                {
                                    
dialog.Text("Disbanding your guild is a decision not to be taken lightly. When armies fall apart, a period of chaos ensues?");
                                    
dialog.Option("I~decide~to~disband.."7);
                                    
dialog.Option("I~changed~my~mind."255);
                                    
dialog.Send();
                                    break;
                                }
                            case 
7:
                                {
                                    if (
client.Guild != null && client.AsMember.Rank == Game.Enums.GuildMemberRank.GuildLeader)
                                    {
                                        
client.Guild.Disband();
                                    }
                                    else if (
client.Guild == null)
                                    {
                                        
client.MessageBox("You haven't joined any guild now."nullnull0);
                                    }
                                    break;
                                }
                            case 
8:
                                {
                                    
dialog.Text("Only the Guild Leader can change the Guild`s name, which will take effect after the server maintenance on the second day. It`ll cost you 1075 CPs. Deal?");
                                    
dialog.Option("Deal!"9);
                                    
dialog.Option("Wait~a~minute."255);
                                    break;
                                }
                            case 
9:
                                {
                                    
dialog.Text("Please enter a new name for your Guild.");
                                    
dialog.Input("Name:"1016);
                                    
dialog.Option("Cancel."255);
                                    break;
                                }
                            case 
10:
                                {
                                    if (
client.Guild == null || client.AsMember.Rank != Enums.GuildMemberRank.GuildLeader)
                                    {
                                        
dialog.Text("Sorry, you`re not the Guild Leader.");
                                        
dialog.Option("My~bad."255);
                                    }
                                    else if (
client.Entity.ConquerPoints 1075)
                                    {
                                        
dialog.Text("Sorry, you don`t have enough CPs.");
                                        
dialog.Option("My~bad."255);
                                    }
                                    else if (
client.Guild != null && client.AsMember.Rank == Enums.GuildMemberRank.GuildLeader && client.Entity.ConquerPoints >= 1075)
                                    {
                                        if (
npcRequest.Input != "" && npcRequest.Input.Length && npcRequest.Input.Length 16)
                                        {
                                            if (!
Guild.CheckNameExist(npcRequest.Input))
                                            {
                                                
Database.GuildTable.ChangeName(clientnpcRequest.Input);
                                                
client.Guild.Name npcRequest.Input;
                                                
client.Guild.SendGuild(client);
                                                
client.Guild.SendName(client);
                                                
client.Entity.ConquerPoints -= 1075;
                                                
client.Screen.FullWipe();
                                                
client.Screen.Reload(null);
                                            }
                                            else
                                            {
                                                
dialog.Text("There is a Guild Already with this Name i'm sorry.");
                                                
dialog.Option("Choose another Name"9);
                                                
dialog.Option("Ok Sorry."255);
                                                
dialog.Send();
                                            }
                                        }
                                        else
                                        {
                                            
dialog.Text("There is a Guild bad Name i'm sorry.");
                                            
dialog.Option("Try Again"9);
                                            
dialog.Option("Ok Sorry."255);
                                            
dialog.Send();
                                        }
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion 

وهقول تاني الناس الي هيجيها ايرور في Player هتبدله بي Entity او العكس

كان معكم Mohamed ElSaher اراكم في موضوع اخر


abdelrahman 2020-04-13 04:37 PM

رد: حل مشكلة الجيلدات الناس مش بينه فيها
 
ممكن الفيس بتاعك او رقم الواتس


الساعة الآن 08:00 PM

مرحبا بكم في منتدي اكواد لتطوير الالعاب