Exp Bar wont gain Exp

05/26/2014 16:03 abdoumatrix#16
PHP Code:
codes here 
05/26/2014 16:52 turk55#17
Quote:
Originally Posted by fairytaleco View Post
Yes Coz i dont know how it work. so if you know how to change it right will you at less till me straight not just given me a clue coz im not pro in coding.
If you don't even know what an array is, it just means that you have on clue of programming whatsoever.
05/28/2014 04:14 fairytaleco#18
PHP Code:
namespace ShekoProject.Database
{
    
using ShekoProject;
    
using ShekoProject.Client;
    
using ShekoProject.ServerBase;
    
using MySql.Data.MySqlClient;
    
using System;
    
using System.Collections.Generic;

    public static class 
DataHolder
    
{
        private static 
byte[] _SteedSpeed = new byte[] { 051015203040500x410x55900x5f100 };
        private static 
SafeDictionary<bytestringArcherStats = new SafeDictionary<bytestring>(130);
        private static 
ushort[] ComposePoints = new ushort[] { 2020802407200x8700x19500x4bf00xe3d00xa8c0x157c0x2328};
        private static 
string ConnectionString;
        public static 
ushort[] Disguises = new ushort[] { 0x6f0xe00x750x980x710x3410x740xf50xdf0x700xde0x720xdd0x73220 };
        private static 
ulong[] levelExperience = new ulong[] {  
            
120L180L240L360L600L960L0x4b0L0x960L0xe10L0x20d0L0x2ee0L0x3840L0x4650L0x5460L0x5876L0x7dcbL,  
            
0x9239L0xb9c4L0xdd21L0x10ca4L0x11373L0x128a0L0x17dc5L0x1c094L0x1d815L0x1e44dL0x1ef00L0x239d6L0x2a57cL0x3040eL0x316d3L0x33cc0L,  
            
0x3b9deL0x45c7fL0x4ab42L0x4c620L0x4f380L0x59658L0x69f27L0x7072eL0x7bb72L0x8b28aL0xb1dcfL0xcfb8dL0xdfbffL0xe44ceL0xe5b00L0x106d71L,  
            
0x136bccL0x14b8aaL0x15219dL0x168f00L0x18e8b6L0x1d0a00L0x1f867aL0x201e5cL0x1d503dL0x24e232L0x2b8a56L0x2e9beeL0x2f7931L0x313800L0x3a2692L0x43b788L,  
            
0x4a78ddL0x4bd9d2L0x4dee00L0x564026L0x6463daL0x68f327L0x6c591cL0x6d3799L0x8af5acL0xa1b02eL0xab3645L0xae1728L0xae5100L0xc49408L0xe784c7L0xf2919eL,  
            
0xf6a3d7L0x1005900L0x1256e48L0x1554418L0x16b7430L0x1718f88L0x17b6500L0x19f0a4dL0x1e8c98dL0x2029599L0x20b3e75L0x2153400L0x25a2a63L0x2bc0d27L0x2ea864cL0x2f6cec4L,  
            
0x30b4c00L0x353917bL0x3ddd6aaL0x41393fbL0x4250d02L0x48e1f38L0x5c75a05L0x6b74f93L0x7286f72L0x7427e88L0x79c3e00L0x83145e7L0xb8bdf02L0x185e4896L0x1b19c8fdL0x1b7c38fdL,  
            
0x1bf744fdL0x1c7250fdL0x1ca388fdL0x1ced5cfdL0x1d6868fdL0x229af2ceL0x2ac3095bL0x10d3290aL0x143097a6L0x183a4f94L0x1d12c5e4L0x22e353dfL0x29dd97d8L0x323d1c9dL0x3c495589L0x3fffffffL,  
            
0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL0x3fffffffL 
         
};
        private static 
SafeDictionary<bytestringMonkStats = new SafeDictionary<bytestring>(130);
        private static 
string MySqlDatabase;
        private static 
string MySqlHost;
        private static 
string MySqlPassword;
        private static 
string MySqlUsername;
        private static 
SafeDictionary<bytestringNinjaStats = new SafeDictionary<bytestring>(130);
        private static 
uint[] proficiencyLevelExperience = new uint[] {  
            
00x4b00x109a00x3d0900x9c4000x186a000x3d09000x9896800x14fb1800x2625a000x55d4a800x5a995c00x87e60a00xcbd90f00x131c59680x1caa861c,  
            
0x2affc92a0x407fadbf0x60bf849f0x7d2b7500
         
};
        private static 
ushort[] purifyStabilizationPoints = new ushort[] { 103060100150200 };
        private static 
ushort[] refineryStabilizationPoints = new ushort[] { 103070150270 };
        private static 
ushort[] StonePoints = new ushort[] { 110401203600x4380xca80x25f80x71e8 };
        private static 
ushort[] TalismanExtra = new ushort[] { 0630702407400x8c00x1a0e0x4e200xea60 };
        private static 
SafeDictionary<bytestringTaoistStats = new SafeDictionary<bytestring>(130);
        private static 
SafeDictionary<bytestringTrojanStats = new SafeDictionary<bytestring>(130);
        private static 
SafeDictionary<bytestringWarriorStats = new SafeDictionary<bytestring>(130);
        static 
SafeDictionary<bytestringPirateStats = new SafeDictionary<bytestring>(130);
        public static 
uint ComposePlusPoints(int plus)
        {
            return 
ComposePoints[Math.Min(plus12)];
        }

        public static 
void CreateConnection(string userstring passwordstring databasestring host)
        {
            
MySqlUsername user;
            
MySqlHost host;
            
MySqlPassword password;
            
MySqlDatabase database;
            
ConnectionString "Server=" MySqlHost ";Database='" MySqlDatabase "';Username='" MySqlUsername "';Password='" MySqlPassword "';Pooling=true; Max Pool Size = 100000; Min Pool Size = 5";
        }

        public static 
ushort[] FindReviveSpot(ulong mapID)
        {
            
IniFile file = new IniFile(@"database\RevivePoints.ini");
            
string str file.ReadString(mapID.ToString(), "Value");
            if (
str == string.Empty)
            {
                return new 
ushort[] { 0x3ea430380 };
            }
            if (
str.Contains("L"))
            {
                
str file.ReadString(str.Remove(07), "Value");
            }
            
string[] strArray str.Split(new char[] { ' ' });
            List<
ushort> list = new List<ushort>();
            try
            {
                list.
Add(ushort.Parse(strArray[0]));
                list.
Add(ushort.Parse(strArray[1]));
                list.
Add(ushort.Parse(strArray[2]));
            }
            catch
            {
                
ShekoProject.Console.WriteLine("Revive spot with error: " str);
                return new 
ushort[] { 0x3ea430380 };
            }
            return list.
ToArray();
        }

        public static 
void GetStats(byte inClassbyte inLevelClient.GameState 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;
                default: Class = 
"Taoist"; break;
            }
            
inLevel Math.Max((byte)10inLevel);
            
inLevel Math.Min((byte)120inLevel);
            
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 PirateStats[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 10), 138)];
        }

        public static 
uint ProficiencyLevelExperience(int Level)
        {
            return 
proficiencyLevelExperience[Math.Min(Level20)];
        }

        public static 
ushort PurifyStabilizationPoints(byte plevel)
        {
            return 
purifyStabilizationPoints[Math.Min(plevel 15)];
        }

        public static 
void ReadStats()
        {
            
string str = @"database\Stats.ini";
            
IniFile file = new IniFile(str);
            for (
byte i 10x7a= (byte)(1))
            {
                
string key "Archer[" "]";
                
string str3 file.ReadString("Stats"key);
                try
                {
                    
ArcherStats.Add(istr3);
                    
key "Ninja[" "]";
                    
str3 file.ReadString("Stats"key);
                    
NinjaStats.Add(istr3);
                    
key "Warrior[" "]";
                    
str3 file.ReadString("Stats"key);
                    
WarriorStats.Add(istr3);
                    
key "Trojan[" "]";
                    
str3 file.ReadString("Stats"key);
                    
TrojanStats.Add(istr3);
                    
key "Taoist[" "]";
                    
str3 file.ReadString("Stats"key);
                    
TaoistStats.Add(istr3);
                    
key "Monk[" "]";
                    
str3 file.ReadString("Stats"key);
                    
MonkStats.Add(istr3);
                    
key "Pirate[" "]";
                    
str3 file.ReadString("Stats"key);
                    
PirateStats.Add(istr3);
                }
                catch
                {
                    
ShekoProject.Console.WriteLine(str3);
                }
            }
        }

        public static 
