Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2007, 09:43 AM
inkubus
Hill Giant
 
Join Date: Feb 2002
Posts: 146
Default Harmony/Lull temporary fix

Hi all

Not sure if i've implemented this in the best way but I am sure someone can point out any issues.

Quote:
spdat.h changes:
Line 476 add:
bool IsHarmonySpell(int16 spell_id);

spdat.cpp changes:
Line 202
add:
bool IsHarmonySpell(int16 spell_id)
{
int i;
const SPDat_Spell_Struct &sp = spells[spell_id];

for(i = 0; i < EFFECT_COUNT; i++)
{
if(sp.effectid[i] == SE_Lull || sp.effectid[i] == SE_Harmony)
return true;
}
return false;
}

spells.cpp line 2250
(above if(!(IsClient() && CastToClient()->GetGM())) // GMs can cast on anything)
add:
if (!IsHarmonySpell(spell_id))
{

and closing brace below

attack.cpp line 1573 add:
// If the hate's 0 then why bother?
if (hate == 0)
return;
Not sure why hate == 0 wasn't being checked. Is there a reason for this? Please someone proof read!

Thanks

Bolly
Reply With Quote
  #2  
Old 08-14-2007, 09:52 AM
inkubus
Hill Giant
 
Join Date: Feb 2002
Posts: 146
Default

Eek some changes as i had the line numebrs wrong


Quote:
spdat.h changes:
Line 476 add:
bool IsHarmonySpell(int16 spell_id);

spdat.cpp changes:
Line 202
add:
bool IsHarmonySpell(int16 spell_id)
{
int i;
const SPDat_Spell_Struct &sp = spells[spell_id];

for(i = 0; i < EFFECT_COUNT; i++)
{
if(sp.effectid[i] == SE_Lull || sp.effectid[i] == SE_Harmony)
return true;
}
return false;
}

spells.cpp line 2250
(above if(!(IsClient() && CastToClient()->GetGM())) // GMs can cast on anything)
add:
if (!IsHarmonySpell(spell_id))
{

and closing brace below

attack.cpp line 1577
(In Mob::AddToHateList() below assert(other != NULL)
add:
// If the hate's 0 then why bother?
if (hate == 0)
return;
Reply With Quote
  #3  
Old 08-14-2007, 10:38 AM
inkubus
Hill Giant
 
Join Date: Feb 2002
Posts: 146
Default

Ok for some reason, this sometimes still generates 1 hate on lull line spells. Still looking into this. Fix works fine for harmony though.

Thanks

Bolly
Reply With Quote
  #4  
Old 08-14-2007, 10:51 AM
inkubus
Hill Giant
 
Join Date: Feb 2002
Posts: 146
Default

Found it,

in aggro.cpp
(below: int16 spell_id = spellid
line 989 replace:

int16 AggroAmount = 1;

with:

int16 AggroAmount = 1;
if (IsHarmonySpell(spellid))
{
AggroAmount = 0;
}
Reply With Quote
  #5  
Old 08-14-2007, 10:54 AM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

This is based off of 1030 build?

Thanks for your efforts! This will help many classes, especially chanters, if it gets checked in.
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #6  
Old 08-14-2007, 05:22 PM
inkubus
Hill Giant
 
Join Date: Feb 2002
Posts: 146
Default

Tested on 1026 and 1030 build.

Thanks

Bolly
Reply With Quote
  #7  
Old 08-15-2007, 04:20 AM
inkubus
Hill Giant
 
Join Date: Feb 2002
Posts: 146
Default

I think i did this right!

Patch:

Quote:
--- aggro-orig.cpp 2007-08-15 16:58:09.114683370 +0100
+++ aggro.cpp 2007-08-15 17:01:02.979532414 +0100
@@ -987,6 +987,9 @@
int16 Mob::CheckAggroAmount(int16 spellid) {
int16 spell_id = spellid;
int16 AggroAmount = 1;
+ if (IsHarmonySpell(spellid)) {
+ AggroAmount = 0;
+ }
int16 slevel = GetLevel();

for (int o = 0; o < EFFECT_COUNT; o++) {
--- spdat-orig.cpp 2007-08-15 15:34:23.203261821 +0100
+++ spdat.cpp 2007-08-14 22:49:32.057599869 +0100
@@ -199,6 +199,19 @@
return false;
}

+bool IsHarmonySpell(int16 spell_id)
+{
+int i;
+const SPDat_Spell_Struct &sp = spells[spell_id];
+
+for(i = 0; i < EFFECT_COUNT; i++)
+{
+if(sp.effectid[i] == SE_Lull || sp.effectid[i] == SE_Harmony)
+return true;
+}
+return false;
+}
+
bool IsPercentalHealSpell(int16 spell_id)
{
return IsEffectInSpell(spell_id, SE_PercentalHeal);
-- spdat-orig.h 2007-08-15 15:34:34.736113852 +0100
+++ spdat.h 2007-08-15 16:30:38.800733373 +0100
@@ -473,6 +473,7 @@
bool IsStunSpell(int16 spell_id);
bool IsSlowSpell(int16 spell_id);
bool IsHasteSpell(int16 spell_id);
+bool IsHarmonySpell(int16 spell_id);
bool IsPercentalHealSpell(int16 spell_id);
bool IsGroupOnlySpell(int16 spell_id);
bool IsBeneficialSpell(int16 spell_id);
--- spells-orig.cpp 2007-08-15 15:34:49.029169807 +0100
+++ spells.cpp 2007-08-15 16:55:43.259905133 +0100
@@ -2217,6 +2217,8 @@
return(false);
}

+if (!IsHarmonySpell(spell_id))
+{
if(!(IsClient() && CastToClient()->GetGM())) // GMs can cast on anything
{
// Beneficial spells check
@@ -2254,6 +2256,8 @@
}
}

+}
+
// solar: ok at this point the spell is permitted to affect the target,
// but we need to check special cases and resists

@@ -2351,8 +2355,11 @@
) {
int16 aggro_amount = CheckAggroAmount(spell_id);//*spelltar->CastToNPC()->AggroModifier();
mlog(SPELLS__CASTING, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount);
+ if (!IsHarmonySpell(spell_id))
+ {
spelltar->AddToHateList(this, aggro_amount);
}
+ }
else if (IsBeneficialSpell(spell_id))
entity_list.AddHealAggro(spelltar, this, CheckHealAggroAmount(spell_id));

Reply With Quote
  #8  
Old 08-15-2007, 08:34 AM
gernblan
Discordant
 
Join Date: Aug 2006
Posts: 394
Default

I hope this is solid and gets checked in!

Thanks for all the hard work!
__________________
--
Keelyeh
Owner, ServerOp and Developer
Jest 4 Server
Linux (Jest3 runs on Fedora, our Dev servers usually run on Ubuntu and/or Gentoo), OC-12 Connection = Hella Fast
Reply With Quote
  #9  
Old 08-15-2007, 11:32 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

I have it up on PEQ and no major problems so far. The only issue it seems is the AE part of the spell isn't working. It's single target only, even though the spell effect is supposed to be AE. This is using the level 5 harmony spell Druids get.

Everything else is perfect so far, thanks
Reply With Quote
  #10  
Old 08-16-2007, 05:11 PM
inkubus
Hill Giant
 
Join Date: Feb 2002
Posts: 146
Default

Oh jeez yeah i forgot to check that. I'll have a look now.

Cheers

Bolly
Reply With Quote
  #11  
Old 08-21-2007, 10:50 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Nice fix, thanks!
This is real important for players you like to play alone, or actually pull mobs like they do on live.
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 10:09 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3