OMG I typed LONG-LONG tutorial text and occasionally hit the "x" in the right-upper corner of my browser window :0! (Damn this touchpad).
Wait a few minutes, I'll try again.
[EDIT] O.K.
Open /raw/objects/item_weapons.txt
This is a file where your weapons' info is stored.
You have two options - to add your weapon here, or to make another .txt file with your weapon which can be easily shared in internat (because it won't replace original files and will be modular). To make a modular file create new item_weapons_custom .txt file (or something like this) and input this text:
[text]
item_weapons_custom
[OBJECT:ITEM]
[/text]
Then copy short sword entry from item_weapons.txt to your file.
Let's look at it.
[ITEM_WEAPON:ITEM_WEAPON_SWORD_SHORT] <- item ID
[NAME:short sword:short swords] <- item name singular/plural
[DAMAGE:100:SLASH] <- damage amount and type
[WEIGHT:30] <- weapon weight
[SKILL:SWORD] <- which category this weapon in (sword/axe/mace/hammer)
[CRIT_BOOST:1] <- [optional] increases chance to hit internal parts (1-..)
[TWO_HANDED:4] <- race <= size 4 will use this as two-handed
[MINIMUM_SIZE:4] <- race < size 4 cannot use this weapon
[CAN_STONE] <- [optional] can be made from obsidian
[MATERIAL_SIZE:3] <- number of metal bars to forge the weapon
I hope it's not that hard.
A few comments:
Damage type for usual weapons are PIERCE, BLUDGEON, SLASH and GORE (whips).
There're 3 more types: COLD, HEAT and BURN.
CRIT_BOOST is not boolean, 1 is value, so it may be 2, 3 and more.
Damage for short sword is 100, for long sword is 120.
Look at other weapons to determine the comparative power of your custom weapon in-game.
Example of "magma sword":
[ITEM_WEAPON:ITEM_WEAPON_SWORD_MAGMA] <- item ID
[NAME:magma sword:magma swords]
[DAMAGE:120:HEAT] <- OUCH IT IS HOT!
[WEIGHT:50]
[SKILL:SWORD]
[TWO_HANDED:5]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:3]
Also there're ranged weapons:
[ITEM_WEAPON:ITEM_WEAPON_BOW] <- ID again
[NAME:bow:bows] <- name again
[DAMAGE:40:BLUDGEON] <- damage again
[WEIGHT:30] <- weight
[SKILL:SWORD] <- in melee a bow is considered as a sword
[RANGED:BOW:ARROW] <- main part here. Look below*
[TWO_HANDED:0] <- ranged weapons are one-handed but require 2nd hand to be empty
[MINIMUM_SIZE:5] <- minimum size to use
[MATERIAL_SIZE:3] <- namber of bars inside
*BOW shows that it uses bow skill in ranged, ARROW indicates the type of ammo it uses. There're common ARROW and BOLT, but you can make other types.
There's AMMO in item_ammo.txt
[ITEM_AMMO:ITEM_AMMO_ARROWS] <- ID again
[NAME:arrow:arrows] <- name
[CLASS:ARROW] <- ammo type
[DAMAGE:100:PIERCE] <- damage again
Example of harpoon shooter:
[ITEM_WEAPON:ITEM_WEAPON_HARPOONGUN]
[NAME:harpoon gun:harpon guns]
[DAMAGE:40:BLUDGEON]
[WEIGHT:30]
[SKILL:HAMMER]
[RANGED:CROSSBOW:HARPOON] - is considered crossbow and uses HARPOON ammo
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:3]
Let's make harpoon ammo (in item_ammo.txt or make a modular file as shown above):
[ITEM_AMMO:ITEM_AMMO_HARPOONS]
[NAME:harpoon:harpoons]
[CLASS:HARPOON] <- new type of ammo
[DAMAGE:100:PIERCE]
Let's add some magic:
[ITEM_AMMO:ITEM_AMMO_HARPOONS_LIGHT]
[NAME:harpoon of light:harpoons of light]
[CLASS:HARPOON]
[DAMAGE:100:BURN] <- IT BURNS!
[ITEM_AMMO:ITEM_AMMO_HARPOONS_FROST]
[NAME:frost harpoon:frost harpoons]
[CLASS:HARPOON]
[DAMAGE:100:COLD] <- IT CHILLS!
The last part:
open entity_default.txt and find the race you want to use this weapon.
There's text like:
code:
...
[WEAPON:ITEM_WEAPON_SWORD_SHORT]
[WEAPON:ITEM_WEAPON_MACE]
[WEAPON:ITEM_WEAPON_CROSSBOW]
[AMMO:ITEM_AMMO_BOLTS]
...
Insert your weapon and ammo for ranged weapons (below their names)
So in our case it'll be:code:
...
[WEAPON:ITEM_WEAPON_SWORD_SHORT]
[WEAPON:ITEM_WEAPON_SWORD_MAGMA]
[WEAPON:ITEM_WEAPON_HARPOON_GUN]
[AMMO:ITEM_AMMO_HARPOONS]
[AMMO:ITEM_AMMO_HARPOONS_LIGHT]
[AMMO:ITEM_AMMO_HARPOON_FROST]
[WEAPON:ITEM_WEAPON_MACE]
...
I hope it helps.[ May 02, 2008: Message edited by: Deon ]