aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/CreatureEventAI.cpp8
-rw-r--r--src/game/CreatureEventAI.h5
-rw-r--r--src/game/CreatureEventAIMgr.cpp10
3 files changed, 12 insertions, 11 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp
index 6f7a8a89958..5c425217844 100644
--- a/src/game/CreatureEventAI.cpp
+++ b/src/game/CreatureEventAI.cpp
@@ -794,12 +794,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_creature->ForcedDespawn();
break;
}
- case ACTION_T_SET_INVINCEABILITY_HP_LEVEL:
+ case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
{
- if(action.invinceability_hp_level.is_percent)
- InvinceabilityHpLevel = m_creature->GetMaxHealth()*100/action.invinceability_hp_level.hp_level;
+ if(action.invincibility_hp_level.is_percent)
+ InvinceabilityHpLevel = m_creature->GetMaxHealth()*action.invincibility_hp_level.hp_level/100;
else
- InvinceabilityHpLevel = action.invinceability_hp_level.hp_level;
+ InvinceabilityHpLevel = action.invincibility_hp_level.hp_level;
break;
}
}
diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h
index de46fee3eae..7882e7542ec 100644
--- a/src/game/CreatureEventAI.h
+++ b/src/game/CreatureEventAI.h
@@ -113,7 +113,7 @@ enum EventAI_ActionType
ACTION_T_FORCE_DESPAWN = 41, // No Params
ACTION_T_END = 105,
- ACTION_T_SET_INVINCEABILITY_HP_LEVEL= 42, // MinHpValue, format(0-flat,1-percent from max health)
+ ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue, format(0-flat,1-percent from max health)
};
enum Target
@@ -380,11 +380,12 @@ struct CreatureEventAI_Action
{
uint32 sheath;
} set_sheath;
+ // ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42
struct
{
uint32 hp_level;
uint32 is_percent;
- } invinceability_hp_level;
+ } invincibility_hp_level;
// RAW
struct
{
diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp
index 94f83296536..45bff09eb03 100644
--- a/src/game/CreatureEventAIMgr.cpp
+++ b/src/game/CreatureEventAIMgr.cpp
@@ -661,13 +661,13 @@ 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)
+ case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
+ if(action.invincibility_hp_level.is_percent)
{
- if(action.invinceability_hp_level.hp_level > 100)
+ if(action.invincibility_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;
+ sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level);
+ action.invincibility_hp_level.hp_level = 100;
}
}
break;