[8235] Fixed typos in ACTION_T_SET_INVINCEABILITY_HP_LEVEL.

Thanks to Zor for pointing.
This commit is contained in:
VladimirMangos 2009-07-23 17:26:05 +04:00
parent ae2f25ce64
commit 18ae2de853
5 changed files with 15 additions and 14 deletions

View file

@ -137,7 +137,7 @@ Each event type has its own specific interpretation of it's params, like every e
39 ACTION_T_CALL_FOR_HELP Radius Call any friendly out-of-combat creatures in a radius (Param1) to attack current creature's target. 39 ACTION_T_CALL_FOR_HELP Radius Call any friendly out-of-combat creatures in a radius (Param1) to attack current creature's target.
40 ACTION_T_SET_SHEATH Sheath Sets sheath state for a creature (0 = no weapon, 1 = melee weapon, 2 = ranged weapon). 40 ACTION_T_SET_SHEATH Sheath Sets sheath state for a creature (0 = no weapon, 1 = melee weapon, 2 = ranged weapon).
41 ACTION_T_FORCE_DESPAWN No Params Despawns the creature 41 ACTION_T_FORCE_DESPAWN No Params Despawns the creature
42 ACTION_T_SET_INVINCEABILITY_HP_LEVEL hp_level, is_percent Set min. health level for creature that can be set at damage as flat value or percent from max health 42 ACTION_T_SET_INVINCIBILITY_HP_LEVEL hp_level, is_percent Set min. health level for creature that can be set at damage as flat value or percent from max health
* = Use -1 where the param is expected to do nothing. Random constant is generated for each event, so if you have a random yell and a random sound, they will be linked up with each other (ie. param2 with param2). * = Use -1 where the param is expected to do nothing. Random constant is generated for each event, so if you have a random yell and a random sound, they will be linked up with each other (ie. param2 with param2).
@ -739,7 +739,7 @@ Despawns the creature (in or out of combat)
No parameters No parameters
------------------------- -------------------------
42 ACTION_T_SET_INVINCEABILITY_HP_LEVEL 42 ACTION_T_SET_INVINCIBILITY_HP_LEVEL
------------------------- -------------------------
Parameter 1: min. health level for creature that can be set at damage, 0 used as absent min. health value for apply damage. Parameter 1: min. health level for creature that can be set at damage, 0 used as absent min. health value for apply damage.
Parameter 2: format of paramater 1 value Parameter 2: format of paramater 1 value

View file

@ -782,12 +782,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_creature->ForcedDespawn(); m_creature->ForcedDespawn();
break; break;
} }
case ACTION_T_SET_INVINCEABILITY_HP_LEVEL: case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
{ {
if(action.invinceability_hp_level.is_percent) if(action.invincibility_hp_level.is_percent)
InvinceabilityHpLevel = m_creature->GetMaxHealth()*100/action.invinceability_hp_level.hp_level; InvinceabilityHpLevel = m_creature->GetMaxHealth()*action.invincibility_hp_level.hp_level/100;
else else
InvinceabilityHpLevel = action.invinceability_hp_level.hp_level; InvinceabilityHpLevel = action.invincibility_hp_level.hp_level;
break; break;
} }
} }

View file

@ -106,7 +106,7 @@ enum EventAI_ActionType
ACTION_T_CALL_FOR_HELP = 39, // Radius ACTION_T_CALL_FOR_HELP = 39, // Radius
ACTION_T_SET_SHEATH = 40, // Sheath (0-passive,1-melee,2-ranged) ACTION_T_SET_SHEATH = 40, // Sheath (0-passive,1-melee,2-ranged)
ACTION_T_FORCE_DESPAWN = 41, // No Params ACTION_T_FORCE_DESPAWN = 41, // No Params
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)
ACTION_T_END, ACTION_T_END,
}; };
@ -374,11 +374,12 @@ struct CreatureEventAI_Action
{ {
uint32 sheath; uint32 sheath;
} set_sheath; } set_sheath;
// ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42
struct struct
{ {
uint32 hp_level; uint32 hp_level;
uint32 is_percent; uint32 is_percent;
} invinceability_hp_level; } invincibility_hp_level;
// RAW // RAW
struct struct
{ {

View file

@ -661,13 +661,13 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
action.set_sheath.sheath = SHEATH_STATE_UNARMED; action.set_sheath.sheath = SHEATH_STATE_UNARMED;
} }
break; break;
case ACTION_T_SET_INVINCEABILITY_HP_LEVEL: case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
if(action.invinceability_hp_level.is_percent) 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); sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level);
action.invinceability_hp_level.hp_level = 100; action.invincibility_hp_level.hp_level = 100;
} }
} }
break; break;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8234" #define REVISION_NR "8235"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__