|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Spell Support Broken Spells? Want them Fixed? Request it here. |
|
|
|
02-03-2013, 09:47 PM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
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
|
|
|
|
02-04-2013, 11:20 AM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
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
|
02-04-2013, 11:59 AM
|
|
Dragon
|
|
Join Date: Dec 2009
Posts: 719
|
|
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;
|
02-04-2013, 02:17 PM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
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
|
02-04-2013, 02:52 PM
|
|
Dragon
|
|
Join Date: Dec 2009
Posts: 719
|
|
... 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;
|
|
|
|
02-04-2013, 03:18 PM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
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
|
|
|
|
02-04-2013, 03:57 PM
|
|
Dragon
|
|
Join Date: Dec 2009
Posts: 719
|
|
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;
|
02-04-2013, 04:24 PM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
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
|
|
|
|
02-04-2013, 04:41 PM
|
|
Dragon
|
|
Join Date: Dec 2009
Posts: 719
|
|
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;
|
|
|
|
02-04-2013, 04:49 PM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
Thanks for taking your time to help me. It means alot. I'll do that and report back.
__________________
Nikon
|
02-04-2013, 05:22 PM
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
Quote:
Originally Posted by c0ncrete
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)
|
02-04-2013, 07:28 PM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
Yes. Yes, and Yes. Checking that now. Thanks Derision & Concrete, cool of you guys to give me some direction.
__________________
Nikon
|
02-05-2013, 04:27 PM
|
Sarnak
|
|
Join Date: Sep 2008
Location: Atlanta, GA
Posts: 33
|
|
I fixed it. It was a number of things. Too much to list. Thanks so much for the help.
__________________
Nikon
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 11:19 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|