Valentine90 Posted September 26, 2012 Author Share Posted September 26, 2012 **Sorry my english**The Soul created a tutorial for the same purpose, but was not complete, so I completed.**Soul:**It seems that the code for HoTs just assumes you want to heal HP. So even setting a Heal MP spell will heal the HP, regardless of the type of magic. Points are not affected by this error. Here is a fix (not elegant, but I tried to touch existing code as little as possible):**Valentine:**Besides the bug mentioned above, there is another, when the player is healed is not sent to the client the new HP or MP, then added a code to fix this.**Open Server****Fix for players****1 -** Search for:```SendActionMsg Player(index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(index).x * 32, Player(index).y * 32Player(index).Vital(Vitals.HP) = Player(index).Vital(Vitals.HP) + Spell(.Spell).Vital```**2 -** Replace it:```If 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).VitalCall SendVital(Index, Vitals.HP)ElseSendActionMsg 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).VitalCall SendVital(Index, Vitals.MP)End If```**Fix for NPCs****1 -** Search for:```SendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32MapNpc(mapNum).Npc(index).Vital(Vitals.HP) = MapNpc(mapNum).Npc(index).Vital(Vitals.HP) + Spell(.Spell).Vital```**2 -** Replace it:```If Spell(.Spell).Type = SPELL_TYPE_HEALHP ThenSendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32MapNpc(mapNum).Npc(index).Vital(Vitals.HP) = MapNpc(mapNum).Npc(index).Vital(Vitals.HP) + Spell(.Spell).VitalElseSendActionMsg mapNum, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, MapNpc(mapNum).Npc(index).x * 32, MapNpc(mapNum).Npc(index).y * 32MapNpc(mapNum).Npc(index).Vital(Vitals.MP) = MapNpc(mapNum).Npc(index).Vital(Vitals.MP) + Spell(.Spell).VitalEnd If```**Credits:**SoulValentine Link to comment Share on other sites More sharing options...
Alerd Posted October 17, 2012 Share Posted October 17, 2012 i dont have in eo 2.3```Player(index).Vital(Vitals.HP) = Player(index).Vital(Vitals.HP) + Spell(.Spell).Vital```i have```Public Sub HandleHoT_Player(ByVal Index As Long, ByVal hotNum As Long) With TempPlayer(Index).HoT(hotNum) If .Used And .Spell > 0 Then ' time to tick? If GetTickCount > .Timer + (Spell(.Spell).Interval * 1000) Then If Spell(.Spell).Type = SPELL_TYPE_HEALHP Then SendActionMsg Player(Index).Map, "+" & Spell(.Spell).Vital, BrightGreen, ACTIONMSG_SCROLL, Player(Index).x * 32, Player(Index).y * 32 SetPlayerVital Index, Vitals.HP, GetPlayerVital(Index, Vitals.HP) + Spell(.Spell).Vital Else SendActionMsg Player(Index).Map, "+" & Spell(.Spell).Vital, BrightBlue, ACTIONMSG_SCROLL, Player(Index).x * 32, Player(Index).y * 32 SetPlayerVital Index, Vitals.MP, GetPlayerVital(Index, Vitals.MP) + Spell(.Spell).Vital End If .Timer = GetTickCount ' check if DoT is still active - if player died it'll have been purged If .Used And .Spell > 0 Then ' destroy hoT if finished If GetTickCount - .StartTime >= (Spell(.Spell).Duration * 1000) Then .Used = False .Spell = 0 .Timer = 0 .Caster = 0 .StartTime = 0 End If End If End If End If End WithEnd Sub``` Link to comment Share on other sites More sharing options...
Valentine90 Posted October 19, 2012 Author Share Posted October 19, 2012 This fix is ​​for Eclipse Origins v2, should be adapted to derived versions such as 2.3.I have no way of knowing how the engine you're using, I work with corrections official version Link to comment Share on other sites More sharing options...
Alerd Posted October 20, 2012 Share Posted October 20, 2012 I think he fits no errors and everything works 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