Tsukihime 1,489 Posted October 8, 2012 (edited) Effect: Vampiric Weapon -Tsukihime This script adds a "vampiric weapon" effect to a state. When a battler has this effect, a percentage of damage inflicted to the target will be absorbed as HP. Download Script: Download here Required: Effect Manager Usage Tag your state with <eff: vampiric_weapon x> Where x is the fraction of damage that should be converted.For example, 0.5 would mean 50% of damage will be absorbed. Edited March 10, 2016 by Tsukihime 2 Share this post Link to post Share on other sites
Tammsyn 8 Posted October 8, 2012 well after modifying this to work as a weapon tag this is a nice code thank you for the share Share this post Link to post Share on other sites
HellKiteChaoS 36 Posted October 10, 2012 well after modifying this to work as a weapon tag this is a nice code thank you for the share Would you mind posting that fix? Or show it to Tsu so he/she can apply this fix in the code? Share this post Link to post Share on other sites
Tammsyn 8 Posted October 10, 2012 here you go =begin #============================================================================== ** Effect: Vampiric Weapon Author: Tsukihime Date: Oct 8, 2012 ------------------------------------------------------------------------------ ** Change log Oct 8, 2012 - initial release ------------------------------------------------------------------------------ ** Terms of Use * Free to use in commercial/non-commercial projects * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Preserve this header ------------------------------------------------------------------------------ Adds a "vampiric weapon" effect to your state. When a battler has this effect, all attacks will drain HP equal to the damage, offset by some amount. Tag your state with <eff: vampiric_weapon x> Where x is a percentage of the damage inflicted, as a float eg: 0.5 means you will absorb 50% of damage dealt as HP. #============================================================================== =end $imported = {} if $imported.nil? $imported["Effect_VampiricWeapon"] = true #============================================================================== # ** Rest of the script #============================================================================== module Effect module Vampiric_Weapon Effect_Manager.register_effect(:vampiric_weapon) end end class Game_Battler < Game_BattlerBase def weapon_effect_vampiric_weapon(user, weapon, effect) return if user == self amount = [@result.hp_damage, @result.old_hp].min amount *= (eval(effect.value1[0]) rescue 1) user.hp = [user.hp + amount, user.mhp].min self.hp = [self.hp - amount, 0].max @result.effect_results.push("%s drained %d HP from %s" %[user.name, amount, self.name]) @result.success = true end end Share this post Link to post Share on other sites
Tsukihime 1,489 Posted October 10, 2012 You can just add the weapon_effect method under the state_effect. Share this post Link to post Share on other sites
Tammsyn 8 Posted October 10, 2012 that is a good point Share this post Link to post Share on other sites
Audrey 2 Posted June 15, 2013 Is there a way to make it so only skills with Same as Attack are affected by this effect? Share this post Link to post Share on other sites
Tsukihime 1,489 Posted June 16, 2013 "Same as Attack"? Share this post Link to post Share on other sites
Audrey 2 Posted June 16, 2013 (edited) "Normal Attack" attribute that can be applied to skills to make them use the properties set on attack states and whatnot. I was wondering on the same thing with your Iron/Thorn Armor script. This is so that physical spells aren't counted as direct hits. But because this is a personal preference, then I was thinking maybe you'd want to have a tag for skills to set them to work with Thorn Armor and Vampire Weapon. 'Cause maybe someone would like to have-- Body Slam: Tagged with Thorn Armor so that if you Body Slam an enemy you will get hurt by their Thorn Armor, but not tagged with Vampire Weapon because it's not a direct weapon skill (this might be someone's preference). Powerful Slash: Tagged with Thorn Armor and Vampire Weapon because it's a direct weapon skill Jagged Rock: Tagged with neither because it's a physical spell, not a direct attack nor a weapon skill. although the "Normal Attack" attribute works for me. It's just a way of saying they're direct attacks. Heheh. So just wondering. Edited June 16, 2013 by Audrey Share this post Link to post Share on other sites
Pyramid_Head 0 Posted July 20, 2013 Hi, uhm, I'm fairly new to RPG Maker VX, and I'm not entirely sure on how to get this to work, I know that to tag something means to put it in the notes box in the database, but do I put the tag in the notes on the weapons tab, or the state tab? Any and all help will be appreciated. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 20, 2013 You can put it in a state notebox or a weapon notebox since both are supported. Share this post Link to post Share on other sites
Pyramid_Head 0 Posted July 20, 2013 Ah, wonderful, thank you, I shall give this a try Share this post Link to post Share on other sites
RaZzi 20 Posted August 30, 2013 (edited) Can't get this to work with Yanfly Battle engine + symphony + atb... I'm using Passive States script from Yanfly to add a state to one actor who is vampire. That state has exactly this in its notetag: <eff: vampiric_weapon 0.5> so everytime that actor attacks, it should heal 50% of the dmg done. But it does nothing. I can see the state icon so the state applies normally. I've also added <eff: vampiric_weapon 0.5> to the weapon the actor uses and it still does nothing. I have tried having this script and the effect manager script above and below the battle engine scripts with no luck. Vampiric script is of course below Effect Manager. Also tried with empty project with only Effect Manager and this script in it and nothing. Added skill that adds state to actor that has <eff: vampiric_weapon 0.5> in its notetag and attacked enemy after that state was applied. Again, the state icon showed up normally so the state was "On". And yes, I've remembered to save before trying battle test. EDIT: Think I'll go with this route of doing things http://forums.rpgmakerweb.com/index.php?/topic/15369-lifesteal/ but would still like to know why I can't get the script working even with blank project.. Edited August 30, 2013 by RaZzi Share this post Link to post Share on other sites
Tsukihime 1,489 Posted August 30, 2013 (edited) I am not sure why it doesn't work for you in a blank project. I created a state with that note-tag <eff: vampiric_weapon 0.5> added it to my actor on turn 2, and it restored HP whenever it hit the enemy after the state was applied.I am not using any custom scripts besides effect manager and vampiric weapon. You can upload the blank project if you want. Edited August 30, 2013 by Tsukihime Share this post Link to post Share on other sites
RaZzi 20 Posted August 31, 2013 I am not sure why it doesn't work for you in a blank project. I created a state with that note-tag <eff: vampiric_weapon 0.5> added it to my actor on turn 2, and it restored HP whenever it hit the enemy after the state was applied.I am not using any custom scripts besides effect manager and vampiric weapon. You can upload the blank project if you want. Got it to work. Did everything like last time and it worked. Can't really tell how but nvrmind. Good script. Share this post Link to post Share on other sites
hellvandalier001 0 Posted November 7, 2013 Hey, just wondering if this could easily be adapted to being applied to an actor. Like, their passive ability is that they restore damage dealt as HP all the time. Could I just take the notetag and put it onto the actor? Share this post Link to post Share on other sites
Tsukihime 1,489 Posted November 7, 2013 This script was written as an "effect", and effects are only applied to skills or items. You would need a different approach to achieve this kind of thing for an actor. Share this post Link to post Share on other sites
bagohammers49 0 Posted September 24, 2014 I can't get this to work with Sapphire Action System IV. Share this post Link to post Share on other sites
Shana 4 Posted February 24, 2015 Uhm... right now, the script link seems to be leading to the eight directional movement script instead *^* Share this post Link to post Share on other sites