Official 5165 FAQ/Question thread

06/16/2010 15:52 flex30#1531
Quote:
Originally Posted by xStylo View Post
in myshop.cs or charactershop.cs or vendor.cs or something. not sure.
but is under features folder I think.
There is personalShop.cs but nothing in it related to sockets or something:

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoSX.Game;

namespace CoSX.Features
{
    public class PersonalShops
    {
        public struct ItemValue
        {
            public byte MoneyType;
            public uint Value;
        }
        public class Shop
        {
            public Character Owner;
            public string Hawk = "";
            public Hashtable Items;
            public NPC NPCInfo;
            public uint UID;

            public Shop(Character C, uint Time)
            {
                Owner = C;
                Items = new Hashtable();

                NPCInfo = new NPC();
                NPCInfo.EntityID = (uint)Program.Rnd.Next(102000, 106000);
                while (World.H_NPCs.Contains(NPCInfo.EntityID) || World.H_PShops.Contains(NPCInfo.EntityID) || World.H_Chars.Contains(NPCInfo.EntityID))
                    NPCInfo.EntityID = (uint)Program.Rnd.Next(102000, 106000);
                NPCInfo.Type = 400;
                NPCInfo.Flags = 14;
                NPCInfo.Loc = C.Loc;
                NPCInfo.Loc.X++;
                NPCInfo.Direction = 6;
                NPCInfo.Avatar = 0;

                UID = NPCInfo.EntityID;

                ArrayList ePackets = new ArrayList();

                C.MyClient.AddSend(Packets.SpawnNamedNPC2(NPCInfo, Name));
                C.MyClient.AddSend(Packets.GeneralData(C.EntityID, UID, NPCInfo.Loc.X, NPCInfo.Loc.Y, 111, 6));
                C.MyClient.EndSend();

                World.H_PShops.Add(UID, this);
                
                World.Spawn(this);
            }
            public void Close()
            {
                World.H_PShops.Remove(UID);
                World.Action(Owner, Packets.GeneralData(UID, 0, 0, 0, 135).Get);
                Owner.MyShop = null;
            }
            public bool AddItem(uint UID, uint Value, byte MoneyType)
            {
                Item I = Owner.FindInvItem(UID);
                if (!I.FreeItem && I.UID == UID && !Items.Contains(UID))
                {
                    Items.Add(UID, new ItemValue() { Value = Value, MoneyType = MoneyType });
                    return true;
                }
                return false;
            }
            public void Buy(uint UID, Character C)
            {
                if (Owner != C && Items.Contains(UID) && C.Inventory.Count < 40)
                {
                    Item I = Owner.FindInvItem(UID);
                    if (I.ID != 0)
                    {
                        ItemValue Val = (ItemValue)Items[UID];
                        uint Costs = Val.Value;

                        if (Val.MoneyType == 1 && C.Silvers >= Costs)
                        {
                            C.Silvers -= Costs;
                            Owner.Silvers += Costs;
                            Owner.MyClient.LocalMessage(2005, C.Name + " has bought " + I.DBInfo.Name + " for " + Costs + " from you.");
                            C.AddItem(I);                            
                            RemoveItem(UID, Packets.ItemPacket(UID, this.UID, 23).Get);
                            Owner.RemoveItem(I);
                        }
                        else if (Val.MoneyType == 3 && C.CPs >= Costs)
                        {
                            C.CPs -= Costs;
                            Owner.CPs += Costs;
                            Owner.MyClient.LocalMessage(2005, C.Name + " has bought " + I.DBInfo.Name + " for " + Costs + " from you.");
                            C.AddItem(I);
                            RemoveItem(UID, Packets.ItemPacket(UID, this.UID, 23).Get);
                            Owner.RemoveItem(I);
                        }
                    }
                }
            }
            public void RemoveItem(uint UID, byte[] Data)
            {
                if (Items.Contains(UID))
                    Items.Remove(UID);
                foreach (Character C in World.H_Chars.Values)
                    if (C.Loc.Map == Owner.Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, Owner.Loc.X, Owner.Loc.Y, 18))
                        C.MyClient.AddSend(Data);
            }
            public void SendItems(Main.GameClient C)
            {
                foreach (DictionaryEntry DE in Items)
                {
                    Item I = Owner.FindInvItem((uint)DE.Key);
                    if (I.ID != 0)
                        C.AddSend(Packets.AddStallItem(I, (ItemValue)DE.Value, UID));
                }
            }
            public string Name
            {
                get
                {
                    return Owner.Name;
                }
            }
        }
    }
}
06/16/2010 16:32 ryuchetval#1532
@flex30

