Switched some heal messages to StringIDs

This commit is contained in:
Michael Cook (mackal) 2014-02-28 17:43:37 -05:00
parent d525d23217
commit 5c7484cea2
3 changed files with 35 additions and 38 deletions

View File

@ -125,6 +125,7 @@
#define YOU_ARE_PROTECTED 424 //%1 tries to cast a spell on you, but you are protected. #define YOU_ARE_PROTECTED 424 //%1 tries to cast a spell on you, but you are protected.
#define TARGET_RESISTED 425 //Your target resisted the %1 spell. #define TARGET_RESISTED 425 //Your target resisted the %1 spell.
#define YOU_RESIST 426 //You resist the %1 spell! #define YOU_RESIST 426 //You resist the %1 spell!
#define YOU_CRIT_HEAL 427 //You perform an exceptional heal! (%1)
#define YOU_CRIT_BLAST 428 //You deliver a critical blast! (%1) #define YOU_CRIT_BLAST 428 //You deliver a critical blast! (%1)
#define SUMMONING_CORPSE 429 //Summoning your corpse. #define SUMMONING_CORPSE 429 //Summoning your corpse.
#define SUMMONING_CORPSE_OTHER 430 //Summoning %1's corpse. #define SUMMONING_CORPSE_OTHER 430 //Summoning %1's corpse.
@ -169,6 +170,7 @@
#define OTHER_REGAIN_CAST 1033 //%1 regains concentration and continues casting. #define OTHER_REGAIN_CAST 1033 //%1 regains concentration and continues casting.
#define GENERIC_SHOUT 1034 //%1 shouts '%2' #define GENERIC_SHOUT 1034 //%1 shouts '%2'
#define GENERIC_EMOTE 1036 //%1 %2 #define GENERIC_EMOTE 1036 //%1 %2
#define OTHER_CRIT_HEAL 1039 //%1 performs an exceptional heal! (%2)
#define OTHER_CRIT_BLAST 1040 //%1 delivers a critical blast! (%2) #define OTHER_CRIT_BLAST 1040 //%1 delivers a critical blast! (%2)
#define NPC_ENRAGE_START 1042 //%1 has become ENRAGED. #define NPC_ENRAGE_START 1042 //%1 has become ENRAGED.
#define NPC_ENRAGE_END 1043 //%1 is no longer enraged. #define NPC_ENRAGE_END 1043 //%1 is no longer enraged.

View File

@ -3851,24 +3851,17 @@ void Mob::HealDamage(uint32 amount, Mob* caster) {
} }
} }
if(amount > (maxhp - curhp)) if(amount > (maxhp - curhp))
acthealed = (maxhp - curhp); acthealed = (maxhp - curhp);
else else
acthealed = amount; acthealed = amount;
char *TempString = nullptr; if (acthealed > 100) {
if (caster) {
MakeAnyLenString(&TempString, "%d", acthealed); Message_StringID(MT_NonMelee, YOU_HEALED, caster->GetCleanName(), itoa(acthealed));
if (caster != this)
if(acthealed > 100){ caster->Message_StringID(MT_NonMelee, YOU_HEAL, GetCleanName(), itoa(acthealed));
if(caster){ } else {
Message_StringID(MT_NonMelee, YOU_HEALED, caster->GetCleanName(), TempString);
if(caster != this){
caster->Message_StringID(MT_NonMelee, YOU_HEAL, GetCleanName(), TempString);
}
}
else{
Message(MT_NonMelee, "You have been healed for %d points of damage.", acthealed); Message(MT_NonMelee, "You have been healed for %d points of damage.", acthealed);
} }
} }
@ -3882,7 +3875,6 @@ void Mob::HealDamage(uint32 amount, Mob* caster) {
SendHPUpdate(); SendHPUpdate();
} }
safe_delete_array(TempString);
} }
//proc chance includes proc bonus //proc chance includes proc bonus

View File

@ -259,7 +259,7 @@ int32 NPC::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
} }
int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
if (target == nullptr) if (target == nullptr)
target = this; target = this;
@ -267,54 +267,57 @@ int32 Client::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
int16 chance = 0; int16 chance = 0;
int8 modifier = 1; int8 modifier = 1;
bool Critical = false; bool Critical = false;
value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100); value_BaseEffect = value + (value*GetFocusEffect(focusFcBaseEffects, spell_id)/100);
value = value_BaseEffect; value = value_BaseEffect;
value += int(value_BaseEffect*GetFocusEffect(focusImprovedHeal, spell_id)/100); value += int(value_BaseEffect*GetFocusEffect(focusImprovedHeal, spell_id)/100);
// Instant Heals // Instant Heals
if(spells[spell_id].buffduration < 1) { if(spells[spell_id].buffduration < 1) {
chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance; chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance;
chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id);
chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id);
if (spellbonuses.CriticalHealDecay) if (spellbonuses.CriticalHealDecay)
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay); chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
if(chance && (MakeRandomInt(0,99) < chance)) { if(chance && (MakeRandomInt(0,99) < chance)) {
Critical = true; Critical = true;
modifier = 2; //At present time no critical heal amount modifier SPA exists. modifier = 2; //At present time no critical heal amount modifier SPA exists.
} }
value *= modifier; value *= modifier;
value += GetFocusEffect(focusFcHealAmtCrit, spell_id) * modifier; value += GetFocusEffect(focusFcHealAmtCrit, spell_id) * modifier;
value += GetFocusEffect(focusFcHealAmt, spell_id); value += GetFocusEffect(focusFcHealAmt, spell_id);
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id); value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5) if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
value += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier; value += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier;
value += value*target->GetHealRate(spell_id, this)/100; value += value*target->GetHealRate(spell_id, this)/100;
if (Critical) if (Critical) {
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s performs an exceptional heal! (%d)", GetName(), value); entity_list.MessageClose_StringID(this, true, 100, MT_SpellCrits,
OTHER_CRIT_HEAL, GetName(), itoa(value));
Message_StringID(MT_SpellCrits, YOU_CRIT_HEAL, itoa(value));
}
return value; return value;
} }
//Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value] //Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value]
else { else {
chance = itembonuses.CriticalHealOverTime + spellbonuses.CriticalHealOverTime + aabonuses.CriticalHealOverTime;
chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id); chance = itembonuses.CriticalHealOverTime + spellbonuses.CriticalHealOverTime + aabonuses.CriticalHealOverTime;
chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id);
if (spellbonuses.CriticalRegenDecay) if (spellbonuses.CriticalRegenDecay)
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay); chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
if(chance && (MakeRandomInt(0,99) < chance)) if(chance && (MakeRandomInt(0,99) < chance))
return (value * 2); return (value * 2);
} }