Typical 0 Posted February 5, 2020 Share Posted February 5, 2020 Hi, I have 2 questions. 1. The first leadership skill is unlocked from level 10. How can I unlock all level 1 skills? I change it: m_anMaxRole[PARTY_ROLE_ATTACKER] = m_iLeadership >= 10 ? 1 : 0; m_anMaxRole[PARTY_ROLE_HASTE] = m_iLeadership >= 20 ? 1 : 0; m_anMaxRole[PARTY_ROLE_TANKER] = m_iLeadership >= 20 ? 1 : 0; m_anMaxRole[PARTY_ROLE_BUFFER] = m_iLeadership >= 25 ? 1 : 0; m_anMaxRole[PARTY_ROLE_SKILL_MASTER] = m_iLeadership >= 35 ? 1 : 0; m_anMaxRole[PARTY_ROLE_DEFENDER] = m_iLeadership >= 40 ? 1 : 0; m_anMaxRole[PARTY_ROLE_ATTACKER] += m_iLeadership >= 40 ? 1 : 0; for this: m_anMaxRole[PARTY_ROLE_ATTACKER] = m_iLeadership >= 1 ? 1 : 0; m_anMaxRole[PARTY_ROLE_HASTE] = m_iLeadership >= 1 ? 1 : 0; m_anMaxRole[PARTY_ROLE_TANKER] = m_iLeadership >= 1 ? 1 : 0; m_anMaxRole[PARTY_ROLE_BUFFER] = m_iLeadership >= 1 ? 1 : 0; m_anMaxRole[PARTY_ROLE_SKILL_MASTER] = m_iLeadership >= 1 ? 1 : 0; m_anMaxRole[PARTY_ROLE_DEFENDER] = m_iLeadership >= 1 ? 1 : 0; m_anMaxRole[PARTY_ROLE_ATTACKER] += m_iLeadership >= 1 ? 1 : 0; But it doesn't work. 2. How to change polymorph bonuses? I would like polymorphic bonuses to be read from the array that I set. For example like this: Strong against monsters: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] Attack value: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400] This line probably seems to be responsible for bonuses in the source: switch (GetBonusType(pMob->m_table.dwVnum)) { case POLYMORPH_ATK_BONUS: pChar->AddAffect(AFFECT_POLYMORPH, POINT_ATT_BONUS, dwBonusPercent, AFF_POLYMORPH, dwDuration - 1, 0, false); break; case POLYMORPH_DEF_BONUS: pChar->AddAffect(AFFECT_POLYMORPH, POINT_DEF_BONUS, dwBonusPercent, AFF_POLYMORPH, dwDuration - 1, 0, false); break; case POLYMORPH_SPD_BONUS: pChar->AddAffect(AFFECT_POLYMORPH, POINT_MOV_SPEED, dwBonusPercent, AFF_POLYMORPH, dwDuration - 1, 0, false); break; default: case POLYMORPH_NO_BONUS: break; } But I don't know how to make bonuses read from the array. Many thanks in advance for help. Link to comment Share on other sites More sharing options...
Typical 0 Posted February 12, 2020 Author Share Posted February 12, 2020 refresh Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10270 Posted February 12, 2020 Forum Moderator Share Posted February 12, 2020 (edited) You've to do something like this: static const uint16_t POLYMORPH_BONUS_MONSTER[SKILL_MAX_LEVEL + 1] = { 0, // reserved 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, // 1-10 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, // 11-20 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, // 21-30 310, 320, 330, 340, 350, 360, 370, 380, 390, 400 // 31-40 }; pChar->AddAffect(AFFECT_POLYMORPH, POINT_ATTBONUS_MONSTER, POLYMORPH_BONUS_MONSTER[bySkillLevel], AFF_POLYMORPH, dwDuration - 1, 0, false); Edited February 12, 2020 by VegaS™ 2 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Typical 0 Posted February 12, 2020 Author Share Posted February 12, 2020 (edited) 4 hours ago, VegaS™ said: You've to do something like this: static const uint16_t POLYMORPH_BONUS_MONSTER[SKILL_MAX_LEVEL] = { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400 }; pChar->AddAffect(AFFECT_POLYMORPH, POINT_ATTBONUS_MONSTER, POLYMORPH_GIVE_MONSTER[bySkillLevel], AFF_POLYMORPH, dwDuration - 1, 0, false); I did something like this: But it doesn't work. Log: polymorph.cpp:96: error: too many initializers for 'const uint16_t [40]' polymorph.cpp:102: error: 'POLYMORPH_GIVE_MONSTER' was not declared in this scope Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10270 Posted February 12, 2020 Forum Moderator Share Posted February 12, 2020 (edited) Check my reply again. Btw, instead of doing an array with values, you could do a simple formula for each level and play with it as you want. For default structure: value = 10 * bySkillLevel Edited February 12, 2020 by VegaS™ 1 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Typical 0 Posted February 12, 2020 Author Share Posted February 12, 2020 (edited) 42 minutes ago, VegaS™ said: Check my reply again. Btw, instead of doing an array with values, you could do a simple formula for each level and play with it as you want. For default structure: value = 10 * bySkillLevel It compiled, but after the transformation I do not get any bonuses. did something like this: Did I make a mistake somewhere? Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10270 Posted February 12, 2020 Forum Moderator Share Posted February 12, 2020 (edited) The function PolymorphCharacter from CPolymorphUtils class is called just if you use 50322 item vnum and it's used just the type POMYMORPH_SPD_BONUS, rest of them are unused. If you want to do this change for polymorph itself with the item 70104, try to do this: Open file char_item.cpp and search for: AddAffect(AFFECT_POLYMORPH, POINT_ATT_BONUS, dwBonus, AFF_POLYMORPH, iDuration, 0, false); Replace with: (have careful when you do copy-paste of a code from code tag, if you get the error "expected a ;") - the code tag is shitty, for solve this copy the code into notepad and set the encoding to ANSI then copy to visual studio. This is the hidden content, please Sign In or Sign Up Also you can take a look into int CHARACTER::GetPolymorphPoint(BYTE type) const, there're some calculations too, if you want to change them or remove. Edited December 3, 2020 by VegaS™ 6 2 2 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Typical 0 Posted February 12, 2020 Author Share Posted February 12, 2020 48 minutes ago, VegaS™ said: The function PolymorphCharacter from CPolymorphUtils class is called just if you use 50322 item vnum and it's used just the type POMYMORPH_SPD_BONUS, rest of them are unused. If you want to do this change for polymorph itself with the item 70104, try to do this: Open file char_item.cpp and search for: AddAffect(AFFECT_POLYMORPH, POINT_ATT_BONUS, dwBonus, AFF_POLYMORPH, iDuration, 0, false); Replace with: (have careful when you do copy-paste of a code from code tag, if you get the error "expected a ;") - the code tag is shitty, for solve this copy the code into notepad and set the encoding to ANSI then copy to visual studio. static const uint16_t POLYMORPH_BONUS_MONSTER[SKILL_MAX_LEVEL + 1] = { 0, // reserved 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, // 1-10 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, // 11-20 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, // 21-30 310, 320, 330, 340, 350, 360, 370, 380, 390, 400 // 31-40 }; const uint8_t bSkillLevel = GetSkillLevel(POLYMORPH_SKILL_ID); AddAffect(AFFECT_POLYMORPH, POINT_ATTBONUS_MONSTER, POLYMORPH_BONUS_MONSTER[bSkillLevel], AFF_POLYMORPH, iDuration, 0, false); Also you can take a look into int CHARACTER::GetPolymorphPoint(BYTE type) const, there're some calculations too, if you want to change them or remove. Thank you so much, it works. Could I still count on help regarding these group bonuses? Link to comment Share on other sites More sharing options...
Typical 0 Posted February 17, 2020 Author Share Posted February 17, 2020 refresh I need help with 1 question Link to comment Share on other sites More sharing options...
Typical 0 Posted February 19, 2020 Author Share Posted February 19, 2020 On 2/17/2020 at 10:26 AM, Typical said: refresh I need help with 1 question Link to comment Share on other sites More sharing options...
Typical 0 Posted February 21, 2020 Author Share Posted February 21, 2020 On 2/17/2020 at 10:26 AM, Typical said: refresh I need help with 1 question Link to comment Share on other sites More sharing options...
Typical 0 Posted February 23, 2020 Author Share Posted February 23, 2020 On 2/17/2020 at 10:26 AM, Typical said: refresh I need help with 1 question Link to comment Share on other sites More sharing options...
Typical 0 Posted February 26, 2020 Author Share Posted February 26, 2020 On 2/17/2020 at 10:26 AM, Typical said: refresh I need help with 1 question 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