أهلا وسهلا بك زائرنا الكريم في فوكس تهيس، لكي تتمكن من المشاركة ومشاهدة جميع أقسام المنتدى وكافة الميزات ، يجب عليك إنشاء حساب جديد بالتسجيل بالضغط هنا أو تسجيل الدخول اضغط هنا إذا كنت عضواً .







حل مشاكل Source ElmistRo V2

اللهم صلي وسلم وبارك على سيدنا محمد صلى الله عليه وسلم الحمد لله العزيز الغفار يبسط يده بالنهار ليتوب مسيء الليل، وي ..



08-02-2019 08:26 مساء
ابو ريتاج
menu_open عضوية موثقة
::.. الإدارة ..::

rating
الأوسمة:1
الإدارة
الإدارة
معلومات الكاتب ▼
تاريخ الإنضمام : 20-12-2018
رقم العضوية : 1
المشاركات : 862
الدولة : مصر
الجنس : ذكر
تاريخ الميلاد : 29-10-1984
الدعوات : 52
يتابعهم : 0
يتابعونه : 183
قوة السمعة : 4270
موقعي : زيارة موقعي
عدد الإجابات: 295
 

p_31740jnm1

اللهم صلي وسلم وبارك على سيدنا محمد صلى الله عليه وسلم heart 
الحمد لله العزيز الغفار يبسط يده بالنهار ليتوب مسيء الليل،
ويبسط يده بالليل ليتوب مسيء النهار، 
أحمده على جزيل فضله وإنعامه وعظيم كرمه وإحسانه والصلاة والسلام ,
على نبيه المصطفى ورسوله المجتبى محمد صلى,
الله عليه وآله وسلم تسليماً كثيراً إلى يوم الدين الحمد لله العزيز الغفار ,
يبسط يده بالنهار ليتوب مسيء الليل ، ويبسط يده بالليل ليتوب مسيء النهار ،
أحمده على جزيل فضله وإنعامه وعظيم كرمه وإحسانه والصلاة والسلام على,
نبيه المصطفى ورسوله المجتبى محمد صلى الله عليه وآله وسلم تسليماً كثيراً إلى يوم الدين ,

ازيكو يا شباب عملين ايه thumbs_up

انهرده معناء موضوع حل مشاكل سورس المسترو

p_359vtudd1

اي مشكله هتلاقيه اولاه وهيتم حله انشاء الله
@Bondq
وايا اخويه وحبيبي
mr.gm53

مستينكو

ملحوزه…… الناس الي مش عرف وبتفتح بي اوتو باتش

متفتحش من الاوتو باتش علشان الابجريد بتاعو باظ مع الشخصيه الجديده حط الباتش في فلدر
Env_DX8
وافتح من الايكون الي فيه thumbs_up
حل مشكلة الباتل بور لم تعمل اميل بنت والبور بيعله

افتح كلاس

 

 
1
DataHolder.cs

 

