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 07-09-2006, 08:16 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

the buff is fading fine, but the effect would not. Any spell effect applied for a buff which is not just added to spell_bonuses has to be removed in FadeBuff. However, it actually looks like the Pacify spell effect (SE_Lull) is not even implemented. But if it were, it would need to be faded when the buff wears off.

Given that the faction mod stuff is not a buff, does it stack if the spell is cast again?

Either way, dont worry about clearing the faction mods when they zone, their Client object will get destroyed soon after and they will clear anyways.

you should come to #support on IRC, a lot easier to talk.
Reply With Quote
  #2  
Old 07-09-2006, 07:21 PM
unicorn97211
Sarnak
 
Join Date: May 2006
Posts: 37
Default

Made the changes you recommended, I think

Here's the diff

Code:
--- E:\EQEmu815\zone\mob.h	Mon Jul 10 00:55:03 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\mob.h	Mon Jul 10 00:54:58 2006
@@ -945,8 +945,10 @@
 	AISpells_Struct	AIspells[MAX_AISPELLS]; // expected to be pre-sorted, best at low index
 	HateList hate_list;
 	std::set<int32> feign_memory_list;
-	
-	
+	// EverHood - This is to keep track of mobs we cast faction mod spells on
+	std::map<uint32,sint32> faction_bonuses; // Primary FactionID, Bonus
+	void	AddFactionBonus(uint32 pFactionID,sint32 bonus);
+	sint32	GetFactionBonus(uint32 pFactionID);
 #ifdef ENABLE_FEAR_PATHING
 	void CalculateFearPosition();
 	bool FearTryStraight(Mob *caster, int32 duration, bool flee, VERTEX &hit, VERTEX &fv);
--- E:\EQEmu815\zone\spdat.h	Tue Jul 04 09:33:18 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\spdat.h	Sun Jul 09 23:24:17 2006
@@ -41,6 +41,12 @@
 
 #define EFFECT_COUNT 12
 
+enum SpellAffectIndex {
+	SAI_Calm			= 12, // Lull and Alliance Spells
+	SAI_Dispell			= 14,
+	SAI_Memory_Blur		= 27,
+	SAI_Calm_Song		= 43  // Lull and Alliance Songs
+};
 enum RESISTTYPE
 {
 	RESIST_NONE = 0,
--- E:\EQEmu815\zone\spell_effects.cpp	Tue Jul 04 09:33:18 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\spell_effects.cpp	Sun Jul 09 23:57:17 2006
@@ -375,9 +375,10 @@
 #ifdef SPELL_EFFECT_SPAM
 				snprintf(effect_desc, _EDLEN, "Faction Mod: %+i", effect_value);
 #endif
-				// solar: TODO implement this
-				const char *msg = "Faction Mod is not implemented.";
-				if(caster) caster->Message(13, msg);
+				// EverHood 
+				if(caster && GetPrimaryFaction()>0) {
+					caster->AddFactionBonus(GetPrimaryFaction(),spell.base[0]);
+				}
 				break;
 			}
 
--- E:\EQEmu815\zone\faction.cpp	Fri May 12 19:35:58 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\faction.cpp	Mon Jul 10 00:38:49 2006
@@ -264,6 +264,32 @@
 	return(CheckNPCFactionAlly(other_faction) == FACTION_ALLY);
 }
 
+// EverHood - Faction Mods for Alliance type spells
+void Mob::AddFactionBonus(uint32 pFactionID,sint32 bonus) {
+    map <uint32, sint32> :: const_iterator faction_bonus;
+	typedef std::pair <uint32, sint32> NewFactionBonus;
+
+	faction_bonus = faction_bonuses.find(pFactionID);
+	if(faction_bonus == faction_bonuses.end()){
+		faction_bonuses.insert(NewFactionBonus(pFactionID,bonus));
+	}else{
+		if(faction_bonus->second<bonus){
+			faction_bonuses.erase(pFactionID);
+			faction_bonuses.insert(NewFactionBonus(pFactionID,bonus));
+		}
+	}
+}
+
+sint32 Mob::GetFactionBonus(uint32 pFactionID) {
+    map <uint32, sint32> :: const_iterator faction_bonus;
+	faction_bonus = faction_bonuses.find(pFactionID);
+	if(faction_bonus != faction_bonuses.end()){
+			return (*faction_bonus).second;
+	}
+	return 0;
+}
+
+
 FACTION_VALUE Mob::GetSpecialFactionCon(Mob* iOther) {
 #if FACTIONS_DEBUG >= 5
 	LogFile->write(EQEMuLog::Debug, "called $s::GetSpecialFactionCon(%s)", GetName(), iOther->GetName());
@@ -431,6 +457,8 @@
 		{
 			//Get the players current faction with pFaction
 			tmpFactionValue = GetCharacterFactionLevel(pFaction);
+			// Everhood - tack on any bonuses from Alliance type spell effects
+			tmpFactionValue += GetFactionBonus(pFaction);
 			//Return the faction to the client
 			fac = CalculateFaction(&fmods, tmpFactionValue);
 			//Message(0,"Faction: %i %i %i %i",fmods.base,fmods.class_mod,fmods.race_mod,fmods.deity_mod);
--- E:\EQEmu815\zone\spdat.cpp	Sat Feb 26 14:39:14 2005
+++ C:\EQEmuSP\Source\0.7.0\zone\spdat.cpp	Sun Jul 09 23:24:18 2006
@@ -208,6 +208,16 @@
 
 bool IsBeneficialSpell(int16 spell_id)
 {
+	// EverHood - These spells are actually detrimental
+	if(spells[spell_id].goodEffect == 1){
+		SpellTargetType tt = spells[spell_id].targettype;
+		if(tt == ST_Target || tt == ST_AETarget || tt == ST_Animal || tt == ST_Undead)
+			if(spells[spell_id].resisttype == RESIST_MAGIC){
+				int16 sai = spells[spell_id].SpellAffectIndex;
+				if(sai == SAI_Calm || sai == SAI_Dispell || sai == SAI_Memory_Blur || sai == SAI_Calm_Song)
+					return false;
+			}
+	}
 	return spells[spell_id].goodEffect != 0 || IsGroupSpell(spell_id);
 }
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 05:39 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