mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-02 17:53:51 +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;
|
||||
}
|
||||
|
||||
if(hidden || improved_hidden){
|
||||
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);
|
||||
}
|
||||
CancelSneakHide();
|
||||
|
||||
if (spellbonuses.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.
|
||||
if(hidden || improved_hidden){
|
||||
|
||||
if (caster){
|
||||
Mob* target = nullptr;
|
||||
bool IsCastersTarget = false; // Chance to avoid only applies to AOE spells when not targeted.
|
||||
if (hidden || improved_hidden) {
|
||||
if (caster) {
|
||||
Mob *target = nullptr;
|
||||
target = caster->GetTarget();
|
||||
if (target && target == this){
|
||||
IsCastersTarget = true;
|
||||
}
|
||||
IsCastersTarget = target && target == this;
|
||||
}
|
||||
|
||||
if (!IsCastersTarget){
|
||||
|
||||
int chance = spellbonuses.NoBreakAESneak + itembonuses.NoBreakAESneak + aabonuses.NoBreakAESneak;
|
||||
if (!IsCastersTarget) {
|
||||
int chance =
|
||||
spellbonuses.NoBreakAESneak + itembonuses.NoBreakAESneak + aabonuses.NoBreakAESneak;
|
||||
|
||||
if (IsResisted)
|
||||
chance *= 2;
|
||||
|
||||
if(chance && (zone->random.Roll(chance)))
|
||||
if (chance && zone->random.Roll(chance))
|
||||
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);
|
||||
|
||||
//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);
|
||||
}
|
||||
CancelSneakHide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user