غيرو كلو بي ده

 

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
[PHP] using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ElmistRo.Datab*ase
{
    using MYSQLCOMMAND = MySql.Data.MySqlClient.MySqlCommand;
    using MYSQLREADER = MySql.Data.MySqlClient.MySqlDataReader;
    using MYSQLCONNECTION = MySql.Data.MySqlClient.MySqlConnection;
 
    public static class DataHolder
    {
        public static string ConnectionString;
        private static string MySqlUsername, MySqlPassword, MySqlDatab*ase, MySqlHost;
        public static void CreateConnection(string user, string password, string datab*ase, string host)
        {
            MySqlUsername = user;
            MySqlHost = host;
            MySqlPassword = password;
            MySqlDatab*ase = datab*ase;
            ConnectionString = "Server=" + MySqlHost + ";Datab*ase='" + MySqlDatab*ase + "';Username='" + MySqlUsername + "';Password='" + MySqlPassword + "';Pooling=true; Max Pool Size = 900000; Min Pool Size = 5";
        }
        public static void CreateConnection()
        {
            var list = System.Configuration.ConfigurationManager.ConnectionStrings;
            ConnectionString =
                System.Configuration.ConfigurationManager.ConnectionStrings[list.Count - 1].ConnectionString;
        }
 
        public static MYSQLCONNECTION MySqlConnection
        {
            get
            {
                MYSQLCONNECTION conn = new MYSQLCONNECTION();
                conn.ConnectionString = ConnectionString;
                return conn;
            }
        }
 
        private static SafeDictionary<byte, string> ArcherStats = new SafeDictionary<byte, string>(130);
        private static SafeDictionary<byte, string> NinjaStats = new SafeDictionary<byte, string>(130);
        private static SafeDictionary<byte, string> WarriorStats = new SafeDictionary<byte, string>(130);
        private static SafeDictionary<byte, string> TrojanStats = new SafeDictionary<byte, string>(130);
        private static SafeDictionary<byte, string> TaoistStats = new SafeDictionary<byte, string>(130);
        private static SafeDictionary<byte, string> MonkStats = new SafeDictionary<byte, string>(130);
        private static SafeDictionary<byte, string> BruceLee = new SafeDictionary<byte, string>(130);
        private static SafeDictionary<byte, string> WindwalkerStats = new SafeDictionary<byte, string>(130);
 
        public static bool IsTrojan(byte Job)
        {
            return Job >= 10 && Job <= 15;
        }
 
        public static bool IsWarrior(byte Job)
        {
            return Job >= 20 && Job <= 25;
        }
 
        public static bool IsArcher(byte Job)
        {
            return Job >= 40 && Job <= 45;
        }
 
        public static bool IsNinja(byte Job)
        {
            return Job >= 50 && Job <= 55;
        }
 
        public static bool IsMonk(byte Job)
        {
            return Job >= 60 && Job <= 65;
        }
 
        public static bool IsPirate(byte Job)
        {
            return Job >= 70 && Job <= 75;
        }
 
        public static bool IsWather(byte Job)
        {
            return Job >= 100 && Job <= 135;
        }
 
        public static bool IsFire(byte Job)
        {
            return Job >= 140 && Job <= 145;
        }
 
        public static bool IsTaoist(byte Job)
        {
            return Job >= 100 && Job <= 145;
        }
 
        public static bool IsWindwalker(byte Job)
        {
            return Job >= 160 && Job <= 165;
        }
 
        public static void ReadStats()
        {
            string Path = Constants.DataHolderPath + "Stats.ini";
            IniFile IniFile = new IniFile(Path);
 
            for (byte lvl = 1; lvl < 122; lvl++)
            {
                string job = "Archer[" + lvl + "]";
                string Data = IniFile.ReadString("Stats", job);
                try
                {
                    ArcherStats.Add(lvl, Data);
 
                    job = "Ninja[" + lvl + "]";
                    Data = IniFile.ReadString("Stats", job);
                    NinjaStats.Add(lvl, Data);
 
                    job = "Warrior[" + lvl + "]";
                    Data = IniFile.ReadString("Stats", job);
                    WarriorStats.Add(lvl, Data);
 
                    job = "Trojan[" + lvl + "]";
                    Data = IniFile.ReadString("Stats", job);
                    TrojanStats.Add(lvl, Data);
 
                    job = "Taoist[" + lvl + "]";
                    Data = IniFile.ReadString("Stats", job);
                    TaoistStats.Add(lvl, Data);
 
                    job = "Monk[" + lvl + "]";
                    Data = IniFile.ReadString("Stats", job);
                    MonkStats.Add(lvl, Data);
 
                    job = "BruceLee[" + lvl + "]";
                    Data = IniFile.ReadString("Stats", job);
                    BruceLee.Add(lvl, Data);
 
                    job = "WindWalker[" + lvl + "]";
                    Data = IniFile.ReadString("Stats", job);
                    WindwalkerStats.Add(lvl, Data);
 
                }
 
                catch
                {
                    Console.WriteLine(Data);
                }
            }
        }
 
        public static ushort[] FindReviveSpot(ushort mapID)
        {
            IniFile IniFile = new IniFile(Constants.RevivePoints);
            string value = IniFile.ReadString(mapID.ToString(), "Value");
            if (value == String.Empty)
                return new ushort[] { 1002, 300, 278 };
 
            if (value.Contains("L"))
                value = IniFile.ReadString(value.Remove(0, 7), "Value");
 
            string[] split = value.Split(' ');
            List<ushort> values = new List<ushort>();
            try
            {
                values.Add(ushort.Parse(split[0]));
                values.Add(ushort.Parse(split[1]));
                values.Add(ushort.Parse(split[2]));
            }
            catch
            {
                Console.WriteLine("Revive spot with error: " + value);
                return new ushort[] { 1002, 300, 278 };
            }
            return values.ToArray();
        }
 
      /*  public static ushort[] FindReviveSpotSpecial(ushort mapID)
        {
            IniFile IniFile = new IniFile(Constants.RevivePoints);
            string value = IniFile.ReadString(mapID.ToString(), "Value");
            if (value == String.Empty)
                return new ushort[] { 1002, 300, 278 };
 
            if (value.Contains("L"))
                value = IniFile.ReadString(value.Remove(0, 7), "Value");
 
            string[] split = value.Split(' ');
            List<ushort> values = new List<ushort>();
            try
            {
                values.Add(ushort.Parse(split[0]));
                values.Add(ushort.Parse(split[1]));
                values.Add(ushort.Parse(split[2]));
            }
            catch
            {
                Console.WriteLine("Revive spot with error: " + value);
                return new ushort[] { 1002, 300, 278 };
            }
            return values.ToArray();
        }*/
 
        public static void GetStats(byte inClass, byte inLevel, Client.GameClient client)
        {
            string Class = "";
            inClass = (byte)((inClass / 10) * 10);
            switch (inClass)
            {
                case 10:
                    Class = "Trojan";
                    break;
                case 20:
                    Class = "Warrior";
                    break;
                case 40:
                    Class = "Archer";
                    break;
                case 50:
                    Class = "Ninja";
                    break;
                case 60:
                    Class = "Monk";
                    break;
                case 70:
                    Class = "Pirate";
                    break;
                case 80:
                    Class = "BruceLee";
                    break;
                case 160:
                    Class = "Windwalker";
                    break;
                default:
                    Class = "Taoist";
                    break;
            }
            inLevel = Math.Max((byte)10, inLevel);
            inLevel = Math.Min((byte)120, inLevel);
            string[] Data = null;
            if (Class == "Trojan")
                Data = TrojanStats[inLevel].Split(',');
            else if (Class == "Warrior")
                Data = WarriorStats[inLevel].Split(',');
            else if (Class == "Archer")
                Data = ArcherStats[inLevel].Split(',');
            else if (Class == "Ninja")
                Data = NinjaStats[inLevel].Split(',');
            else if (Class == "Taoist")
                Data = TaoistStats[inLevel].Split(',');
            else if (Class == "Monk")
                Data = MonkStats[inLevel].Split(',');
            else if (Class == "Pirate")
                Data = MonkStats[inLevel].Split(',');
            else if (Class == "BruceLee")
                Data = BruceLee[inLevel].Split(',');
            else if (Class == "Windwalker")
                Data = WindwalkerStats[inLevel].Split(',');
            client.Entity.Strength = Convert.ToUInt16(Data[0]);
            client.Entity.Vitality = Convert.ToUInt16(Data[1]);
            client.Entity.Agility = Convert.ToUInt16(Data[2]);
            client.Entity.Spirit = Convert.ToUInt16(Data[3]);
        }
 
        public static ulong LevelExperience(byte Level)
        {
            return levelExperience[Math.Min(Math.Max(Level - 1, 0), 135)];
        }
 
        public static uint ProficiencyLevelExperience(byte Level)
        {
            return proficiencyLevelExperience[Math.Min(Level, (byte)20)];
        }
 
        private static uint[] proficiencyLevelExperience = new uint[21]
        {
            0, 1200, 68000, 250000, 640000, 1600000, 4000000, 10000000, 22000000, 40000000, 90000000, 95000000, 142500000,
            213750000, 320625000, 480937500, 721406250, 1082109375, 1623164063, 2100000000, 0
        };
 
        private static ulong[] levelExperience = new ulong[139]
        {
            120, 180, 240, 360, 600, 960, 1200, 2400, 3600, 8400, 12000, 14400, 18000, 21600, 22646, 32203, 37433, 47556,
            56609, 68772, 70515, 75936, 97733, 114836, 120853, 123981, 126720, 145878, 173436, 197646, 202451, 212160,
            244190, 285823, 305986, 312864, 324480, 366168, 433959, 460590, 506738, 569994, 728527, 850829, 916479,
            935118, 940800, 1076593, 1272780, 1357994, 1384861, 1478400, 1632438, 1903104, 2066042, 2104924, 1921085,
            2417202, 2853462, 3054574, 3111217, 3225600, 3810962, 4437896, 4880605, 4970962, 5107200, 5652518, 6579162,
            6877991, 7100700, 7157657, 9106860, 10596398, 11220549, 11409192, 11424000, 12882952, 15172807, 15896990,
            16163799, 16800000, 19230280, 22365208, 23819312, 24219528, 24864000, 27200077, 32033165, 33723801, 34291317,
            34944000, 39463523, 45878567, 48924236, 49729220, 51072000, 55808379, 64870058, 68391931, 69537026, 76422968,
            96950789, 112676755, 120090482, 121798280, 127680000, 137446887, 193715970, 408832150, 454674685, 461125885,
            469189885, 477253885, 480479485, 485317885, 493381885, 580580046, 717424987, 282274058, 338728870, 406474644,
            487769572, 585323487, 702388184, 842865821, 1011438985, 1073741823, 1073741823, 8589134588, 25767403764,
            77302211292, 231906633876, 347859950814, 447859950814, 547859950814, 1174030000000, 1761040000000,
            2641550000000
        };
 
        public static uint StonePlusPoints(byte plus)
        {
            return StonePoints[Math.Min((int)plus, 8)];
        }
 
        public static uint ComposePlusPoints(byte plus)
        {
            return ComposePoints[Math.Min(plus, (byte)12)];
        }
 
        public static byte SteedSpeed(byte plus)
        {
            return _SteedSpeed[Math.Min(plus, (byte)12)];
        }
 
        public static ushort TalismanPlusPoints(byte plus)
        {
            return TalismanExtra[Math.Min(plus, (byte)9)];
        }
 
        public static ushort PurifyStabilizationPoints(byte plevel)
        {
            return purifyStabilizationPoints[Math.Min(plevel - 1, (byte)5)];
        }
 
        private static ushort[] purifyStabilizationPoints = new ushort[6] { 10, 30, 60, 100, 150, 200 };
 
        public static ushort RefineryStabilizationPoints(byte elevel)
        {
            return refineryStabilizationPoints[Math.Min(elevel - 1, (byte)4)];
        }
 
        private static ushort[] refineryStabilizationPoints = new ushort[5] { 10, 30, 70, 150, 270 };
 
        public static ushort[] Disguises = new ushort[] { 111, 224, 117, 152, 113, 833, 116, 245, 223, 112, 222, 114, 221, 115, 220 };
 
        private static ushort[] StonePoints = new ushort[9] { 1, 10, 40, 120, 360, 1080, 3240, 9720, 29160 };
 
        private static ushort[] ComposePoints = new ushort[13] { 20, 20, 80, 240, 720, 2160, 6480, 19440, 58320, 2700, 5500, 9000, 0 };
 
        private static byte[] _SteedSpeed = new byte[] { 0, 5, 10, 15, 20, 30, 40, 50, 65, 85, 90, 95, 100 };
        private static ushort[] TalismanExtra = new ushort[10] { 0, 6, 30, 70, 240, 740, 2240, 6670, 20000, 60000 };
    }
}

 

