Looking for an answer.

07/10/2015 16:09 xenomco#1
Hello everyone , i am trying to make the skill WarCry to be based on Battle Power and not on Steed (+) or Lineage and i have edited the skill but is stil not working like i want to could anyone look into what i have edited and to help with an ( idea , answer or something to guide me trough this ) .

Here is the skill .

Code:
#region WarCry
case 7003:
{//WarCry
SpellUse suse = new SpellUse(true);
suse.Attacker = attacker.UID;
suse.SpellID = spell.ID;
suse.SpellLevel = spell.Level;
suse.X = X;
suse.Y = Y;
ConquerItem attackedSteed = null, attackerSteed = null;
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
{
if (_obj == null)
continue;
if (_obj.MapObjType == MapObjectType.Player && _obj.UID != attacker.UID)
{
attacked = _obj as Entity;
if ((attackedSteed = attacked.Owner.Equipment.TryGetItem(ConquerItem.St eed)) != null)
{
if ((attackerSteed = attacker.Owner.Equipment.TryGetItem(ConquerItem.St eed)) != null)
{
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= attackedSteed.Plus)
{
if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
suse.AddTarget(attacked.UID, 0, attack);
if (attacked.BattlePower < attacker.BattlePower)
attacked.RemoveFlag(Update.Flags.Ride);
else if (attacked.BattlePower == attacker.BattlePower)
attacked.RemoveFlag(Update.Flags.Ride);
else
suse.Targets[attacked.UID].Hit = false;
}
}
}
}
}
}
attacker.Owner.SendScreen(suse, true);
break;
}

#endregion
07/10/2015 18:51 pintinho12#2
WarCry is the one that makes everybody go down from the Steed alright?
This might be handled server side, since you don't need to click over a target to Spook it.

After reading your code, you really can't find out where to edit?
Code:
// you seriously can't figure out the error on the line below?
if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= attackedSteed.Plus)
{
	if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
	{
		suse.AddTarget(attacked.UID, 0, attack);
		if (attacked.BattlePower <= attacker.BattlePower)
			attacked.RemoveFlag(Update.Flags.Ride);
		else
			suse.Targets[attacked.UID].Hit = false;
	}
}
I even changed a few lines of this, because that code was and still so fucking ugly.
07/11/2015 02:28 xenomco#3
Code:
 if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= attacked.BattlePower) //changed
     {
   if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
{
  suse.AddTarget(attacked.UID, 0, attack);
  if (attacked.BattlePower <= attacker.BattlePower)
    attacked.RemoveFlag(Update.Flags.Ride);
 else
 suse.Targets[attacked.UID].Hit = false;
}
stil not working ..
07/11/2015 06:25 pintinho12#4
Because I didn't change anything... quoted where would you take a look.. you don't know how to read a code?
07/11/2015 07:01 xenomco#5
Code:
 if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= attacked.BattlePower) //changed
     {

i reviewed what is coded and this was the only mistake i saw .

and i saw you didnt changed anything dude .
07/11/2015 07:06 pintinho12#6
If you don't want the battle power to count... just remove that line... simple