[Release] Some needed stuff for Coemu

09/21/2009 22:38 samehvan#91
Quote:
Originally Posted by $HaDoW View Post
samehvan so can you help me with my prob ?
sure

add this at Nano.cs (definitions section)

Code:
public static Dictionary<short, Struct.ItemInfo> Lotto=new Dictionary<short,Struct.ItemInfo>();
09/21/2009 23:05 Illustria#92
Quote:
Originally Posted by 12tails View Post
here is:

Code:
        private static bool ReqLvl(int NewItemId, ClientSocket CSocket)
        {
            if (Nano.Items.ContainsKey(NewItemId))
            {
                Struct.ItemData Item = Nano.Items[NewItemId];
                if (Item.Level <= CSocket.Client.Level) return true;
            }
            return false;
        }
& for item issue, see this thread :

[Only registered and activated users can see links. Click Here To Register...]
Man if i werent straight, id kiss you hahaha jk. Thanks i appreciate the help on both matters i was staring at the source with the error going... ummmm... :'(
09/21/2009 23:17 12tails#93
: D

if u need any help you can PM me always you wan't ^^

i'll be here for some time.... so if you need : D
09/22/2009 00:59 pedro93#94
#region FatalStrike
Dictionary<int, int> Targets = new Dictionary<int, int>();
if (CSocket.Client.XPSkillList)
{
CSocket.Client.FatalStrike = true;
CSocket.Client.XPSkillList = false;
CSocket.Client.FatalStrikeActivated = DateTime.Now;
CSocket.Client.FatalStrikeTime = 30;
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CS ocket.Client.ID, Spell.ID, Spell.Level, Targets, X, Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
if (DateTime.Now > CSocket.Client.FatalStrikeActivated.AddSeconds(CSo cket.Client.FatalStrikeTime) && CSocket.Client.FatalStrike == true)
{
int DamagePercent = CSocket.Client.MinAttack * 5 & CSocket.Client.MaxAttack * 5;
foreach (Monster Monster in Nano.Monsters.Values)
{
if (Monster.Map == (int)CSocket.Client.Map)
{
if (Monster.CurrentHP > 0)
{
if (Calculation.InRange(Monster.X, Monster.Y, X, Y, 4))
{
int MinusHP = Monster.CurrentHP * DamagePercent;
Targets.Add(Monster.UID, MinusHP);
Calculation.doMonster(Monster, MinusHP, 2, CSocket);
ConquerPacket.ToLocal(ConquerPacket.Status(Monster .UID, 2, 2, Struct.StatusTypes.StatusEffect), Monster.X, Monster.Y, Monster.Map, 0, 0);
}
}
}
}
foreach (Monster Guard in Nano.Guards.Values)
{
if (Guard.Map == (int)CSocket.Client.Map)
{
if (CSocket.Client.PKMode == Struct.PkType.PK || CSocket.Client.PKMode == Struct.PkType.Team)
{
if (Calculation.InRange(Guard.X, Guard.Y, X, Y, 4))
{
int MinusHP = Guard.CurrentHP * DamagePercent;
Targets.Add(Guard.UID, MinusHP);
Calculation.doMonster(Guard, MinusHP, 2, CSocket);
ConquerPacket.ToLocal(ConquerPacket.Status(Guard.U ID, 2, 2, Struct.StatusTypes.StatusEffect), Guard.X, Guard.Y, Guard.Map, 0, 0);
}
}
}
}
foreach (SummonGuard Guard in Nano.SummonedGuards.Values)
{
if (Guard.Map == (int)CSocket.Client.Map)
{
if (CSocket.Client.Guard != null)
{
if (Guard.UID != CSocket.Client.Guard.UID)
{
if (CSocket.Client.PKMode == Struct.PkType.PK || CSocket.Client.PKMode == Struct.PkType.Team)
{
if (Calculation.InRange(Guard.X, Guard.Y, X, Y, 4))
{
int MinusHP = Guard.CurrentHP * DamagePercent;
Targets.Add(Guard.UID, MinusHP);
Calculation.doPlayer(CSocket, Guard, MinusHP, 2);
ConquerPacket.ToLocal(ConquerPacket.Status(Guard.U ID, 2, 2, Struct.StatusTypes.StatusEffect), Guard.X, Guard.Y, Guard.Map, 0, 0);
}
}
}
}
else
{
if (CSocket.Client.PKMode == Struct.PkType.PK || CSocket.Client.PKMode == Struct.PkType.Team)
{
if (Calculation.InRange(Guard.X, Guard.Y, X, Y, 4))
{
int MinusHP = Guard.CurrentHP * DamagePercent;
Guard.Poisoned = true;
Targets.Add(Guard.UID, MinusHP);
Calculation.doPlayer(CSocket, Guard, MinusHP, 2);
ConquerPacket.ToLocal(ConquerPacket.Status(Guard.U ID, 2, 2, Struct.StatusTypes.StatusEffect), Guard.X, Guard.Y, Guard.Map, 0, 0);
}
}
}
}
}
}
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CS ocket.Client.ID, Spell.ID, Spell.Level, Targets, X, Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
}
break;
#endregion
09/22/2009 02:38 gme4l1f3#95
Btw nice job samehvan on the codes and stuff.
Lets say that i just downloaded the coemuv2 nano source and put all your codes in the right spot but... it came out with lots of errors like:
The name "DeleteItem" and "Lotto" did not exist in current context.
Should i use the non-nano version or can you fix it for me? :D
09/22/2009 02:38 Illustria#96
Quote:
Originally Posted by 12tails View Post
: D

