Merge pull request #461 from KayenEQ/Development

Updated a few AA effects to use database values instead of hard coded …
This commit is contained in:
KayenEQ 2015-10-09 13:58:04 -04:00
commit 902a850c71
5 changed files with 59 additions and 185 deletions

View File

@ -381,7 +381,7 @@ typedef enum {
#define SE_GiveDoubleAttack 225 // implemented[AA] - Allow any class to double attack with set chance. #define SE_GiveDoubleAttack 225 // implemented[AA] - Allow any class to double attack with set chance.
#define SE_TwoHandBash 226 // *not implemented as bonus #define SE_TwoHandBash 226 // *not implemented as bonus
#define SE_ReduceSkillTimer 227 // implemented #define SE_ReduceSkillTimer 227 // implemented
#define SE_ReduceFallDamage 228 // not implented as bonus - reduce the damage that you take from falling #define SE_ReduceFallDamage 228 // implented - 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 // implemented - increase chance to stun from bash. #define SE_StunBashChance 231 // implemented - increase chance to stun from bash.
@ -409,7 +409,7 @@ typedef enum {
#define SE_FrontalBackstabMinDmg 253 // implemented[AA] - allow a frontal backstab for mininum damage. #define SE_FrontalBackstabMinDmg 253 // implemented[AA] - allow a frontal backstab for mininum damage.
#define SE_Blank 254 // implemented #define SE_Blank 254 // implemented
#define SE_ShieldDuration 255 // not implemented as bonus - increases duration of /shield #define SE_ShieldDuration 255 // not implemented as bonus - increases duration of /shield
#define SE_ShroudofStealth 256 // not implemented as bonus - rogue improved invs #define SE_ShroudofStealth 256 // implemented
#define SE_PetDiscipline 257 // not implemented as bonus - /pet hold #define SE_PetDiscipline 257 // not implemented as bonus - /pet hold
#define SE_TripleBackstab 258 // implemented[AA] - chance to perform a triple backstab #define SE_TripleBackstab 258 // implemented[AA] - chance to perform a triple backstab
#define SE_CombatStability 259 // implemented[AA] - damage mitigation #define SE_CombatStability 259 // implemented[AA] - damage mitigation
@ -421,7 +421,7 @@ typedef enum {
#define SE_MasteryofPast 265 // implemented[AA] - Spells less than effect values level can not be fizzled #define SE_MasteryofPast 265 // implemented[AA] - Spells less than effect values level can not be fizzled
#define SE_ExtraAttackChance 266 // implemented - increase chance to score an extra attack with a 2-Handed Weapon. #define SE_ExtraAttackChance 266 // implemented - increase chance to score an extra attack with a 2-Handed Weapon.
#define SE_PetDiscipline2 267 // *not implemented - /pet focus, /pet no cast #define SE_PetDiscipline2 267 // *not implemented - /pet focus, /pet no cast
#define SE_ReduceTradeskillFail 268 // *not implemented? - reduces chance to fail with given tradeskill by a percent chance #define SE_ReduceTradeskillFail 268 // implemented - reduces chance to fail with given tradeskill by a percent chance
#define SE_MaxBindWound 269 // implemented[AA] - Increase max HP you can bind wound. #define SE_MaxBindWound 269 // implemented[AA] - Increase max HP you can bind wound.
#define SE_BardSongRange 270 // implemented[AA] - increase range of beneficial bard songs (Sionachie's Crescendo) #define SE_BardSongRange 270 // implemented[AA] - increase range of beneficial bard songs (Sionachie's Crescendo)
#define SE_BaseMovementSpeed 271 // implemented[AA] - mods basemove speed, doesn't stack with other move mods #define SE_BaseMovementSpeed 271 // implemented[AA] - mods basemove speed, doesn't stack with other move mods

View File

@ -1429,13 +1429,23 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
newbon->PC_Pet_Flurry += base1; //Chance to Flurry newbon->PC_Pet_Flurry += base1; //Chance to Flurry
break; break;
case SE_ShroudofStealth:
newbon->ShroudofStealth = true;
break;
case SE_ReduceFallDamage:
newbon->ReduceFallDamage += base1;
break;
case SE_ReduceTradeskillFail:
newbon->ReduceTradeskillFail[base2] += base1;
break;
// to do // to do
case SE_PetDiscipline: case SE_PetDiscipline:
break; break;
case SE_PetDiscipline2: case SE_PetDiscipline2:
break; break;
case SE_ReduceTradeskillFail:
break;
case SE_PotionBeltSlots: case SE_PotionBeltSlots:
break; break;
case SE_BandolierSlots: case SE_BandolierSlots:
@ -1458,13 +1468,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break; break;
case SE_TrapCircumvention: case SE_TrapCircumvention:
break; break;
case SE_ShroudofStealth:
break;
case SE_FeignedMinion: case SE_FeignedMinion:
break; break;
// handled client side
case SE_ReduceFallDamage:
// not handled here // not handled here
case SE_HastenedAASkill: case SE_HastenedAASkill:
// not handled here but don't want to clutter debug log -- these may need to be verified to ignore // not handled here but don't want to clutter debug log -- these may need to be verified to ignore
@ -3143,6 +3149,18 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
new_bonus->PC_Pet_Flurry += effect_value; //Chance to Flurry new_bonus->PC_Pet_Flurry += effect_value; //Chance to Flurry
break; break;
case SE_ShroudofStealth:
new_bonus->ShroudofStealth = true;
break;
case SE_ReduceFallDamage:
new_bonus->ReduceFallDamage += effect_value;
break;
case SE_ReduceTradeskillFail:
new_bonus->ReduceTradeskillFail[base2] += effect_value;
break;
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) { if (IsAISpellEffect) {

View File

@ -5076,18 +5076,12 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met."); Message(13, "Ability recovery time not yet met.");
return; return;
} }
int reuse = DisarmTrapsReuseTime;
switch (GetAA(aaAdvTrapNegotiation)) { int reuse = DisarmTrapsReuseTime - GetSkillReuseTime(SkillDisarmTraps);
case 1:
reuse -= 1; if (reuse < 1)
break; reuse = 1;
case 2:
reuse -= 3;
break;
case 3:
reuse -= 5;
break;
}
p_timers.Start(pTimerDisarmTraps, reuse - 1); p_timers.Start(pTimerDisarmTraps, reuse - 1);
Trap* trap = entity_list.FindNearbyTrap(this, 60); Trap* trap = entity_list.FindNearbyTrap(this, 60);
@ -5359,17 +5353,9 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
if (ed->dmgtype == 252) { if (ed->dmgtype == 252) {
switch (GetAA(aaAcrobatics)) { //Don't know what acrobatics effect is yet but it should be done client side via aa effect.. till then int mod = spellbonuses.ReduceFallDamage + itembonuses.ReduceFallDamage + aabonuses.ReduceFallDamage;
case 1:
damage = damage * 95 / 100; damage -= damage * mod / 100;
break;
case 2:
damage = damage * 90 / 100;
break;
case 3:
damage = damage * 80 / 100;
break;
}
} }
if (damage < 0) if (damage < 0)
@ -5443,19 +5429,13 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met."); Message(13, "Ability recovery time not yet met.");
return; return;
} }
int reuse = FeignDeathReuseTime; int reuse = FeignDeathReuseTime;
switch (GetAA(aaRapidFeign)) reuse -= GetSkillReuseTime(SkillFeignDeath);
{
case 1: if (reuse < 1)
reuse -= 1; reuse = 1;
break;
case 2:
reuse -= 2;
break;
case 3:
reuse -= 5;
break;
}
p_timers.Start(pTimerFeignDeath, reuse - 1); p_timers.Start(pTimerFeignDeath, reuse - 1);
//BreakInvis(); //BreakInvis();
@ -7762,7 +7742,11 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met."); Message(13, "Ability recovery time not yet met.");
return; return;
} }
int reuse = HideReuseTime - GetAA(209); int reuse = HideReuseTime - GetSkillReuseTime(SkillHide);
if (reuse < 1)
reuse = 1;
p_timers.Start(pTimerHide, reuse - 1); p_timers.Start(pTimerHide, reuse - 1);
float hidechance = ((GetSkill(SkillHide) / 250.0f) + .25) * 100; float hidechance = ((GetSkill(SkillHide) / 250.0f) + .25) * 100;
@ -7776,7 +7760,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
sa_out->parameter = 1; sa_out->parameter = 1;
entity_list.QueueClients(this, outapp, true); entity_list.QueueClients(this, outapp, true);
safe_delete(outapp); safe_delete(outapp);
if (GetAA(aaShroudofStealth)){ if (spellbonuses.ShroudofStealth || aabonuses.ShroudofStealth || itembonuses.ShroudofStealth){
improved_hidden = true; improved_hidden = true;
hidden = true; hidden = true;
} }
@ -11698,18 +11682,12 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met."); Message(13, "Ability recovery time not yet met.");
return; return;
} }
int reuse = SenseTrapsReuseTime;
switch (GetAA(aaAdvTrapNegotiation)) { int reuse = SenseTrapsReuseTime - GetSkillReuseTime(SkillSenseTraps);
case 1:
reuse -= 1; if (reuse < 1)
break; reuse = 1;
case 2:
reuse -= 3;
break;
case 3:
reuse -= 5;
break;
}
p_timers.Start(pTimerSenseTraps, reuse - 1); p_timers.Start(pTimerSenseTraps, reuse - 1);
Trap* trap = entity_list.FindNearbyTrap(this, 800); Trap* trap = entity_list.FindNearbyTrap(this, 800);

