Help Me For Replace Skill !!

02/01/2013 19:07 magnon#1
can anyone help me for replace this skill from kimo source

Code:
 case 0x288d:
                    if (CanUseSpell(spell, this.attacker.Owner))
                    {
                        ushort num29;
                        ushort num30;
                        if (attacker != null)
                        {
                            num29 = attacker.X;
                            num30 = attacker.Y;
                        }
                        else
                        {
                            num29 = sob.X;
                            num30 = sob.Y;
                        }
                        if (Kernel.GetDistance(this.attacker.X, this.attacker.Y, num29, num30) <= spell.Range)
                        {
                            if (((sob == null) && attacker.ContainsFlag(0x8000000L)) || this.attacker.ContainsFlag(0x8000000L))
                            {
                                return;
                            }
                            PrepareSpell(spell, this.attacker.Owner);
                            use = new SpellUse(true)
                            {
                                Attacker = this.attacker.UID,
                                SpellID = spell.ID,
                                SpellLevel = spell.Level,
                                X = x,
                                Y = y
                            };
                            bool flag8 = false;
                            if (sob == null)
                            {
                                if (CanAttack(this.attacker, attacker, spell, this.attack.AttackType == 2))
                                {
                                    this.attack.Effect1 = Attack.AttackEffects1.None;
                                    power = Calculate.Melee(this.attacker, attacker, spell, ref this.attack);
                                    power = (power * 100) / 100;
                                    use.Effect1 = this.attack.Effect1;
                                    ReceiveAttack(this.attacker, attacker, this.attack, power, spell);
                                    use.Targets.Add(attacker.UID, power);
                                    flag8 = true;
                                }
                            }
                            else if (CanAttack(this.attacker, sob, spell))
                            {
                                this.attack.Effect1 = Attack.AttackEffects1.None;
                                power = (uint)(Calculate.Melee(this.attacker, sob, ref this.attack) * spell.PowerPercent);
                                ReceiveAttack(this.attacker, sob, this.attack, power, spell);
                                use.Effect1 = this.attack.Effect1;
                                use.Targets.Add(sob.UID, power);
                                flag8 = true;
                            }
                            if (flag8)
                            {
                                this.attacker.Owner.SendScreen(use, true);
                            }
                        }
                        else
                        {
                            this.attacker.AttackPacket = null;
                        }
                    }
                    goto Label_C19A;

to my source
Code:
//Radiant Palm 
                                case 10381:
                                    // case 10315:
                                    {
                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);
                                            Game.Attacking.InLineAlgorithm ila = new Conquer_Online_Server.Game.Attacking.InLineAlgorithm(attacker.X,
                                        X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = SpellID;
                                            suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            for (int c = 0; c < attacker.Owner.Screen.Objects.Length; c++)
                                            {
                                                //For a multi threaded application, while we go through the collection
                                                //the collection might change. We will make sure that we wont go off
                                                //the limits with a check.
                                                if (c >= attacker.Owner.Screen.Objects.Length)
                                                    break;
                                                Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    attacked = _obj as Entity;
                                                    if (ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;

                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell);

                                                        attack.Damage = damage;
                                                        // damage = ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                        ReceiveAttack( attacker, attacked, attack, damage, spell);

                                                        suse.Targets.Add(attacked.UID, damage);
                                                    }
                                                }
                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    attackedsob = _obj as SobNpcSpawn;

                                                    if (ila.InLine(attackedsob.X, attackedsob.Y))
                                                    {
                                                        if (!CanAttack(attacker, attackedsob, spell))
                                                            continue;

                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob);
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        attack.Damage = damage;

                                                        ReceiveAttack( attacker, attackedsob, attack, damage, spell);

                                                        suse.Targets.Add(attackedsob.UID, damage);
                                                    }
                                                }
                                            }

                                            attacker.Owner.SendScreen(suse, true);
                                        }
                                        attacker.AttackPacket = null;
                                        break;
                                    }
cuz when i try i got alot of Error
02/05/2013 13:26 benjaminblas#2
Nc
02/05/2013 15:00 magnon#3
no can help me for that it's bad thing for me can anyone help me
02/05/2013 18:03 pro4never#4
You cannot expect to just copy and paste entire sections of code and have them work.


Every single method is going to be different when you switch between sources and as such you'll have to change all of them to what exists already in your source or transfer over methods as needed to make the new code work.


FAR better off just reading through your own source to understand how it works, then looking at a working example in other sources to give you an idea of how to re-code the feature yourself using what's provided already in your source.


This is kinda like saying "I copy/pasted my chemistry textbook into my biology final exam... why did my teacher fail me?". They both might be conquer sources but that doesn't mean they contain similar information or formatting.