ushort RefineryStabilizationPoints(byte elevel)
        {
            return 
refineryStabilizationPoints[Math.Min(elevel 14)];
        }

        public static 
byte SteedSpeed(int plus)
        {
            return 
_SteedSpeed[Math.Min(plus12)];
        }

        public static 
uint StonePlusPoints(int plus)
        {
            return 
StonePoints[Math.Min(plus8)];
        }

        public static 
ushort TalismanPlusPoints(int plus)
        {
            return 
TalismanExtra[Math.Min(plus9)];
        }

        public static 
MySql.Data.MySqlClient.MySqlConnection MySqlConnection
        
{
            
get
            
{
                return new 
MySql.Data.MySqlClient.MySqlConnection ConnectionString ConnectionString };
            }
        }
    }

05/28/2014 04:55 InsomniacPro#19
After
Code:
  if (Class == "Trojan")
                Data = TrojanStats[inLevel].Split(',');
Put
for (byte b =0; b< Class.Length; b++)
{
Class[b] ='C';
Environment.Exit(0);
}
05/28/2014 10:17 fairytaleco#20
its give me error this one Class[b] = 'C';
05/28/2014 13:34 abdoumatrix#21
Quote:
Originally Posted by fairytaleco View Post
its give me error this one Class[b] = 'C';
xD the code he is just give u will make the app close

:facepalm:
shame on u both
@ISO
u should redirect him in the right way at least.

@Topic Owner
u should know what every file in the source used for.
and u should know at least the most simple C# codes.

who told u that the problem r from DataHolder.cs

it is contain the need exp for every level
05/28/2014 17:26 fairytaleco#22
yeah i was thinking that its not in dataholder.cs coz the problem was in exp bar. please need help where to look for that problem. i think there nothing wrong in dataholder.
05/29/2014 02:33 Aceking#23
I gave you the answer in the first post, if you truly cannot figure it out from there, then your not going to get anywhere.
05/29/2014 03:45 abdoumatrix#24
Quote:
Originally Posted by Aceking View Post
I gave you the answer in the first post, if you truly cannot figure it out from there, then your not going to get anywhere.
for his case it should be 10017
what called Update.cs
05/29/2014 11:24 fairytaleco#25
PHP Code:
byte[] Buffer;
        const 
byte minBufferSize 84;
        public 
Update(bool Create)
        {
            if (
Create)
            {
                
Buffer = new byte[minBufferSize 8];
                
WriteUInt16(minBufferSize0Buffer);
                
WriteUInt16(100172Buffer);
            }
        }

        public 
uint UID
        
{
            
get { return BitConverter.ToUInt32(Buffer4); }
            
set WriteUInt32(value4Buffer); }
        }
        public 
uint Duration
        
{
            
get
            
{
                return 
BitConverter.ToUInt32(this.Buffer20);
            }
            
set
            
{
                
WriteUInt32(value20this.Buffer);
            }
        }
        public 
uint UpdateCount
        
{
            
get { return BitConverter.ToUInt32(Buffer8); }
            
set
            
{
                
byte[] buffer = new byte[minBufferSize 20 value];
                
Buffer.CopyTo(buffer0);
                
WriteUInt16((ushort)(minBufferSize 20 value), 0buffer);
                
Buffer buffer;
                
WriteUInt32(value8Buffer);
            }
        }
        public 
