So I wrote a scripted spell script that would restore your Mana by 100, by reducing your HP by 100: ``` Case 0 If GetPlayerHP(Index) > 100 Then Call SetPlayerHP(index, GetPlayerHP(index) -100) Call SetPlayerMP(index, GetPlayerMP(index) + 100) Call PlayerMsg(index,"You transfer some health points into mana points!",GREEN) Else Call PlayerMsg(index,"You can't do that! That would be suicide!",RED) Endif Exit Sub ```Which worked fine. However, Soljah pointed out, correctly so, that there was a major flaw in teh fact that it could, in theory, restore your Mana beyond the maximum. So I tried to fix this flaw: ``` Case 0 If GetPlayerHP(Index) > 100 Then If GetPlayerMaxMP(Index) - GetPlayerMP(Index) >= 100 Call SetPlayerHP(index, GetPlayerHP(index) -100) Call SetPlayerMP(index, GetPlayerMP(index) + 100) Call PlayerMsg(index,"You transfer some health points into mana points!",GREEN) Else If GetPlayerMaxMP(Index) - GetPlayerMP(Index) > 0 diff = GetPlayerMaxMP(Index) - GetPlayerMP(Index) If diff