Merge remote-tracking branch 'upstream/master' into spa395fix2

This commit is contained in:
KayenEQ
2021-10-01 14:28:45 -04:00
55 changed files with 6196 additions and 5682 deletions
+18 -73
View File
@@ -2838,10 +2838,17 @@ bool Mob::HateSummon() {
if(summon_level == 1) {
entity_list.MessageClose(this, true, 500, Chat::Say, "%s says 'You will not evade me, %s!' ", GetCleanName(), target->GetCleanName() );
auto new_pos = m_Position;
float angle = new_pos.w - target->GetHeading();
new_pos.w = target->GetHeading();
// probably should be like half melee range, but we can't get melee range nicely because reasons :)
new_pos = target->TryMoveAlong(new_pos, 5.0f, angle);
if (target->IsClient())
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), m_Position.x, m_Position.y, m_Position.z, target->GetHeading(), 0, SummonPC);
target->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), new_pos.x, new_pos.y, new_pos.z, new_pos.w, 0, SummonPC);
else
target->GMMove(m_Position.x, m_Position.y, m_Position.z, target->GetHeading());
target->GMMove(new_pos.x, new_pos.y, new_pos.z, new_pos.w);
return true;
} else if(summon_level == 2) {
@@ -3602,81 +3609,20 @@ bool Mob::TrySpellTrigger(Mob *target, uint32 spell_id, int effect)
return false;
}
void Mob::TryTriggerOnValueAmount(bool IsHP, bool IsMana, bool IsEndur, bool IsPet)
void Mob::TryTriggerOnCastRequirement()
{
/*
At present time there is no obvious difference between ReqTarget and ReqCaster
ReqTarget is typically used in spells cast on a target where the trigger occurs on that target.
ReqCaster is typically self only spells where the triggers on self.
Regardless both trigger on the owner of the buff.
*/
/*
Base2 Range: 1004 = Below < 80% HP
Base2 Range: 500-520 = Below (base2 - 500)*5 HP
Base2 Range: 521 = Below (?) Mana UKNOWN - Will assume its 20% unless proven otherwise
Base2 Range: 522 = Below (40%) Endurance
Base2 Range: 523 = Below (40%) Mana
Base2 Range: 220-? = Number of pets on hatelist to trigger (base2 - 220) (Set at 30 pets max for now)
38311 = < 10% mana;
*/
if (!spellbonuses.TriggerOnValueAmount)
return;
if (spellbonuses.TriggerOnValueAmount){
if (spellbonuses.TriggerOnCastRequirement) {
int buff_count = GetMaxTotalSlots();
for(int e = 0; e < buff_count; e++){
uint32 spell_id = buffs[e].spellid;
if (IsValidSpell(spell_id)){
for(int i = 0; i < EFFECT_COUNT; i++){
for (int e = 0; e < buff_count; e++) {
int spell_id = buffs[e].spellid;
if (IsValidSpell(spell_id)) {
for (int i = 0; i < EFFECT_COUNT; i++) {
if ((spells[spell_id].effectid[i] == SE_TriggerOnReqTarget) || (spells[spell_id].effectid[i] == SE_TriggerOnReqCaster)) {
int base2 = spells[spell_id].base2[i];
bool use_spell = false;
if (IsHP){
if ((base2 >= 500 && base2 <= 520) && GetHPRatio() < (base2 - 500)*5)
use_spell = true;
else if (base2 == 1004 && GetHPRatio() < 80)
use_spell = true;
}
else if (IsMana){
if ( (base2 = 521 && GetManaRatio() < 20) || (base2 = 523 && GetManaRatio() < 40))
use_spell = true;
else if (base2 == 38311 && GetManaRatio() < 10)
use_spell = true;
}
else if (IsEndur){
if (base2 == 522 && GetEndurancePercent() < 40){
use_spell = true;
}
}
else if (IsPet){
int count = hate_list.GetSummonedPetCountOnHateList(this);
if ((base2 >= 220 && base2 <= 250) && count >= (base2 - 220)){
use_spell = true;
}
}
if (use_spell){
if (PassCastRestriction(spells[spell_id].base2[i])) {
SpellFinished(spells[spell_id].base[i], this, EQ::spells::CastingSlot::Item, 0, -1, spells[spell_id].ResistDiff);
if(!TryFadeEffect(e))
if (!TryFadeEffect(e)) {
BuffFadeBySlot(e);
}
}
}
}
@@ -3685,7 +3631,6 @@ void Mob::TryTriggerOnValueAmount(bool IsHP, bool IsMana, bool IsEndur, bool IsP
}
}
//Twincast Focus effects should stack across different types (Spell, AA - when implemented ect)
void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
{