Log in

View Full Version : Charm fade by invis


Hugghiebear
09-03-2008, 09:09 AM
Hello all,

Even though Sony made a change so that invisibility doesn't kill pets, they did leave it that invisibility would break charm. This appears to be absent within EqEmu (and consequently makes it harder to deal with crowd control and charm fighting abilities). To fix this, I propose changing the Mob::SetInvisible function. I did test it on my personal server.


void Mob::SetInvisible(bool state)
{
invisible = state;
SendAppearancePacket(AT_Invis, invisible);

// Invis breaks charms
if ((this->GetPetType() == petCharmed) && invisible)
{
Mob* formerpet = this->GetPet();
formerpet->BuffFadeByEffect(SE_Charm);
}
}

Hugghiebear
09-03-2008, 09:19 AM
Trying to clean that up a little with tabs...


void Mob::SetInvisible(bool state)
{
invisible = state;
SendAppearancePacket(AT_Invis, invisible);

// Invis breaks charms
if ((this->GetPetType() == petCharmed) && invisible)
{
Mob* formerpet = this->GetPet();
formerpet->BuffFadeByEffect(SE_Charm);
}
}

trevius
09-03-2008, 04:32 PM
That looks pretty good. I think this was discussed a while back. But, I was under the assumption that the charm window that Derision got working was able to dismiss pets, so this wouldn't really be needed. I may be wrong about that though. Either way, it probably wouldn't hurt to add this code into the source. Thanks for the submission!

cavedude
09-03-2008, 04:37 PM
Casting invis on yourself will break charm on Live, so this is a legit fix.

KLS
09-03-2008, 04:43 PM
Yeah I've known about it a while but there were other easier ways at the time to break it so I just sorta put it off. If someone else wants to do the work I can't reject that though.

Hugghiebear
09-04-2008, 12:15 AM
The new window didn't quite fix the breakage problem, though I still greatly appreciate the new window. I tried dismissing my charmed mob, but it still held.

Thank you all! =)

MNWatchdog
09-04-2008, 03:32 AM
/pet get lost command has always worked 100%. The pet controls window wasnt implimented last I played a enchanter on Emu.

Was that way on live too, so theres never been a reason to use invisible to break charm.

Angelox
09-04-2008, 07:55 AM
Also pets poof when you invis , I remember building some AAs, so this wouldn't happen.

EDIT:Well, anyways, it was like that when I played - made you want to get those AA's

So_1337
09-04-2008, 08:51 AM
You're right, Angelox. That was the way it was early on, but sometime (around Luclin, I believe), there was a patch that made it so pets would not poof if you went invis. It was around the same time they changed the way NPCs viewed pets; indifferent unless they took an action, so a lost pet trying to find its master wouldn't bring a train.

cavedude
09-04-2008, 11:15 AM
I confirmed during the free time this summer on Live that casting any sort of invis spell on yourself will break the charm on any charmed pets you have.

ChaosSlayer
09-04-2008, 11:26 AM
It was around the same time they changed the way NPCs viewed pets; indifferent unless they took an action, so a lost pet trying to find its master wouldn't bring a train.

yeha it was a real pain in the arse to be a pet class before that - you could not run throw a green dungeon wihout kiling every stupid green mob cause they would all agro on your pet

cavedude
09-04-2008, 12:42 PM
This code causes a zone crash when the player uses an invis spell and has no pet up. Here is the output:


#0 0x080fdc43 in Mob::BuffFadeByEffect(int, int) (this=0x0, effectid=22,
skipslot=-1) at spells.cpp:2726
#1 0x080c8757 in Mob::SetInvisible(bool) (this=0x8586490) at mob.cpp:395
#2 0x0819fcd5 in Mob::SpellEffect(Mob*, unsigned short, float) (
this=0x8586490, caster=0x8586490, spell_id=42, partial=100)
at spell_effects.cpp:439
#3 0x080fd5e7 in Mob::SpellOnTarget(unsigned short, Mob*) (this=0x8586490,
spell_id=42, spelltar=0x8586490) at spells.cpp:2602
#4 0x080fa4a5 in Mob::SpellFinished(unsigned short, Mob*, unsigned short, unsigned short, unsigned) (this=0x8586490, spell_id=42, spell_target=0x8586490,
slot=1, mana_used=0, inventory_slot=4294967295) at spells.cpp:1466
#5 0x080f91c6 in Mob::CastedSpellFinished(unsigned short, unsigned, unsigned short, unsigned short, unsigned) (this=0x8586490, spell_id=42, target_id=263,
slot=1, mana_used=0, inventory_slot=4294967295) at spells.cpp:923
#6 0x080f7240 in Mob::SpellProcess() (this=0x8586490) at spells.cpp:132
#7 0x080f725e in NPC::SpellProcess() (this=0x8586490) at spells.cpp:139
#8 0x080df229 in NPC::Process() (this=0x8586490) at npc.cpp:521
#9 0x080bd5c7 in EntityList::MobProcess() (this=0x82b0240) at entity.cpp:462
#10 0x080e3676 in main (argc=0, argv=0xbfffefe4) at net.cpp:481

KLS
09-04-2008, 01:44 PM
void Mob::SetInvisible(bool state)
{
invisible = state;
SendAppearancePacket(AT_Invis, invisible);
// Invis breaks charms

if ((this->GetPetType() == petCharmed) && invisible)
{
Mob* formerpet = this->GetPet();

if(formerpet)
formerpet->BuffFadeByEffect(SE_Charm);
}
}

Always make sure a pointer is valid before using it.