summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-08-25 22:36:51 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-08-25 22:36:51 +0000
commitba5c32ee9c5c57613ec678d47c3871e9ea312402 (patch)
treed33acb84348eb0acad268af1db9213f9dd46f21b
parent0de989625ed27003420ca3bd6a55183901564fbb (diff)
downloadmana-client-ba5c32ee9c5c57613ec678d47c3871e9ea312402.tar.gz
mana-client-ba5c32ee9c5c57613ec678d47c3871e9ea312402.tar.bz2
mana-client-ba5c32ee9c5c57613ec678d47c3871e9ea312402.tar.xz
mana-client-ba5c32ee9c5c57613ec678d47c3871e9ea312402.zip
Added items effect description support. TODO: Display it in buy/sell/inventory/equip windows.
-rw-r--r--data/items.xsd1
-rw-r--r--src/resources/iteminfo.cpp10
-rw-r--r--src/resources/iteminfo.h7
-rw-r--r--src/resources/itemmanager.cpp4
-rw-r--r--src/resources/itemmanager.h2
5 files changed, 23 insertions, 1 deletions
diff --git a/data/items.xsd b/data/items.xsd
index 407182cc..0f5ed91b 100644
--- a/data/items.xsd
+++ b/data/items.xsd
@@ -22,6 +22,7 @@
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="description" type="xsd:string" />
+ <xsd:attribute name="effect" type="xsd:string" />
<xsd:attribute name="id" type="xsd:positiveInteger" />
<xsd:attribute name="image" type="xsd:positiveInteger" />
<xsd:attribute name="art" type="mw_ItemArtType" />
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index bceeffef..e23be049 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -70,6 +70,16 @@ std::string ItemInfo::getDescription()
return description;
}
+void ItemInfo::setEffect(const std::string &effect)
+{
+ this->effect = effect;
+}
+
+std::string ItemInfo::getEffect()
+{
+ return effect;
+}
+
void ItemInfo::setType(short type)
{
this->type = type;
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index c9c5c85c..f634025f 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -53,7 +53,11 @@ class ItemInfo
void setDescription(const std::string &description);
std::string getDescription();
-
+
+ void setEffect(const std::string &effect);
+
+ std::string getEffect();
+
void setType(short type);
short getType();
@@ -76,6 +80,7 @@ class ItemInfo
short image, art;
std::string name;
std::string description;
+ std::string effect;
short type, weight;
char slot;
diff --git a/src/resources/itemmanager.cpp b/src/resources/itemmanager.cpp
index f56968cf..7d9c5ef5 100644
--- a/src/resources/itemmanager.cpp
+++ b/src/resources/itemmanager.cpp
@@ -68,6 +68,9 @@ ItemManager::ItemManager()
prop = xmlGetProp(node, BAD_CAST "description");
std::string description((const char*)prop);
xmlFree(prop);
+ prop = xmlGetProp(node, BAD_CAST "effect");
+ std::string effect((const char*)prop);
+ xmlFree(prop);
prop = xmlGetProp(node, BAD_CAST "type");
int type = atoi((const char*)prop);
xmlFree(prop);
@@ -83,6 +86,7 @@ ItemManager::ItemManager()
itemInfo->setArt(art);
itemInfo->setName(name);
itemInfo->setDescription(description);
+ itemInfo->setEffect(effect);
itemInfo->setType(type);
itemInfo->setWeight(weight);
itemInfo->setSlot(slot);
diff --git a/src/resources/itemmanager.h b/src/resources/itemmanager.h
index ed4889a6..124b2afd 100644
--- a/src/resources/itemmanager.h
+++ b/src/resources/itemmanager.h
@@ -45,6 +45,8 @@ class ItemManager
~ItemManager();
ItemInfo *getItemInfo(int id);
+
+ ItemInfo *getItemEffect(int id);
protected:
// Items database