Jump to content
Sign in to follow this  
heinsenberg

Energy shield skill

Recommended Posts

Hi! check your struct function Hp_Dmg

function Hp_Dmg(role, dmg)
...
	local statelv_mfd = GetChaStateLv(role, STATE_MFD) 
	if statelv_mfd >= 1 then -- state magic sheld  is above 1 
	...
		if dmg / sp_change <= sp then
			sp = math.floor(sp - dmg / sp_change)
		else
			hp = math.floor(hp - (dmg / sp_change - sp))
			sp = 0
			RemoveState(role, STATE_MFD)
		end
	else -- whithout magic sheld 
	...
	end

	SetCharaAttr(sp, role, ATTR_SP)
	SetCharaAttr(hp, role, ATTR_HP)
end

 

  • Thanks 1

Контакты:
Сайт: https://magicseaonline.com/
Telegram: https://t.me/magicsea_online - здесь мы публикуем последние новости по разработке
Discord: 
https://discord.gg/nqkv76YVbj

Группа VK: https://vk.cc/chjbzd
Чат VK: https://vk.cc/chjc8L

YouTube: https://www.youtube.com/@magicsea_online
Форум: https://forum.magicseaonline.com
Служба поддержкиhttps://magicseaonline.com/support

База знаний: https://magicseaonline.com/knowledge
Рейтингhttps://magicseaonline.com/rating


Финансовая помощь проектуhttps://magicseaonline.com/donate

С уважением, Magicsea Team

Share this post


Link to post
Share on other sites

function Hp_Dmg(role,dmg)
    local hp = Hp(role) 
    local sp = Sp(role) 
    if dmg <= 0 then 
        hp = hp - dmg 
        SetCharaAttr(hp, role, ATTR_HP)  
        return 
    end 

 

this is the standard 

8 hours ago, heinsenberg said:

I'm having problems with the energy shield, the skill is active, but when I receive attacks, HP is being hit instead of SP, can anyone help me solve this

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...