diff options
author | megamage <none@none> | 2009-07-30 10:53:16 +0800 |
---|---|---|
committer | megamage <none@none> | 2009-07-30 10:53:16 +0800 |
commit | 3926cb174b7a5ff98a69705092831a7111333377 (patch) | |
tree | f34f9ac23333d2bb5e91cdda898b02264328a65b /src/game/CreatureEventAIMgr.cpp | |
parent | dd94fb12d68677c01b906ab05ef8c8eb676554b3 (diff) |
[8233] Implement new EventAI action ACTION_T_SET_INVINCEABILITY_HP_LEVEL. Author: VladimirMangos
Action set min. health value that can be set for creature in result damage apply.
It can be used in duel like events with creatures to prevent killing creature and other
cases when creature must avoid damage at some health level while it used.
--HG--
branch : trunk
Diffstat (limited to 'src/game/CreatureEventAIMgr.cpp')
-rw-r--r-- | src/game/CreatureEventAIMgr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index 18db935536b..94f83296536 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -661,6 +661,16 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() action.set_sheath.sheath = SHEATH_STATE_UNARMED; } break; + case ACTION_T_SET_INVINCEABILITY_HP_LEVEL: + if(action.invinceability_hp_level.is_percent) + { + if(action.invinceability_hp_level.hp_level > 100) + { + sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invinceability_hp_level.hp_level); + action.invinceability_hp_level.hp_level = 100; + } + } + break; case ACTION_T_EVADE: //No Params case ACTION_T_FLEE_FOR_ASSIST: //No Params case ACTION_T_DIE: //No Params |