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

Reply
 
Thread Tools Display Modes
  #1  
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
  #2  
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
  #3  
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
  #4  
Old 02-26-2009, 06:12 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Alright, this now works with group spells just fine. The problem is bard songs still hit. Looking at spells.cpp, it looks like Bard spells hit all pets no matter what, it doesn't even check for Pet Affinity. Is this correct? If not, I'll add the check for charmed pets and Pet Affinity. This was also the trouble testing last night, !caster->GetPet()->Charmed() probably did work, since I was only testing with Bard songs not group spells. :I
Reply With Quote
  #5  
Old 02-26-2009, 06:51 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Quote:
Originally Posted by cavedude View Post
Alright, this now works with group spells just fine. The problem is bard songs still hit. Looking at spells.cpp, it looks like Bard spells hit all pets no matter what, it doesn't even check for Pet Affinity. Is this correct? If not, I'll add the check for charmed pets and Pet Affinity. This was also the trouble testing last night, !caster->GetPet()->Charmed() probably did work, since I was only testing with Bard songs not group spells. :I
Did you change the lines in zones/groups.cpp? From what I recall the comments say they have to do with bard songs, and I don't recall the songs hitting peoples pets that didn't have pet affinity, well besides the chorus ones
Reply With Quote
  #6  
Old 02-26-2009, 06:59 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

groups.cpp doesn't matter, the problem is in spells.cpp, that's where the final above all be all check is. The code looks like:

Code:
#ifdef GROUP_BUFF_PETS
						if (GetPet())
							GetPet()->BardPulse(spell_id, this);
#endif
					}
				}
			}
			else {
				mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id);
				BardPulse(spell_id, this);
#ifdef GROUP_BUFF_PETS
				if (GetPet())
					GetPet()->BardPulse(spell_id, this);
#endif
			}
			break;
		}
	}
Meaning all songs will land on every pet all the time. I'm going to add a check for charmed pets, but not for Pet Affinity for now. If somebody knows otherwise, please let me know.
Reply With Quote
  #7  
Old 02-26-2009, 07:17 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

well I know morte could twist songs on his bard while his end had a charmed pet and then when he got pet affinity the bards resist song would cause the pet to break, so the zones/groups.cpp code would be working
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 06:54 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