Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2009, 07:34 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Quote:
Originally Posted by cavedude View Post
The one thing I did change was !Charmed() should be !caster->GetPet()->Charmed(), substituting caster with members[z] where necessary. Haven't had time to test yet, though. I also added it to a couple of missed lines.
Alright that's what I was going to do, some how I missed the lines in spells.cpp my first time, but yeah that's what I was going to try when I went home for spring break
Reply With Quote
  #2  
Old 02-25-2009, 11:10 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

even though I'm sure CD found them all, I'll just post everything fixed:

zones/groups.cpp

lines 594-597

Code:
#ifdef GROUP_BUFF_PETS
			if(caster->GetPet() && caster->GetAA(aaPetAffinity))
				caster->SpellOnTarget(spell_id, caster->GetPet());
#endif
change to

Code:
#ifdef GROUP_BUFF_PETS
			if(caster->GetPet() && caster->GetAA(aaPetAffinity) && !caster->GetPet()->Charmed())
				caster->SpellOnTarget(spell_id, caster->GetPet());
#endif
lines 604 - 607

Code:
#ifdef GROUP_BUFF_PETS
				if(members[z]->GetPet() && members[z]->GetAA(aaPetAffinity))
					caster->SpellOnTarget(spell_id, members[z]->GetPet());
#endif
change to

Code:
#ifdef GROUP_BUFF_PETS
				if(members[z]->GetPet() && members[z]->GetAA(aaPetAffinity) && !members[z]->GetPet()->Charmed())
					caster->SpellOnTarget(spell_id, members[z]->GetPet());
#endif
lines 633-636

Code:
#ifdef GROUP_BUFF_PETS
			if(caster->GetPet() && caster->GetAA(aaPetAffinity))
				caster->BardPulse(spell_id, caster->GetPet());
#endif
change to

Code:
#ifdef GROUP_BUFF_PETS
			if(caster->GetPet() && caster->GetAA(aaPetAffinity) && !caster->GetPet()->Charmed())
				caster->BardPulse(spell_id, caster->GetPet());
#endif
well I think you get the idea, but here is the rest of the line numbers

in zones/groups.cpp on line 644

in zones/raids.cpp on lines 413, 424, 592, 603

in zones/spells.cpp on lines 1561 and 1569

the rest in groups and raids are the same (it's the same two statements), for spells it's a little different, for line 1561 change

Code:
if (GetPet() && GetAA(aaPetAffinity))
to

Code:
if (GetPet() && GetAA(aaPetAffinity) && !GetPet()->Charmed())
and on 1569

Code:
if (spell_target->GetPet() && GetAA(aaPetAffinity))
to

Code:
if (spell_target->GetPet() && GetAA(aaPetAffinity) && !spell_target->GetPet()->Charmed())
these should be all correct, but I don't have a means to test them
Reply With Quote
  #3  
Old 02-26-2009, 04:05 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

I played with this last night and it's not working. To be truthful, I'm stumped. We're checking if the player has a pet, making sure the pet isn't charmed, and checking to make sure they have the AA. If they all check out we cast the spell on the pet... But charmed pets are still getting hit by buffs/songs. I can find no other place in the code where this AA is specified.
Reply With Quote
  #4  
Old 02-26-2009, 04:17 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Quote:
Originally Posted by cavedude View Post
I played with this last night and it's not working. To be truthful, I'm stumped. We're checking if the player has a pet, making sure the pet isn't charmed, and checking to make sure they have the AA. If they all check out we cast the spell on the pet... But charmed pets are still getting hit by buffs/songs. I can find no other place in the code where this AA is specified.
!caster->GetPet()->Charmed() must not be check if the pet is charmed :P, I guess I'd have to look into each function better, but I'd assume Charmed() would check if current thing is charmed (the caster's pet in this case), so I guess when I get home and can compile I'll mess around with this some more, unless someone beats me to it :P
Reply With Quote
  #5  
Old 02-26-2009, 04:56 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Charmed() by itself is a null pointer and will create a zone crash. There is no current entity, that's why caster-> is specified. The server will basically say is what not charmed, and then crash. But, caster->GetPet()->Charmed() is the correct code to find it the caster's pet has a charm spell on them. I've used it in the past, and it wouldn't compile if it wasn't valid.

Last edited by cavedude; 02-27-2009 at 12:58 AM..
Reply With Quote
  #6  
Old 02-26-2009, 05:03 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

I'll fiddle with GetPetType and a couple of other things.
Reply With Quote
  #7  
Old 02-26-2009, 05:18 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Quote:
Originally Posted by cavedude View Post
I'll fiddle with GetPetType and a couple of other things.
try caster->GetPetType != petCharmed
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:16 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3