Lua_Horus2 2 Posted July 2, 2018 Share Posted July 2, 2018 hello, how can I change the damage depending on the item I use, for example if I have equipped an item with vnum 105, when using this item, my damage is always 10? Thanks!! Link to comment Share on other sites More sharing options...
Lua_Horus2 2 Posted July 12, 2018 Author Share Posted July 12, 2018 push Link to comment Share on other sites More sharing options...
boaspessoal 8 Posted July 12, 2018 Share Posted July 12, 2018 Maybe: char_battle -> CHARACTER::Damage Spoiler if (pAttacker) { if(pAttacker->IsEquipUniqueItem(105)) { dam = 10; } } Link to comment Share on other sites More sharing options...
avertuss 48 Posted July 12, 2018 Share Posted July 12, 2018 3 minuty temu, boaspessoal napisał: Maybe: char_battle -> CHARACTER::Damage Odkryj ukrytą treść if (pAttacker) { if(pAttacker->IsEquipUniqueItem(105)) { dam = 10; } } but what if item isn't unique? Link to comment Share on other sites More sharing options...
boaspessoal 8 Posted July 12, 2018 Share Posted July 12, 2018 9 minutes ago, avertuss said: but what if item isn't unique? EDIT: It only works on unique_item it seems Link to comment Share on other sites More sharing options...
Lua_Horus2 2 Posted July 12, 2018 Author Share Posted July 12, 2018 And for item like sword? Link to comment Share on other sites More sharing options...
boaspessoal 8 Posted July 12, 2018 Share Posted July 12, 2018 35 minutes ago, Lua_Horus2 said: And for item like sword? Not tested: Spoiler if (pAttacker) { LPITEM item = pAttacker->GetWear(WEAR_WEAPON); if (item == NULL) return; else if (item == 105) dam = 10; } Link to comment Share on other sites More sharing options...
avertuss 48 Posted July 13, 2018 Share Posted July 13, 2018 20 godzin temu, boaspessoal napisał: Not tested: Odkryj ukrytą treść if (pAttacker) { LPITEM item = pAttacker->GetWear(WEAR_WEAPON); if (item == NULL) return; else if (item == 105) dam = 10; } char_battle.cpp: In member function 'bool CHARACTER::Damage(CHARACTER*, int, EDamageType)': char_battle.cpp:1971: error: ISO C++ forbids comparison between pointer and integer Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now