#include <item.hpp>
Public Member Functions | |
ItemClass (int id, ItemType type, Script *s=NULL) | |
bool | use (Being *itemUser) |
Applies the modifiers of an item to a given user. | |
ItemType | getType () const |
Gets item type. | |
int | getWeight () const |
Gets item weight. | |
void | setWeight (int weight) |
Sets item weight. | |
int | getCost () const |
Gets unit cost of these items. | |
void | setCost (int cost) |
Sets unit cost of these items. | |
int | getMaxPerSlot () const |
Gets max item per slot. | |
void | setMaxPerSlot (int perSlot) |
Sets max item per slot. | |
const ItemModifiers & | getModifiers () const |
Gets item modifiers. | |
void | setModifiers (const ItemModifiers &modifiers) |
Sets item modifiers. | |
int | getDatabaseID () |
Gets database ID. | |
void | setSpriteID (int spriteID) |
Sets the sprite ID. | |
int | getSpriteID () |
Gets the sprite ID. | |
void | setScript (Script *s) |
Sets the script that is to be used. | |
void | setAttackZone (AttackZone *attackZone) |
Set attack zone (only needed when the item is a weapon). | |
const AttackZone * | getAttackZone () const |
Gets attack zone of weapon (returns NULL for non-weapon items). |
Definition at line 174 of file item.hpp.
bool ItemClass::use | ( | Being * | itemUser | ) |
Applies the modifiers of an item to a given user.
Definition at line 145 of file item.cpp.
References ItemModifiers::applyAttributes(), Script::execute(), Script::prepare(), and Script::push().