بعدين افتح كلاس

 

 
1
EntityTable.cs

 

ابحث عن

 

 
1
client.Entity = new Game.Entity(Game.EntityFlag.Player, false);

 

دور علي ده

 

 
1
if (eC.Class == 2 || eC.Class == 3)

 

غير بي ده

 

 

 
1
2
3
4
5
if (eC.Class == 2 || eC.Class == 3)
            {
                client.Entity.Class = 10;
                DataHolder.GetStats(10, 1, client);
            }  <code>

 

حل مشكلة ابيك ال Warrior

افتح كلاس

 

 
1
PacketHandler.cs

 

ابحث عن

 

 
1
public static Positions GetPositionFromID(UInt32 itemid)

 

انزل لحد

 

 
1
2
else if (iType == 1050 || iType == 900 || iType == 619 || iType == 624)
                return Positions.Left;

 

غير بي

 

 
1
2
else if (iType == 1050 || iType == 900 || iType == 619)
                return Positions.Left;

 

بعديه ابحث عن

 

 
1
  static void DoLogin(GameClient client)

 

انزل لحد

 

 
1
  #region Gear

 

غيروه بي ده

 

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
region Gear
                            client.Inventory.AddandWear(132013, 0, client);//Dress
                        if (client.Entity.Class >= 10 && client.Entity.Class <= 15)
                            client.Inventory.AddandWear(410301, 0, client);//Blade
                        if (client.Entity.Class >= 20 && client.Entity.Class <= 25)
                            client.Inventory.AddandWear(561301, 0, client);//Wand
                        if (client.Entity.Class >= 40 && client.Entity.Class <= 45)
                            client.Inventory.AddandWear(500301, 0, client);//Bow
                        if (client.Entity.Class >= 50 && client.Entity.Class <= 55)
                            client.Inventory.AddandWear(601301, 0, client);//Katana
                        if (client.Entity.Class >= 60 && client.Entity.Class <= 65)
                            client.Inventory.AddandWear(610301, 0, client);//Bead
                        if (client.Entity.Class >= 70 && client.Entity.Class <= 75)
                            client.Inventory.AddandWear(611301, 0, client);//Rapier
                        if (client.Entity.Class >= 80 && client.Entity.Class <= 85)
                            client.Inventory.AddandWear(617301, 0, client);//DragonWarriorWeapon
                        if (client.Entity.Class >= 100 && client.Entity.Class <= 145)
                            client.Inventory.AddandWear(421301, 0, client);//BackSword
                        /*if (client.Entity.Class >= 160 && client.Entity.Class <= 165)
                            client.Inventory.AddandWear(626301, 0, client);//PrideFan
                            client.Inventory.AddandWear(626301, 0, client);//PrideFan
                            client.Inventory.AddandWear(170005, 0, client);//
                            client.Inventory.AddandWear(101313, 0, client);//*/
                        #endregion

 

