Refactor message functions

This commit is contained in:
Akkadius
2019-08-11 00:14:02 -05:00
parent 57354579aa
commit 9f25c9070c
38 changed files with 814 additions and 579 deletions
+11 -9
View File
@@ -122,11 +122,12 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
else if (IsNPC() && CastToNPC()->GetSpellScale())
value = int(static_cast<float>(value) * CastToNPC()->GetSpellScale() / 100.0f);
entity_list.MessageClose_StringID(this, true, 100, Chat::SpellCrit,
OTHER_CRIT_BLAST, GetName(), itoa(-value));
entity_list.MessageCloseString(
this, true, 100, Chat::SpellCrit,
OTHER_CRIT_BLAST, GetName(), itoa(-value));
if (IsClient())
Message_StringID(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value));
MessageString(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value));
return value;
}
@@ -306,11 +307,12 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
value = int(static_cast<float>(value) * CastToNPC()->GetHealScale() / 100.0f);
if (Critical) {
entity_list.MessageClose_StringID(this, true, 100, Chat::SpellCrit,
OTHER_CRIT_HEAL, GetName(), itoa(value));
entity_list.MessageCloseString(
this, true, 100, Chat::SpellCrit,
OTHER_CRIT_HEAL, GetName(), itoa(value));
if (IsClient())
Message_StringID(Chat::SpellCrit, YOU_CRIT_HEAL, itoa(value));
MessageString(Chat::SpellCrit, YOU_CRIT_HEAL, itoa(value));
}
return value;
@@ -595,7 +597,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
}
if(level_to_use > GetLevel()) {
Message_StringID(Chat::Red, DISC_LEVEL_USE_ERROR);
MessageString(Chat::Red, DISC_LEVEL_USE_ERROR);
//should summon them a new one...
return(false);
}
@@ -607,7 +609,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
// sneak attack discs require you to be hidden for 4 seconds before use
if (spell.sneak && (!hidden || (hidden && (Timer::GetCurrentTime() - tmHidden) < 4000))) {
Message_StringID(Chat::SpellFailure, SNEAK_RESTRICT);
MessageString(Chat::SpellFailure, SNEAK_RESTRICT);
return false;
}
@@ -621,7 +623,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
/*char val1[20]={0};*/ //unused
/*char val2[20]={0};*/ //unused
uint32 remain = p_timers.GetRemainingTime(DiscTimer);
//Message_StringID(Chat::WhiteSmoke, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2));
//MessageString(Chat::WhiteSmoke, DISCIPLINE_CANUSEIN, ConvertArray((remain)/60,val1), ConvertArray(remain%60,val2));
Message(0, "You can use this discipline in %d minutes %d seconds.", ((remain)/60), (remain%60));
return(false);
}