EvilSkillz
Back
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
and add this after
at item.cpp
find
and add this after
find
and add this after
at item.h
find
and add this after
find
and add this after
at items.cpp
find
and add this after
find
and add this after
at items.h
find
and add this after
at luascript.cpp
find
add this after
at player.cpp
find
and replace this
with this
find
and after this
add this code
find
and replace this
with this
find
and after this
add this code
at tools.cpp
find
and add this after
now we have done the dual code
how it work ?
at items.xml u can add this attribute key to any weapon
Good Luck
Regards : EvilSkillz
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
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;
}
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));
}
Code:
if (hasAttribute(ITEM_ATTRIBUTE_DUAL)) {
return;
}
at item.h
find
Code:
ATTR_SHOOTRANGE = 33,
Code:
ATTR_DUAL = 34
find
Code:
int32_t getDefense() const {
if (hasAttribute(ITEM_ATTRIBUTE_DEFENSE)) {
return getIntAttr(ITEM_ATTRIBUTE_DEFENSE);
}
return items[id].defense;
}
Code:
bool isDual() const {
if (hasAttribute(ITEM_ATTRIBUTE_DUAL)) {
return bool(ITEM_ATTRIBUTE_DUAL);
}
return items[id].dual;
}
at items.cpp
find
Code:
armor = 0;
Code:
dual = false;
find
Code:
else if (tmpStrValue == "defense") {
it.defense = pugi::cast<int32_t>(valueAttribute.value());
}
Code:
else if (tmpStrValue == "dual") {
it.dual = valueAttribute.as_bool();
}
at items.h
find
Code:
int32_t runeLevel;
Code:
bool dual;
at luascript.cpp
find
Code:
registerEnum(ITEM_ATTRIBUTE_ATTACK)
Code:
registerEnum(ITEM_ATTRIBUTE_DUAL)
at player.cpp
find
Code:
case CONST_SLOT_RIGHT:
Code:
if (item->getWeaponType() != WEAPON_SHIELD)
Code:
if (item->getWeaponType() != WEAPON_SHIELD && !item->isDual())
find
Code:
else if (!leftItem->isWeapon() || !item->isWeapon()
Code:
|| type == WEAPON_AMMO
Code:
|| leftItem->isDual() && item->isDual()
find
Code:
case CONST_SLOT_LEFT:
Code:
if (!item->isWeapon() || item->getWeaponType() == WEAPON_SHIELD)
Code:
if (!item->isWeapon() && !item->isDual() || item->getWeaponType() == WEAPON_SHIELD)
find
Code:
else if (!rightItem->isWeapon() || !item->isWeapon()
Code:
type == WEAPON_AMMO
Code:
|| rightItem->isDual() && item->isDual()
at tools.cpp
find
Code:
else if (str == "defense") {
return ITEM_ATTRIBUTE_DEFENSE;
}
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