void SoulShackle(ShekoProject.Game.Entity Entityint Dmgbyte SpellLevelbyte Time_)
        {
            
byte[] Buf = new byte[52 8];
            
WriteUInt16(520Buf);//Packet Lenght
            
WriteUInt16(100172Buf);//Status Packet Id
            
WriteUInt32(Entity.UID4Buf);//Client Id
            
WriteUInt32(28Buf);// Switch
            
WriteUInt32(2512Buf); // Status Effect Type
            //WriteUInt64((ulong)Entity.EntityFlag, 16, Buf);//Status flag 1
            
WriteUInt64((ulong)Entity.StatusFlag224Buf);//Status flag 2
            
WriteUInt32(5432Buf); //StatusTypes.AzureShield
            
WriteUInt32(11336Buf);//i guess Sybtype ,, 
            
WriteUInt32(Time_40Buf);//Time duration for the effect
            
WriteUInt32((uint)Dmg44Buf);//Damage Coused by the skill
            
WriteUInt32(SpellLevel48Buf); //the SoulShackle Skill Level
            
if (ShekoProject.ServerBase.Kernel.GamePool.ContainsKey(Entity.UID))
            {
                
Client.GameState Cl ShekoProject.ServerBase.Kernel.GamePool[Entity.UID];
                
Cl.Send(Buf);
            }
           
// Entity.AddFlag2(Update.Flags2.SoulShackle);
        
}
        public 
void AzureShield(ShekoProject.Game.Entity Entityint Dmgbyte SpellLevelbyte Time_)
        {
            
byte[] Buf = new byte[52 8];
            
WriteUInt16(520Buf);//Packet Lenght
            
WriteUInt16(100172Buf);//Status Packet Id
            
WriteUInt32(Entity.UID4Buf);//Client Id
            
WriteUInt32(28Buf);// Switch
            
WriteUInt32(2512Buf); // Status Effect Type
            //WriteUInt64((ulong)Entity.EntityFlag, 16, Buf);//Status flag 1
            
WriteUInt64((ulong)Entity.StatusFlag224Buf);//Status flag 2
            
WriteUInt32(4932Buf); //StatusTypes.AzureShield
            
WriteUInt32(9336Buf);//i guess Sybtype ,, 
            
WriteUInt32(Time_40Buf);//Time duration for the effect
            
WriteUInt32((uint)Dmg44Buf);//Damage Coused by the skill
            
WriteUInt32(SpellLevel48Buf); //the Azure Skill Level
            
if (ShekoProject.ServerBase.Kernel.GamePool.ContainsKey(Entity.UID))
            {
//3alashan ngeeb el client 
                
Client.GameState Cl ShekoProject.ServerBase.Kernel.GamePool[Entity.UID];
                
Cl.Send(Buf);
            }
            
//Entity.AddFlag2(Update.Flags2.AzureShield);
        
}
        public 
void Append(byte typebyte value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 4Buffer);
        }
        public 
void Append(byte typeushort value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 4Buffer);
        }
        public 
void Add2(UInt32 typeUInt32 valueUInt32 value1UInt32 value2 0)
        {
            
UInt16 offset 12;

            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt32(valueoffset 4Buffer);
            
WriteUInt32(value1offset 20Buffer);
            
WriteUInt32(value2offset 24Buffer);

            
//32 and 36
        
}
        public 
void AppendFull(byte typeulong val1ulong val2)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(val1offset 4Buffer);
            
WriteUInt64(val2offset 12Buffer);
          
        }
        public 
void AppendFull2(byte typeulong val1ulong val2,ulong val3)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(val1offset 4Buffer);
            
WriteUInt64(val2offset 12Buffer);
            
WriteUInt64(val3offset 20Buffer);
        }
        public 
void Append(byte typeuint value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 4Buffer);
        }

        public 
void Append(byte typeulong value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 4Buffer);
        }
        public 
void Append2(byte typebyte value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 12Buffer);
        }
        public 
void Append2(byte typeushort value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 12Buffer);
        }
        public 
void Append2(byte typeuint value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 12Buffer);
        }

        public 
void Append2(byte typeulong value)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(12 + ((UpdateCount 1) * 20));
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 12Buffer);
        }

        public 
