Merge branch 'master' into water_map_v2

This commit is contained in:
KimLS
2014-05-23 16:09:46 -07:00
10 changed files with 55 additions and 44 deletions
+1 -1
View File
@@ -318,7 +318,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c
chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker);
// Chance to hit; Max 95%, Min 30%
if(chancetohit > 1000) {
if(chancetohit > 1000 || chancetohit < -1000) {
//if chance to hit is crazy high, that means a discipline is in use, and let it stay there
}
else if(chancetohit > 95) {
+25 -13
View File
@@ -2151,28 +2151,40 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
case SE_LimitHPPercent:
{
if(newbon->HPPercCap != 0 && newbon->HPPercCap > effect_value)
newbon->HPPercCap = effect_value;
else if(newbon->HPPercCap == 0)
newbon->HPPercCap = effect_value;
if(newbon->HPPercCap[0] != 0 && newbon->HPPercCap[0] > effect_value){
newbon->HPPercCap[0] = effect_value;
newbon->HPPercCap[1] = base2;
}
else if(newbon->HPPercCap[0] == 0){
newbon->HPPercCap[0] = effect_value;
newbon->HPPercCap[1] = base2;
}
break;
}
case SE_LimitManaPercent:
{
if(newbon->ManaPercCap != 0 && newbon->ManaPercCap > effect_value)
newbon->ManaPercCap = effect_value;
else if(newbon->ManaPercCap == 0)
newbon->ManaPercCap = effect_value;
if(newbon->ManaPercCap[0] != 0 && newbon->ManaPercCap[0] > effect_value){
newbon->ManaPercCap[0] = effect_value;
newbon->ManaPercCap[1] = base2;
}
else if(newbon->ManaPercCap[0] == 0) {
newbon->ManaPercCap[0] = effect_value;
newbon->ManaPercCap[1] = base2;
}
break;
}
case SE_LimitEndPercent:
{
if(newbon->EndPercCap != 0 && newbon->EndPercCap > effect_value)
newbon->EndPercCap = effect_value;
else if(newbon->EndPercCap == 0)
newbon->EndPercCap = effect_value;
if(newbon->EndPercCap[0] != 0 && newbon->EndPercCap[0] > effect_value) {
newbon->EndPercCap[0] = effect_value;
newbon->EndPercCap[1] = base2;
}
else if(newbon->EndPercCap[0] == 0){
newbon->EndPercCap[0] = effect_value;
newbon->EndPercCap[1] = base2;
}
break;
}
+4 -4
View File
@@ -10649,10 +10649,10 @@ int32 Bot::CalcMaxHP() {
if (cur_hp > max_hp)
cur_hp = max_hp;
int hp_perc_cap = spellbonuses.HPPercCap;
int hp_perc_cap = spellbonuses.HPPercCap[0];
if(hp_perc_cap) {
int curHP_cap = (max_hp * hp_perc_cap) / 100;
if (cur_hp > curHP_cap)
if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1]))
cur_hp = curHP_cap;
}
@@ -10671,10 +10671,10 @@ int32 Bot::CalcMaxEndurance()
cur_end = max_end;
}
int end_perc_cap = spellbonuses.EndPercCap;
int end_perc_cap = spellbonuses.EndPercCap[0];
if(end_perc_cap) {
int curEnd_cap = (max_end * end_perc_cap) / 100;
if (cur_end > curEnd_cap)
if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1]))
cur_end = curEnd_cap;
}
+6 -6
View File
@@ -255,10 +255,10 @@ int32 Client::CalcMaxHP() {
if (cur_hp > max_hp)
cur_hp = max_hp;
int hp_perc_cap = spellbonuses.HPPercCap;
int hp_perc_cap = spellbonuses.HPPercCap[0];
if(hp_perc_cap) {
int curHP_cap = (max_hp * hp_perc_cap) / 100;
if (cur_hp > curHP_cap)
if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1]))
cur_hp = curHP_cap;
}
@@ -950,10 +950,10 @@ int32 Client::CalcMaxMana()
cur_mana = max_mana;
}
int mana_perc_cap = spellbonuses.ManaPercCap;
int mana_perc_cap = spellbonuses.ManaPercCap[0];
if(mana_perc_cap) {
int curMana_cap = (max_mana * mana_perc_cap) / 100;
if (cur_mana > curMana_cap)
if (cur_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && cur_mana > spellbonuses.ManaPercCap[1]))
cur_mana = curMana_cap;
}
@@ -1890,10 +1890,10 @@ void Client::CalcMaxEndurance()
cur_end = max_end;
}
int end_perc_cap = spellbonuses.EndPercCap;
int end_perc_cap = spellbonuses.EndPercCap[0];
if(end_perc_cap) {
int curEnd_cap = (max_end * end_perc_cap) / 100;
if (cur_end > curEnd_cap)
if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1]))
cur_end = curEnd_cap;
}
}
+3 -3
View File
@@ -310,9 +310,9 @@ struct StatBonuses {
int16 IncreaseBlockChance; // overall block chance modifier
uint16 PersistantCasting; // chance to continue casting through a stun
int XPRateMod; //i
int HPPercCap; //Spell effect that limits you to being healed/regening beyond a % of your max
int ManaPercCap; // ^^
int EndPercCap; // ^^
int HPPercCap[2]; //Spell effect that limits you to being healed/regening beyond a % of your max
int ManaPercCap[2]; // ^^ 0 = % Cap 1 = Flat Amount Cap
int EndPercCap[2]; // ^^
bool BlockNextSpell; // Indicates whether the client can block a spell or not
//uint16 BlockSpellEffect[EFFECT_COUNT]; // Prevents spells with certain effects from landing on you *no longer used
bool ImmuneToFlee; // Bypass the fleeing flag
+1 -1
View File
@@ -163,7 +163,7 @@ Mob* HateList::GetClosest(Mob *hater) {
++iterator;
}
if (close == 0 && hater->IsNPC())
if (close == 0 && hater->IsNPC() || close->DivineAura())
close = hater->CastToNPC()->GetHateTop();
return close;
+6 -6
View File
@@ -917,10 +917,10 @@ int32 Merc::CalcMaxHP() {
if (cur_hp > max_hp)
cur_hp = max_hp;
int hp_perc_cap = spellbonuses.HPPercCap;
int hp_perc_cap = spellbonuses.HPPercCap[0];
if(hp_perc_cap) {
int curHP_cap = (max_hp * hp_perc_cap) / 100;
if (cur_hp > curHP_cap)
if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1]))
cur_hp = curHP_cap;
}
@@ -959,10 +959,10 @@ int32 Merc::CalcMaxMana()
cur_mana = max_mana;
}
int mana_perc_cap = spellbonuses.ManaPercCap;
int mana_perc_cap = spellbonuses.ManaPercCap[0];
if(mana_perc_cap) {
int curMana_cap = (max_mana * mana_perc_cap) / 100;
if (cur_mana > curMana_cap)
if (cur_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && cur_mana > spellbonuses.ManaPercCap[1]))
cur_mana = curMana_cap;
}
@@ -1054,10 +1054,10 @@ void Merc::CalcMaxEndurance()
cur_end = max_end;
}
int end_perc_cap = spellbonuses.EndPercCap;
int end_perc_cap = spellbonuses.EndPercCap[0];
if(end_perc_cap) {
int curEnd_cap = (max_end * end_perc_cap) / 100;
if (cur_end > curEnd_cap)
if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1]))
cur_end = curEnd_cap;
}
}
+5 -10
View File
@@ -351,19 +351,14 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
//Live AA - Technique of Master Wu
uint16 bDoubleSpecialAttack = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack;
if( bDoubleSpecialAttack && (bDoubleSpecialAttack >= 100 || bDoubleSpecialAttack > MakeRandomInt(0,100)) ) {
if (bDoubleSpecialAttack && (bDoubleSpecialAttack >= 100 || bDoubleSpecialAttack > MakeRandomInt(0, 99))) {
int MonkSPA [5] = { SkillFlyingKick, SkillDragonPunch, SkillEagleStrike, SkillTigerClaw, SkillRoundKick };
MonkSpecialAttack(GetTarget(), MonkSPA[MakeRandomInt(0,4)]);
MonkSpecialAttack(GetTarget(), MonkSPA[MakeRandomInt(0, 4)]);
int TripleChance = 25;
if (bDoubleSpecialAttack > 100)
TripleChance += TripleChance*(100-bDoubleSpecialAttack)/100;
if(TripleChance > MakeRandomInt(0,100)) {
MonkSpecialAttack(GetTarget(), MonkSPA[MakeRandomInt(0,4)]);
}
// always 1/4 of the double attack chance, 25% at rank 5 (100/4)
if ((bDoubleSpecialAttack / 4) > MakeRandomInt(0, 99))
MonkSpecialAttack(GetTarget(), MonkSPA[MakeRandomInt(0, 4)]);
}
if(ReuseTime < 100) {