Weapons

General Scripting 101 - Getting Started - Introduction - Weapons - Armor - FAQs

     One of the easier things to do is to make a weapon or a new armor. If you are wanting to make a new armor, skip this page by clicking here. If you wish to make a weapon however, read on!

Making a Sword:
     Sword creation is always fun, so I'll go ahead and post the code to one of my weapons that I've made and explain how to make a new sword. I'll post the code to make a Lightningblade. All of the re-colored areas are what you'll need to change.

//***********************************************
// LIGHTNING BLADE
//***********************************************

$AccessoryVar[LightningBlade, $AccessoryType] = $SwordAccessoryType;
$AccessoryVar[LightningBlade, $SpecialVar] = "6 102";
$AccessoryVar[LightningBlade, $Weight] = 3;
$AccessoryVar[LightningBlade, $MiscInfo] = "Lightning-changed sword.";
$SkillType[LightningBlade] = $SkillSlashing;
$ItemCost[LightningBlade] = GenerateItemCost(LightningBlade);

ItemImageData LightningBladeImage
{
shapeFile = "katana";
mountPoint = 0;

weaponType = 0; // Single Shot
reloadTime = 0;
fireTime = GetDelay(LightningBlade);
minEnergy = 0;
maxEnergy = 0;

accuFire = true;

sfxFire = SoundSwing3;
sfxActivate = AxeSlash2;
};
ItemData LightningBlade
{
heading = "bWeapons";
description = "Lightning Blade";
className = "Weapon";
shapeFile = "katana";
hudIcon = "blaster";
shadowDetailMask = 4;
imageType = LightningBladeImage;
price = 0;
showWeaponBar = true;
};
function LightningBladeImage::onFire(%player, %slot)
{
MeleeAttack(%player, GetRange(LightningBlade), LightningBlade);
}

Where you see LightningBlade change to a new "internal name" without spaces such as DarkSword.
Where you see 6 102 change that to the power you want the sword to have. This is the ATK power you'd see in-game.
Where you see $Weight] = 3 change this to how heavy you wish your sword to be. Light = fast swinging. Heavy = slow.
Where you see "Lightning-changed sword." change to whatever you'd want it to say when you do a #w weaponname.
Where you see "katana" change to what you want it to appear as. Eg. "sword" or "katana"
Where you see SoundSwing3; and AxeSlash2; change to the sounds you want your sword to make. (In RPG folder)

     That's about it for making a sword, you should be able to figure out how to adapt the code to make a bow. If you can't figure out a bow, email me at particle@xfury.net and request that I add a tutorial for it!

Now on to the next step of editing. Armor!

Tutorial © 2001 by Particle.