Full Version : Is there anyway of adding Bleed attack to mobs
xmlspawner >>Q&A >>Is there anyway of adding Bleed attack to mobs
<< Prev | Next >>
Dave1969- 03-13-2006
Is there anyway of adding special attacks like Bleed to mobs using xml? i couldnt find it anywhere in the "How do I" section
ArteGordon- 03-13-2006
yes, it could be done.
It requires a simple mod in the GetWeaponAbility method in basecreature.cs
I've been tied up for the last couple of weeks, but I'll post a mod that will let you do that when I get a chance.
ArteGordon- 03-13-2006
ok, here is what you can do. In basecreature.cs around line 290 change this

CODE
public virtual WeaponAbility GetWeaponAbility() { return null; }

to this

CODE
public virtual WeaponAbility GetWeaponAbility() { // ARTEGORDONMOD // allow creatures special attack ability to be specified by the xmlweaponattachment XmlWeaponAbility a = (XmlWeaponAbility)XmlAttach.FindAttachment(this, typeof(XmlWeaponAbility));
if (a != null)
{
return a.WeaponAbility;
}
else
{
return null;
}
}

or, you could just add something like the above (replace the 'virtual' with 'override') to your custom creature script if you only wanted to be able to do this for specific mobs.
Then get the XmlWeaponAbility attachment script that I added to the beta_308.zip upcoming releases file.
Then you can add special attacks to a mob by doing something like
orc/ATTACH/xmlweaponability,BleedAttack
Note, the attack name is case sensitive and can be any of
ArmorIgnore
BleedAttack
ConcussionBlow
CrushingBlow
Disarm
Dismount
DoubleStrike
InfectiousStrike
MortalStrike
MovingShot
ParalyzingBlow
ShadowStrike
WhirlwindAttack
which are the special weapon abilities defined in WeaponAbility.cs
Dave1969- 03-14-2006
Arte you are the man Have a few errors though . I did dl the XmlWeaponAbility.cs and put in it the XML Spawner folder
[/CODE] - Error: Scripts\Engines\AI\Creature\BaseCreature.cs: CS0246: (line 622, column
3) The type or namespace name 'XmlWeaponAbility' could not be found (are you mi
ssing a using directive or an assembly reference?)
- Error: Scripts\Engines\AI\Creature\BaseCreature.cs: CS0103: (line 623, column
7) The name 'a' does not exist in the class or namespace 'Server.Mobiles.BaseCr
eature'
- Error: Scripts\Engines\AI\Creature\BaseCreature.cs: CS0246: (line 625, column
11) The type or namespace name 'a' could not be found (are you missing a using
directive or an assembly reference?)[CODE]
ArteGordon- 03-14-2006
add this to the beginning of your basecreature.cs
using Server.Engines.XmlSpawner2;