عرض مشاركة واحدة
قديم 2020-03-20, 01:45 PM
المشاركة 4
bosha1
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكله فى الان بى سى دا ي جدعان عاوز حلها ضرور
غير الانبي سي دا بي الي معاك وجرب هتلاقيه اشتغل انشاء الله وهتحدد لاسيبي من هنا برضو

كود:
#region chi npc
                
case 4444:
                    {
                        
dialog.avatar(218);
                        switch (
npcrequest.optionid)
                        {
                            case 
0:
                                {
                                    if (
client.chipowers.count == 0)
                                    {
                                        
dialog.text("sorry but you don't have chi yet.");
                                        
dialog.option("i'll think about it!"255);
                                        
dialog.send();
                                        return;
                                    }
                                    
dialog.text("hello i'm chi seller.");
                                    for (
int i 0client.chipowers.counti++)
                                    {
                                        var 
stage client.chipowers[i];
                                        
dialog.option(((game.enums.chipowertype)(1)).tostring(), (byte)(1));
                                    }
                                    
dialog.option("i'll think about it!"255);
                                    
dialog.send();
                                    break;
                                }
                            default:
                                {
                                    
int mstage npcrequest.optionid;
                                    if (
mstage >= && mstage <= 4)
                                    {
                                        
client.entity.selectedstage mstage;
                                        
dialog.text("you choose " + ((game.enums.chipowertype)mstage).tostring() + " stage. Please select attribute you want to change ");
                                        for (
int i 04i++)
                                        {
                                            
dialog.option("attribute [" + (byte)(1) + "]", (byte)(4));
                                        }
                                        
dialog.option("back"0);
                                        
dialog.option("i'll think about it!"255);
                                        
dialog.send();
                                        break;
                                    }
                                    else if (
mstage >= && mstage <= 8)
                                    {
                                        try
                                        {
                                            
client.entity.selectedattribute mstage 4;
                                            var 
mychiattribute = new list<enums.chiattribute>();
                                            var 
powers client.chipowers[(int)client.entity.selectedstage 1];
                                            for (
int i 0powers.attributes.lengthi++)
                                            {
                                                if (
client.entity.conquerpoints >= 1)
                                                {
                                                    
client.entity.conquerpoints -= 1;//

                                                    
var attribute powers.attributes[i];
                                                    
mychiattribute.add(attribute.type);
                                                }
                                                else
                                                {
                                                    
dialog.text("anta yasta msh ma3ak 1 cps ");
                                                }
                                            }
                                            
dialog.text("you choose attribute [" client.entity.selectedattribute "] please select attributetype you want to change ");
                                            for (
int i 0< (int)enums.chiattribute.magicdamagedecreasei++)
                                            {
                                                var 
type = ((enums.chiattribute)(1));
                                                if (!
mychiattribute.contains(type))
                                                    
dialog.option(type.tostring(), (byte)(((1) * 10)));
                                            }
                                            
dialog.option("back", (byte)client.entity.selectedstage);
                                            
dialog.option("i'll think about it!"255);
                                            
dialog.send();
                                        }
                                        catch
                                        {
                                        }
                                        break;
                                    }
                                    else
                                    {

                                        var 
typex mstage 10;

                                        var 
mode client.entity.selectedstage;
                                        var 
pos client.entity.selectedattribute 1;
                                        var 
powers client.chipowers[mode 1];
                                        var 
attributes powers.attributes;
                                        foreach (var 
attr in attributes)
                                        {

                                            if (
attr.type == (enums.chiattribute)typex)
                                            {
                                                
client.messagebox("sorry you can't muliplay stats"nullnull);
                                                return;
                                            }
                                        }
                                        
attributes[pos].type = (enums.chiattribute)typex;
                                        
attributes[pos].value = (ushort)game.enums.chimaxvalues(attributes[pos].type);
                                        
powers.calculatepoints();
                                        
database.chitable.sort((enums.chipowertype)mode);
                                        
powers.power = (enums.chipowertype)mode;
                                        
client.send(new chipowers(true).query(client));
                                        
#region update ranking
                                        
database.chitable.chidata[] array = null;
                                        switch ((
enums.chipowertype)mode)
                                        {
                                            case 
game.enums.chipowertype.dragon:
                                                Array = 
database.chitable.dragon;
                                                break;

                                            case 
game.enums.chipowertype.phoenix:
                                                Array = 
database.chitable.phoenix;
                                                break;

                                            case 
game.enums.chipowertype.tiger:
                                                Array = 
database.chitable.tiger;
                                                break;

                                            case 
game.enums.chipowertype.turtle:
                                                Array = 
database.chitable.turtle;
                                                break;
                                        }
                                        foreach (var 
chidata in array)
                                        {
                                            if (
kernel.gamepool.containskey(chidata.uid))
                                            {
                                                var 
pclient kernel.gamepool[chidata.uid];
                                                if (
pclient == null) continue;
                                                if (
pclient.chidata == null) continue;
                                                
// make it public instead of private 
                                                
packethandler.sendrankingquery(new genericranking(true) { mode genericranking.querycount }, pclientgenericranking.chi + (uint)modepclient.chidata.selectrank((enums.chipowertype)mode), pclient.chidata.selectpoints((enums.chipowertype)mode));
                                                if (
pclient.entity.uid == client.entity.uid || pclient.chidata.selectrank((enums.chipowertype)mode) < 50)
                                                    
pclient.loaditemstats();
                                            }
                                        }
                                        
#endregion
                                        
database.chitable.save(client);
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion 
دا الان بى سى دلوقتى بقا يعملو ببلاش

متحلتش المشكله