حل مشكلة الاسكله Warrior

ابحث عن

 

 
1
#region WaveOfBlood

 

غيره بده

 

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#region WaveofBlood
                                case 12690:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
                                            if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance + 1)
                                            {
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (sector.IsInFan(attacked.X, attacked.Y))
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                attack.Effect = Attack.AttackEffects.None;
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
                                                                damage = (uint)(damage * 0.9);
                                                                suse.Effect = attack.Effect;
                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                suse.AddTarget(attacked.UID, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;
                                                        if (sector.IsInFan(attackedsob.X, attackedsob.Y))
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                attack.Effect = Attack.AttackEffects.None;
                                                                uint damage = Calculate.Melee(attacker, attackedsob, ref attack);
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                suse.AddTarget(attackedsob.UID, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            
                                            {
                                                //  attacker.WaveofBloodXp -= 1;
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
 
                                #endregion

 

الناس الي عوز تسهل اللفلفه thumbs_up

افتح كلاس

 

 
1
  GameClient.cs

 

ابحث عن

 

 
1
public void IncreaseExperience(ulong experience, bool addMultiple)

 

بدلو بده

 

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
public void IncreaseExperience(ulong experience, bool addMultiple)
        {
            if (Entity.ContainsFlag(Update.Flags.Cursed))
                return;
            if (Entity.Dead) return;
            byte level = Entity.Level;
            ulong _experience = Entity.Experience;
            ulong prExperienece = experience;
            if (addMultiple)
            {
                if (Entity.VIPLevel > 0)
                    experience *= Entity.VIPLevel;
                experience *= Constants.ExtraExperienceRate;
                if (Entity.HeavenBlessing > 0)
                    experience += (uint)(experience * 20 / 100);
                if (Entity.Reborn >= 2)
                    experience /= 3;
 
                if (Guild != null)
                {
                    if (Guild.Level > 0)
                    {
                        experience += (ushort)(experience * Guild.Level / 100);
                    }
                }
                prExperienece = experience + (ulong)(experience * ((float)Entity.BattlePower / 100));
 
                _experience += prExperienece;
            }
            else
                _experience += experience;
 
            if (Entity.Level < 140 && Entity.InAutoHunt == true)
            {
                Entity.AutoHuntEXP += experience;
                return;
            }
            else if (Entity.Level == 140 && Entity.InAutoHunt == true)
            {
                Entity.AutoHuntEXP = 0;
                return;
            }
            if (Entity.Level < 140)
            {
                while (_experience >= Datab*ase.DataHolder.LevelExperience(level) && level < 140)
                {
                    _experience -= Datab*ase.DataHolder.LevelExperience(level);
                    level++;
                    if (Entity.Reborn == 1)
                    {
                        if (level >= 130 && Entity.FirstRebornLevel > 130 && level < Entity.FirstRebornLevel)
                            level = Entity.FirstRebornLevel;
                    }
                    else if (Entity.Reborn == 2)
                    {
                        if (level >= 130 && Entity.SecondRebornLevel > 130 && level < Entity.SecondRebornLevel)
                            level = Entity.SecondRebornLevel;
                    }
                    if (Entity.Class >= 10 && Entity.Class <= 15)
                        if (!Spells.ContainsKey(1110))
                            AddSpell(new Network.GamePackets.Spell(true) { ID = 1110 });
                    if (Entity.Class >= 20 && Entity.Class <= 25)
                        if (!Spells.ContainsKey(1020))
                            AddSpell(new Network.GamePackets.Spell(true) { ID = 1020 });
                    if (Entity.Class >= 40 && Entity.Class <= 45)
                        if (!Spells.ContainsKey(8002))
                            AddSpell(new Network.GamePackets.Spell(true) { ID = 8002 });
                    if (Entity.Class >= 50 && Entity.Class <= 55)
                        if (!Spells.ContainsKey(6011))
                            AddSpell(new Network.GamePackets.Spell(true) { ID = 6011 });
                    if (Entity.Class >= 60 && Entity.Class <= 65)
                        if (!Spells.ContainsKey(10490))
                            AddSpell(new Network.GamePackets.Spell(true) { ID = 10490 });
                    if (Mentor != null)
                    {
                        if (Mentor.IsOnline)
                        {
                            uint exExp = (uint)(level * 2);
                            Mentor.Client.PrizeExperience += exExp;
                            AsApprentice = Mentor.Client.Apprentices[Entity.UID];
                            if (AsApprentice != null)
                            {
                                AsApprentice.Actual_Experience += exExp;
                                AsApprentice.Total_Experience += exExp;
                            }
                            if (Mentor.Client.PrizeExperience > 50 * 606)
                                Mentor.Client.PrizeExperience = 50 * 606;
                        }
                    }
                    if (level == 70)
                    {
                        if (ArenaStatistic == null || ArenaStatistic.EntityID == 0)
                        {
                            ArenaStatistic = new ElmistRo.Network.GamePackets.ArenaStatistic(true);
                            ArenaStatistic.EntityID = Entity.UID;
                            ArenaStatistic.Name = Entity.Name;
                            ArenaStatistic.Level = Entity.Level;
                            ArenaStatistic.Class = Entity.Class;
                            ArenaStatistic.Model = Entity.Mesh;
                            ArenaPoints = Datab*ase.ArenaTable.ArenaPointFill(Entity.Level);
                            ArenaStatistic.LastArenaPointFill = DateTime.Now;
                            Datab*ase.ArenaTable.InsertArenaStatistic(this);
                            ArenaStatistic.Status = Network.GamePackets.ArenaStatistic.NotSignedUp;
                            Game.Arena.ArenaStatistics.Add(Entity.UID, ArenaStatistic);
                        }
                    }
                    if (Entity.Reborn == 0)
                    {
                        if (level <= 120)
                        {
                            Datab*ase.DataHolder.GetStats(Entity.Class, level, this);
                            CalculateStatBonus();
                            CalculateHPBonus();
                            GemAlgorithm();
                        }
                        else
                            Entity.Atributes += 3;
                    }
                    else
                    {
                        Entity.Atributes += 3;
                    }
                }
                if (Entity.Level != level)
                {
                    if (Team != null)
                    {
                        if (Team.LowestLevelsUID == Entity.UID)
                        {
                            Team.LowestLevel = 0;
                            Team.LowestLevelsUID = 0;
                            Team.SearchForLowest();
                        }
                    }
                    Entity.Level = level;
                    Entity.Hitpoints = Entity.MaxHitpoints;
                    Entity.Mana = Entity.MaxMana;
                    if (Entity.Level > 130)
                        Datab*ase.EntityTable.UpdateLevel(Entity.Owner);
                    if (Entity.Reborn == 2)
                        Network.PacketHandler.ReincarnationHash(Entity.Owner);
                }
                if (Entity.Experience != _experience)
                    Entity.Experience = _experience;
            }
            #region Trojan
            if (Entity.Class >= 10 && Entity.Class <= 15)
            {
                if (Entity.Level >= 40)
                {
                    if (!Spells.ContainsKey(1110)) { AddSpell(LearnableSpell(1110)); }
                    if (!Spells.ContainsKey(1015)) { AddSpell(LearnableSpell(1015)); }
                    if (!Spells.ContainsKey(1115)) { AddSpell(LearnableSpell(1115)); }
                    if (!Spells.ContainsKey(1270)) { AddSpell(LearnableSpell(1270)); }
                    if (!Spells.ContainsKey(1190)) { AddSpell(LearnableSpell(1190)); }
                }
            }
            #endregion
            #region Warrior
            if (Entity.Class >= 20 && Entity.Class <= 25)
            {
                if (Entity.Level >= 40)
                {
                    if (!Spells.ContainsKey(11200)) { AddSpell(LearnableSpell(11200)); }
                    if (!Spells.ContainsKey(10470)) { AddSpell(LearnableSpell(10470)); }
                    if (!Spells.ContainsKey(1025)) { AddSpell(LearnableSpell(1025)); }
                    if (!Spells.ContainsKey(1020)) { AddSpell(LearnableSpell(1020)); }
                    if (!Spells.ContainsKey(1015)) { AddSpell(LearnableSpell(1015)); }
                    if (!Spells.ContainsKey(12670)) { AddSpell(LearnableSpell(12670)); }
                    if (!Spells.ContainsKey(12700)) { AddSpell(LearnableSpell(12700)); }
                }
                if (Entity.Level >= 61)
                {
                    if (!Spells.ContainsKey(1051)) { AddSpell(LearnableSpell(1051)); }
                    if (!Spells.ContainsKey(12680)) { AddSpell(LearnableSpell(12680)); }
                }
                if (Entity.Level >= 70)
                {
                    if (!Spells.ContainsKey(11160)) { AddSpell(LearnableSpell(11160)); }
                    if (!Spells.ContainsKey(12660)) { AddSpell(LearnableSpell(12660)); }
                    if (!Spells.ContainsKey(12690)) { AddSpell(LearnableSpell(12690)); }
                }
            }
            #endregion
            #region Archer
            if (Entity.Class >= 40 && Entity.Class <= 45)
            {
                if (Entity.Level >= 1)
                {
                    if (!Spells.ContainsKey(8002)) { AddSpell(LearnableSpell(8002)); }
                }
                if (Entity.Level >= 23)
                {
                    if (!Spells.ContainsKey(8001)) { AddSpell(LearnableSpell(8001)); }
                }
                if (Entity.Level >= 40)
                {
                    if (!Spells.ContainsKey(8000)) { AddSpell(LearnableSpell(8000)); }
                }
                if (Entity.Level >= 70)
                {
                    if (!Spells.ContainsKey(8003)) { AddSpell(LearnableSpell(8003));