if u need any help you can PM me always you wan't ^^

i'll be here for some time.... so if you need : D
Haha thanks i appreciate it, i try not to bug the forums too much as you can tell by my posts and join date lol. Right now im more trying to get a feel for c# coding a bit more, maybe make a simple code of my own sometime.

Right now the only issue i seem to be having is the npc implementing, trying to get a better feel for the database's variables and such. The npc adding seems to be giving me the hardest time oddly enough, first i tried to add the npc i got the wrong name and sprite appearing in the game, then i got the right one to appear but no luck making it talk or anything.

You happen to know a good tutorial post for npc implementing or anything? Maybe something that states what each variable in the database is for, like the MapID 1010 for which map theyre on and x and y coords for location.
Actually any tutorials would help, id rather learn how to do this rather than how to duplicate it.
09/22/2009 03:44 Illustria#97
Quote:
Originally Posted by gme4l1f3 View Post
Btw nice job samehvan on the codes and stuff.
Lets say that i just downloaded the coemuv2 nano source and put all your codes in the right spot but... it came out with lots of errors like:
The name "DeleteItem" and "Lotto" did not exist in current context.
Should i use the non-nano version or can you fix it for me? :D
I had a few similar problems with the delete item. Any chance you can post a screenshot of where the code is getting the error i might be able to remember how i fixed it, If you read earlier posts there was a solution posted about the undefined lotto problem. I havent grabbed the lottery code due to my own hatred for conquer lotto ^_^. But the code seemed to help, i dont anyone posted whether or not the solution helped though.
09/22/2009 03:44 samehvan#98
Quote:
Originally Posted by gme4l1f3 View Post
Btw nice job samehvan on the codes and stuff.
Lets say that i just downloaded the coemuv2 nano source and put all your codes in the right spot but... it came out with lots of errors like:
The name "DeleteItem" and "Lotto" did not exist in current context.
Should i use the non-nano version or can you fix it for me? :D
my codes are for Coemu including Nano.cs , so if u had any errors then u will just need to add more functions or definitions which u will absolutely find them here
09/22/2009 06:17 gme4l1f3#99
At the third post what am i suppose to do for the talisman thing? I don't know what table and stuff is lol...
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
There all the errors please help T_T
09/22/2009 08:15 samehvan#100
first of all u need to fix the openssl reference problem to be able to run the server then we will c about the code u wanna add
09/22/2009 08:19 Illustria#101
Oh man your on the code im too scared to even try to implement... lol DisCity, id love to intigrate that into my mini project thing its a damn masterfully done code, but i couldnt just because theyre was so much i couldnt understand from it. Ill have to add it when im skilled enough to fix those problems.

