Kosztüm fegyver

Indította gife974, 2017-06-13, 16:36:50

2017-06-13, 16:36:50 Utolsó szerkesztés: 2017-06-13, 16:47:54 Szerző: gife974
Sziasztok! Be szeretném tenni a kosztüm fegyvert, ennek a témának az alapján:
[spoiler]https://forum.turkmmo.com/konu/3456478-kostum-silah-sistemi/[/spoiler]

Idáig szép és jó, indító, csomagoló lefordul, viszont a char_item.cpp nem szeretne. Lehetséges, hogy a Weapon_arrow zavar be.

Itt a funkció, amit be kell tenni:
// 1) Search: if (item->GetWearFlag() & WEARABLE_UNIQUE)
// 2) After their definition make a new line and paste:
#ifdef __WEAPON_COSTUME_SYSTEM__
#ifdef __NEW_ARROW_SYSTEM__
if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW && item->GetSubType() != WEAPON_UNLIMITED_ARROW)
#else
if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW)
#endif
{
LPITEM pkItem = GetWear(WEAR_COSTUME_WEAPON);
if (pkItem)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("For can do this unwear the costume weapon."));
return false;
}
}
else if (item->GetType() == ITEM_COSTUME && item->GetSubType() == COSTUME_WEAPON)
{
LPITEM pkItem = GetWear(WEAR_WEAPON);
if (!pkItem)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't wear a costume weapon without have a weapon weared."));
return false;
}
else if (item->GetValue(3) != pkItem->GetSubType())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't wear a costume weapon who has different type of your weapon."));
return false;
}
}

if (item->GetType() == ITEM_ROD || item->GetType() == ITEM_PICK)
{
LPITEM pkItem = GetWear(WEAR_COSTUME_WEAPON);
if (pkItem)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("For can do this unwear the costume weapon."));
return false;
}
}
#endif


// 1) Search: bool CHARACTER::CanUnequipNow(const LPITEM item, const TItemPos& srcCell, const TItemPos& destCell)
// 2) Replace their definition with:
bool CHARACTER::CanUnequipNow(const LPITEM item, const TItemPos& srcCell, const TItemPos& destCell)
{
if (ITEM_BELT == item->GetType())
VERIFY_MSG(CBeltInventoryHelper::IsExistItemInBeltInventory(this), "벨트 인벤토리에 아이템이 존재하면 해제할 수 없습니다.");

// 영원히 해제할 수 없는 아이템
if (IS_SET(item->GetFlag(), ITEM_FLAG_IRREMOVABLE))
return false;

// 아이템 unequip시 인벤토리로 옮길 때 빈 자리가 있는 지 확인
{
int pos = -1;
if (item->IsDragonSoul())
pos = GetEmptyDragonSoulInventory(item);
else
pos = GetEmptyInventory(item->GetSize());

VERIFY_MSG( -1 == pos, "소지품에 빈 공간이 없습니다." );
}

#ifdef __WEAPON_COSTUME_SYSTEM__
#ifdef __NEW_ARROW_SYSTEM__
if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW && item->GetSubType() != WEAPON_UNLIMITED_ARROW)
#else
if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW)
#endif
{
LPITEM pkItem = GetWear(WEAR_COSTUME_WEAPON);
if (pkItem)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("For can do this unwear the costume weapon."));
return false;
}
}
#endif

return true;
}


// 1) Search: static BYTE abSlot[] = {WEAR_COSTUME_BODY, WEAR_COSTUME_HAIR,};
// 2) Replace with:
static BYTE abSlot[] = {WEAR_COSTUME_BODY, WEAR_COSTUME_HAIR,
#ifdef __WEAPON_COSTUME_SYSTEM__
WEAR_COSTUME_WEAPON,
#endif
};


És itt a hiba
compile char_item.cpp
compile mob_manager.cpp
compile monarch.cpp
In file included from char_item.cpp:44:
../../common/VnumHelper.h:59:32: warning: no newline at end of file
In file included from char_item.cpp:47:
belt_inventory_helper.h:108:42: warning: no newline at end of file
compile motion.cpp
monarch.cpp:276:2: warning: no newline at end of file
compile over9refine.cpp
In file included from char_item.cpp:47:
belt_inventory_helper.h: In static member function 'static BYTE CBeltInventoryHelper::GetBeltGradeByRefineLevel(int)':
belt_inventory_helper.h:28: warning: comparison between signed and unsigned integer expressions
char_item.cpp: In member function 'bool CHARACTER::IsEmptyItemGrid(TItemPos, BYTE, int) const':
char_item.cpp:647: warning: comparison is always false due to limited range of data type
char_item.cpp:673: warning: comparison is always false due to limited range of data type
char_item.cpp: In member function 'bool CHARACTER::UseItemEx(CItem*, TItemPos)':
char_item.cpp:2394: warning: format '%d' expects type 'int', but argument 6 has type 'long int'
char_item.cpp:2398: warning: format '%d' expects type 'int', but argument 6 has type 'long int'
char_item.cpp:2410: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
char_item.cpp:2414: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
char_item.cpp:2441: warning: format '%d' expects type 'int', but argument 6 has type 'long int'
char_item.cpp:2449: warning: format '%d' expects type 'int', but argument 5 has type 'long int'
char_item.cpp:5106: warning: comparison between signed and unsigned integer expressions
char_item.cpp: In member function 'bool CHARACTER::UseItem(TItemPos, TItemPos)':
char_item.cpp:5178: warning: unused variable 'wDestCell'
char_item.cpp:5179: warning: unused variable 'bDestInven'
char_item.cpp: In member function 'bool CHARACTER::EquipItem(CItem*, int)':
char_item.cpp:6213: warning: array subscript has type 'char'
char_item.cpp: In member function 'void CHARACTER::BuffOnAttr_AddBuffsFromItem(CItem*)':
char_item.cpp:6277: warning: comparison between signed and unsigned integer expressions
char_item.cpp: In member function 'void CHARACTER::BuffOnAttr_RemoveBuffsFromItem(CItem*)':
char_item.cpp:6289: warning: comparison between signed and unsigned integer expressions
char_item.cpp: In member function 'bool CHARACTER::CanEquipNow(CItem*, const TItemPos&, const TItemPos&)':
char_item.cpp:7475: warning: unused variable 'itemType'
char_item.cpp:7476: warning: unused variable 'itemSubType'
char_item.cpp: At global scope:
char_item.cpp:7580: error: expected unqualified-id before 'if'
gmake: *** [OBJDIR/char_item.o] Error 1
gmake: *** Waiting for unfinished jobs....
root@host:/usr/src/mainline/Srcs/Server/game/src #


Előre is köszönöm.

7580. sort másold be ide

2017-06-13, 18:21:50 #2 Utolsó szerkesztés: 2017-06-13, 18:32:11 Szerző: gife974
Tessék:
#ifdef __NEW_ARROW_SYSTEM__

fogalmam sincs hogy mivan vele max annyit tehetsz hogy ha bent van a végtelen nyíl neked akkor

ezt
#ifdef __NEW_ARROW_SYSTEM__
if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW && item->GetSubType() != WEAPON_UNLIMITED_ARROW)
#else
if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW)
#endif


írd át erre

if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW && item->GetSubType() != WEAPON_UNLIMITED_ARROW)


ha bent van akkor erre
if (item->GetType() == ITEM_WEAPON && item->GetSubType() != WEAPON_ARROW)

bár nem hiszem hogy ez lenne a baja :/


A probléma továbbra is fent áll.