it's not from the personalshop.cs it's from packets.cs look for

Code:
        public static COPacket AddStallItem(Game.Item I, Features.PersonalShops.ItemValue Val, uint StallID)
06/17/2010 00:19 ConquerFreakish#1533
Okay I think i have the config set up whenever i open the NewestCoserver it tells me cannot find database?:(
06/17/2010 00:28 .Summer#1534
did you put database in c:/
?
06/17/2010 01:08 ConquerFreakish#1535
Okay i run the newestcoserver and it says loading dmaps then it crashes
06/17/2010 02:27 ConquerFreakish#1536
Quote:
Originally Posted by Axe4Hire View Post
woot i got it working! i was using the wrong hamachi thing and thx so much for all the help!
What you mean by wrong hamachi thing cause i am having same problem D:
06/17/2010 11:16 Adziunia#1537
hamchi ip this is only thing thats needed if u dont have external ip then u r using ip from hamachi try to run the server in visual C# i think its coz there r errors with love stone just check it and debbug in visual C#
06/17/2010 20:38 daniel7851109#1538
Why can't GM's pk, trade, or drop items?
A.It is a system made by Tanel to keep the GM's from abusing their powers.

is there a way to remove it ?
06/17/2010 21:43 .Summer#1539
Quote:
Originally Posted by daniel7851109 View Post
Why can't GM's pk, trade, or drop items?
A.It is a system made by Tanel to keep the GM's from abusing their powers.

is there a way to remove it ?
######He fixed it ###########
06/18/2010 16:45 ryuchetval#1540
i've seen that the skills deal a lot more damage than the normal attacks:
ex: rage: 20k normal club hit 6k ...difference 14k...o.O ok 2 big
ex: scatter: 14k normal hit 12k (scatter was supposed to hit less than normal right?o.O)

now i used /skilladder and saw that rage had range dmg type and scatter same so i tried to change that to meele...then magic....but nothing changes...

so i've gone to Mob.cs and looked inside this
Code:
        public uint TakeAttack(Character Attacker,ref uint Damage, AttackType AT, bool IsSkill)
the only attacks that are influenced by the mob's dodge are the range type skills...now if they were already ranged from the start why is the damage so big?
any help with this?
Code:
        public uint TakeAttack(Character Attacker,ref uint Damage, AttackType AT, bool IsSkill)
        {
            if (AT != AttackType.Magic && Attacker.BuffOf(Features.SkillsClass.ExtraEffect.Superman).Eff == Features.SkillsClass.ExtraEffect.Superman)
                Damage *= 10;
            if (!IsSkill && Attacker.BuffOf(Features.SkillsClass.ExtraEffect.FatalStrike).Eff == Features.SkillsClass.ExtraEffect.FatalStrike)
            {
                AT = AttackType.FatalStrike;
                Damage *= 5;
            }
            double e = 1;
            if (Level + 4 < Attacker.Level)
                e = 0.1;
            if (Level + 4 >= Attacker.Level)
                e = 1;
            if (Level >= Attacker.Level)
                e = 1.1;
            if (Level - 4 > Attacker.Level)
                e = 1.3;

            if (Type == MobBehaveour.HuntBlueNames || Type == MobBehaveour.HuntMobsAndBlue)
            {
                Attacker.BlueName = true;
                if (Attacker.BlueNameLasts < 60)
                    Attacker.BlueNameLasts = 15;
            }
            if (AT != AttackType.Magic && !IsSkill)
            {
                short _Agi = (short)(Attacker.Agi + Attacker.EqStats.ExtraDex);

                Buff Accuracy = Attacker.BuffOf(Features.SkillsClass.ExtraEffect.Accuracy);
                if (Accuracy.Eff == Features.SkillsClass.ExtraEffect.Accuracy)
                    _Agi = (short)(_Agi * Accuracy.Value);
                Buff SM = Attacker.BuffOf(Features.SkillsClass.ExtraEffect.Superman);
                if (SM.StEff == StatusEffectEn.SuperMan)
                    _Agi *= 2;
                double MissValue = Rnd.Next(15 + _Agi, _Agi + Dodge + 15);
                if (MissValue <= Dodge && AT != AttackType.FatalStrike)
                    Damage = 0;
                else
                {
                    if (LevDifDmg) Damage = (uint)(Damage * MyMath.LevelDifference(Attacker.Level, Level));                    
                }
            }
            if (!IsSkill && Damage != 0)
            {
                if (AT == AttackType.Melee || AT == AttackType.FatalStrike)
                {
                    if (Defense >= Damage)
                        Damage = 1;
                    else
                        Damage -= Defense;

                    Damage += Attacker.EqStats.MeleeDamageIncrease;
                }
                else if (AT == AttackType.Ranged)
                {
                    Damage = (uint)((double)Damage * ((double)(200 - Dodge) / 100));
                    Damage += Attacker.EqStats.MeleeDamageIncrease;
                }
                else
                {
                    if (MDef >= Damage)
                        Damage = 1;
                    else
                        Damage -= MDef;

                    Damage += Attacker.EqStats.MagicDamageIncrease;
                }
                Damage = (uint)(Damage / DmgReduceTimes);
            }            
            uint Exp = 0;
            if (Damage < CurrentHP)
            {
                CurrentHP -= Damage;
                if (!IsSkill)
                {
                    if (AT == AttackType.FatalStrike)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, (ushort)(Loc.X + 1), (ushort)(Loc.Y + 1), Damage, (byte)AT).Get);
                        Attacker.Shift((ushort)(Loc.X), (ushort)(Loc.Y));
                    }
                    else if (AT == AttackType.Scapegoat)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 43).Get);
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 2).Get);
                    }
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
                }
                if (Gives)
                {
                    Exp = (uint)(Damage * e);
                    if (!IsSkill)
                    {
                        if (AT == AttackType.Ranged || AT == AttackType.Melee || AT == AttackType.FatalStrike)
                        {
                            if (Attacker.Equips.RightHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.RightHand.ID, 0, 3), Damage);
                            if (Attacker.Equips.LeftHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.LeftHand.ID, 0, 3), Damage / 3 * 2);
                        }
                    }
                }
            }
            else
            {
                if (Attacker.Loc.Map == 2022)
                    Attacker.DisCityMobs++;
                
                Attacker.XPKO++;
                if (Attacker.Superman || Attacker.Cyclone)
                    Attacker.TotalKO++;
                PlayerTarget = null;
                Alive = false;
                uint Benefit = CurrentHP;
                CurrentHP = 0;
                PoisonedInfo = null;
                Died = DateTime.Now;
                if (!IsSkill)
                {
                    if (AT == AttackType.FatalStrike)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, (ushort)(Loc.X + 1), (ushort)(Loc.Y + 1), Damage, (byte)AT).Get);
                        Attacker.Shift((ushort)(Loc.X), (ushort)(Loc.Y));
                    }
                    else if (AT == AttackType.Scapegoat)
                    {
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 43).Get);
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, 2).Get);
                    }
                    else
                        World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, Damage, (byte)AT).Get);
                }
                if (Attacker.Superman || Attacker.Cyclone)
                    World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, (uint)(65536 * Attacker.TotalKO), (byte)AttackType.Kill).Get);
                else
                    World.Action(this, Packets.AttackPacket(Attacker.EntityID, EntityID, Loc.X, Loc.Y, (uint)(1), (byte)AttackType.Kill).Get);

                World.Action(this, Packets.Status(EntityID, Status.Effect, 2080).Get);

                Attacker.AtkMem.Attacking = false;
                Attacker.AtkMem.Target = 0;

                if (Gives)
                {
                    Exp = (uint)(Benefit * e);
                    if (Attacker.MyTeam != null)
                    {
                        foreach (Character C in Attacker.MyTeam.Members)
                        {
                            if (C != Attacker && C.Alive && MyMath.InBox(C.Loc.X, C.Loc.Y, Attacker.Loc.X, Attacker.Loc.Y, 18))
                            {
                                if (C.Level + 20 > Level || C.Level >= 70)
                                {
                                    C.IncreaseExp(MaxHP / 10, true);
                                }
                                else
                                {
                                    uint Amount = (uint)(356 + (C.Level * 27));
                                    byte Lev = C.Level;
                                    C.IncreaseExp(Amount, true);
                                    for (; Lev < C.Level; Lev++)
                                    {
                                        uint VPAmount = (uint)Math.Max(1, Lev * 12 - 17);
                                        Attacker.MyTeam.Leader.VP += VPAmount;
                                        Attacker.MyTeam.Message(Packets.ChatMessage(45216, "SYSTEM", "ALL", Attacker.MyTeam.Leader.Name + " gained " + VPAmount + " virtue points.", 2003, 0));
                                    }
                                }
                            }
                        }
                    }
                    Attacker.IncreaseExp(MaxHP / 10, false);
                    if (!IsSkill)
                    {
                        if (AT == AttackType.Ranged || AT == AttackType.Melee || AT == AttackType.FatalStrike)
                        {
                            if (Attacker.Equips.RightHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.RightHand.ID, 0, 3), Benefit);
                            if (Attacker.Equips.LeftHand.ID != 0)
                                Attacker.AddProfExp((ushort)Game.ItemIDManipulation.Part(Attacker.Equips.LeftHand.ID, 0, 3), Benefit / 3 * 2);
                        }
                    }
                    DropAnItem(Attacker.EntityID, Attacker.Level, Attacker.Name);
                }
            }
            
            if (!IsSkill)
                Attacker.IncreaseExp(Exp, false);
            return Exp;
        }
