escfoe2 Posted February 28, 2013 Author Share Posted February 28, 2013 Ever made a spell that heals the caster over time? I know I have, and it shows the +00 in green floating up from your forehead every second or however long you set the interval, but it doesn't change your health. Crappy issue, but I'll show you how to fix it.1) In Server>modCombat>SpellPlayer_Effect you'll need to add some things. To make it easier for you simply change this:```If increment ThenSetPlayerVital index, Vital, GetPlayerVital(index, Vital) + DamageIf Spell(spellnum).Duration > 0 ThenAddHoT_Player index, spellnumEnd IfElseIf Not increment ThenSetPlayerVital index, Vital, GetPlayerVital(index, Vital) - DamageEnd If```To This:```If increment ThenSetPlayerVital index, Vital, GetPlayerVital(index, Vital) + DamageDoEventsSendVital index, HPIf Spell(spellnum).Duration > 0 ThenAddHoT_Player index, spellnumEnd IfElseIf Not increment ThenSetPlayerVital index, Vital, GetPlayerVital(index, Vital) - DamageDoEventsSendVital index, HPEnd If```The main issue isn't that it's not healing you, only that it's not updating your health. Hang on though, we're not done yet.2) In Server>modCombat>HandleHoT_Player change this:```' time to tick?If GetTickCount > .Timer + (Spell(.Spell).Interval * 1000) ThenIf Spell(.Spell).Type = SPELL_TYPE_HEALHP ThenSendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32SetPlayerVital index, Vitals.HP, GetPlayerVital(index, Vitals.HP) + Spell(.Spell).VitalElseSendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32SetPlayerVital index, Vitals.MP, GetPlayerVital(index, Vitals.MP) + Spell(.Spell).VitalEnd If```To this:```' time to tick?If GetTickCount > .Timer + (Spell(.Spell).Interval * 1000) ThenIf Spell(.Spell).Type = SPELL_TYPE_HEALHP ThenSendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32SetPlayerVital index, Vitals.HP, GetPlayerVital(index, Vitals.HP) + Spell(.Spell).VitalDoEventsSendVital index, HPElseSendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32SetPlayerVital index, Vitals.MP, GetPlayerVital(index, Vitals.MP) + Spell(.Spell).VitalDoEventsSendVital index, HPEnd If```See, all I'm doing is adding a call to update the player with his/her new health. The DoEvents is just to make sure things don't get crunched together or accidentally missed.. May be useless. I like it so screw you ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Hope this helps someone. Link to comment Share on other sites More sharing options...
Wortel Angels Posted February 28, 2013 Share Posted February 28, 2013 If im not wrong then is that already fixed…http://www.touchofdeathforums.com/community/index.php?/topic/129697-bug-fix-heal-mp-in-time-spells-buff/page__hl__buff Link to comment Share on other sites More sharing options...
escfoe2 Posted February 28, 2013 Author Share Posted February 28, 2013 Not quite but close. Kudos sir, thank you for putting that out there. That code does not include what is in SpellPlayer_Effect sub which is needed to display the initial impact of the spell. What it has that mine doesn't is the NPC portion. As a side-note, the version of eclipse that is available to download now already has your refrenced code in it except it **still** doesn't include the SendVital part. I don't understand why but that's how it is. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now