mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-30 01:29:21 +02:00
fix issue that spell runes are no longer comulative
This commit is contained in:
parent
3eaee10d1e
commit
7db3b3fc1f
@ -14129,282 +14129,282 @@ Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3148
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3149
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3150
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3151
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3152
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3153
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3154
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3155
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3156
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3157
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3158
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3159
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3160
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3161
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3162
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3163
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3164
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3165
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3166
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3167
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3168
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3169
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3170
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3171
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3172
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3173
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3174
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3175
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3176
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3177
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3178
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3179
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120}
|
||||
|
||||
TypeID = 3180
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3181
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3182
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3183
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3184
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3185
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3186
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3187
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=2,LightColor=215}
|
||||
|
||||
TypeID = 3188
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3189
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3190
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3191
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3192
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3193
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3194
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3195
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3196
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3197
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3198
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3199
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3200
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3201
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3202
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3203
|
||||
Name = "a spell rune"
|
||||
Flags = {MultiUse,DistUse,Rune,Take,Cumulative}
|
||||
Flags = {MultiUse,DistUse,Rune,Take}
|
||||
Attributes = {Weight=120,Brightness=1,LightColor=215}
|
||||
|
||||
TypeID = 3204
|
||||
|
@ -837,7 +837,7 @@ void BehaviourDatabase::checkAction(const NpcBehaviourAction* action, Player* pl
|
||||
int32_t itemId = evaluate(action->expression, player, message);
|
||||
const ItemType& it = Item::items[itemId];
|
||||
|
||||
if (it.stackable && !it.isRune()) {
|
||||
if (it.stackable) {
|
||||
do {
|
||||
int32_t count = std::min<int32_t>(100, amount);
|
||||
amount -= count;
|
||||
|
@ -326,7 +326,7 @@ ReturnValue Container::queryMaxCount(int32_t index, const Thing& thing, uint32_t
|
||||
}
|
||||
} else {
|
||||
const Item* destItem = getItemByIndex(index);
|
||||
if (item->equals(destItem) && !destItem->isRune() && destItem->getItemCount() < 100) {
|
||||
if (item->equals(destItem) && destItem->getItemCount() < 100) {
|
||||
uint32_t remainder = 100 - destItem->getItemCount();
|
||||
if (queryAdd(index, *item, remainder, flags) == RETURNVALUE_NOERROR) {
|
||||
n = remainder;
|
||||
|
15
src/game.cpp
15
src/game.cpp
@ -1019,11 +1019,11 @@ void Game::playerMoveItem(Player* player, const Position& fromPos,
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue ret = internalMoveItem(fromCylinder, toCylinder, toIndex, item, item->isRune() ? item->getItemCount() : count, nullptr, 0, player);
|
||||
ReturnValue ret = internalMoveItem(fromCylinder, toCylinder, toIndex, item, count, nullptr, 0, player);
|
||||
if (ret != RETURNVALUE_NOERROR) {
|
||||
player->sendCancelMessage(ret);
|
||||
} else {
|
||||
g_events->eventPlayerOnItemMoved(player, item, item->isRune() ? item->getItemCount() : count, fromPos, toPos, fromCylinder, toCylinder);
|
||||
g_events->eventPlayerOnItemMoved(player, item, count, fromPos, toPos, fromCylinder, toCylinder);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1097,12 +1097,7 @@ ReturnValue Game::internalMoveItem(Cylinder* fromCylinder, Cylinder* toCylinder,
|
||||
|
||||
uint32_t m;
|
||||
if (item->isStackable()) {
|
||||
if (item->isRune()) {
|
||||
m = std::min<uint32_t>(item->getItemCount(), maxQueryCount);
|
||||
}
|
||||
else {
|
||||
m = std::min<uint32_t>(count, maxQueryCount);
|
||||
}
|
||||
m = std::min<uint32_t>(count, maxQueryCount);
|
||||
}
|
||||
else {
|
||||
m = maxQueryCount;
|
||||
@ -1140,7 +1135,7 @@ ReturnValue Game::internalMoveItem(Cylinder* fromCylinder, Cylinder* toCylinder,
|
||||
if (item->isStackable()) {
|
||||
uint32_t n;
|
||||
|
||||
if (!item->isRune() && item->equals(toItem)) {
|
||||
if (item->equals(toItem)) {
|
||||
n = std::min<uint32_t>(100 - toItem->getItemCount(), m);
|
||||
toCylinder->updateThing(toItem, toItem->getID(), toItem->getItemCount() + n);
|
||||
updateItem = toItem;
|
||||
@ -1240,7 +1235,7 @@ ReturnValue Game::internalAddItem(Cylinder* toCylinder, Item* item, int32_t inde
|
||||
return RETURNVALUE_NOERROR;
|
||||
}
|
||||
|
||||
if (item->isStackable() && !item->isRune() && item->equals(toItem)) {
|
||||
if (item->isStackable() && item->equals(toItem)) {
|
||||
uint32_t m = std::min<uint32_t>(item->getItemCount(), maxQueryCount);
|
||||
uint32_t n = std::min<uint32_t>(100 - toItem->getItemCount(), m);
|
||||
|
||||
|
92
src/item.cpp
92
src/item.cpp
@ -823,7 +823,7 @@ bool Item::hasProperty(ITEMPROPERTY prop) const
|
||||
uint32_t Item::getWeight() const
|
||||
{
|
||||
uint32_t weight = getBaseWeight();
|
||||
if (isStackable() && !isRune()) {
|
||||
if (isStackable()) {
|
||||
return weight * std::max<uint32_t>(1, getItemCount());
|
||||
}
|
||||
return weight;
|
||||
@ -840,6 +840,8 @@ std::string Item::getDescription(const ItemType& it, int32_t lookDistance,
|
||||
}
|
||||
|
||||
if (it.isRune()) {
|
||||
uint32_t charges = std::max(static_cast<uint32_t>(1), static_cast<uint32_t>(item == nullptr ? it.charges : item->getCharges()));
|
||||
|
||||
if (it.runeLevel > 0) {
|
||||
s << " for level " << it.runeLevel;
|
||||
}
|
||||
@ -849,18 +851,21 @@ std::string Item::getDescription(const ItemType& it, int32_t lookDistance,
|
||||
}
|
||||
|
||||
s << " for magic level " << it.runeMagLevel;
|
||||
s << ". It's an \"" << it.runeSpellName << "\"-spell (" << subType << "x). ";
|
||||
} else if (it.isDoor() && item) {
|
||||
s << ". It's an \"" << it.runeSpellName << "\"-spell (" << charges << "x). ";
|
||||
}
|
||||
else if (it.isDoor() && item) {
|
||||
if (item->hasAttribute(ITEM_ATTRIBUTE_DOORLEVEL)) {
|
||||
s << " for level " << item->getIntAttr(ITEM_ATTRIBUTE_DOORLEVEL);
|
||||
}
|
||||
s << ".";
|
||||
} else if (it.weaponType != WEAPON_NONE) {
|
||||
}
|
||||
else if (it.weaponType != WEAPON_NONE) {
|
||||
if (it.weaponType == WEAPON_DISTANCE && it.ammoType != AMMO_NONE) {
|
||||
if (it.attack != 0) {
|
||||
s << ", Atk" << std::showpos << it.attack << std::noshowpos;
|
||||
}
|
||||
} else if (it.weaponType != WEAPON_AMMO && it.weaponType != WEAPON_WAND && (it.attack != 0 || it.defense != 0)) {
|
||||
}
|
||||
else if (it.weaponType != WEAPON_AMMO && it.weaponType != WEAPON_WAND && (it.attack != 0 || it.defense != 0)) {
|
||||
s << " (";
|
||||
if (it.attack != 0) {
|
||||
s << "Atk:" << static_cast<int>(it.attack);
|
||||
@ -876,39 +881,49 @@ std::string Item::getDescription(const ItemType& it, int32_t lookDistance,
|
||||
s << ")";
|
||||
}
|
||||
s << ".";
|
||||
} else if (it.armor != 0) {
|
||||
}
|
||||
else if (it.armor != 0) {
|
||||
if (it.charges > 0) {
|
||||
if (subType > 1) {
|
||||
s << " that has " << static_cast<int32_t>(subType) << " charges left";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << " that has " << it.charges << " charge left";
|
||||
}
|
||||
}
|
||||
|
||||
s << " (Arm:" << it.armor << ").";
|
||||
} else if (it.isFluidContainer()) {
|
||||
}
|
||||
else if (it.isFluidContainer()) {
|
||||
if (item && item->getFluidType() != 0) {
|
||||
s << " of " << items[item->getFluidType()].name << ".";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << ". It is empty.";
|
||||
}
|
||||
} else if (it.isSplash()) {
|
||||
}
|
||||
else if (it.isSplash()) {
|
||||
s << " of ";
|
||||
if (item && item->getFluidType() != 0) {
|
||||
s << items[item->getFluidType()].name;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << items[1].name;
|
||||
}
|
||||
s << ".";
|
||||
} else if (it.isContainer() && !it.isChest()) {
|
||||
}
|
||||
else if (it.isContainer() && !it.isChest()) {
|
||||
s << " (Vol:" << static_cast<int>(it.maxItems) << ").";
|
||||
} else if (it.isKey()) {
|
||||
}
|
||||
else if (it.isKey()) {
|
||||
if (item) {
|
||||
s << " (Key:" << static_cast<int>(item->getIntAttr(ITEM_ATTRIBUTE_KEYNUMBER)) << ").";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << " (Key:0).";
|
||||
}
|
||||
} else if (it.allowDistRead) {
|
||||
}
|
||||
else if (it.allowDistRead) {
|
||||
s << ".";
|
||||
s << std::endl;
|
||||
|
||||
@ -922,39 +937,49 @@ std::string Item::getDescription(const ItemType& it, int32_t lookDistance,
|
||||
s << " on " << formatDateShort(date);
|
||||
}
|
||||
s << ": ";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << "You read: ";
|
||||
}
|
||||
s << item->getText();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << "You are too far away to read it.";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << "Nothing is written on it.";
|
||||
}
|
||||
} else if (it.charges > 0) {
|
||||
}
|
||||
else if (it.charges > 0) {
|
||||
uint32_t charges = (item == nullptr ? it.charges : item->getCharges());
|
||||
if (charges > 1) {
|
||||
s << " that has " << static_cast<int>(charges) << " charges left.";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << " that has 1 charge left.";
|
||||
}
|
||||
} else if (it.showDuration) {
|
||||
}
|
||||
else if (it.showDuration) {
|
||||
if (item && item->hasAttribute(ITEM_ATTRIBUTE_DURATION)) {
|
||||
int32_t duration = item->getDuration() / 1000;
|
||||
s << " that has energy for ";
|
||||
|
||||
if (duration >= 120) {
|
||||
s << duration / 60 << " minutes left.";
|
||||
} else if (duration > 60) {
|
||||
}
|
||||
else if (duration > 60) {
|
||||
s << "1 minute left.";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << "less than a minute left.";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << " that is brand-new.";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << ".";
|
||||
}
|
||||
|
||||
@ -967,7 +992,8 @@ std::string Item::getDescription(const ItemType& it, int32_t lookDistance,
|
||||
|
||||
if (it.wieldInfo & WIELDINFO_VOCREQ) {
|
||||
s << it.vocationString;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << "players";
|
||||
}
|
||||
|
||||
@ -978,7 +1004,8 @@ std::string Item::getDescription(const ItemType& it, int32_t lookDistance,
|
||||
if (it.wieldInfo & WIELDINFO_MAGLV) {
|
||||
if (it.wieldInfo & WIELDINFO_LEVEL) {
|
||||
s << " and";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << " of";
|
||||
}
|
||||
|
||||
@ -997,7 +1024,8 @@ std::string Item::getDescription(const ItemType& it, int32_t lookDistance,
|
||||
|
||||
if (item && item->getSpecialDescription() != "") {
|
||||
s << std::endl << item->getSpecialDescription().c_str();
|
||||
} else if (it.description.length() && lookDistance <= 1) {
|
||||
}
|
||||
else if (it.description.length() && lookDistance <= 1) {
|
||||
s << std::endl << it.description << ".";
|
||||
}
|
||||
|
||||
@ -1020,13 +1048,14 @@ std::string Item::getNameDescription(const ItemType& it, const Item* item /*= nu
|
||||
|
||||
const std::string& name = (item ? item->getName() : it.name);
|
||||
if (!name.empty()) {
|
||||
if (it.stackable && !it.isRune() && subType > 1) {
|
||||
if (it.stackable && subType > 1) {
|
||||
if (it.showCount) {
|
||||
s << subType << ' ';
|
||||
}
|
||||
|
||||
s << (item ? item->getPluralName() : it.getPluralName());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (addArticle) {
|
||||
const std::string& article = (item ? item->getArticle() : it.article);
|
||||
if (!article.empty()) {
|
||||
@ -1036,7 +1065,8 @@ std::string Item::getNameDescription(const ItemType& it, const Item* item /*= nu
|
||||
|
||||
s << name;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
s << "an item of type " << it.id;
|
||||
}
|
||||
return s.str();
|
||||
|
@ -105,7 +105,7 @@ void NetworkMessage::addItem(uint16_t id, uint8_t count)
|
||||
add<uint16_t>(it.id);
|
||||
}
|
||||
|
||||
if (it.stackable) {
|
||||
if (it.stackable || it.isRune()) {
|
||||
addByte(count);
|
||||
} else if (it.isSplash() || it.isFluidContainer()) {
|
||||
addByte(getLiquidColor(count));
|
||||
@ -124,6 +124,8 @@ void NetworkMessage::addItem(const Item* item)
|
||||
|
||||
if (it.stackable) {
|
||||
addByte(std::min<uint16_t>(0xFF, item->getItemCount()));
|
||||
} else if (it.isRune()) {
|
||||
addByte(std::min<uint16_t>(0xFF, item->getCharges()));
|
||||
} else if (it.isSplash() || it.isFluidContainer()) {
|
||||
addByte(getLiquidColor(item->getFluidType()));
|
||||
}
|
||||
|
@ -2138,7 +2138,7 @@ ReturnValue Player::queryAdd(int32_t index, const Thing& thing, uint32_t count,
|
||||
if (ret == RETURNVALUE_NOERROR || ret == RETURNVALUE_NOTENOUGHROOM) {
|
||||
//need an exchange with source?
|
||||
const Item* inventoryItem = getInventoryItem(static_cast<slots_t>(index));
|
||||
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->isRune() || inventoryItem->getID() != item->getID())) {
|
||||
if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->getID() != item->getID())) {
|
||||
return RETURNVALUE_NEEDEXCHANGE;
|
||||
}
|
||||
|
||||
@ -2207,7 +2207,7 @@ ReturnValue Player::queryMaxCount(int32_t index, const Thing& thing, uint32_t co
|
||||
}
|
||||
|
||||
if (destItem) {
|
||||
if (!destItem->isRune() && destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {
|
||||
if (destItem->isStackable() && item->equals(destItem) && destItem->getItemCount() < 100) {
|
||||
maxQueryCount = 100 - destItem->getItemCount();
|
||||
}
|
||||
else {
|
||||
|
@ -1841,7 +1841,7 @@ bool RuneSpell::executeUse(Player* player, Item* item, const Position&, Thing* t
|
||||
|
||||
postCastSpell(player);
|
||||
if (hasCharges && item && g_config.getBoolean(ConfigManager::REMOVE_RUNE_CHARGES)) {
|
||||
int32_t newCount = std::max<int32_t>(0, item->getItemCount() - 1);
|
||||
int32_t newCount = std::max<int32_t>(0, item->getCharges() - 1);
|
||||
g_game.transformItem(item, item->getID(), newCount);
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user