Magic Soul Leeching

Junior Spellweaver
Joined
Aug 5, 2011
Messages
167
Reaction score
7
Newbie guide here but if you ever wondered how to add a Magic Soul Leeching, check it out.

It works just like the (melee) soul leeching but as a sepparate stat for magic skills only (so you can set it to a different value).



Source:
WndManager.cpp
under:
Code:
DST_MELEE_STEALHP,				TID_TOOLTIP_DST_MELEE_STEALHP,
add:
Code:
#ifdef __MAGIC_STEALHP
DST_MAGIC_STEALHP,				TID_TOOLTIP_DST_MAGIC_STEALHP,
#endif
~~~~~~~~
under:
Code:
static int nDstRate[] = {
add*:
Code:
#ifdef __MAGIC_STEALHP
DST_MAGIC_STEALHP,
#endif
*you can also put the DST_MELEE_STEALHP here if you want it to appear as % in game.
~~~~~~~~
AttackArbiter.cpp
under:
Code:
if( type == ATK_GENERIC && m_pAttacker->IsPlayer() )
	{
		int nDstHP = m_pAttacker->GetParam( DST_MELEE_STEALHP, 0 );
		int nStealHP = (int)( nDamage * (nDstHP / 100.0f) );
		if( 0 < nDstHP )
			m_pAttacker->SetDestParam( DST_HP, nStealHP, NULL_CHGPARAM );				// °ø°ÝÀÚ¿¡°Ô ÈíÇ÷HP¸¦ ÁÜ.
	}
add:
Code:
#ifdef __MAGIC_STEALHP
	if (type == ATK_MAGICSKILL && m_pAttacker->IsPlayer())
	{
		int nDstHP = m_pAttacker->GetParam(DST_MAGIC_STEALHP, 0);
		int nStealHP = (int)(nDamage * (nDstHP / 100.0f));
		if (0 < nDstHP)
			m_pAttacker->SetDestParam(DST_HP, nStealHP, NULL_CHGPARAM);				// °ø°ÝÀÚ¿¡°Ô ÈíÇ÷HP¸¦ ÁÜ.
	}
#endif

Versioncommon.h (or kCommon.h if you use Ketchup's files)
Code:
#define __MAGIC_STEALHP

Resource
defineAttribute.h
Code:
#define DST_MAGIC_STEALHP	XXX

defineText.h
Code:
#define TID_TOOLTIP_DST_MAGIC_STEALHP XXX

textclient.txt.txt
Code:
IDS_TEXTCLIENT_INC_004960	Magic Soul Leeching

textclient.inc
Code:
TID_TOOLTIP_DST_MAGIC_STEALHP 0xffffffff
{
	IDS_TEXTCLIENT_INC_004960
}
 
Last edited:
Newbie guide here but if you ever wondered how to add a Magic Soul Leeching, check it out.

It works just like the (melee) soul leeching but as a sepparate stat for magic skills only (so you can set it to a different value).



Source:
WndManager.cpp
under:
Code:
DST_MELEE_STEALHP,                TID_TOOLTIP_DST_MELEE_STEALHP,
add:
Code:
#ifdef __MAGIC_STEALHP
DST_MAGIC_STEALHP,                TID_TOOLTIP_DST_MAGIC_STEALHP,
#endif
~~~~~~~~
under:
Code:
static int nDstRate[] = {
add:
Code:
#ifdef __MAGIC_STEALHP
DST_MAGIC_STEALHP,
#endif
*you can also put the DST_MELEE_STEALHP here if you want it to appear as % in game.
~~~~~~~~
AttackArbiter.cpp
under:
Code:
if( type == ATK_GENERIC && m_pAttacker->IsPlayer() )
    {
        int nDstHP = m_pAttacker->GetParam( DST_MELEE_STEALHP, 0 );
        int nStealHP = (int)( nDamage * (nDstHP / 100.0f) );
        if( 0 < nDstHP )
            m_pAttacker->SetDestParam( DST_HP, nStealHP, NULL_CHGPARAM );                // °ø°ÝÀÚ¿¡°Ô ÈíÇ÷HP¸¦ ÁÜ.
    }
add:
Code:
#ifdef __MAGIC_STEALHP
    if (type == ATK_MAGICSKILL && m_pAttacker->IsPlayer())
    {
        int nDstHP = m_pAttacker->GetParam(DST_MAGIC_STEALHP, 0);
        int nStealHP = (int)(nDamage * (nDstHP / 100.0f));
        if (0 < nDstHP)
            m_pAttacker->SetDestParam(DST_HP, nStealHP, NULL_CHGPARAM);                // °ø°ÝÀÚ¿¡°Ô ÈíÇ÷HP¸¦ ÁÜ.
    }
#endif

Versioncommon.h (or kCommon.h if you use Ketchup's files)
Code:
#define __MAGIC_STEALHP

Resource
defineAttribute.h
Code:
#define DST_MAGIC_STEALHP    XXX

defineText.h
Code:
#define TID_TOOLTIP_DST_MAGIC_STEALHP XXX

textclient.txt.txt
Code:
IDS_TEXTCLIENT_INC_004960    Magic Soul Leeching

textclient.inc
Code:
TID_TOOLTIP_DST_MAGIC_STEALHP 0xffffffff
{
    IDS_TEXTCLIENT_INC_004960
}


Thanks for this. Works as intended!

flyff00000 - Magic Soul Leeching - RaGEZONE Forums


I had a little problem before tho. I wasn't able to use /sro command when I put 120 in it. I instead put it on
#define DST_MAGIC_STEALHP 84
since 84 isn't used on sir Ketchup's V18.3 source.
 
Last edited:
Nope. Doesn't work at all.
Tested with mage and tested with RM. Doesn't work.

Added this to one of my guild buffs and Soul leech beads.

 
Last edited:
Nope. Doesn't work at all.
Tested with mage and tested with RM. Doesn't work.

Added this to one of my guild buffs and Soul leech beads.


I am 100% sure that you missed something.

If it works for me and for many other people, but it doesn't for you, who's wrong?

Have you added it correctly in AttackArbiter.cpp?
 
I am 100% sure that you missed something.

If it works for me and for many other people, but it doesn't for you, who's wrong?

Have you added it correctly in AttackArbiter.cpp?

I got it working.
The number already had its define so i changed it. Works now.
 
Back