Is there anyone know how to apply lifesteal effect on the weapon?

+
Is there anyone know how to apply lifesteal effect on the weapon?

I modified weapon.xml file that is added lifesteal effect, but it didn't work lifesteal effect in game. Even though there was explanation about lifesteal effect but it still didn't work the effect.

So, is there anyone teach me how to apply lifesteal effect? Please teach me how to work...
 
I modified weapon.xml file that is added lifesteal effect, but it didn't work lifesteal effect in game. Even though there was explanation about lifesteal effect but it still didn't work the effect.

So, is there anyone teach me how to apply lifesteal effect? Please teach me how to work...

AMM
 
<lifesteal type="mult" min="#.##" />

Appears to work for me :)


EDIT: Please see my other posts below
 
Last edited:
It doesnt work for me either. I tried modifiying some weapons or trophies with it. I tested it in game and it doesnt function. It displays the ability on the item but testing it I dont actually gain any life back.
 
This can be found in r4Player.ws

Code:
if(npc && inv.GetItemName(attackAction.GetWeaponId()) == 'PC Caretaker Shovel')               
{
                    //inv.PlayItemEffect( items[i], 'stab_attack' );
                    lifeLeech = CalculateAttributeValue(inv.GetItemAttributeValue(attackAction.GetWeaponId() ,'lifesteal'));
                    if (npc.UsesVitality())
                        lifeLeech *= action.processedDmg.vitalityDamage;
                    else if (UsesEssence())
                        lifeLeech *= action.processedDmg.essenceDamage;
                    else
                        lifeLeech = 0;
                        
                    if ( lifeLeech > 0 )
                    {
                        inv.PlayItemEffect( attackAction.GetWeaponId(), 'stab_attack' );
                        PlayEffect('drain_energy_caretaker_shovel');        
                        GainStat(BCS_Vitality, lifeLeech);
                    }
}

If you comment-out "if(npc && inv.GetItemName(attackAction.GetWeaponId()) == 'PC Caretaker Shovel')" and it's respective brackets, lifesteal should work for all weapons.
 
Thank you very much

It works! I added this part "if(npc && inv.GetItemName(attackAction.GetWeaponId()) == 'PC Caretaker Shovel')" that was modified weapon's name on the r4Player.ws and it worked in game.

Thank you very much, you saved my life. :)

---------- Updated at 02:35 AM ----------

I have a problem again it didn't work on silver weapons. It worked only on steel weapons, and I don't know why.

I think blow part is problems. Please solve this problem. I couldn't solve it.

inv.PlayItemEffect( attackAction.GetWeaponId(), 'stab_attack' );
PlayEffect('drain_energy_caretaker_shovel');

---------- Updated at 04:21 AM ----------


I checked that the problem was that it worked only for npc(human) not for monster. If I use silver or steel, lifesteal effect works for npc, but not works for monster. I don't know how to solve this problem. I wanna make lifesteal effect to work for monster too. Please anyone, help me.
 
It works! I added this part "if(npc && inv.GetItemName(attackAction.GetWeaponId()) == 'PC Caretaker Shovel')" that was modified weapon's name on the r4Player.ws and it worked in game.

Thank you very much, you saved my life. :)

---------- Updated at 02:35 AM ----------

I have a problem again it didn't work on silver weapons. It worked only on steel weapons, and I don't know why.

I think blow part is problems. Please solve this problem. I couldn't solve it.

inv.PlayItemEffect( attackAction.GetWeaponId(), 'stab_attack' );
PlayEffect('drain_energy_caretaker_shovel');

---------- Updated at 04:21 AM ----------


I checked that the problem was that it worked only for npc(human) not for monster. If I use silver or steel, lifesteal effect works for npc, but not works for monster. I don't know how to solve this problem. I wanna make lifesteal effect to work for monster too. Please anyone, help me.



Here's the original vanilla script:

if(npc && inv.GetItemName(attackAction.GetWeaponId()) == 'PC Caretaker Shovel')
{

lifeLeech = CalculateAttributeValue(inv.GetItemAttributeValue(attackAction.GetWeaponId() ,'lifesteal'));
if (npc.UsesVitality())
lifeLeech *= action.processedDmg.vitalityDamage;
else if (UsesEssence())
lifeLeech *= action.processedDmg.essenceDamage;
else
lifeLeech = 0;

if ( lifeLeech > 0 )
{
inv.PlayItemEffect( attackAction.GetWeaponId(), 'stab_attack' );
PlayEffect('drain_energy_caretaker_shovel');
GainStat(BCS_Vitality, lifeLeech);
}
}

