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)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-08-2006, 12:51 PM
unicorn97211
Sarnak
 
Join Date: May 2006
Posts: 37
Default Lull,Alliance,Mem Blur - Spell/Song Line Fix/Implementation

This fix allows the following spells/songs to take affect on NPCs.

Wake of Tranquility
Lull Animal
Calm Animal
Numb the Dead
Rest the Dead
Pacify
Calm
Benevolence
Lull
Alliance
Soothe
Collaboration
Pacification
Harmony of Nature
Placate
Nature's Serenity
Placate

Beholder Dispel
Strip Enchantment
Pillage Enchantment
Nullify Magic
Annul Magic
Recant Magic
Recant Magic
SpellTheft1
SpellTheft2
SpellTheft3
Nature Veil
Omen-Bst-PH
Devour Enchantment

Mind Wipe
Blanket of Forgetfulness
Reoccurring Amnesia
Memory Blur
Atone
Guide Memory Blur
Guide Memory Blur
Memory Flux

Cinda`s Charismatic Carillon
Kelin`s Lugubrious Lament
Silent Song of Quellious
Luvwen's Aria of Serenity

The current code considers these spells/songs beneficial and won't allow them to be cast on NPCs.

Here is the Diff:
Code:
--- E:\EQEmu815\zone\spdat.cpp	Sat Feb 26 14:39:14 2005
+++ C:\EQEmuSP\Source\0.7.0\zone\spdat.cpp	Sat Jul 08 16:52:11 2006
@@ -208,6 +208,17 @@
 
 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 == 1){
+				int16 sai = spells[spell_id].SpellAffectIndex;
+				// 12 = Lulls & Alliances , 14 = Dispells, 27 = Mem Blurs, 43 = Bard Lull Alliance Blur etc songs
+				if(sai == 12 || sai == 14 || sai == 27 || sai == 43) // Lulls,Dispells,Mem Blurs,Songs
+					return false;
+			}
+	}
 	return spells[spell_id].goodEffect != 0 || IsGroupSpell(spell_id);
 }
After implementing the above fix and doing some testing I found that the Alliance line was not implemented yet so I went ahead and did that as well.

Here is the Diff:
Code:
--- E:\EQEmu815\zone\spell_effects.cpp	Tue Jul 04 09:33:18 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\spell_effects.cpp	Sat Jul 08 16:55:14 2006
@@ -375,9 +375,13 @@
 #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) {
+                    NPCFaction* target_faction = new struct NPCFaction;
+					target_faction->factionID = GetPrimaryFaction();
+					target_faction->value_mod = spell.base[0];
+					caster->AddFactionBonus(target_faction);
+				}
 				break;
 			}
 
--- E:\EQEmu815\zone\mob.h	Tue Jul 04 09:33:18 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\mob.h	Sat Jul 08 13:44:10 2006
@@ -696,7 +696,11 @@
 	void				AddFeignMemory(Client* attacker);
 	void				RemoveFromFeignMemory(Client* attacker);
 	void				ClearFeignMemory();
-
+	// EverHood - This is to keep track of mobs we cast faction mod spells on
+	void				AddFactionBonus(NPCFaction* FactionBonus);
+	sint32				GetFactionBonus(sint32 pFaction);
+	void				RemoveFactionBonus(NPCFaction* FactionBonus);
+	void				ClearFactionBonuses();
 	
 	int					GetCurWp(){ return cur_wp; }
 #ifdef ENABLE_FEAR_PATHING
@@ -946,7 +950,15 @@
 	AISpells_Struct	AIspells[MAX_AISPELLS]; // expected to be pre-sorted, best at low index
 	HateList hate_list;
 	std::set<int32> feign_memory_list;
-	
+	// EverHood - Faction Bonuses
+	struct lessNPCFaction
+	{
+	bool operator()(NPCFaction s1, NPCFaction s2) const
+	{
+		return (s1.factionID<s2.factionID);
+	}
+	};
+    std::set<NPCFaction, lessNPCFaction > faction_bonuses;
 	
 #ifdef ENABLE_FEAR_PATHING
 	void CalculateFearPosition();
--- E:\EQEmu815\zone\faction.cpp	Fri May 12 19:35:58 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\faction.cpp	Sat Jul 08 16:42:51 2006
@@ -264,6 +264,39 @@
 	return(CheckNPCFactionAlly(other_faction) == FACTION_ALLY);
 }
 
+// EverHood - Faction Mods for Alliance type spells
+void Mob::AddFactionBonus(NPCFaction* FactionBonus) {
+	std::set<NPCFaction, lessNPCFaction >::value_type faction_bonuses_value_type;
+	faction_bonuses_value_type.factionID = FactionBonus->factionID;
+	faction_bonuses_value_type.value_mod = FactionBonus->value_mod;
+	faction_bonuses.insert(faction_bonuses_value_type);
+}
+
+sint32 Mob::GetFactionBonus(sint32 pFaction) {
+	std::set<NPCFaction, lessNPCFaction >::iterator faction_bonus;
+	faction_bonus = faction_bonuses.begin();
+	while(faction_bonus != faction_bonuses.end()) {
+		if ((*faction_bonus).factionID == pFaction) 
+		{
+			return (*faction_bonus).value_mod;
+		} else {
+			faction_bonus++;
+		}
+	}
+	return 0;
+}
+
+void Mob::RemoveFactionBonus(NPCFaction* FactionBonus) {
+	std::set<NPCFaction, lessNPCFaction >::value_type faction_bonuses_value_type;
+	faction_bonuses_value_type.factionID = FactionBonus->factionID;
+	faction_bonuses_value_type.value_mod = FactionBonus->value_mod;
+	faction_bonuses.erase(faction_bonuses_value_type);
+}
+
+void Mob::ClearFactionBonuses() {
+	faction_bonuses.clear();
+}
+
 FACTION_VALUE Mob::GetSpecialFactionCon(Mob* iOther) {
 #if FACTIONS_DEBUG >= 5
 	LogFile->write(EQEMuLog::Debug, "called $s::GetSpecialFactionCon(%s)", GetName(), iOther->GetName());
@@ -431,6 +464,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\zoning.cpp	Sat Jul 08 18:33:22 2006
+++ C:\EQEmuSP\Source\0.7.0\zone\zoning.cpp	Sat Jul 08 14:25:32 2006
@@ -365,6 +365,8 @@
 	
 	//if we are actually going to zone...
 	if (zoneID != zone->GetZoneID()) {
+		// EverHood - Clear faction bonuses
+		ClearFactionBonuses();
 		//set up our accounting vars to be ready to zone
 		zone_mode = zm;
 		zonesummon_ignorerestrictions = ignorerestrictions;
I don't really know enough about playing a bard to test any of the songs so if someone could test that and let me know, that would be great
Reply With Quote
 


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 11:01 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