ID:140458
 
Code:
obj
Armor//A TYPE of obj[object]
var
power = 0
verb //Object Verb
Drop()
set src in usr
if(src.suffix=="Equipped")//makes it so equipped items cant get dropped!
usr << "Thats equipped!"
else
src.Move(usr.loc)
Get()
set src in oview(1)
src.Move(usr)
Equip()
set src in usr //makes it so that you can only use it when it's in your inventory
if(usr.armoron==0)
usr.armoron++//adds ONE.
usr << "You equip [src.name]"
usr.overlays+=src.icon//Makes it so you can see the armor you equip
usr.defense+=src.power//Gives more defense to you.
src.suffix="Equipped"
else
usr << "You have something else on"
Unequip()
set src in usr
if(usr.armoron==1)
if(src.suffix=="Equipped")
usr.armoron--
usr << "You unequip [src.name]"
usr.overlays-=src.icon//"Removes" the armor.
usr.defense-=src.power//subtracts defense
src.suffix=""
else
usr << "That armor isn't equipped!"
else
usr << "Nothing is equipped"
Iron_Armor//Lets make some Armor now. Follow this simple setup to make more armor
icon = 'objects.dmi'//Make a different Icon for every Overlay icon, otherwise, it won't work!
icon_state = "iron_armor"
power = 2//Adds defense
Weapon
var
power = 0
verb //Object Verb
Drop()
set src in usr
if(src.suffix=="Equipped")//makes it so equipped items cant get dropped!
usr << "Thats equipped!"
else
src.Move(usr.loc)
Get()
set src in oview(1)
src.Move(usr)
Equip()
set src in usr //makes it so that you can only use it when it's in your inventory
if(usr.weaponon==0)
usr.weaponon++//adds ONE.
usr << "You equip the [src.name]"
usr.attack+=src.power//Gives more defense to you.
src.suffix="Equipped"
else
usr << "You have something else on"
Unequip()
set src in usr
if(usr.weaponon==1)
if(src.suffix=="Equipped")
usr.weaponon--
usr << "You unequip [src.name]"
usr.attack-=src.power//subtracts defense
src.suffix=""
else
usr << "That armor isn't equipped!"
else
usr << "Nothing is equipped"
Iron_Sword
icon = 'objects.dmi'
icon_state="longsword"
power = 5


Steel_Sword
icon = 'objects.dmi'
icon_state = "steelsword"
power = 10
Gods_Sword
icon = 'objects.dmi'
icon_state = "swordoflight"
power = 150
Satans_Wrath
icon = 'objects.dmi'
icon_state = "swordofdark"
power = 200
Axe
icon = 'objects.dmi'
icon_state = "fireaxe"
power = 25
Bow
icon = 'objects.dmi'
icon_state = "bow"
power = 15
Saber
icon = 'objects.dmi'
icon_state = "saber"
power = 30


Problem description:I just need to know how to get a weapon to add attack, Where it says Random 1,10, Id like it to increase and decrese with each weapon thats being held and used, for example if you start out with 1,10 damage without weapons, lets say you equipt the bow, then the damage should be 1,15, please help im at a stand still and cant figure it out!

The weapons are already adding to the player's attack variable. Assuming you are basing damage on that, it's already doing what you want.

If you aren't doing that, and are instead having the damage be something like = rand(1,10), you just need to change it to rand(1,attack).
In response to Garthor
thank you it worked, I before i added the 1,attack my weapons did nothing to increase my attack!