Merge branch 'master' of https://github.com/EQEmu/Server into bots_updater

This commit is contained in:
Uleat
2015-10-09 21:39:05 -04:00
18 changed files with 367 additions and 315 deletions
+4 -1
View File
@@ -960,6 +960,9 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
//offensive spell aggro
int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
{
if (NoDetrimentalSpellAggro(spell_id))
return 0;
int32 AggroAmount = 0;
int32 nonModifiedAggro = 0;
uint16 slevel = GetLevel();
@@ -1240,7 +1243,7 @@ bool Mob::PassCharismaCheck(Mob* caster, uint16 spell_id) {
if(IsCharmSpell(spell_id)) {
if (spells[spell_id].powerful_flag == -1) //If charm spell has this set(-1), it can not break till end of duration.
if (spells[spell_id].no_resist) //If charm spell has this set(-1), it can not break till end of duration.
return true;
//1: The mob has a default 25% chance of being allowed a resistance check against the charm.
+24 -7
View File
@@ -2410,7 +2410,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack
return true;
}
void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/)
void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/, uint16 spell_id)
{
if(!other)
return;
@@ -2466,6 +2466,9 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
if(IsFamiliar() || GetSpecialAbility(IMMUNE_AGGRO))
return;
if (spell_id != SPELL_UNKNOWN && NoDetrimentalSpellAggro(spell_id))
return;
if (other == myowner)
return;
@@ -3139,15 +3142,15 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
if(!RuleB(Combat, EXPFromDmgShield)) {
// Damage shield damage shouldn't count towards who gets EXP
if(!attacker->CastToClient()->GetFeigned() && !FromDamageShield)
AddToHateList(attacker, 0, damage, true, false, iBuffTic);
AddToHateList(attacker, 0, damage, true, false, iBuffTic, spell_id);
}
else {
if(!attacker->CastToClient()->GetFeigned())
AddToHateList(attacker, 0, damage, true, false, iBuffTic);
AddToHateList(attacker, 0, damage, true, false, iBuffTic, spell_id);
}
}
else
AddToHateList(attacker, 0, damage, true, false, iBuffTic);
AddToHateList(attacker, 0, damage, true, false, iBuffTic, spell_id);
}
if(damage > 0) {
@@ -3172,7 +3175,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
{
if (!pet->IsHeld()) {
Log.Out(Logs::Detail, Logs::Aggro, "Sending pet %s into battle due to attack.", pet->GetName());
pet->AddToHateList(attacker, 1);
pet->AddToHateList(attacker, 1,0, true, false, false, spell_id);
pet->SetTarget(attacker);
Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName());
}
@@ -4760,8 +4763,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec
// A "quad" on live really is just a successful dual wield where both double attack
// The mobs that could triple lost the ability to when the triple attack skill was added in
Attack(target, MainPrimary, false, false, false, opts, special);
if (CanThisClassDoubleAttack() && CheckDoubleAttack())
if (CanThisClassDoubleAttack() && CheckDoubleAttack()){
Attack(target, MainPrimary, false, false, false, opts, special);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
if (chance && zone->random.Roll(chance))
Flurry(nullptr);
}
}
return;
}
@@ -4811,8 +4821,15 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int speci
GetEquipment(MaterialSecondary) != 0) {
if (CheckDualWield()) {
Attack(target, MainSecondary, false, false, false, opts, special);
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack())
if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()){
Attack(target, MainSecondary, false, false, false, opts, special);
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry;
if (chance && zone->random.Roll(chance))
Flurry(nullptr);
}
}
}
}
}
+70 -15
View File
@@ -1199,13 +1199,14 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break;
}
// Kayen: Not sure best way to implement this yet.
// Physically raises skill cap ie if 55/55 it will raise to 55/60
case SE_RaiseSkillCap: {
if (newbon->RaiseSkillCap[0] < base1) {
newbon->RaiseSkillCap[0] = base1; // value
newbon->RaiseSkillCap[1] = base2; // skill
}
if (base2 > HIGHEST_SKILL)
break;
if (newbon->RaiseSkillCap[base2] < base1)
newbon->RaiseSkillCap[base2] = base1;
break;
}
@@ -1423,22 +1424,45 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
if (newbon->PC_Pet_Rampage[1] < base2)
newbon->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest
break;
}
}
case SE_PC_Pet_Flurry_Chance:
newbon->PC_Pet_Flurry += base1; //Chance to Flurry
break;
case SE_ShroudofStealth:
newbon->ShroudofStealth = true;
break;
case SE_ReduceFallDamage:
newbon->ReduceFallDamage += base1;
break;
case SE_ReduceTradeskillFail:{
if (base2 > HIGHEST_SKILL)
break;
newbon->ReduceTradeskillFail[base2] += base1;
break;
}
case SE_TradeSkillMastery:
if (newbon->TradeSkillMastery < base1)
newbon->TradeSkillMastery = base1;
break;
// to do
case SE_PetDiscipline:
break;
case SE_PetDiscipline2:
break;
case SE_ReduceTradeskillFail:
break;
case SE_PotionBeltSlots:
break;
case SE_BandolierSlots:
break;
case SE_ForageSkill:
break;
case SE_TradeSkillMastery:
break;
case SE_SecondaryForte:
break;
case SE_FeignedCastOnChance:
@@ -1453,13 +1477,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break;
case SE_TrapCircumvention:
break;
case SE_ShroudofStealth:
break;
case SE_FeignedMinion:
break;
// handled client side
case SE_ReduceFallDamage:
// not handled here
case SE_HastenedAASkill:
// not handled here but don't want to clutter debug log -- these may need to be verified to ignore
@@ -3132,8 +3152,43 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
if (new_bonus->PC_Pet_Rampage[1] < base2)
new_bonus->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest
break;
}
}
case SE_PC_Pet_Flurry_Chance:
new_bonus->PC_Pet_Flurry += effect_value; //Chance to Flurry
break;
case SE_ShroudofStealth:
new_bonus->ShroudofStealth = true;
break;
case SE_ReduceFallDamage:
new_bonus->ReduceFallDamage += effect_value;
break;
case SE_ReduceTradeskillFail:{
if (base2 > HIGHEST_SKILL)
break;
new_bonus->ReduceTradeskillFail[base2] += effect_value;
break;
}
case SE_TradeSkillMastery:
if (new_bonus->TradeSkillMastery < effect_value)
new_bonus->TradeSkillMastery = effect_value;
break;
case SE_RaiseSkillCap: {
if (base2 > HIGHEST_SKILL)
break;
if (new_bonus->RaiseSkillCap[base2] < effect_value)
new_bonus->RaiseSkillCap[base2] = effect_value;
break;
}
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) {
+2 -12
View File
@@ -2439,18 +2439,8 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16
}
}
// This should possibly be handled by bonuses rather than here.
switch(skillid)
{
case SkillTracking:
{
Result += ((GetAA(aaAdvancedTracking) * 10) + (GetAA(aaTuneofPursuance) * 10));
break;
}
default:
break;
}
Result += spellbonuses.RaiseSkillCap[skillid] + itembonuses.RaiseSkillCap[skillid] + aabonuses.RaiseSkillCap[skillid];
return Result;
}
+28 -50
View File
@@ -3734,7 +3734,7 @@ void Client::Handle_OP_BuffRemoveRequest(const EQApplicationPacket *app)
uint16 SpellID = m->GetSpellIDFromSlot(brrs->SlotID);
if (SpellID && IsBeneficialSpell(SpellID))
if (SpellID && IsBeneficialSpell(SpellID) && !spells[SpellID].no_remove)
m->BuffFadeBySlot(brrs->SlotID, true);
}
@@ -5076,18 +5076,12 @@ void Client::Handle_OP_DisarmTraps(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met.");
return;
}
int reuse = DisarmTrapsReuseTime;
switch (GetAA(aaAdvTrapNegotiation)) {
case 1:
reuse -= 1;
break;
case 2:
reuse -= 3;
break;
case 3:
reuse -= 5;
break;
}
int reuse = DisarmTrapsReuseTime - GetSkillReuseTime(SkillDisarmTraps);
if (reuse < 1)
reuse = 1;
p_timers.Start(pTimerDisarmTraps, reuse - 1);
Trap* trap = entity_list.FindNearbyTrap(this, 60);
@@ -5359,17 +5353,9 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
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
case 1:
damage = damage * 95 / 100;
break;
case 2:
damage = damage * 90 / 100;
break;
case 3:
damage = damage * 80 / 100;
break;
}
int mod = spellbonuses.ReduceFallDamage + itembonuses.ReduceFallDamage + aabonuses.ReduceFallDamage;
damage -= damage * mod / 100;
}
if (damage < 0)
@@ -5443,19 +5429,13 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met.");
return;
}
int reuse = FeignDeathReuseTime;
switch (GetAA(aaRapidFeign))
{
case 1:
reuse -= 1;
break;
case 2:
reuse -= 2;
break;
case 3:
reuse -= 5;
break;
}
reuse -= GetSkillReuseTime(SkillFeignDeath);
if (reuse < 1)
reuse = 1;
p_timers.Start(pTimerFeignDeath, reuse - 1);
//BreakInvis();
@@ -7762,7 +7742,11 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met.");
return;
}
int reuse = HideReuseTime - GetAA(209);
int reuse = HideReuseTime - GetSkillReuseTime(SkillHide);
if (reuse < 1)
reuse = 1;
p_timers.Start(pTimerHide, reuse - 1);
float hidechance = ((GetSkill(SkillHide) / 250.0f) + .25) * 100;
@@ -7776,7 +7760,7 @@ void Client::Handle_OP_Hide(const EQApplicationPacket *app)
sa_out->parameter = 1;
entity_list.QueueClients(this, outapp, true);
safe_delete(outapp);
if (GetAA(aaShroudofStealth)){
if (spellbonuses.ShroudofStealth || aabonuses.ShroudofStealth || itembonuses.ShroudofStealth){
improved_hidden = true;
hidden = true;
}
@@ -11698,18 +11682,12 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app)
Message(13, "Ability recovery time not yet met.");
return;
}
int reuse = SenseTrapsReuseTime;
switch (GetAA(aaAdvTrapNegotiation)) {
case 1:
reuse -= 1;
break;
case 2:
reuse -= 3;
break;
case 3:
reuse -= 5;
break;
}
int reuse = SenseTrapsReuseTime - GetSkillReuseTime(SkillSenseTraps);
if (reuse < 1)
reuse = 1;
p_timers.Start(pTimerSenseTraps, reuse - 1);
Trap* trap = entity_list.FindNearbyTrap(this, 800);
+6 -1
View File
@@ -408,6 +408,7 @@ struct StatBonuses {
uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs.
uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success.
uint32 PC_Pet_Rampage[2]; // 0= % chance to rampage, 1=damage modifier
uint32 PC_Pet_Flurry; // Percent chance flurry from double attack
// AAs
int8 Packrat; //weight reduction for items, 1 point = 10%
@@ -438,7 +439,7 @@ struct StatBonuses {
int32 CombatStability; // Melee damage mitigation.
int32 DoubleRiposte; // Chance to double riposte
int32 GiveDoubleRiposte[3]; // 0=Regular Chance, 1=Skill Attack Chance, 2=Skill
uint32 RaiseSkillCap[2]; // Raise a specific skill cap (1 = value, 2=skill)
uint32 RaiseSkillCap[HIGHEST_SKILL+1]; // Raise a specific skill cap (base1= value, base2=skill)
int32 Ambidexterity; // Increase chance to duel wield by adding bonus 'skill'.
int32 PetMaxHP; // Increase the max hp of your pet.
int32 PetFlurry; // Chance for pet to flurry.
@@ -466,6 +467,10 @@ struct StatBonuses {
int32 PetMeleeMitigation; // Add AC to owner's pet.
bool IllusionPersistence; // Causes illusions not to fade.
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.
uint8 TradeSkillMastery; // Allow number of tradeskills to exceed 200 skill.
};
typedef struct
+3 -6
View File
@@ -112,7 +112,7 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetFocusEffect(focusFcDamageAmt, spell_id);
value -= GetFocusEffect(focusFcDamageAmt2, spell_id);
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value)*ratio/100;
else if (IsNPC() && CastToNPC()->GetSpellScale())
@@ -145,7 +145,7 @@ int32 Mob::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetFocusEffect(focusFcDamageAmt, spell_id);
value -= GetFocusEffect(focusFcDamageAmt2, spell_id);
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value);
if (IsNPC() && CastToNPC()->GetSpellScale())
@@ -287,7 +287,7 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
value += GetFocusEffect(focusFcHealAmt, spell_id);
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
value += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier;
value += value*target->GetHealRate(spell_id, this)/100;
@@ -430,9 +430,6 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
int32 Mob::GetActSpellDuration(uint16 spell_id, int32 duration)
{
if (spells[spell_id].not_extendable)
return duration;
int increase = 100;
increase += GetFocusEffect(focusSpellDuration, spell_id);
int tic_inc = 0;
+2 -2
View File
@@ -406,7 +406,7 @@ int Lua_Spell::GetSpellGroup() {
int Lua_Spell::GetPowerfulFlag() {
Lua_Safe_Call_Int();
return self->powerful_flag;
return self->no_resist;
}
int Lua_Spell::GetCastRestriction() {
@@ -436,7 +436,7 @@ int Lua_Spell::GetAEMaxTargets() {
int Lua_Spell::GetMaxTargets() {
Lua_Safe_Call_Int();
return self->maxtargets;
return self->no_heal_damage_item_mod;
}
bool Lua_Spell::GetPersistDeath() {
+3 -3
View File
@@ -5598,18 +5598,18 @@ int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot)
else if (id == "NimbusEffect") {return spells[spell_id].NimbusEffect; }
else if (id == "directional_start") {return static_cast<int32>(spells[spell_id].directional_start); }
else if (id == "directional_end") {return static_cast<int32>(spells[spell_id].directional_end); }
else if (id == "not_extendable") {return spells[spell_id].not_extendable; }
else if (id == "not_focusable") {return spells[spell_id].not_focusable; }
else if (id == "suspendable") {return spells[spell_id].suspendable; }
else if (id == "viral_range") {return spells[spell_id].viral_range; }
else if (id == "spellgroup") {return spells[spell_id].spellgroup; }
else if (id == "rank") {return spells[spell_id].rank; }
else if (id == "powerful_flag") {return spells[spell_id].powerful_flag; }
else if (id == "no_resist") {return spells[spell_id].no_resist; }
else if (id == "CastRestriction") {return spells[spell_id].CastRestriction; }
else if (id == "AllowRest") {return spells[spell_id].AllowRest; }
else if (id == "InCombat") {return spells[spell_id].InCombat; }
else if (id == "OutofCombat") {return spells[spell_id].OutofCombat; }
else if (id == "aemaxtargets") {return spells[spell_id].aemaxtargets; }
else if (id == "maxtargets") {return spells[spell_id].maxtargets; }
else if (id == "no_heal_damage_item_mod") {return spells[spell_id].no_heal_damage_item_mod; }
else if (id == "persistdeath") {return spells[spell_id].persistdeath; }
else if (id == "min_dist") {return static_cast<int32>(spells[spell_id].min_dist); }
else if (id == "min_dist_mod") {return static_cast<int32>(spells[spell_id].min_dist_mod); }
+1 -1
View File
@@ -489,7 +489,7 @@ public:
inline uint32 GetLevelCon(uint8 iOtherLevel) const {
return this ? GetLevelCon(GetLevel(), iOtherLevel) : CON_GREEN; }
virtual void AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true,
bool bFrenzy = false, bool iBuffTic = false);
bool bFrenzy = false, bool iBuffTic = false, uint16 spell_id = SPELL_UNKNOWN);
bool RemoveFromHateList(Mob* mob);
void SetHateAmountOnEnt(Mob* other, int32 hate = 0, int32 damage = 0) { hate_list.SetHateAmountOnEnt(other,hate,damage);}
void HalveAggro(Mob *other) { uint32 in_hate = GetHateAmount(other); SetHateAmountOnEnt(other, (in_hate > 1 ? in_hate / 2 : 1)); }
+7 -1
View File
@@ -780,7 +780,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
// define spells with fixed duration
// charm spells with -1 in field 209 are all of fixed duration, so lets use that instead of spell_ids
if(spells[spell_id].powerful_flag == -1)
if(spells[spell_id].no_resist)
bBreak = true;
if (!bBreak)
@@ -5228,6 +5228,9 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
if (IsBardSong(spell_id) && type != focusFcBaseEffects && type != focusSpellDuration)
return 0;
if (spells[spell_id].not_focusable)
return 0;
int16 realTotal = 0;
int16 realTotal2 = 0;
int16 realTotal3 = 0;
@@ -5499,6 +5502,9 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id)
int16 NPC::GetFocusEffect(focusType type, uint16 spell_id) {
if (spells[spell_id].not_focusable)
return 0;
int16 realTotal = 0;
int16 realTotal2 = 0;
bool rand_effectiveness = false;
+7 -15
View File
@@ -750,14 +750,6 @@ bool Client::CheckFizzle(uint16 spell_id)
// always at least 1% chance to fail or 5% to succeed
fizzlechance = fizzlechance < 1 ? 1 : (fizzlechance > 95 ? 95 : fizzlechance);
/*
if(IsBardSong(spell_id))
{
//This was a channel chance modifier - no evidence for fizzle reduction
fizzlechance -= GetAA(aaInternalMetronome) * 1.5f;
}
*/
float fizzle_roll = zone->random.Real(0, 100);
Log.Out(Logs::Detail, Logs::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll);
@@ -4067,7 +4059,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4094,7 +4086,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4110,7 +4102,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
} else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false))
@@ -4127,7 +4119,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if (aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4150,7 +4142,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4190,7 +4182,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4298,7 +4290,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
}
//Get the resist chance for the target
if(resist_type == RESIST_NONE)
if(resist_type == RESIST_NONE || spells[spell_id].no_resist)
{
Log.Out(Logs::Detail, Logs::Spells, "Spell was unresistable");
return 100;
+5 -129
View File
@@ -941,135 +941,10 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
float res = zone->random.Real(0, 99);
int aa_chance = 0;
//AA modifiers
//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;
}
}
aa_chance = spellbonuses.ReduceTradeskillFail[spec->tradeskill] + itembonuses.ReduceTradeskillFail[spec->tradeskill] + aabonuses.ReduceTradeskillFail[spec->tradeskill];
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;
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);
if (((spec->tradeskill==75) || GetGM() || (chance > res)) || zone->random.Roll(aa_chance)) {
@@ -1528,8 +1403,9 @@ bool Client::CanIncreaseTradeskill(SkillUseTypes tradeskill) {
uint8 Pottery = (GetRawSkill(SkillPottery) > 200) ? 1 : 0;
uint8 Tailoring = (GetRawSkill(SkillTailoring) > 200) ? 1 : 0;
uint8 SkillTotal = Baking + Smithing + Brewing + Fletching + Jewelry + Pottery + Tailoring; //Tradeskills above 200
uint32 aaLevel = GetAA(aaNewTanaanCraftingMastery); //New Tanaan AA: Each level allows an additional tradeskill above 200 (first one is free)
//New Tanaan AA: Each level allows an additional tradeskill above 200 (first one is free)
uint8 aaLevel = spellbonuses.TradeSkillMastery + itembonuses.TradeSkillMastery + aabonuses.TradeSkillMastery;
switch (tradeskill) {
case SkillBaking:
case SkillBlacksmithing: