Hello OTLand
today i've made this feature for tfs 1.x
tested and working very well
first we start with code
at enums.h
find
Code:
ITEM_ATTRIBUTE_DOORID = 4194304
and add this after
Code:
ITEM_ATTRIBUTE_DUAL = 8388608
at item.cpp
find
Code:
case ATTR_EXTRADEFENSE: {
int32_t extraDefense;
if (!propStream.read<int32_t>(extraDefense)) {
return ATTR_READ_ERROR;
}
setIntAttr(ITEM_ATTRIBUTE_EXTRADEFENSE, extraDefense);
break;
}
and add this after
Code:
case ATTR_DUAL: {
bool dual;
if (!propStream.read<bool>(dual)) {
return ATTR_READ_ERROR;
}
break;
}
find
Code:
if (hasAttribute(ITEM_ATTRIBUTE_EXTRADEFENSE)) {
propWriteStream.write<uint8_t>(ATTR_EXTRADEFENSE);
propWriteStream.write<int32_t>(getIntAttr(ITEM_ATTRIBUTE_EXTRADEFENSE));
}
and add this after
Code:
if (hasAttribute(ITEM_ATTRIBUTE_DUAL)) {
return;
}
at item.h
find
and add this after
find
Code:
int32_t getDefense() const {
if (hasAttribute(ITEM_ATTRIBUTE_DEFENSE)) {
return getIntAttr(ITEM_ATTRIBUTE_DEFENSE);
}
return items[id].defense;
}
and add this after
Code:
bool isDual() const {
if (hasAttribute(ITEM_ATTRIBUTE_DUAL)) {
return bool(ITEM_ATTRIBUTE_DUAL);
}
return items[id].dual;
}
at items.cpp
find
and add this after
find
Code:
else if (tmpStrValue == "defense") {
it.defense = pugi::cast<int32_t>(valueAttribute.value());
}
and add this after
Code:
else if (tmpStrValue == "dual") {
it.dual = valueAttribute.as_bool();
}
at items.h
find
and add this after
at luascript.cpp
find
Code:
registerEnum(ITEM_ATTRIBUTE_ATTACK)
add this after
Code:
registerEnum(ITEM_ATTRIBUTE_DUAL)
at player.cpp
find
and replace this
Code:
if (item->getWeaponType() != WEAPON_SHIELD)
with this
Code:
if (item->getWeaponType() != WEAPON_SHIELD && !item->isDual())
find
Code:
else if (!leftItem->isWeapon() || !item->isWeapon()
and after this
add this code
Code:
|| leftItem->isDual() && item->isDual()
find
and replace this
Code:
if (!item->isWeapon() || item->getWeaponType() == WEAPON_SHIELD)
with this
Code:
if (!item->isWeapon() && !item->isDual() || item->getWeaponType() == WEAPON_SHIELD)
find
Code:
else if (!rightItem->isWeapon() || !item->isWeapon()
and after this
add this code
Code:
|| rightItem->isDual() && item->isDual()
at tools.cpp
find
Code:
else if (str == "defense") {
return ITEM_ATTRIBUTE_DEFENSE;
}
and add this after
Code:
else if (str == "dual") {
return ITEM_ATTRIBUTE_DUAL;
}
now we have done the dual code
how it work ?
at items.xml u can add this attribute key to any weapon
Code:
<attribute key="dual" value="1" />
Good Luck
Regards : EvilSkillz