mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Unify chat constants usage
This commit is contained in:
+117
-115
@@ -180,9 +180,9 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
Log(Logs::Detail, Logs::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d",
|
||||
IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() );
|
||||
if(IsSilenced() && !IsDiscipline(spell_id))
|
||||
Message_StringID(13, SILENCED_STRING);
|
||||
Message_StringID(Chat::Red, SILENCED_STRING);
|
||||
if(IsAmnesiad() && IsDiscipline(spell_id))
|
||||
Message_StringID(13, MELEE_SILENCE);
|
||||
Message_StringID(Chat::Red, MELEE_SILENCE);
|
||||
if(IsClient())
|
||||
CastToClient()->SendSpellBarEnable(spell_id);
|
||||
if(casting_spell_id && IsNPC())
|
||||
@@ -197,7 +197,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
int chance = CastToClient()->GetFocusEffect(focusFcMute, spell_id);//Client only
|
||||
|
||||
if (zone->random.Roll(chance)) {
|
||||
Message_StringID(13, SILENCED_STRING);
|
||||
Message_StringID(Chat::Red, SILENCED_STRING);
|
||||
if(IsClient())
|
||||
CastToClient()->SendSpellBarEnable(spell_id);
|
||||
return(false);
|
||||
@@ -205,7 +205,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
}
|
||||
|
||||
if(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat()){
|
||||
Message_StringID(13, SPELL_WOULDNT_HOLD);
|
||||
Message_StringID(Chat::Red, SPELL_WOULDNT_HOLD);
|
||||
if(IsClient())
|
||||
CastToClient()->SendSpellBarEnable(spell_id);
|
||||
if(casting_spell_id && IsNPC())
|
||||
@@ -257,7 +257,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class");
|
||||
}
|
||||
else {
|
||||
Message_StringID(13, MUST_EQUIP_ITEM);
|
||||
Message_StringID(Chat::Red, MUST_EQUIP_ITEM);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
@@ -272,11 +272,11 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
if (CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
|
||||
{
|
||||
// Line 181 in eqstr_us.txt was changed in RoF+
|
||||
Message(15, "Your race, class, or deity cannot use this item.");
|
||||
Message(Chat::Yellow, "Your race, class, or deity cannot use this item.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Message_StringID(13, CANNOT_USE_ITEM);
|
||||
Message_StringID(Chat::Red, CANNOT_USE_ITEM);
|
||||
}
|
||||
}
|
||||
return(false);
|
||||
@@ -289,7 +289,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it");
|
||||
}
|
||||
else {
|
||||
Message_StringID(13, MUST_EQUIP_ITEM);
|
||||
Message_StringID(Chat::Red, MUST_EQUIP_ITEM);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
@@ -370,22 +370,24 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
Mob::SetMana(GetMana() - use_mana); // We send StopCasting which will update mana
|
||||
StopCasting();
|
||||
|
||||
Message_StringID(MT_SpellFailure, fizzle_msg);
|
||||
Message_StringID(Chat::SpellFailure, fizzle_msg);
|
||||
|
||||
/* Song Failure Messages */
|
||||
/**
|
||||
* Song Failure message
|
||||
*/
|
||||
entity_list.FilteredMessageClose_StringID(
|
||||
this, /* Sender */
|
||||
true, /* Skip Sender */
|
||||
this,
|
||||
true,
|
||||
RuleI(Range, SpellMessages),
|
||||
MT_SpellFailure, /* Type: 289 */
|
||||
(IsClient() ? FilterPCSpells : FilterNPCSpells), /* FilterType: 8 or 9 depending on client/npc */
|
||||
Chat::SpellFailure,
|
||||
(IsClient() ? FilterPCSpells : FilterNPCSpells),
|
||||
(fizzle_msg == MISS_NOTE ? MISSED_NOTE_OTHER : SPELL_FIZZLE_OTHER),
|
||||
/*
|
||||
MessageFormat: You miss a note, bringing your song to a close! (if missed note)
|
||||
MessageFormat: A missed note brings %1's song to a close!
|
||||
MessageFormat: %1's spell fizzles!
|
||||
*/
|
||||
GetName() /* Message1 */
|
||||
GetName()
|
||||
);
|
||||
|
||||
TryTriggerOnValueAmount(false, true);
|
||||
@@ -426,7 +428,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
Log(Logs::Detail, Logs::Spells, "Spell Error: no target. spell=%d", spell_id);
|
||||
if(IsClient()) {
|
||||
//clients produce messages... npcs should not for this case
|
||||
Message_StringID(13, SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red, SPELL_NEED_TAR);
|
||||
InterruptSpell();
|
||||
} else {
|
||||
InterruptSpell(0, 0, 0); //the 0 args should cause no messages
|
||||
@@ -459,7 +461,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
Log(Logs::Detail, Logs::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", spell_id, my_curmana, mana_cost);
|
||||
if(IsClient()) {
|
||||
//clients produce messages... npcs should not for this case
|
||||
Message_StringID(13, INSUFFICIENT_MANA);
|
||||
Message_StringID(Chat::Red, INSUFFICIENT_MANA);
|
||||
InterruptSpell();
|
||||
} else {
|
||||
InterruptSpell(0, 0, 0); //the 0 args should cause no messages
|
||||
@@ -516,7 +518,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
|
||||
if (IsClient() && slot == CastingSlot::Item && item_slot != 0xFFFFFFFF) {
|
||||
auto item = CastToClient()->GetInv().GetItem(item_slot);
|
||||
if (item && item->GetItem())
|
||||
Message_StringID(MT_Spells, BEGINS_TO_GLOW, item->GetItem()->Name);
|
||||
Message_StringID(Chat::Spells, BEGINS_TO_GLOW, item->GetItem()->Name);
|
||||
}
|
||||
|
||||
if (!DoCastingChecks()) {
|
||||
@@ -573,28 +575,28 @@ bool Mob::DoCastingChecks()
|
||||
if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) {
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id);
|
||||
if (!IsBardSong(spell_id))
|
||||
Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL);
|
||||
Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()) {
|
||||
Message_StringID(13, CAST_OUTDOORS);
|
||||
Message_StringID(Chat::Red, CAST_OUTDOORS);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsEffectInSpell(spell_id, SE_Levitate) && !zone->CanLevitate()) {
|
||||
Message(13, "You can't levitate in this zone.");
|
||||
Message(Chat::Red, "You can't levitate in this zone.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))) {
|
||||
const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition()));
|
||||
if (msg) {
|
||||
Message(13, msg);
|
||||
Message(Chat::Red, msg);
|
||||
return false;
|
||||
} else {
|
||||
Message(13, "You can't cast this spell here.");
|
||||
Message(Chat::Red, "You can't cast this spell here.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -678,7 +680,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
|
||||
if (GetRawSkill(EQEmu::skills::SkillPercussionInstruments) > 0) // no skill increases if not trained in the instrument
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillPercussionInstruments, nullptr, -15);
|
||||
else
|
||||
Message_StringID(13,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training
|
||||
Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL); // tell the client that they need instrument training
|
||||
}
|
||||
else
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||
@@ -688,7 +690,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
|
||||
if (GetRawSkill(EQEmu::skills::SkillStringedInstruments) > 0)
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillStringedInstruments, nullptr, -15);
|
||||
else
|
||||
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
||||
Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL);
|
||||
}
|
||||
else
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||
@@ -698,7 +700,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
|
||||
if (GetRawSkill(EQEmu::skills::SkillWindInstruments) > 0)
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillWindInstruments, nullptr, -15);
|
||||
else
|
||||
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
||||
Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL);
|
||||
}
|
||||
else
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||
@@ -708,7 +710,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
|
||||
if (GetRawSkill(EQEmu::skills::SkillBrassInstruments) > 0)
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillBrassInstruments, nullptr, -15);
|
||||
else
|
||||
Message_StringID(13,NO_INSTRUMENT_SKILL);
|
||||
Message_StringID(Chat::Red,NO_INSTRUMENT_SKILL);
|
||||
}
|
||||
else
|
||||
CheckIncreaseSkill(EQEmu::skills::SkillSinging, nullptr, -15);
|
||||
@@ -859,7 +861,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid)
|
||||
}
|
||||
|
||||
if(casting_spell_aa_id && IsClient()) { //Rest AA Timer on failed cast
|
||||
CastToClient()->Message_StringID(MT_SpellFailure, ABILITY_FAILED);
|
||||
CastToClient()->Message_StringID(Chat::SpellFailure, ABILITY_FAILED);
|
||||
CastToClient()->ResetAlternateAdvancementTimer(casting_spell_aa_id);
|
||||
}
|
||||
|
||||
@@ -938,7 +940,7 @@ void Mob::StopCasting()
|
||||
if (IsClient()) {
|
||||
auto c = CastToClient();
|
||||
if (casting_spell_aa_id) { //Rest AA Timer on failed cast
|
||||
c->Message_StringID(MT_SpellFailure, ABILITY_FAILED);
|
||||
c->Message_StringID(Chat::SpellFailure, ABILITY_FAILED);
|
||||
c->ResetAlternateAdvancementTimer(casting_spell_aa_id);
|
||||
}
|
||||
|
||||
@@ -967,7 +969,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
if(IsClient() && slot != CastingSlot::Item && slot != CastingSlot::PotionBelt && spells[spell_id].recast_time > 1000) { // 10 is item
|
||||
if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) {
|
||||
//should we issue a message or send them a spell gem packet?
|
||||
Message_StringID(13, SPELL_RECAST);
|
||||
Message_StringID(Chat::Red, SPELL_RECAST);
|
||||
Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id);
|
||||
StopCasting();
|
||||
return;
|
||||
@@ -981,7 +983,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
if(itm && itm->GetItem()->RecastDelay > 0)
|
||||
{
|
||||
if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) {
|
||||
Message_StringID(13, SPELL_RECAST);
|
||||
Message_StringID(Chat::Red, SPELL_RECAST);
|
||||
Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id);
|
||||
StopCasting();
|
||||
return;
|
||||
@@ -1003,7 +1005,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
if(delaytimer)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: recast too quickly", spell_id);
|
||||
Message(13, "You are unable to focus.");
|
||||
Message(Chat::Red, "You are unable to focus.");
|
||||
InterruptSpell();
|
||||
return;
|
||||
}
|
||||
@@ -1013,7 +1015,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
if (casting_spell_id != spell_id)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: already casting", spell_id);
|
||||
Message_StringID(13,ALREADY_CASTING);
|
||||
Message_StringID(Chat::Red,ALREADY_CASTING);
|
||||
InterruptSpell();
|
||||
return;
|
||||
}
|
||||
@@ -1131,8 +1133,8 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
}
|
||||
// if we got here, we regained concentration
|
||||
regain_conc = true;
|
||||
Message_StringID(MT_Spells,REGAIN_AND_CONTINUE);
|
||||
entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), MT_Spells, OTHER_REGAIN_CAST, this->GetCleanName());
|
||||
Message_StringID(Chat::Spells, REGAIN_AND_CONTINUE);
|
||||
entity_list.MessageClose_StringID(this, true, RuleI(Range, SpellMessages), Chat::Spells, OTHER_REGAIN_CAST, this->GetCleanName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1168,7 +1170,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
case 13000:
|
||||
if(itembonuses.percussionMod == 0) { // check for the appropriate instrument type
|
||||
HasInstrument = false;
|
||||
c->Message_StringID(13, SONG_NEEDS_DRUM); // send an error message if missing
|
||||
c->Message_StringID(Chat::Red, SONG_NEEDS_DRUM); // send an error message if missing
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1176,7 +1178,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
case 13001:
|
||||
if(itembonuses.windMod == 0) {
|
||||
HasInstrument = false;
|
||||
c->Message_StringID(13, SONG_NEEDS_WIND);
|
||||
c->Message_StringID(Chat::Red, SONG_NEEDS_WIND);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1184,7 +1186,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
case 13011:
|
||||
if(itembonuses.stringedMod == 0) {
|
||||
HasInstrument = false;
|
||||
c->Message_StringID(13, SONG_NEEDS_STRINGS);
|
||||
c->Message_StringID(Chat::Red, SONG_NEEDS_STRINGS);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1192,7 +1194,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
case 13012:
|
||||
if(itembonuses.brassMod == 0) {
|
||||
HasInstrument = false;
|
||||
c->Message_StringID(13, SONG_NEEDS_BRASS);
|
||||
c->Message_StringID(Chat::Red, SONG_NEEDS_BRASS);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1220,13 +1222,13 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
{
|
||||
if (!missingreags)
|
||||
{
|
||||
c->Message_StringID(13, MISSING_SPELL_COMP);
|
||||
c->Message_StringID(Chat::Red, MISSING_SPELL_COMP);
|
||||
missingreags=true;
|
||||
}
|
||||
|
||||
const EQEmu::ItemData *item = database.GetItem(component);
|
||||
if(item) {
|
||||
c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name);
|
||||
c->Message_StringID(Chat::Red, MISSING_SPELL_COMP_ITEM, item->Name);
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component);
|
||||
}
|
||||
else {
|
||||
@@ -1270,7 +1272,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
}
|
||||
else
|
||||
{ // some kind of error in the code if this happens
|
||||
c->Message(13, "ERROR: reagent item disappeared while processing?");
|
||||
c->Message(Chat::Red, "ERROR: reagent item disappeared while processing?");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1322,7 +1324,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
if(IsClient() && fromaug && recastdelay > 0)
|
||||
{
|
||||
if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) {
|
||||
Message_StringID(13, SPELL_RECAST);
|
||||
Message_StringID(Chat::Red, SPELL_RECAST);
|
||||
Log(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id);
|
||||
StopCasting();
|
||||
return;
|
||||
@@ -1353,7 +1355,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
|
||||
else
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot);
|
||||
Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot);
|
||||
Message(Chat::Red, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot);
|
||||
InterruptSpell();
|
||||
return;
|
||||
}
|
||||
@@ -1500,7 +1502,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
targetType = ST_Target;
|
||||
|
||||
if (spell_target && !spell_target->PassCastRestriction(true, spells[spell_id].CastRestriction)){
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1510,7 +1512,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if (spell_target &&
|
||||
((spell_target->IsNPC() && spell_target->IsEngaged()) ||
|
||||
(spell_target->IsClient() && spell_target->CastToClient()->GetAggroCount()))) {
|
||||
Message_StringID(13, SPELL_NO_EFFECT); // Unsure correct string
|
||||
Message_StringID(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1518,9 +1520,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
else if (IsBeneficialSpell(spell_id)) {
|
||||
if ((IsNPC() && IsEngaged()) || (IsClient() && CastToClient()->GetAggroCount())) {
|
||||
if (IsDiscipline(spell_id))
|
||||
Message_StringID(13, NO_ABILITY_IN_COMBAT);
|
||||
Message_StringID(Chat::Red, NO_ABILITY_IN_COMBAT);
|
||||
else
|
||||
Message_StringID(13, NO_CAST_IN_COMBAT);
|
||||
Message_StringID(Chat::Red, NO_CAST_IN_COMBAT);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1533,7 +1535,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if (spell_target &&
|
||||
((spell_target->IsNPC() && !spell_target->IsEngaged()) ||
|
||||
(spell_target->IsClient() && !spell_target->CastToClient()->GetAggroCount()))) {
|
||||
Message_StringID(13, SPELL_NO_EFFECT); // Unsure correct string
|
||||
Message_StringID(Chat::Red, SPELL_NO_EFFECT); // Unsure correct string
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1541,9 +1543,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
else if (IsBeneficialSpell(spell_id)) {
|
||||
if ((IsNPC() && !IsEngaged()) || (IsClient() && !CastToClient()->GetAggroCount())) {
|
||||
if (IsDiscipline(spell_id))
|
||||
Message_StringID(13, NO_ABILITY_OUT_OF_COMBAT);
|
||||
Message_StringID(Chat::Red, NO_ABILITY_OUT_OF_COMBAT);
|
||||
else
|
||||
Message_StringID(13, NO_CAST_OUT_OF_COMBAT);
|
||||
Message_StringID(Chat::Red, NO_CAST_OUT_OF_COMBAT);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1580,9 +1582,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
//invalid target
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, mob_body);
|
||||
if(!spell_target)
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
else
|
||||
Message_StringID(13,CANNOT_AFFECT_NPC);
|
||||
Message_StringID(Chat::Red,CANNOT_AFFECT_NPC);
|
||||
return false;
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
@@ -1594,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
{
|
||||
//invalid target
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, mob_body);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
@@ -1609,7 +1611,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)",
|
||||
spell_id, mob_body);
|
||||
|
||||
Message_StringID(13, SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red, SPELL_NEED_TAR);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1633,9 +1635,9 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
//invalid target
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, mob_body, target_bt);
|
||||
if(!spell_target)
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
else
|
||||
Message_StringID(13,CANNOT_AFFECT_NPC);
|
||||
Message_StringID(Chat::Red,CANNOT_AFFECT_NPC);
|
||||
return false;
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
@@ -1650,7 +1652,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1658,14 +1660,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target->IsNPC())
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(spell_target->GetClass() != LDON_TREASURE)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1674,7 +1676,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false; // can't cast these unless we have a target
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
@@ -1690,7 +1692,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target) message = SPELL_NEED_TAR;
|
||||
else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES;
|
||||
else if(!spell_target->IsPlayerCorpse()) message = CORPSE_NOT_VALID;
|
||||
Message_StringID(13, message);
|
||||
Message_StringID(Chat::Red, message);
|
||||
return false;
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
@@ -1702,7 +1704,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (no pet)", spell_id);
|
||||
Message_StringID(13,NO_PET);
|
||||
Message_StringID(Chat::Red,NO_PET);
|
||||
return false; // can't cast these unless we have a target
|
||||
}
|
||||
CastAction = SingleTarget;
|
||||
@@ -1773,7 +1775,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (AOE)", spell_id);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
ae_center = spell_target;
|
||||
@@ -1798,7 +1800,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
}
|
||||
|
||||
if (spell_target && spell_target->IsPet() && spells[spell_id].targettype == ST_GroupNoPets){
|
||||
Message_StringID(13,NO_CAST_ON_PET);
|
||||
Message_StringID(Chat::Red,NO_CAST_ON_PET);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1810,7 +1812,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(!spell_target)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id);
|
||||
Message_StringID(13,SPELL_NEED_TAR);
|
||||
Message_StringID(Chat::Red,SPELL_NEED_TAR);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1927,14 +1929,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
||||
if(group_id_caster == 0 || group_id_target == 0)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id);
|
||||
Message_StringID(13, TARGET_GROUP_MEMBER);
|
||||
Message_StringID(Chat::Red, TARGET_GROUP_MEMBER);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(group_id_caster != group_id_target)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id);
|
||||
Message_StringID(13, TARGET_GROUP_MEMBER);
|
||||
Message_StringID(Chat::Red, TARGET_GROUP_MEMBER);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2028,7 +2030,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
||||
if( spells[spell_id].zonetype == 1 && !zone->CanCastOutdoor()){
|
||||
if(IsClient()){
|
||||
if(!CastToClient()->GetGM()){
|
||||
Message_StringID(13, CAST_OUTDOORS);
|
||||
Message_StringID(Chat::Red, CAST_OUTDOORS);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2037,7 +2039,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
||||
if(IsEffectInSpell(spell_id, SE_Levitate) && !zone->CanLevitate()){
|
||||
if(IsClient()){
|
||||
if(!CastToClient()->GetGM()){
|
||||
Message(13, "You can't levitate in this zone.");
|
||||
Message(Chat::Red, "You can't levitate in this zone.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2048,11 +2050,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
||||
if(zone->IsSpellBlocked(spell_id, glm::vec3(GetPosition()))){
|
||||
const char *msg = zone->GetSpellBlockedMessage(spell_id, glm::vec3(GetPosition()));
|
||||
if(msg){
|
||||
Message(13, msg);
|
||||
Message(Chat::Red, msg);
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
Message(13, "You can't cast this spell here.");
|
||||
Message(Chat::Red, "You can't cast this spell here.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2110,14 +2112,14 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
||||
if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: cannot see target %s", spell_id, spell_target->GetName());
|
||||
Message_StringID(13,CANT_SEE_TARGET);
|
||||
Message_StringID(Chat::Red,CANT_SEE_TARGET);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check to see if target is a caster mob before performing a mana tap
|
||||
if(spell_target && IsManaTapSpell(spell_id)) {
|
||||
if(spell_target->GetCasterClass() == 'N') {
|
||||
Message_StringID(13, TARGET_NO_MANA);
|
||||
Message_StringID(Chat::Red, TARGET_NO_MANA);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2141,13 +2143,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
||||
if(dist2 > range2) {
|
||||
//target is out of range.
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2);
|
||||
Message_StringID(13, TARGET_OUT_OF_RANGE);
|
||||
Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE);
|
||||
return(false);
|
||||
}
|
||||
else if (dist2 < min_range2){
|
||||
//target is too close range.
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2);
|
||||
Message_StringID(13, TARGET_TOO_CLOSE);
|
||||
Message_StringID(Chat::Red, TARGET_TOO_CLOSE);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -2162,13 +2164,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
||||
if(dist2 > range2) {
|
||||
//target is out of range.
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2);
|
||||
Message_StringID(13, TARGET_OUT_OF_RANGE);
|
||||
Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE);
|
||||
return(false);
|
||||
}
|
||||
else if (dist2 < min_range2){
|
||||
//target is too close range.
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2);
|
||||
Message_StringID(13, TARGET_TOO_CLOSE);
|
||||
Message_StringID(Chat::Red, TARGET_TOO_CLOSE);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -2518,7 +2520,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, CastingSlot slo
|
||||
if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target))
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName());
|
||||
Message_StringID(13, CANT_SEE_TARGET);
|
||||
Message_StringID(Chat::Red, CANT_SEE_TARGET);
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -2533,7 +2535,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, CastingSlot slo
|
||||
if(dist2 > range2) {
|
||||
//target is out of range.
|
||||
Log(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2);
|
||||
Message_StringID(13, TARGET_OUT_OF_RANGE);
|
||||
Message_StringID(Chat::Red, TARGET_OUT_OF_RANGE);
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
@@ -2892,7 +2894,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
|
||||
|
||||
if (spellbonuses.Screech == 1) {
|
||||
if (effect2 == SE_Screech && sp2.base[i] == -1) {
|
||||
Message_StringID(MT_SpellFailure, SCREECH_BUFF_BLOCK, sp2.name);
|
||||
Message_StringID(Chat::SpellFailure, SCREECH_BUFF_BLOCK, sp2.name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -3213,7 +3215,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
|
||||
Log(Logs::Detail, Logs::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d",
|
||||
spell_id, curbuf.spellid, buffslot, curbuf.casterlevel);
|
||||
if (caster && caster->IsClient() && RuleB(Client, UseLiveBlockedMessage)) {
|
||||
caster->Message(13, "Your %s did not take hold on %s. (Blocked by %s.)", spells[spell_id].name, this->GetName(), spells[curbuf.spellid].name);
|
||||
caster->Message(Chat::Red, "Your %s did not take hold on %s. (Blocked by %s.)", spells[spell_id].name, this->GetName(), spells[curbuf.spellid].name);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -3414,7 +3416,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
if(!spelltar)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Unable to apply spell %d without a target", spell_id);
|
||||
Message(13, "SOT: You must have a target for this spell.");
|
||||
Message(Chat::Red, "SOT: You must have a target for this spell.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3423,7 +3425,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
|
||||
if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) {
|
||||
if(!IsClient() || !CastToClient()->GetGM()) {
|
||||
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD);
|
||||
Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3588,7 +3590,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
{
|
||||
if(spelltar->invisible)
|
||||
{
|
||||
spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName());
|
||||
spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
}
|
||||
@@ -3598,7 +3600,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
{
|
||||
if(spelltar->invisible_undead)
|
||||
{
|
||||
spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName());
|
||||
spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
}
|
||||
@@ -3608,7 +3610,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
{
|
||||
if(spelltar->invisible_animals)
|
||||
{
|
||||
spelltar->Message_StringID(MT_SpellFailure, ALREADY_INVIS, GetCleanName());
|
||||
spelltar->Message_StringID(Chat::SpellFailure, ALREADY_INVIS, GetCleanName());
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
}
|
||||
@@ -3688,7 +3690,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
Log(Logs::Detail, Logs::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar));
|
||||
} else {
|
||||
Log(Logs::Detail, Logs::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar));
|
||||
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD);
|
||||
Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD);
|
||||
}
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
@@ -3698,7 +3700,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName());
|
||||
spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName());
|
||||
spelltar->Message_StringID(Chat::SpellFailure, YOU_ARE_PROTECTED, GetCleanName());
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
}
|
||||
@@ -3735,7 +3737,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
focus = CalcFocusEffect(focusBlockNextSpell, buffs[b].spellid, spell_id);
|
||||
if(focus) {
|
||||
CheckNumHitsRemaining(NumHit::MatchingSpells, b);
|
||||
Message_StringID(MT_SpellFailure, SPELL_WOULDNT_HOLD);
|
||||
Message_StringID(Chat::SpellFailure, SPELL_WOULDNT_HOLD);
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
}
|
||||
@@ -3788,14 +3790,14 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
this, /* Sender */
|
||||
false, /* Skip Sender */
|
||||
RuleI(Range, SpellMessages), /* Range */
|
||||
MT_Spells, /* Type */
|
||||
Chat::Spells, /* Type */
|
||||
SPELL_REFLECT, /* String ID */
|
||||
GetCleanName(), /* Message 1 */
|
||||
spelltar->GetCleanName() /* Message 2 */
|
||||
);
|
||||
}
|
||||
else {
|
||||
Message_StringID(MT_Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName());
|
||||
Message_StringID(Chat::Spells, SPELL_REFLECT, GetCleanName(), spelltar->GetCleanName());
|
||||
}
|
||||
|
||||
CheckNumHitsRemaining(NumHit::ReflectSpell);
|
||||
@@ -3827,12 +3829,12 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName());
|
||||
|
||||
if (spells[spell_id].resisttype == RESIST_PHYSICAL){
|
||||
Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name);
|
||||
spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name);
|
||||
Message_StringID(Chat::SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name);
|
||||
spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name);
|
||||
}
|
||||
else {
|
||||
Message_StringID(MT_SpellFailure, TARGET_RESISTED, spells[spell_id].name);
|
||||
spelltar->Message_StringID(MT_SpellFailure, YOU_RESIST, spells[spell_id].name);
|
||||
Message_StringID(Chat::SpellFailure, TARGET_RESISTED, spells[spell_id].name);
|
||||
spelltar->Message_StringID(Chat::SpellFailure, YOU_RESIST, spells[spell_id].name);
|
||||
}
|
||||
|
||||
if (spelltar->IsAIControlled()) {
|
||||
@@ -3897,7 +3899,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id);
|
||||
if(!IsBardSong(spell_id))
|
||||
Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL);
|
||||
Message_StringID(Chat::SpellFailure, SPELL_TOO_POWERFUL);
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
}
|
||||
@@ -3909,7 +3911,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
// spell. It's most likely a buff that can't stack.
|
||||
Log(Logs::Detail, Logs::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName());
|
||||
if(casting_spell_aa_id)
|
||||
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD);
|
||||
Message_StringID(Chat::SpellFailure, SPELL_NO_HOLD);
|
||||
safe_delete(action_packet);
|
||||
return false;
|
||||
}
|
||||
@@ -3989,14 +3991,14 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster)
|
||||
|
||||
if(IsRezzed()){
|
||||
if(Caster && Caster->IsClient())
|
||||
Caster->Message(13,"This character has already been resurrected.");
|
||||
Caster->Message(Chat::Red,"This character has already been resurrected.");
|
||||
|
||||
return;
|
||||
}
|
||||
/*
|
||||
if(!can_rez) {
|
||||
if(Caster && Caster->IsClient())
|
||||
Caster->Message_StringID(0, CORPSE_TOO_OLD);
|
||||
Caster->Message_StringID(Chat::WhiteSmoke, CORPSE_TOO_OLD);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
@@ -4224,7 +4226,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
{
|
||||
if(GetSpecialAbility(UNMEZABLE)) {
|
||||
Log(Logs::Detail, Logs::Spells, "We are immune to Mez spells.");
|
||||
caster->Message_StringID(MT_SpellFailure, CANNOT_MEZ);
|
||||
caster->Message_StringID(Chat::SpellFailure, CANNOT_MEZ);
|
||||
int32 aggro = caster->CheckAggroAmount(spell_id, this);
|
||||
if(aggro > 0) {
|
||||
AddToHateList(caster, aggro);
|
||||
@@ -4242,7 +4244,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
(!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity))))
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]);
|
||||
caster->Message_StringID(MT_SpellFailure, CANNOT_MEZ_WITH_SPELL);
|
||||
caster->Message_StringID(Chat::SpellFailure, CANNOT_MEZ_WITH_SPELL);
|
||||
AddToHateList(caster, 1,0,true,false,false,spell_id);
|
||||
return true;
|
||||
}
|
||||
@@ -4252,7 +4254,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed))
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "We are immune to Slow spells.");
|
||||
caster->Message_StringID(CC_Red, IMMUNE_ATKSPEED);
|
||||
caster->Message_StringID(Chat::Red, IMMUNE_ATKSPEED);
|
||||
int32 aggro = caster->CheckAggroAmount(spell_id, this);
|
||||
if(aggro > 0) {
|
||||
AddToHateList(caster, aggro);
|
||||
@@ -4268,7 +4270,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
effect_index = GetSpellEffectIndex(spell_id, SE_Fear);
|
||||
if(GetSpecialAbility(UNFEARABLE)) {
|
||||
Log(Logs::Detail, Logs::Spells, "We are immune to Fear spells.");
|
||||
caster->Message_StringID(CC_Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up
|
||||
caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up
|
||||
int32 aggro = caster->CheckAggroAmount(spell_id, this);
|
||||
if(aggro > 0) {
|
||||
AddToHateList(caster, aggro);
|
||||
@@ -4279,13 +4281,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
} else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false))
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Clients cannot fear eachother!");
|
||||
caster->Message_StringID(CC_Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up
|
||||
caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up
|
||||
return true;
|
||||
}
|
||||
else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Level is %d, cannot be feared by this spell.", GetLevel());
|
||||
caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH);
|
||||
caster->Message_StringID(Chat::Shout, FEAR_TOO_HIGH);
|
||||
int32 aggro = caster->CheckAggroAmount(spell_id, this);
|
||||
if (aggro > 0) {
|
||||
AddToHateList(caster, aggro);
|
||||
@@ -4296,9 +4298,9 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
}
|
||||
else if (CheckAATimer(aaTimerWarcry))
|
||||
{
|
||||
Message(13, "Your are immune to fear.");
|
||||
Message(Chat::Red, "Your are immune to fear.");
|
||||
Log(Logs::Detail, Logs::Spells, "Clients has WarCry effect, immune to fear!");
|
||||
caster->Message_StringID(CC_Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up
|
||||
caster->Message_StringID(Chat::Red, IMMUNE_FEAR); // need to verify message type, not in MQ2Cast for easy look up
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -4308,7 +4310,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
if(GetSpecialAbility(UNCHARMABLE))
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "We are immune to Charm spells.");
|
||||
caster->Message_StringID(CC_Red, CANNOT_CHARM); // need to verify message type, not in MQ2Cast for easy look up
|
||||
caster->Message_StringID(Chat::Red, CANNOT_CHARM); // need to verify message type, not in MQ2Cast for easy look up
|
||||
int32 aggro = caster->CheckAggroAmount(spell_id, this);
|
||||
if(aggro > 0) {
|
||||
AddToHateList(caster, aggro);
|
||||
@@ -4321,7 +4323,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
if(this == caster)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "You are immune to your own charms.");
|
||||
caster->Message(CC_Red, "You cannot charm yourself."); // need to look up message?
|
||||
caster->Message(Chat::Red, "You cannot charm yourself."); // need to look up message?
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4334,7 +4336,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]);
|
||||
caster->Message_StringID(CC_Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up<Paste>
|
||||
caster->Message_StringID(Chat::Red, CANNOT_CHARM_YET); // need to verify message type, not in MQ2Cast for easy look up<Paste>
|
||||
AddToHateList(caster, 1,0,true,false,false,spell_id);
|
||||
return true;
|
||||
}
|
||||
@@ -4349,7 +4351,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
{
|
||||
if(GetSpecialAbility(UNSNAREABLE)) {
|
||||
Log(Logs::Detail, Logs::Spells, "We are immune to Snare spells.");
|
||||
caster->Message_StringID(CC_Red, IMMUNE_MOVEMENT);
|
||||
caster->Message_StringID(Chat::Red, IMMUNE_MOVEMENT);
|
||||
int32 aggro = caster->CheckAggroAmount(spell_id, this);
|
||||
if(aggro > 0) {
|
||||
AddToHateList(caster, aggro);
|
||||
@@ -4365,7 +4367,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
if(this == caster)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "You cannot lifetap yourself.");
|
||||
caster->Message_StringID(MT_SpellFailure, CANT_DRAIN_SELF);
|
||||
caster->Message_StringID(Chat::SpellFailure, CANT_DRAIN_SELF);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -4375,7 +4377,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
if(this == caster)
|
||||
{
|
||||
Log(Logs::Detail, Logs::Spells, "You cannot sacrifice yourself.");
|
||||
caster->Message_StringID(MT_SpellFailure, CANNOT_SAC_SELF);
|
||||
caster->Message_StringID(Chat::SpellFailure, CANNOT_SAC_SELF);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -4993,7 +4995,7 @@ void Client::MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message)
|
||||
const char *fadetext = spells[spell_id].spell_fades;
|
||||
outapp = new EQApplicationPacket(OP_ColoredText, sizeof(ColoredText_Struct) + strlen(fadetext));
|
||||
ColoredText_Struct *bfm = (ColoredText_Struct *) outapp->pBuffer;
|
||||
bfm->color = MT_Spells;
|
||||
bfm->color = Chat::Spells;
|
||||
memcpy(bfm->msg, fadetext, strlen(fadetext));
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
Reference in New Issue
Block a user