mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-06 18:42:27 +00:00
Make more usage of CancelSneakHide
This commit is contained in:
parent
54de212214
commit
37b46d1289
@ -4438,17 +4438,7 @@ void Mob::CommonBreakInvisibleFromCombat()
|
|||||||
invisible_animals = false;
|
invisible_animals = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hidden || improved_hidden){
|
CancelSneakHide();
|
||||||
hidden = false;
|
|
||||||
improved_hidden = false;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
|
||||||
SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
|
|
||||||
sa_out->spawn_id = GetID();
|
|
||||||
sa_out->type = 0x03;
|
|
||||||
sa_out->parameter = 0;
|
|
||||||
entity_list.QueueClients(this, outapp, true);
|
|
||||||
safe_delete(outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (spellbonuses.NegateIfCombat)
|
if (spellbonuses.NegateIfCombat)
|
||||||
BuffFadeByEffect(SE_NegateIfCombat);
|
BuffFadeByEffect(SE_NegateIfCombat);
|
||||||
|
|||||||
@ -6759,49 +6759,28 @@ void Mob::BreakInvisibleSpells()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::BreakSneakWhenCastOn(Mob* caster, bool IsResisted)
|
void Client::BreakSneakWhenCastOn(Mob *caster, bool IsResisted)
|
||||||
{
|
{
|
||||||
bool IsCastersTarget = false; //Chance to avoid only applies to AOE spells when not targeted.
|
bool IsCastersTarget = false; // Chance to avoid only applies to AOE spells when not targeted.
|
||||||
if(hidden || improved_hidden){
|
if (hidden || improved_hidden) {
|
||||||
|
if (caster) {
|
||||||
if (caster){
|
Mob *target = nullptr;
|
||||||
Mob* target = nullptr;
|
|
||||||
target = caster->GetTarget();
|
target = caster->GetTarget();
|
||||||
if (target && target == this){
|
IsCastersTarget = target && target == this;
|
||||||
IsCastersTarget = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsCastersTarget){
|
if (!IsCastersTarget) {
|
||||||
|
int chance =
|
||||||
int chance = spellbonuses.NoBreakAESneak + itembonuses.NoBreakAESneak + aabonuses.NoBreakAESneak;
|
spellbonuses.NoBreakAESneak + itembonuses.NoBreakAESneak + aabonuses.NoBreakAESneak;
|
||||||
|
|
||||||
if (IsResisted)
|
if (IsResisted)
|
||||||
chance *= 2;
|
chance *= 2;
|
||||||
|
|
||||||
if(chance && (zone->random.Roll(chance)))
|
if (chance && zone->random.Roll(chance))
|
||||||
return; // Do not drop Sneak/Hide
|
return; // Do not drop Sneak/Hide
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: The skill buttons should reset when this occurs. Not sure how to force that yet. - Kayen
|
|
||||||
hidden = false;
|
|
||||||
improved_hidden = false;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
|
||||||
SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
|
|
||||||
sa_out->spawn_id = GetID();
|
|
||||||
sa_out->type = 0x03;
|
|
||||||
sa_out->parameter = 0;
|
|
||||||
entity_list.QueueClients(this, outapp, false);
|
|
||||||
safe_delete(outapp);
|
|
||||||
|
|
||||||
Message_StringID(MT_Skills,NO_LONGER_HIDDEN);
|
CancelSneakHide();
|
||||||
|
|
||||||
//Sneaking alone will not be disabled from spells, only hide+sneak.
|
|
||||||
if (sneaking){
|
|
||||||
sneaking = false;
|
|
||||||
SendAppearancePacket(AT_Sneak, 0);
|
|
||||||
Message_StringID(MT_Skills,STOP_SNEAKING);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user