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

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

07-09-2006, 07:21 PM
|
Sarnak
|
|
Join Date: May 2006
Posts: 37
|
|
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);
}
|
 |
|
 |
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 05:39 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |