• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ How to fetch leech amount?

Mjmackan

Mapper ~ Writer
Joined
Jul 18, 2009
Messages
1,477
Solutions
18
Reaction score
195
Location
Sweden
C++:
                if (casterPlayer->getHealth() < casterPlayer->getMaxHealth()) {
                    uint16_t chance = casterPlayer->getSpecialSkill(SPECIALSKILL_LIFELEECHCHANCE);
                    uint16_t skill = casterPlayer->getSpecialSkill(SPECIALSKILL_LIFELEECHAMOUNT);
                    if (chance > 0 && skill > 0 && normal_random(1, 100) <= chance) {
                        leechCombat.primary.value = std::round(totalDamage * (skill / 100.));
                        g_game.combatChangeHealth(nullptr, casterPlayer, leechCombat);
                        casterPlayer->sendMagicEffect(casterPlayer->getPosition(), CONST_ME_MAGIC_RED);
                        casterPlayer->sendAnimatedText("hej", casterPlayer->getPosition(), TEXTCOLOR_BLUE);
                    }
                }


Instead of "hej" how do i fetch the leech amount? In Lua you use: fetchleech = "100" sendmsg ".. fetchLeech ..", how do you do in c++?
 
Back
Top