osd_daedalus
Knight
[COMPLETE] Remove Curse to work on spells it should
I have done some changes in RemoveCurse.cs. Some of changes are probabily redundant, like to remove the Blood Oath gump (it should be already in the BloodOath.RemoveCurse), anyway...
Note: this already includes the Remove Curse vs Blood Oath curse patch.
It works well and it's tested, but there is a little bug of minor importance, about Mind Rot.
MindRot.cs won't mean to have a RemoveCurse effect, so I have linked it to the ClearMindRotScalar.
The matter is that function (is that a function?? I have already said I can't code ) won't stop OnTick, that means:
- for developers: even if the effect is removed (tested many times), there is a counter that will run ClearMindRotScalar another time.
- for players: you will have the system message Your mind feels normal again only when the counter reaches 0, and if you move that message from OnTick to ClearMindRotScalar, you will have that message 2 times: as when you use Remove Curse, and at the end of the counter (since OnTick recalls it).
EDIT: these problems about Mind Rot will be no more if you apply the MindRot retouch.(http://www.uodemise.com/forum/showpost.php?p=558795&postcount=24)
Note: About Mass Curse, I have to see the buff and the bug associated about PvP fixed before testing it with Remove Curse.
So, I said it should remove also Clumsy-Feeblemind-Weaken before. That was my fault - I just fizzled Remove Curse . And also about Strangle... sorry!Type: Missing Feature
Basic Description: Chivalry Remove Curse should remove also: Blood Oath curse, Mind Rot and the Curse buff
Way to experience: speaks itself
Detailed Description: As above.
Links: http://www.uoguide.com/Remove_Curse
Code: see below.
To let this work correctly upon Mind Rot, the MindRot spell needs a retouch. http://www.uodemise.com/forum/showpost.php?p=558795&postcount=24
I have done some changes in RemoveCurse.cs. Some of changes are probabily redundant, like to remove the Blood Oath gump (it should be already in the BloodOath.RemoveCurse), anyway...
Note: this already includes the Remove Curse vs Blood Oath curse patch.
Code:
Index: Scripts/Spells/Chivalry/RemoveCurse.cs
===================================================================
--- Scripts/Spells/Chivalry/RemoveCurse.cs (revision 319)
+++ Scripts/Spells/Chivalry/RemoveCurse.cs (working copy)
@@ -86,14 +86,17 @@
CorpseSkinSpell.RemoveCurse( m );
CurseSpell.RemoveEffect( m );
MortalStrike.EndWound( m );
+ if (Core.ML) { BloodOathSpell.RemoveCurse(m); }
+ MindRotSpell.ClearMindRotScalar(m);
BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
+ BuffInfo.RemoveBuff( m, BuffIcon.Curse );
BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
+ BuffInfo.RemoveBuff( m, BuffIcon.Mindrot );
- // TODO: Should this remove blood oath? Pain spike?
}
else
{
Index: Scripts/Spells/Necromancy/BloodOathSpell.cs
===================================================================
--- Scripts/Spells/Necromancy/BloodOathSpell.cs (revision 319)
+++ Scripts/Spells/Necromancy/BloodOathSpell.cs (working copy)
@@ -58,6 +58,10 @@
* ((ss-rm)/8)+8
*/
+ ExpireTimer timer = (ExpireTimer)m_Table[m];
+ if ( timer != null )
+ timer.DoExpire();
+
m_OathTable[Caster] = Caster;
m_OathTable[m] = Caster;
@@ -72,13 +76,31 @@
TimeSpan duration = TimeSpan.FromSeconds( ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 8) + 8 );
m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain
- new ExpireTimer( Caster, m, duration ).Start();
+ timer = new ExpireTimer( Caster, m, duration );
+ timer.Start();
+
+ BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.BloodOathCaster, 1075659, duration, Caster, m.Name.ToString() ) );
+ BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.BloodOathCurse, 1075661, duration, m, Caster.Name.ToString() ) );
+
+ m_Table[m] = timer;
}
FinishSequence();
}
+ public static bool RemoveCurse( Mobile m )
+ {
+ ExpireTimer t = (ExpireTimer)m_Table[m];
+
+ if ( t == null )
+ return false;
+
+ t.DoExpire();
+ return true;
+ }
+
private static Hashtable m_OathTable = new Hashtable();
+ private static Hashtable m_Table = new Hashtable();
public static Mobile GetBloodOath( Mobile m )
{
@@ -112,15 +134,26 @@
{
if ( m_Caster.Deleted || m_Target.Deleted || !m_Caster.Alive || !m_Target.Alive || DateTime.Now >= m_End )
{
- m_Caster.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
- m_Target.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
+ DoExpire();
+ }
+ }
- m_OathTable.Remove( m_Caster );
- m_OathTable.Remove( m_Target );
+ public void DoExpire()
+ {
+ m_Caster.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
+ m_Target.SendLocalizedMessage( 1061620 ); // Your Blood Oath has been broken.
- Stop();
- }
+ m_OathTable.Remove( m_Caster );
+ m_OathTable.Remove( m_Target );
+
+ Stop();
+
+ BuffInfo.RemoveBuff( m_Caster, BuffIcon.BloodOathCaster );
+ BuffInfo.RemoveBuff( m_Target, BuffIcon.BloodOathCurse );
+
+ m_Table.Remove( m_Caster );
}
+
}
private class InternalTarget : Target
MindRot.cs won't mean to have a RemoveCurse effect, so I have linked it to the ClearMindRotScalar.
The matter is that function (is that a function?? I have already said I can't code ) won't stop OnTick, that means:
- for developers: even if the effect is removed (tested many times), there is a counter that will run ClearMindRotScalar another time.
- for players: you will have the system message Your mind feels normal again only when the counter reaches 0, and if you move that message from OnTick to ClearMindRotScalar, you will have that message 2 times: as when you use Remove Curse, and at the end of the counter (since OnTick recalls it).
EDIT: these problems about Mind Rot will be no more if you apply the MindRot retouch.(http://www.uodemise.com/forum/showpost.php?p=558795&postcount=24)
Note: About Mass Curse, I have to see the buff and the bug associated about PvP fixed before testing it with Remove Curse.