06/19/2010 18:44 flex30#1541
Quote:
Originally Posted by ryuchetval View Post
@flex30

it's not from the personalshop.cs it's from packets.cs look for

Code:
        public static COPacket AddStallItem(Game.Item I, Features.PersonalShops.ItemValue Val, uint StallID)
I went there and found:

Quote:
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)0x454);
P.WriteInt32(I.UID);
P.WriteInt32(StallID);
P.WriteInt32(Val.Value);
P.WriteInt32(I.ID);
P.WriteInt16(I.CurDur);
P.WriteInt16(I.MaxDur);
P.WriteInt32(Val.MoneyType);
P.WriteInt32(0);
P.WriteInt16((byte)I.Soc1);
P.WriteInt16((byte)I.Soc2);
P.WriteByte(I.Plus);
P.WriteInt16(I.Bless);
P.WriteByte(I.Enchant);
P.WriteInt32(I.TalismanProgress);
P.Move(4);
P.WriteInt32((uint)I.Color);
P.WriteInt32(I.Progress);
Look fine for me, but always can't see the 2nd socket..
Someone must have fixed it, it's the same problem for all 5165..
06/19/2010 21:11 ryuchetval#1542
Quote:
Originally Posted by flex30 View Post
I went there and found:



Look fine for me, but always can't see the 2nd socket..
Someone must have fixed it, it's the same problem for all 5165..
well i tried to fix it and failed so idk...maybe other time
06/21/2010 21:08 Arcо#1543
Quote:
Originally Posted by flex30 View Post
I went there and found:



Look fine for me, but always can't see the 2nd socket..
Someone must have fixed it, it's the same problem for all 5165..
Try using the trade packet as a reference, I released the fixed trade packet, so search a bit for that.
06/21/2010 22:06 brookesy#1544
Q.when i try to login to my private server it says server maintanence or the server is congested. but i done every thing else e.g configuring and i put
/newacc testacc 123 , in to make an account so please help.. first time writing anything on a forum so sorry if it's in wrong place.
06/22/2010 00:23 Adziunia#1545
just tell us what ip have u used..