BladeTempest Error

10/05/2012 13:47 magnon#1

[Only registered and activated users can see links. Click Here To Register...]
Code:
#region BladeTempest
                case 11110:

                    if (CanUseSpell(spell, this.attacker.Owner))
                    {
                        if (spell.ID == 11110)
                        {
                            spell.UseStamina = 20;
                            spell.Range = 20;
                        }
                        PrepareSpell(spell, this.attacker.Owner);
                        InLineAlgorithm algorithm = new InLineAlgorithm(this.attacker.X, x, this.attacker.Y, y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
                        use = new SpellUse(true)
                        {
                            Attacker = this.attacker.UID,
                            SpellID = damage,
                            SpellLevel = this.attacker.Owner.Spells[damage].Level,
                            X = x,
                            Y = y
                        };
                        if (spell.Level < 4)
                        {
                            this.attacker.Owner.Spells[damage].Level++;
                            this.attacker.Owner.Spells[damage].Experience = 0; ;
                            this.attacker.Owner.Spells[damage].Send(this.attacker.Owner);
                        }

                        if (this.attacker.Owner.Map.Floor[use.X, use.Y, MapObjectType.Player, this.attacker] == true)
                        {
                            this.attacker.X = x;
                            this.attacker.Y = y;

                            foreach (IMapObject obj3 in this.attacker.Owner.Screen.Objects)
                            {
                                if (obj3 != null)
                                {
                                    if ((obj3.MapObjType == MapObjectType.Monster) || (obj3.MapObjType == MapObjectType.Player))
                                    {
                                        attacker = obj3 as Entity;
                                        if (algorithm.InLine(attacker.X, attacker.Y) && CanAttack(this.attacker, attacker, spell, this.attack.AttackType == 2))
                                        {
                                            if (attacker.BlackSpot == false)
                                            {
                                                if (this.attacker.Owner.Spells.ContainsKey(11120))
                                                {

                                                    {
                                                        if (this.attacker.Owner.Spells[11120].Level < 4)
                                                        {
                                                            this.attacker.Owner.Spells[11120].Level++;
                                                            this.attacker.Owner.Spells[11120].Experience = 0; ;
                                                            this.attacker.Owner.Spells[11120].Send(this.attacker.Owner);
                                                        }
                                                        Update ud = new Update(true);
                                                        ud.Blackspot(attacker, true);
                                                        attacker.BlackSpot = true;
                                                        attacker.BlackSpottime = 12;
                                                        attacker.BlackSpotStamp = Time32.Now;
                                                    }
                                                }
                                            }
                                            this.attack.Effect1 = Attack.AttackEffects1.None;
                                            power = Calculate.Melee(this.attacker, attacker, spell, ref this.attack);
                                            use.Effect1 = this.attack.Effect1;
                                            this.attack.Damage = power;
                                            ReceiveAttack(this.attacker, attacker, this.attack, power, spell);
                                            use.Targets.Add(attacker.UID, power);


                                        }
                                    }
                                    else if (obj3.MapObjType == MapObjectType.SobNpc)
                                    {
                                        sob = obj3 as SobNpcSpawn;
                                        if (algorithm.InLine(sob.X, sob.Y) && CanAttack(this.attacker, sob, spell))
                                        {

                                            this.attack.Effect1 = Attack.AttackEffects1.None;
                                            power = (uint)(Calculate.Melee(this.attacker, sob, ref this.attack) * spell.PowerPercent);
                                            this.attack.Damage = power;
                                            ReceiveAttack(this.attacker, sob, this.attack, power, spell);
                                            use.Targets.Add(sob.UID, power);


                                        }
                                    }
                                }


                            }
                            this.attacker.Owner.SendScreen(use, true);
                            this.attacker.Owner.Screen.Reload(use);

                        }


                    }
                    goto Label_C19A;
                #endregion
10/05/2012 22:05 Novakhan#2
And, What is the error?.. I only see a code and a screenshot, Which doesn't really say the error you have.
10/05/2012 22:40 shadowman123#3
Quote:
Originally Posted by elhermanos View Post
And, What is the error?.. I only see a code and a screenshot, Which doesn't really say the error you have.
Are u sure you are C# Coder as u said in your title ? ..havent u seen that there is a player outside arena map bounds ?
10/06/2012 03:27 johan orlando#4
Use
if (attacker.Owner.Map.IsDynamic() == false)
if (attacker.Owner.Map.Floor[X, Y, MapObjectType.InvalidCast, null])
break;

#region BladeTempest
case 11110:

if (CanUseSpell(spell, this.attacker.Owner))
{
if (attacker.Owner.Map.IsDynamic() == false)
if (attacker.Owner.Map.Floor[X, Y, MapObjectType.InvalidCast, null])
break;
if (spell.ID == 11110)
{
spell.UseStamina = 20;
spell.Range = 20;
}
PrepareSpell(spell, this.attacker.Owner);
InLineAlgorithm algorithm = new InLineAlgorithm(this.attacker.X, x, this.attacker.Y, y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
use = new SpellUse(true)
{
Attacker = this.attacker.UID,
SpellID = damage,
SpellLevel = this.attacker.Owner.Spells[damage].Level,
X = x,
Y = y
};
if (spell.Level < 4)
{
this.attacker.Owner.Spells[damage].Level++;
this.attacker.Owner.Spells[damage].Experience = 0; ;
this.attacker.Owner.Spells[damage].Send(this.attacker.Owner);
}

if (this.attacker.Owner.Map.Floor[use.X, use.Y, MapObjectType.Player, this.attacker] == true)
{
this.attacker.X = x;
this.attacker.Y = y;

foreach (IMapObject obj3 in this.attacker.Owner.Screen.Objects)
{
if (obj3 != null)
{
if ((obj3.MapObjType == MapObjectType.Monster) || (obj3.MapObjType == MapObjectType.Player))
{
attacker = obj3 as Entity;
if (algorithm.InLine(attacker.X, attacker.Y) && CanAttack(this.attacker, attacker, spell, this.attack.AttackType == 2))
{
if (attacker.BlackSpot == false)
{
if (this.attacker.Owner.Spells.ContainsKey(11120))
{

{
if (this.attacker.Owner.Spells[11120].Level < 4)
{
this.attacker.Owner.Spells[11120].Level++;
this.attacker.Owner.Spells[11120].Experience = 0; ;
this.attacker.Owner.Spells[11120].Send(this.attacker.Owner);
}
Update ud = new Update(true);
ud.Blackspot(attacker, true);
attacker.BlackSpot = true;
attacker.BlackSpottime = 12;
attacker.BlackSpotStamp = Time32.Now;
}
}
}
this.attack.Effect1 = Attack.AttackEffects1.None;
power = Calculate.Melee(this.attacker, attacker, spell, ref this.attack);
use.Effect1 = this.attack.Effect1;
this.attack.Damage = power;
ReceiveAttack(this.attacker, attacker, this.attack, power, spell);
use.Targets.Add(attacker.UID, power);


}
}
else if (obj3.MapObjType == MapObjectType.SobNpc)
{
sob = obj3 as SobNpcSpawn;
if (algorithm.InLine(sob.X, sob.Y) && CanAttack(this.attacker, sob, spell))
{

this.attack.Effect1 = Attack.AttackEffects1.None;
power = (uint)(Calculate.Melee(this.attacker, sob, ref this.attack) * spell.PowerPercent);
this.attack.Damage = power;
ReceiveAttack(this.attacker, sob, this.attack, power, spell);
use.Targets.Add(sob.UID, power);


}
}
}


}
this.attacker.Owner.SendScreen(use, true);
this.attacker.Owner.Screen.Reload(use);

}


}
goto Label_C19A;
#endregion
10/06/2012 11:38 shadowman123#5
y dont u learn how to use either spoilers or CODE
10/06/2012 14:50 magnon#6
Quote:
Originally Posted by johan orlando View Post
Use
if (attacker.Owner.Map.IsDynamic() == false)
if (attacker.Owner.Map.Floor[X, Y, MapObjectType.InvalidCast, null])
break;

#region BladeTempest
case 11110:

if (CanUseSpell(spell, this.attacker.Owner))
{
if (attacker.Owner.Map.IsDynamic() == false)
if (attacker.Owner.Map.Floor[X, Y, MapObjectType.InvalidCast, null])
break;
if (spell.ID == 11110)
{
spell.UseStamina = 20;
spell.Range = 20;
}
PrepareSpell(spell, this.attacker.Owner);
InLineAlgorithm algorithm = new InLineAlgorithm(this.attacker.X, x, this.attacker.Y, y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
use = new SpellUse(true)
{
Attacker = this.attacker.UID,
SpellID = damage,
SpellLevel = this.attacker.Owner.Spells[damage].Level,
X = x,
Y = y
};
if (spell.Level < 4)
{
this.attacker.Owner.Spells[damage].Level++;
this.attacker.Owner.Spells[damage].Experience = 0; ;
this.attacker.Owner.Spells[damage].Send(this.attacker.Owner);
}

if (this.attacker.Owner.Map.Floor[use.X, use.Y, MapObjectType.Player, this.attacker] == true)
{
this.attacker.X = x;
this.attacker.Y = y;

foreach (IMapObject obj3 in this.attacker.Owner.Screen.Objects)
{
if (obj3 != null)
{
if ((obj3.MapObjType == MapObjectType.Monster) || (obj3.MapObjType == MapObjectType.Player))
{
attacker = obj3 as Entity;
if (algorithm.InLine(attacker.X, attacker.Y) && CanAttack(this.attacker, attacker, spell, this.attack.AttackType == 2))
{
if (attacker.BlackSpot == false)
{
if (this.attacker.Owner.Spells.ContainsKey(11120))
{

{
if (this.attacker.Owner.Spells[11120].Level < 4)
{
this.attacker.Owner.Spells[11120].Level++;
this.attacker.Owner.Spells[11120].Experience = 0; ;
this.attacker.Owner.Spells[11120].Send(this.attacker.Owner);
}
Update ud = new Update(true);
ud.Blackspot(attacker, true);
attacker.BlackSpot = true;
attacker.BlackSpottime = 12;
attacker.BlackSpotStamp = Time32.Now;
}
}
}
this.attack.Effect1 = Attack.AttackEffects1.None;
power = Calculate.Melee(this.attacker, attacker, spell, ref this.attack);
use.Effect1 = this.attack.Effect1;
this.attack.Damage = power;
ReceiveAttack(this.attacker, attacker, this.attack, power, spell);
use.Targets.Add(attacker.UID, power);


}
}
else if (obj3.MapObjType == MapObjectType.SobNpc)
{
sob = obj3 as SobNpcSpawn;
if (algorithm.InLine(sob.X, sob.Y) && CanAttack(this.attacker, sob, spell))
{

this.attack.Effect1 = Attack.AttackEffects1.None;
power = (uint)(Calculate.Melee(this.attacker, sob, ref this.attack) * spell.PowerPercent);
this.attack.Damage = power;
ReceiveAttack(this.attacker, sob, this.attack, power, spell);
use.Targets.Add(sob.UID, power);


}
}
}


}
this.attacker.Owner.SendScreen(use, true);
this.attacker.Owner.Screen.Reload(use);

}


}
goto Label_C19A;
#endregion
thanks for ur help but i got Error
Code:
if (attacker.Owner.Map.Floor[X, Y, MapObjectType.InvalidCast, null])
Error 20 The name 'Y' does not exist in the current context
:(
10/06/2012 14:55 johan orlando#7
Quote:
Originally Posted by magnon View Post
thanks for ur help but i got Error
Code:
if (attacker.Owner.Map.Floor[X, Y, MapObjectType.InvalidCast, null])
Error 20 The name 'Y' does not exist in the current context
:(
send me a private message
10/06/2012 15:10 magnon#8
Quote:
Originally Posted by johan orlando View Post
send me a private message
i'm already send to u private message:)
10/06/2012 18:42 Novakhan#9
Quote:
Originally Posted by shadowman123 View Post
Are u sure you are C# Coder as u said in your title ? ..havent u seen that there is a player outside arena map bounds ?
Yes, I noticed that the player is outside of the map. But do you see any skill being used? No.
10/06/2012 19:00 marlyandedsel#10
Quote:
Originally Posted by elhermanos View Post
Yes, I noticed that the player is outside of the map. But do you see any skill being used? No.
Its already mention Blade Tempest :bandit: Read up dude.
10/06/2012 21:28 Novakhan#11
Quote:
Originally Posted by marlyandedsel View Post
Its already mention Blade Tempest :bandit: Read up dude.
Blade Tempest is a pirate skill. Check his screen, Do you see any skill or blade tempest being used there?
10/06/2012 23:47 shadowman123#12
Quote:
Originally Posted by elhermanos View Post
Blade Tempest is a pirate skill. Check his screen, Do you see any skill or blade tempest being used there?
i dont see any used spell cuz its already been used by the player who is outside the map bounds .. y u no use ur brain ?
10/08/2012 03:19 marlyandedsel#13
Quote:
Originally Posted by elhermanos View Post
Blade Tempest is a pirate skill. Check his screen, Do you see any skill or blade tempest being used there?
I see you are C# Coder below your name lol! common sense dude!!!:facepalm:
10/08/2012 11:41 shadowman123#14
btw the codes looks pathetic & Aweful