Merge pull request #108 from KayenEQ/master

New spell effects
This commit is contained in:
Michael Cook 2014-01-27 17:54:32 -08:00
commit aa57642103
9 changed files with 102 additions and 20 deletions

View File

@ -1,5 +1,13 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 01/27/2014 ==
Kayen: Implemented SE_CriticalMend (chance to critical monk mend)
Kayen: Implemented SE_IncreaseChanceMemwipe (increases the chance to wipe hate with memory blurr)
Kayen: Implemented SE_FcStunTimeMod (modify stun duration from casted spells)
Kayen: Implemented SE_StunBashChance (increase chance to stun from bash)
Required SQL: utils/sql/git/2014_01_27_CritcalMendAA.sql
== 01/26/2014 == == 01/26/2014 ==
Kayen: Revised 'dispel' type spell effects (ie cancel magic) to be consistent with live Kayen: Revised 'dispel' type spell effects (ie cancel magic) to be consistent with live

View File

@ -279,7 +279,7 @@ typedef enum {
#define SE_SpellHateMod 130 // implemented #define SE_SpellHateMod 130 // implemented
#define SE_ReduceReagentCost 131 // implemented #define SE_ReduceReagentCost 131 // implemented
#define SE_ReduceManaCost 132 // implemented #define SE_ReduceManaCost 132 // implemented
#define SE_ApplyEffect2 133 // implemented - Apply additional spell to target #define SE_FcStunTimeMod 133 // implemented - Modify duration of stuns.
#define SE_LimitMaxLevel 134 // implemented #define SE_LimitMaxLevel 134 // implemented
#define SE_LimitResist 135 // implemented #define SE_LimitResist 135 // implemented
#define SE_LimitTarget 136 // implemented #define SE_LimitTarget 136 // implemented
@ -377,7 +377,7 @@ typedef enum {
#define SE_ReduceFallDamage 228 // not implented as bonus - reduce the damage that you take from falling #define SE_ReduceFallDamage 228 // not implented as bonus - reduce the damage that you take from falling
#define SE_PersistantCasting 229 // implemented #define SE_PersistantCasting 229 // implemented
#define SE_ExtendedShielding 230 // not used as bonus - increase range of /shield ability #define SE_ExtendedShielding 230 // not used as bonus - increase range of /shield ability
//#define SE_StunBashChance 231 // not used *Unknown limit used in AA Overpowering Strikes (Decrease chance stun resist) #define SE_StunBashChance 231 // implemented - increase chance to stun from bash.
#define SE_DivineSave 232 // implemented (base1 == % chance on death to insta-res) (base2 == spell cast on save) #define SE_DivineSave 232 // implemented (base1 == % chance on death to insta-res) (base2 == spell cast on save)
#define SE_Metabolism 233 // *not implemented - (Crown of Feathers) Increase metabolism? #define SE_Metabolism 233 // *not implemented - (Crown of Feathers) Increase metabolism?
#define SE_ReduceApplyPoisonTime 234 // not implemented as bonus - reduces the time to apply poison #define SE_ReduceApplyPoisonTime 234 // not implemented as bonus - reduces the time to apply poison
@ -388,7 +388,7 @@ typedef enum {
#define SE_FeignedCastOnChance 239 // *not implemented as bonus - ability gives you an increasing chance for your feigned deaths to not be revealed by spells cast upon you. #define SE_FeignedCastOnChance 239 // *not implemented as bonus - ability gives you an increasing chance for your feigned deaths to not be revealed by spells cast upon you.
//#define SE_StringUnbreakable 240 // not used [Likely related to above - you become immune to feign breaking on a resisted spell and have a good chance of feigning through a spell that successfully lands upon you.] //#define SE_StringUnbreakable 240 // not used [Likely related to above - you become immune to feign breaking on a resisted spell and have a good chance of feigning through a spell that successfully lands upon you.]
#define SE_ImprovedReclaimEnergy 241 // not implemented as bonus - increase the amount of mana returned to you when reclaiming your pet. #define SE_ImprovedReclaimEnergy 241 // not implemented as bonus - increase the amount of mana returned to you when reclaiming your pet.
#define SE_ChanceWipeHateList 242 // *not implemented - increases the chance to wipe hate with memory blurr #define SE_IncreaseChanceMemwipe 242 // implemented - increases the chance to wipe hate with memory blurr
#define SE_CharmBreakChance 243 // implemented - Total Domination #define SE_CharmBreakChance 243 // implemented - Total Domination
#define SE_RootBreakChance 244 // implemented[AA] reduce the chance that your root will break. #define SE_RootBreakChance 244 // implemented[AA] reduce the chance that your root will break.
#define SE_TrapCircumvention 245 // *not implemented[AA] - decreases the chance that you will set off a trap when opening a chest #define SE_TrapCircumvention 245 // *not implemented[AA] - decreases the chance that you will set off a trap when opening a chest
@ -421,7 +421,7 @@ typedef enum {
#define SE_CastingLevel2 272 // implemented #define SE_CastingLevel2 272 // implemented
#define SE_CriticalDoTChance 273 // implemented #define SE_CriticalDoTChance 273 // implemented
#define SE_CriticalHealChance 274 // implemented #define SE_CriticalHealChance 274 // implemented
//#define SE_CriticalMend 275 // not used #define SE_CriticalMend 275 // implemented[AA] - chance to critical monk mend
#define SE_Ambidexterity 276 // implemented[AA] - increase chance to duel weild by adding bonus 'skill' #define SE_Ambidexterity 276 // implemented[AA] - increase chance to duel weild by adding bonus 'skill'
#define SE_UnfailingDivinity 277 // implemented[AA] - ability grants your Death Pact-type spells a second chance to successfully heal their target, also can cause said spells to do a portion of their healing value even on a complete failure. #define SE_UnfailingDivinity 277 // implemented[AA] - ability grants your Death Pact-type spells a second chance to successfully heal their target, also can cause said spells to do a portion of their healing value even on a complete failure.
#define SE_FinishingBlow 278 // implemented[AA] - chance to do massive damage under 10% HP (base1 = chance, base2 = damage) #define SE_FinishingBlow 278 // implemented[AA] - chance to do massive damage under 10% HP (base1 = chance, base2 = damage)

View File

@ -0,0 +1,9 @@
-- Critical Mend
INSERT INTO `aa_effects` (`aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('230', '1', '275', '10', '0');
INSERT INTO `aa_effects` (`aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('230', '1', '275', '25', '0');
INSERT INTO `aa_effects` (`aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('230', '1', '275', '50', '0');
-- Mending of the Tranquil
INSERT INTO `aa_effects` (`aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('539', '1', '275', '15', '0');
INSERT INTO `aa_effects` (`aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('539', '1', '275', '25', '0');
INSERT INTO `aa_effects` (`aaid`, `slot`, `effectid`, `base1`, `base2`) VALUES ('539', '1', '275', '35', '0');

View File

@ -3562,7 +3562,9 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
// Clients can stun mobs under level 56 with their bash/kick when they get level 55 or greater. // Clients can stun mobs under level 56 with their bash/kick when they get level 55 or greater.
if( attacker->IsNPC() || (attacker->IsClient() && attacker->GetLevel() >= RuleI(Combat, ClientStunLevel) && GetLevel() < RuleI(Spells, BaseImmunityLevel)) ) if( attacker->IsNPC() || (attacker->IsClient() && attacker->GetLevel() >= RuleI(Combat, ClientStunLevel) && GetLevel() < RuleI(Spells, BaseImmunityLevel)) )
{ {
if (MakeRandomInt(0,99) < (RuleI(Character, NPCBashKickStunChance)) || attacker->IsClient()) int8 StunBashChanceBonus = spellbonuses.StunBashChance + itembonuses.StunBashChance + aabonuses.StunBashChance;
if (MakeRandomInt(0,99) < ((RuleI(Character, NPCBashKickStunChance) + StunBashChanceBonus)) || attacker->IsClient())
{ {
int stun_resist = itembonuses.StunResist+spellbonuses.StunResist; int stun_resist = itembonuses.StunResist+spellbonuses.StunResist;
int frontal_stun_resist = itembonuses.FrontalStunResist+spellbonuses.FrontalStunResist; int frontal_stun_resist = itembonuses.FrontalStunResist+spellbonuses.FrontalStunResist;

View File

@ -1200,6 +1200,18 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
} }
break; break;
} }
case SE_StunBashChance:
newbon->StunBashChance += base1;
break;
case SE_IncreaseChanceMemwipe:
newbon->IncreaseChanceMemwipe += base1;
break;
case SE_CriticalMend:
newbon->CriticalMend += base1;
break;
} }
} }
} }
@ -2416,6 +2428,18 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
newbon->TwoHandBluntBlock += effect_value; newbon->TwoHandBluntBlock += effect_value;
break; break;
case SE_StunBashChance:
newbon->StunBashChance += effect_value;
break;
case SE_IncreaseChanceMemwipe:
newbon->IncreaseChanceMemwipe += effect_value;
break;
case SE_CriticalMend:
newbon->CriticalMend += effect_value;
break;
case SE_SpellEffectResistChance: case SE_SpellEffectResistChance:
{ {
for(int e = 0; e < MAX_RESISTABLE_EFFECTS*2; e+=2) for(int e = 0; e < MAX_RESISTABLE_EFFECTS*2; e+=2)
@ -2777,6 +2801,8 @@ uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_eff
return focusFcLimitUse; return focusFcLimitUse;
case SE_FcMute: case SE_FcMute:
return focusFcMute; return focusFcMute;
case SE_FcStunTimeMod:
return focusFcStunTimeMod;
case SE_CriticalHealRate: case SE_CriticalHealRate:
return focusCriticalHealRate; return focusCriticalHealRate;
case SE_AdditionalHeal2: case SE_AdditionalHeal2:
@ -3775,6 +3801,24 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
case SE_DivineAura: case SE_DivineAura:
spellbonuses.DivineAura = false; spellbonuses.DivineAura = false;
break; break;
case SE_StunBashChance:
spellbonuses.StunBashChance = effect_value;
itembonuses.StunBashChance = effect_value;
aabonuses.StunBashChance = effect_value;
break;
case SE_IncreaseChanceMemwipe:
spellbonuses.IncreaseChanceMemwipe = effect_value;
itembonuses.IncreaseChanceMemwipe = effect_value;
aabonuses.IncreaseChanceMemwipe = effect_value;
break;
case SE_CriticalMend:
spellbonuses.CriticalMend = effect_value;
itembonuses.CriticalMend = effect_value;
aabonuses.CriticalMend = effect_value;
break;
} }
} }

View File

@ -7610,19 +7610,8 @@ void Client::Handle_OP_Mend(const EQApplicationPacket *app)
int mendhp = GetMaxHP() / 4; int mendhp = GetMaxHP() / 4;
int currenthp = GetHP(); int currenthp = GetHP();
if (MakeRandomInt(0, 199) < (int)GetSkill(SkillMend)) { if (MakeRandomInt(0, 199) < (int)GetSkill(SkillMend)) {
int criticalchance = 0;
switch(GetAA(aaCriticalMend)){ int criticalchance = spellbonuses.CriticalMend + itembonuses.CriticalMend + aabonuses.CriticalMend;
case 1:
criticalchance = 5;
break;
case 2:
criticalchance = 10;
break;
case 3:
criticalchance = 25;
break;
}
criticalchance += 5*GetAA(aaMendingoftheTranquil);
if(MakeRandomInt(0,99) < criticalchance){ if(MakeRandomInt(0,99) < criticalchance){
mendhp *= 2; mendhp *= 2;

View File

@ -78,6 +78,7 @@ typedef enum { //focus types
focusIncreaseNumHits, focusIncreaseNumHits,
focusFcLimitUse, focusFcLimitUse,
focusFcMute, focusFcMute,
focusFcStunTimeMod,
focusCriticalHealRate, focusCriticalHealRate,
focusAdditionalHeal2, focusAdditionalHeal2,
focusAdditionalHeal, focusAdditionalHeal,
@ -372,6 +373,9 @@ struct StatBonuses {
int16 ShieldEquipHateMod; // Hate mod when shield equiped. int16 ShieldEquipHateMod; // Hate mod when shield equiped.
int16 ShieldEquipDmgMod[2]; // Damage mod when shield equiped. 0 = damage modifier 1 = Unknown int16 ShieldEquipDmgMod[2]; // Damage mod when shield equiped. 0 = damage modifier 1 = Unknown
bool TriggerOnValueAmount; // Triggers off various different conditions, bool to check if client has effect. bool TriggerOnValueAmount; // Triggers off various different conditions, bool to check if client has effect.
int8 StunBashChance; // chance to stun with bash.
int8 IncreaseChanceMemwipe; // increases chance to memory wipe
int8 CriticalMend; // chance critical monk mend
}; };
typedef struct typedef struct

View File

@ -3211,7 +3211,7 @@ void Mob::TryApplyEffect(Mob *target, uint32 spell_id)
for(int i = 0; i < EFFECT_COUNT; i++) for(int i = 0; i < EFFECT_COUNT; i++)
{ {
if (spells[spell_id].effectid[i] == SE_ApplyEffect || spells[spell_id].effectid[i] == SE_ApplyEffect2) if (spells[spell_id].effectid[i] == SE_ApplyEffect)
{ {
if(MakeRandomInt(0, 100) <= spells[spell_id].base[i]) if(MakeRandomInt(0, 100) <= spells[spell_id].base[i])
{ {

View File

@ -804,6 +804,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
if (stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist) { if (stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist) {
mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist); mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist);
if (caster->IsClient())
effect_value += effect_value*caster->CastToClient()->GetFocusEffect(focusFcStunTimeMod, spell_id)/100;
Stun(effect_value); Stun(effect_value);
} else { } else {
if (IsClient()) if (IsClient())
@ -1544,6 +1548,9 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
snprintf(effect_desc, _EDLEN, "Memory Blur: %d", effect_value); snprintf(effect_desc, _EDLEN, "Memory Blur: %d", effect_value);
#endif #endif
int wipechance = spells[spell_id].base[i]; int wipechance = spells[spell_id].base[i];
int bonus = spellbonuses.IncreaseChanceMemwipe + itembonuses.IncreaseChanceMemwipe + aabonuses.IncreaseChanceMemwipe;
wipechance += wipechance*bonus/100;
if(MakeRandomInt(0, 100) < wipechance) if(MakeRandomInt(0, 100) < wipechance)
{ {
if(IsAIControlled()) if(IsAIControlled())
@ -2831,7 +2838,6 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
case SE_SpellVulnerability: case SE_SpellVulnerability:
case SE_SpellTrigger: case SE_SpellTrigger:
case SE_ApplyEffect: case SE_ApplyEffect:
case SE_ApplyEffect2:
case SE_Twincast: case SE_Twincast:
case SE_DelayDeath: case SE_DelayDeath:
case SE_InterruptCasting: case SE_InterruptCasting:
@ -2932,6 +2938,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
case SE_FcLimitUse: case SE_FcLimitUse:
case SE_FcMute: case SE_FcMute:
case SE_FfLimitUseType: case SE_FfLimitUseType:
case SE_FcStunTimeMod:
case SE_StunBashChance:
case SE_IncreaseChanceMemwipe:
case SE_CriticalMend:
{ {
break; break;
} }
@ -4425,6 +4435,14 @@ int16 Client::CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id)
break; break;
} }
case SE_FcStunTimeMod:
{
if(type == focusFcStunTimeMod)
value = base1;
break;
}
} }
} }
@ -4949,6 +4967,14 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
break; break;
} }
case SE_FcStunTimeMod:
{
if(type == focusFcStunTimeMod)
value = focus_spell.base[i];
break;
}
#if EQDEBUG >= 6 #if EQDEBUG >= 6
//this spits up a lot of garbage when calculating spell focuses //this spits up a lot of garbage when calculating spell focuses
//since they have all kinds of extra effects on them. //since they have all kinds of extra effects on them.