Merge pull request #507 from KayenEQ/Development

AE Taunt range fix
This commit is contained in:
KayenEQ 2016-03-24 16:27:41 -04:00
commit 747895cbe5
6 changed files with 20 additions and 18 deletions

View File

@ -1,5 +1,9 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 03/24/2016 ==
Kayen: Fix for AE taunt to use correct range and hate modifier.
Fix for spell effect version of taunt to use correct range.
== 03/05/2016 ==
mackal: Implement extra bind points (secondary recall)
For SE_Gate, base2 is which bind to use (starting at 1)

View File

@ -712,10 +712,10 @@ void Client::SendDisciplineTimer(uint32 timer_id, uint32 duration)
}
}
void EntityList::AETaunt(Client* taunter, float range)
void EntityList::AETaunt(Client* taunter, float range, int32 bonus_hate)
{
if (range == 0)
range = 100; //arbitrary default...
range = 40; //Live AE taunt range - Hardcoded.
range = range * range;
@ -729,7 +729,7 @@ void EntityList::AETaunt(Client* taunter, float range)
&& taunter->IsAttackAllowed(them)
&& DistanceSquaredNoZ(taunter->GetPosition(), them->GetPosition()) <= range) {
if (taunter->CheckLosFN(them)) {
taunter->Taunt(them, true);
taunter->Taunt(them, true,0,true,bonus_hate);
}
}
++it;

View File

@ -323,7 +323,7 @@ public:
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
void AEAttack(Mob *attacker, float dist, int Hand = MainPrimary, int count = 0, bool IsFromSpell = false);
void AETaunt(Client *caster, float range = 0);
void AETaunt(Client *caster, float range=0, int32 bonus_hate=0);
void AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true, int16 resist_adjust = 0);
void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);
void AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);

View File

@ -799,7 +799,7 @@ public:
void StartEnrage();
void ProcessEnrage();
bool IsEnraged();
void Taunt(NPC* who, bool always_succeed, float chance_bonus = 0);
void Taunt(NPC* who, bool always_succeed, float chance_bonus=0, bool FromSpell=false, int32 bonus_hate=0);
virtual void AI_Init();
virtual void AI_Start(uint32 iMoveDelay = 0);

View File

@ -2103,7 +2103,7 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
}
}
void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) {
void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus, bool FromSpell, int32 bonus_hate) {
if (who == nullptr)
return;
@ -2111,7 +2111,7 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) {
if(DivineAura())
return;
if(!CombatRange(who))
if(!FromSpell && !CombatRange(who))
return;
if(!always_succeed && IsClient())
@ -2167,7 +2167,7 @@ void Mob::Taunt(NPC* who, bool always_succeed, float chance_bonus) {
if (tauntchance > zone->random.Real(0, 1)) {
if (hate_top && hate_top != this){
newhate = (who->GetNPCHate(hate_top) - who->GetNPCHate(this)) + 1;
newhate = (who->GetNPCHate(hate_top) - who->GetNPCHate(this)) + 1 + bonus_hate;
who->CastToNPC()->AddToHateList(this, newhate);
Success = true;
}

View File

@ -2230,17 +2230,18 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
break;
}
case SE_AETaunt://Dook- slapped it in the spell effect so client does the animations
{ // and incase there are similar spells we havent found yet
case SE_AETaunt:
{
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "AE Taunt");
#endif
if(caster && caster->IsClient()){
float range = 0.0f;
if (spells[spell_id].base2[i])
range = (float)spells[spell_id].base[i];
//Live AE Taunt range is hardcoded at 40 (Spells for AE taunt all use zero range) Target type should be self only.
float range = 40;
if (spells[spell_id].max[i])//custom support if you want to alter range of AE Taunt.
range = spells[spell_id].max[i];
entity_list.AETaunt(caster->CastToClient(), range);
entity_list.AETaunt(caster->CastToClient(), range, spells[spell_id].base[i]);
}
break;
}
@ -2650,10 +2651,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_Taunt:
{
if (IsNPC()){
caster->Taunt(this->CastToNPC(), false, static_cast<float>(spell.base[i]));
if (spell.base2[i] > 0)
CastToNPC()->SetHateAmountOnEnt(caster, (CastToNPC()->GetHateAmount(caster) + spell.base2[i]));
caster->Taunt(this->CastToNPC(), false, static_cast<float>(spell.base[i]), true, spell.base2[i]);
}
break;
}