Full Version : Spawn a mob with special attack abilities.
xmlspawner >>XMLSpawner - How do I? >>Spawn a mob with special attack abilities.
<< Prev | Next >>
ArteGordon- 05-08-2006
You can use the XmlWeaponAbility attachment to give any mob special attacks.
You can add special attacks to a spawned mob with a spawn entry like
orc/ATTACH/xmlweaponability,BleedAttack
or manually add it to any mob with
[addatt xmlweaponability BleedAttack
and then target the mob.
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
You will also need to make this modification to basecreature.cs (or your custom mob script if you only want it to apply to certain mobs).
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 xmlweaponability attachment XmlWeaponAbility a = (XmlWeaponAbility)XmlAttach.FindAttachment(this, typeof(XmlWeaponAbility));
if (a != null)
{
return a.WeaponAbility;
}
else
{
return null;
}
}

and make sure that you have this at the beginning of the script

CODE
using Server.Engines.XmlSpawner2;

aph- 07-16-2006
K přiřazení speciálních útoků mobům můžete použít attach XmlWeaponAbility.
Speciální útok můžete přidat mobovi buď tímto zápisem:
orc/ATTACH/xmlweaponability,BleedAttack
nebo je přidat manuálně:
[addatt xmlweaponability BleedAttack
(a zatargetit moba)
Pozor - jména specek jsou case-sensitivní. Mohou být následující:
ArmorIgnore
BleedAttack
ConcussionBlow
CrushingBlow
Disarm
Dismount
DoubleStrike
InfectiousStrike
MortalStrike
MovingShot
ParalyzingBlow
ShadowStrike
WhirlwindAttack
(toto jsou ability definované v souboru WeaponAbility.cs)
Pro funkčnost tohoto musíte provést drobnou modifikaci v souboru basecreature.cs (nebo přímo ve scriptu moba, pokud to chcete používat jen u něj).
někde kolem řádku 290 změňte toto:

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

za toto:

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

a ujistěte se, že máte na začátku skriptu toto:

CODE
using Server.Engines.XmlSpawner2;

poděkování patří mongbatově továrně na blbosti!