Author Topic: Development Sheet for Weapons/Armors/Items/etc  (Read 70 times)

Offline Halokiller38

  • Director
  • Newbie
  • *****
  • Posts: 28
    • View Profile
Development Sheet for Weapons/Armors/Items/etc
« on: June 28, 2012, 03:21:12 am »
--[[
Name: "sh_item.lua".
Product: "Skeleton".
--]]

ITEM = openAura.item:New();

ITEM.base = "base"; -- if the item has a Base, then specify it here.
ITEM.name = "name"; --Obvious what goes here.
ITEM.worth = 100;   --Cost of the item.
ITEM.model = "models/folder/folder/model.mdl"; --The full directory for the model it will use.
ITEM.weight = 0.1; --The weight of the item.
ITEM.description = "A generic item"; --The discription for the item.
ITEM.access = "O"; --If the item is to be restricted to a flag.
ITEM.category = "Generic Item's"; --The catogary it is held under in the Business menu/inventory.
ITEM.useSound = "sound/folder/sound.wav"; --The sound played on Use of the item.
ITEM.useText = "Use Generic Item"; --the text that appears when you press use on the item.
ITEM.business = true; --If it will appear in the business menu.
ITEM.extraInventory = 1; --How much the item will increase your inventory space.
ITEM.weaponClass = "aura_crowbar"; -- if the item is a weapon

--If you are creating a weapon the following lines are required.
ITEM.weaponClass = "aura_crowbar";
ITEM.meleeWeapon = true; --Is the weapon a melee weapon?
ITEM.isAttachment = true; --Does it attach to a players bone? (Not required for existing weapons)
ITEM.loweredOrigin = Vector(-18, -5, 5); --The Origin to the bone that the item is placed.
ITEM.loweredAngles = Angle(-10, 10, -80); --The Origin to the bone that the item is placed.
ITEM.attachmentBone = "ValveBiped.Bip01_Spine"; --The bone that the weapon Attachs to.
ITEM.weaponCopiesItem = true; --Required
ITEM.attachmentOffsetAngles = Angle(200, 200, 0); --The offset of the attachment.
ITEM.attachmentOffsetVector = Vector(0, 5, 2); --The offset of the attachment.

--[[
If you want a player's attribute to be temporeroly increased then use the following Lua.
ATB_ATTRIBUTE = the attribute name. Such as Strength, Agility, Endurance and so on.
--]]

function ITEM:OnUse(player, itemEntity)   
   player:BoostAttribute(self.name, ATB_AGILITY, 3, 120);
end;


--If you want a player's health of stamina to be increased use the following lua.
function ITEM:OnUse(player, itemEntity)   
   player:SetCharacterData("stamina", 100);
   player:SetHealth( math.Clamp( player:Health() + 8, 0, player:GetMaxHealth() ) );
end;

openAura.item:Register(ITEM);

Share on Bluesky Share on Facebook