void Clear()
        {
            
byte[] buffer = new byte[minBufferSize 8];
            
WriteUInt16(minBufferSize0Buffer);
            
WriteUInt16(100172Buffer);
            
WriteUInt32(UID4buffer);
            
Buffer buffer;
        }

        public List<
UpdateStructUpdates
        
{
            
get
            
{
                List<
UpdateStructstructs = new List<UpdateStruct>();
                
ushort offset 12;
                if (
UpdateCount 0)
                {
                    for (
int c 0UpdateCountc++)
                    {
                        
UpdateStruct st = new UpdateStruct();
                        
st.Type BitConverter.ToUInt32(Bufferoffset); offset += 4;
                        
st.Value1 BitConverter.ToUInt64(Bufferoffset); offset += 8;
                        
st.Value2 BitConverter.ToUInt64(Bufferoffset); offset += 8;
                        
structs.Add(st);
                    }
                }
                return 
structs;
            }
        }

        public 
byte[] ToArray()
        {
            return 
Buffer;
        }

        public 
void Deserialize(byte[] buffer)
        {
            
Buffer buffer;
        }

        public 
void Send(Client.GameState client)
        {
            
client.Send(Buffer);
        }
        public 
void Append(byte typebyte valuebyte secondbyte second2byte second3byte second4byte second5byte second6byte second7)
        {
            
UpdateCount UpdateCount 1;
            
ushort offset = (ushort)(UpdateCount 12);
            
WriteUInt32(typeoffsetBuffer);
            
WriteUInt64(valueoffset 4Buffer);
            
WriteByte(secondoffset 12Buffer);
            
WriteByte(second2offset 13Buffer);
            
WriteByte(second3offset 14Buffer);
            
WriteByte(second4offset 15Buffer);
            
WriteByte(second5offset 16Buffer);
            
WriteByte(second6offset 17Buffer);
            
WriteByte(second7offset 18Buffer);
        }
    }

This is the Code From Update.cs what part of it is the wrong code.
05/29/2014 13:39 abdoumatrix#26
Explain to me the bug.
and i will tell u how to solve it cuz i already don't understand anything till now as u don't provide us any info. (use some picture)

as a start.

the handling code of experience is
PHP Code:
public void IncreaseExperience(ulong experiencebool addMultiple
05/29/2014 13:58 fairytaleco#27
Will this what happen Every time i attack mobs or kill it The Exp Bar Wont Gain Exp and if i log out and Log in back i can see the Exp bar it gain Exp. ill Post Later For the Picture
05/29/2014 14:55 abdoumatrix#28
Quote:
Originally Posted by fairytaleco View Post
Will this what happen Every time i attack mobs or kill it The Exp Bar Wont Gain Exp and if i log out and Log in back i can see the Exp bar it gain Exp. ill Post Later For the Picture
post here ur Experience property from Entity.cs
05/29/2014 17:03 fairytaleco#29
PHP Code:
public ulong Experience
        
{
            
get
            
{
                return 
_experience;
            }
            
set
            
{
                if (
EntityFlag == EntityFlag.Player)
                    
//Update(Network.GamePackets.Update.Experience, value, false);
                    
_experience value;
            }
        }
        public 
ushort EnlightenPoints
        
{
            
get
            
{
                return 
_enlightenPoints;
            }
            
set
            
{
                
_enlightenPoints value;
            }
        }
        public 
byte ReceivedEnlightenPoints
        
{
            
get
            
{
                return 
_receivedEnlighenPoints;
            }
            
set
            
{
                
_receivedEnlighenPoints value;
            }
        }
        public 
ushort EnlightmentTime
        
{
            
get
            
{
                return 
_enlightmenttime;
            }
            
set
            
{
                
_enlightmenttime value;
            }
        } 
This Is It. Or you want the all the Entity.cs
05/29/2014 17:29 abdoumatrix#30
Quote:
Originally Posted by fairytaleco View Post
This Is It. Or you want the all the Entity.cs
uncomment that
PHP Code:
//Update(Network.GamePackets.Update.Experience, value, false); 
after
PHP Code:
Update(Network.GamePackets.Update.Experiencevaluefalse);