View File

@ -467,6 +467,9 @@ struct StatBonuses {
int32 PetMeleeMitigation; // Add AC to owner's pet. int32 PetMeleeMitigation; // Add AC to owner's pet.
bool IllusionPersistence; // Causes illusions not to fade. bool IllusionPersistence; // Causes illusions not to fade.
uint16 extra_xtargets; // extra xtarget entries uint16 extra_xtargets; // extra xtarget entries
bool ShroudofStealth; // rogue improved invisiblity
uint16 ReduceFallDamage; // reduce fall damage by percent
int32 ReduceTradeskillFail[HIGHEST_SKILL+1]; // Reduces chance for trade skills to fail by percent.
}; };
typedef struct typedef struct

View File

@ -941,135 +941,10 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
float res = zone->random.Real(0, 99); float res = zone->random.Real(0, 99);
int aa_chance = 0; int aa_chance = 0;
//AA modifiers aa_chance = spellbonuses.ReduceTradeskillFail[spec->tradeskill] + itembonuses.ReduceTradeskillFail[spec->tradeskill] + aabonuses.ReduceTradeskillFail[spec->tradeskill];
//can we do this with nested switches?
if(spec->tradeskill == SkillAlchemy){
switch(GetAA(aaAlchemyMastery)){
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
if(spec->tradeskill == SkillJewelryMaking){
switch(GetAA(aaJewelCraftMastery)){
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
const Item_Struct* item = nullptr; const Item_Struct* item = nullptr;
if (spec->tradeskill == SkillBlacksmithing) {
switch(GetAA(aaBlacksmithingMastery)) {
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
if (spec->tradeskill == SkillBaking) {
switch(GetAA(aaBakingMastery)) {
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
if (spec->tradeskill == SkillBrewing) {
switch(GetAA(aaBrewingMastery)) {
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
if (spec->tradeskill == SkillFletching) {
switch(GetAA(aaFletchingMastery2)) {
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
if (spec->tradeskill == SkillPottery) {
switch(GetAA(aaPotteryMastery)) {
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
if (spec->tradeskill == SkillTailoring) {
switch(GetAA(aaTailoringMastery)) {
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
if (spec->tradeskill == SkillResearch) {
switch(GetAA(aaArcaneTongues)) {
case 1:
aa_chance = 10;
break;
case 2:
aa_chance = 25;
break;
case 3:
aa_chance = 50;
break;
}
}
chance = mod_tradeskill_chance(chance, spec); chance = mod_tradeskill_chance(chance, spec);
if (((spec->tradeskill==75) || GetGM() || (chance > res)) || zone->random.Roll(aa_chance)) { if (((spec->tradeskill==75) || GetGM() || (chance > res)) || zone->random.Roll(aa_chance)) {