Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2013, 09:47 PM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default Pacify / Line of Sight help

I am having an issue with Pacify, and Theft of Thought working as intended on our server. I assumed it would be a fairly easy fix. I did a little research and came across a changelog that listed these changes as already being addressed. See below.

==02/10/2008
WildcardX: Mesmerize line of spells will now cause aggro when casted on a mesmerize immune mob.
WildcardX: Fixed enchanter spell Theft of Thought. This spell will now work as described.
WildcardX: The pacify/harmony line of spells will no longer require a line of sight check to complete a cast.

Is there a post about these code changes and what needs to be changed for this to be fixed? or do you know if this is handled in spells.cpp? I have only been working on this code for a couple months on and off and would appreciate some direction of any kind. More directly, Pacify should not need line of sight, and theft of thought should be unresistible.

I see this in the code

Code:
	}
	float range = spells[spell_id].range;
	// solar: check line of sight to target if it's a detrimental spell and if its DT
	if(this->GetClass() != 8) {
		if(spell_target && (!IsBeneficialSpell(spell_id) || IsDamageSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].id != 982))
		{
__________________
Nikon

Reply With Quote
  #2  
Old 02-04-2013, 11:20 AM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default

Maybe I'm not asking the right question. What needs to be changed that controls the need for "line of sight" for spells or spell lines?
__________________
Nikon

Reply With Quote
  #3  
Old 02-04-2013, 11:59 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

as far as i know, there is no explicit toggle for LoS checks in the spell data. instead, the server is hard coded to check for LoS based upon the effects of the spell.

the snippet you posted, for example, checks for a negative return from IsHarmonySpell(), which checks for SE_Harmony or SE_ChangeFrenzyRad in the spell id you send as the parameter. if any of these are found, it's considered a harmony spell and the LoS check is ignored.

Code:
bool IsHarmonySpell(uint16 spell_id)
{
	// IsEffectInSpell(spell_id, SE_Lull) - Lull is not calculated anywhere atm
	return (IsEffectInSpell(spell_id, SE_Harmony) || IsEffectInSpell(spell_id, SE_ChangeFrenzyRad));
}
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #4  
Old 02-04-2013, 02:17 PM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default

Oh, well thank you for the reply. I see what your saying, but my problem is that I want the LoS check to be ignored when casting Harmony line spells (like its supposed to be), however it is not being ignored, instead, you must have line of sight to cast harmony spells. Do you know what I would need to change/edit (in the hardcode) to fix this? Thanks so much.
__________________
Nikon

Reply With Quote
  #5  
Old 02-04-2013, 02:52 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

... what i am saying is that it's already coded to ignore LoS checks for spells with SE_Harmony or SE_ChangeFrenzyRad.

Code:
	// check line of sight to target if it's a detrimental spell
	if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id))
	{
		mlog(SPELLS__CASTING, "Spell %d: cannot see target %s", spell_target->GetName());
		Message_StringID(13,CANT_SEE_TARGET);
		return false;
	}
i'm not sure where you got the snippet you posted, but the above is from Mob::SpellFinished in spells.cpp
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #6  
Old 02-04-2013, 03:18 PM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default

Thanks again for the reply....

I see the code....., I see where it is already supposed to be ignoring LoS checks for Harmony line spells, but in-game on this server you must have line of sight, and also, in that code it pushes a message "CANT_SEE_TARGET",..for spells that need LoS, which works fine.

In-game: if I try casting a harmony spell without LoS it doesn't even try to cast, shows the timer maybe for 1/10 of a second and won't cast. If you try to cast anything else without LoS it shows message as intended. Here is the code I'm using.

Is there a syntax issue? Do you mind looking over this?

Code:
float range = spells[spell_id].range;
// solar: check line of sight to target if it's a detrimental spell and if its DT
	if(this->GetClass() != 8) {
		if(spell_target && (!IsBeneficialSpell(spell_id) || IsDamageSpell(spell_id)) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].id != 982)
		{
			if(this->IsClient()) {
				range *= 0.35 + 0.40 * (this->GetSkill(spells[spell_id].skill) / this->CastToClient()->MaxSkill(spells[spell_id].skill, WIZARD, this->GetLevel()));
			}else{
				mlog(SPELLS__CASTING, "Spell %d: cannot see target %s", spell_target->GetName());
				Message_StringID(13,CANT_SEE_TARGET);
				return false;
			}
Could the code in red checking for range be causing the problem?
__________________
Nikon

Reply With Quote
  #7  
Old 02-04-2013, 03:57 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

you stated you were having a LoS issue, which you apparently aren't. if you were, you'd be getting the message about not being able to see the target instead of it simply not casting.

it will be very difficult, if not impossible, for anyone to troubleshoot issues with your custom code without being able to look at all of it. i suggest adding logging messages so you track down the issue..
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #8  
Old 02-04-2013, 04:24 PM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default

I get what your saying, we might all think differently I guess. I mean how else would I describe a problem with a spell that works other then you can't cast it unless you have LoS to the target. I assume the -LoS to target- code is limited. I also assume you have been through this code millions of times, also this is not custom code, the only thing custom is the range check which I stripped, returned back to original yet still have the issue.

Not sure what logs I should be looking at.

Other than Line of sight all harmony spells work fine, they just currently need line of sight.

I am hoping someone can point me in the right direction.
__________________
Nikon

Reply With Quote
  #9  
Old 02-04-2013, 04:41 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

am i correct in understanding that you are not getting the message that you can't see your target when you cast harmony, but it just isn't completing the casting of the spell? if that's the case and other spells that require line of sight are providing that message, but harmony is not, then the issue isn't with the line of sight check, it's somewhere else in your code.

what file (and class/function) is what you are posting in? i'm not seeing any source files with that comment from solar, nor am i finding any with the bard check.

as for logging, you'd want to add lines that would write messages to the log file(s) like this one:
Code:
mlog(SPELLS__CASTING, "Spell %d: cannot see target %s", spell_target->GetName());
and then you'd have to enable logging for that particular category, as explained here
http://www.eqemulator.net/wiki/wikka...a=ServerLogSys

that'll help you track down any problems you have when working with the source code not doing what you are expecting.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #10  
Old 02-04-2013, 04:49 PM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default

Thanks for taking your time to help me. It means alot. I'll do that and report back.
__________________
Nikon

Reply With Quote
  #11  
Old 02-04-2013, 05:22 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by c0ncrete View Post
it will be very difficult, if not impossible, for anyone to troubleshoot issues with your custom code without being able to look at all of it.
It looks like he is using the old VZTZ source:

http://code.google.com/p/vztzfebsour...pells.cpp#1316

Could be changes elsewhere that is stopping it working, e.g. the IsHarmony function in that repo is different than ours: http://code.google.com/p/vztzfebsour.../spdat.cpp#202
(checks for SE_Lull rather than SE_ChangeFrenzyRad)
Reply With Quote
  #12  
Old 02-04-2013, 07:28 PM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default

Yes. Yes, and Yes. Checking that now. Thanks Derision & Concrete, cool of you guys to give me some direction.
__________________
Nikon

Reply With Quote
  #13  
Old 02-05-2013, 04:27 PM
NikonRZ
Sarnak
 
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
Default

I fixed it. It was a number of things. Too much to list. Thanks so much for the help.
__________________
Nikon

Reply With Quote
Reply


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:45 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3