Now, here's the edited script which makes lifesteal work for ALL weapons

//if(npc && inv.GetItemName(attackAction.GetWeaponId()) == 'PC Caretaker Shovel')
//{

lifeLeech = CalculateAttributeValue(inv.GetItemAttributeValue(attackAction.GetWeaponId() ,'lifesteal'));
if (npc.UsesVitality())
lifeLeech *= action.processedDmg.vitalityDamage;
else if (npc.UsesEssence())
lifeLeech *= action.processedDmg.essenceDamage;
else
lifeLeech = 0;

if ( lifeLeech > 0 )
{
inv.PlayItemEffect( attackAction.GetWeaponId(), 'stab_attack' );
PlayEffect('drain_energy_caretaker_shovel');
GainStat(BCS_Vitality, lifeLeech);
}
//}

EDIT: lifesteal stat in the .xml files must be set to "add". Mult does not work.
 
Last edited:
can i necro this? im curious if this method can make lifesteel on trophies work? also ive also edited a few trophies that can burn/poison/bleed but non of them work
 
xrook;n8910630 said:
can i necro this? im curious if this method can make lifesteel on trophies work? also ive also edited a few trophies that can burn/poison/bleed but non of them work

Hmm... I haven't tried it on trophies but I'm sure that the top of modification works on trophies.
 
it doesnt, thats why i posted. i could add 100% lifesteel and hit a wolf all day long and still get no heath back from my attacks, the same with burn/poison/bleed

the trophy itself has the attributes shown in its description
 
First, I'm sorry that upon my post was absolutely wrong.Yes it doesn't work following the top of modication.

I'm not good at English and Modding, but I'm telling you all I know.

I don't know how to add all Effect on trophies, but I'm sure that 'lifesteal' can be worked on trophy by modifying r4Player.ws as


event OnProcessActionPost(action : W3DamageAction)
{
var npc : CNewNPC;
var attackAction : W3Action_Attack;
var lifeLeech : float;
var tmp :SItemUniqueId; //most be added by Tylor

super.OnProcessActionPost(action);

attackAction = (W3Action_Attack)action;

if(attackAction)
{
npc = (CNewNPC)action.victim;

if(npc && npc.IsHuman() )
{
PlayBattleCry('BattleCryHumansHit', 0.05f );
}
else
{
PlayBattleCry('BattleCryMonstersHit', 0.05f );
}

if(attackAction.IsActionMelee())
{

IncreaseUninterruptedHitsCount();


if( IsLightAttack( attackAction.GetAttackName() ) )
{
GCameraShake(0.1, false, GetWorldPosition(), 10);
}

inv.GetItemEquippedOnSlot(EES_HorseTrophy, tmp); //most be added by Tylor
lifeLeech = CalculateAttributeValue(inv.GetItemAttributeValue(attackAction.GetWeaponId() ,'lifesteal'));
lifeLeech += CalculateAttributeValue(inv.GetItemAttributeValue(tmp ,'lifesteal')); //most be added by Tylor

if (npc.UsesVitality())
lifeLeech *= action.processedDmg.vitalityDamage;
else if (npc.UsesEssence())
lifeLeech *= action.processedDmg.essenceDamage;
else
lifeLeech = 0;



if ( lifeLeech > 0 )
{
inv.PlayItemEffect( attackAction.GetWeaponId(), 'stab_attack' );
PlayEffect('drain_energy_caretaker_shovel');
GainStat(BCS_Vitality, lifeLeech);
}
}
}
}

I haven't test it, but maybe it works...

Also other effect, u can find the scripts and simply add like this way, but I couldn't help you where it is because either I don't know...

 
tested, and still not working

i found this in horseManager.ws

if ( slot == EES_HorseTrophy )
{
abls.Clear();
inv.GetItemAbilities(id, abls);
for (i=0; i < abls.Size(); i += 1)
{
if ( abls == 'base_trophy_stats' )
continue;

thePlayer.AddAbility(abls);
}
}

do you think this code is the reason on how the trophy stats are added to geralt?
 
i have a problem
i have merged files from script merger and i have changed it to apply lifesteal effects to all weapons but it seems there is no difference in game after those changes, any solution?
 
Last edited:
Top Bottom