Samehvn - I have to say im extremely impressed, so many pages, so many errors, so many people who shouldnt be doing this kinda implementing and you helped every single one of us. Honestly thanks, but i have to wonder when your patience with us is going to wear thin ^_^. I hope when you said your still starting out in C# we have many many years to come of your help and kindness towards our stupidity ^_^, hopefully it wont take us years to learn though haha.

Honestly man im looking forward to learning from your code, most of it i can read and understand what each function does. Im still in the early early stages of learning why things are structured, how things are defined, basically why the code is the way it is lol
09/23/2009 01:52 Illustria#102
Crap i hit a snag The name 'ConquerPacket' does not exist in current context for installing dis events, im also not sure how to define or even where to define WeeklyPkWar, PkTournament, and ClassPkWar, i tried defining as integers at the start of the nano.cs database but it didnt work. I cant quite figure out where im going wrong and sadly need help.
09/23/2009 03:02 12tails#103
Add this at Nano.cs in game server:

Code:
        public static int TopNinja = 0;
        public static int TopMonth = 0;
        public static int TopWeek = 0;
        public static int TopArcher = 0;
        public static int TopTrojan = 0;
        public static int TopWarrior = 0;
        public static int TopWater = 0;
        public static int TopFire = 0;
        public static int TopGuild = 0;
Add this at Database/Database.cs in game server:

Code:
        public static void LoadTops()
        {
            lock (DatabaseConnection.Connection)
            {
                MySqlCommand Cmd = new MySqlCommand("SELECT * FROM `others`", DatabaseConnection.Connection);

                MySqlDataReader DR = Cmd.ExecuteReader();
                if (DR.Read())
                {
                    Nano.TopNinja = Convert.ToInt32(DR["topninja"]);
                    Nano.TopMonth = Convert.ToInt32(DR["topmonth"]);
                    Nano.TopWeek = Convert.ToInt32(DR["topweek"]);
                    Nano.TopArcher = Convert.ToInt32(DR["toparcher"]);
                    Nano.TopFire = Convert.ToInt32(DR["topfire"]);
                    Nano.TopWater = Convert.ToInt32(DR["topwater"]);
                    Nano.TopTrojan = Convert.ToInt32(DR["toptroj"]);
                    Nano.TopWarrior = Convert.ToInt32(DR["topwarr"]);
                    Nano.TopGuild = Convert.ToInt32(DR["topguild"]);
                }
                DR.Close();
            }
        }
at Packets/Status.cs:

Code:
                if (id == Nano.TopNinja)
                    Status += 0x80000000000;
                if (id == Nano.TopTrojan)
                    Status += 0x8000000000;
                if (id == Nano.TopWarrior)
                    Status += 0x4000000000;
                if (id == Nano.TopArcher)
                    Status += 0x10000000000;
                if (id == Nano.TopWater)
                    Status += 0x20000000000;
                if (id == Nano.TopFire)
                    Status += 0x40000000000;
                if (id == Nano.TopWeek)
                    Status += 0x2000000000;
                if (id == Nano.TopMonth)
                    Status += 0x1000000000;
There you will see TopPk Top warrior... topninja and every of them... the value will be 0... just change the 0 for the ID of the charater... but be aware... don't put the same id at all... other else the character will be buged!

also

add this at Nano.cs StartVoid:

Code:
            Database.Database.LoadTops();
Download the Sql file in the end of the post...
and for PhpMyAdmin... go into SQL function at the left side of the screen!( latter i send you how to do it.... )

@samehvan
Please put this at your first post in this thread....
09/23/2009 04:52 Illustria#104
Unfortunately i use phpmyadmin so i dunno how to run sql files, as well i get an error
Quote:
Error 1 'CoEmu_v2_GameServer.Database.DatabaseConnection' does not contain a definition for 'Connection' D:\Users\Isharu\Desktop\CoEmu v2\CoEmu v2 GameServer\Database\Database.cs 269 38 CoEmu v2 GameServer
09/23/2009 05:27 Illustria#105
Crap i tried to remove the parts bugging my code now when i log onto the server i immediately disconnect