mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Fixed a couple of merc stat issues and a few bot aggro issues, removed unneeded bot pet AI.
This commit is contained in:
parent
b15cb08f54
commit
e2f25d1c92
@ -1,5 +1,11 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
== 04/24/2013 ==
|
||||||
|
Bad_Captain: Fixed a couple of merc stat issues.
|
||||||
|
Bad_Captain: Removed unneeded bot pet AI.
|
||||||
|
Bad_Captain: Fixed a few bot aggro issues. (Uleat)
|
||||||
|
|
||||||
== 04/20/2013 ==
|
== 04/20/2013 ==
|
||||||
JJ: Fixed rare case where heals from buffs could go negative.
|
JJ: Fixed rare case where heals from buffs could go negative.
|
||||||
|
|
||||||
|
|||||||
@ -1083,6 +1083,15 @@ void Mob::AI_Process() {
|
|||||||
RemoveFromHateList(this);
|
RemoveFromHateList(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef BOTS
|
||||||
|
if (IsPet() && GetOwner()->IsBot() && target == GetOwner())
|
||||||
|
{
|
||||||
|
// this blocks all pet attacks against owner..bot pet test (copied above check)
|
||||||
|
RemoveFromHateList(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif //BOTS
|
||||||
|
|
||||||
if(DivineAura())
|
if(DivineAura())
|
||||||
return;
|
return;
|
||||||
|
|||||||
28
zone/bot.cpp
28
zone/bot.cpp
@ -3122,10 +3122,6 @@ bool Bot::Process()
|
|||||||
// Bot AI
|
// Bot AI
|
||||||
AI_Process();
|
AI_Process();
|
||||||
|
|
||||||
// Bot Pet AI
|
|
||||||
if(HasPet())
|
|
||||||
PetAIProcess();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3581,8 +3577,8 @@ void Bot::AI_Process() {
|
|||||||
|
|
||||||
if(!IsEngaged()) {
|
if(!IsEngaged()) {
|
||||||
if(GetFollowID()) {
|
if(GetFollowID()) {
|
||||||
if(BotOwner && BotOwner->CastToClient()->AutoAttackEnabled() && BotOwner->GetTarget() &&
|
if(BotOwner && BotOwner->GetTarget() && BotOwner->GetTarget()->IsNPC() && (BotOwner->GetTarget()->GetHateAmount(BotOwner)
|
||||||
BotOwner->GetTarget()->IsNPC() && BotOwner->GetTarget()->GetHateAmount(BotOwner)) {
|
|| BotOwner->CastToClient()->AutoAttackEnabled()) && IsAttackAllowed(BotOwner->GetTarget())) {
|
||||||
AddToHateList(BotOwner->GetTarget(), 1);
|
AddToHateList(BotOwner->GetTarget(), 1);
|
||||||
|
|
||||||
if(HasPet())
|
if(HasPet())
|
||||||
@ -3594,11 +3590,12 @@ void Bot::AI_Process() {
|
|||||||
if(g) {
|
if(g) {
|
||||||
for(int counter = 0; counter < g->GroupCount(); counter++) {
|
for(int counter = 0; counter < g->GroupCount(); counter++) {
|
||||||
if(g->members[counter]) {
|
if(g->members[counter]) {
|
||||||
if(g->members[counter]->IsEngaged() && g->members[counter]->GetTarget()) {
|
Mob* tar = g->members[counter]->GetTarget();
|
||||||
AddToHateList(g->members[counter]->GetTarget(), 1);
|
if(tar && tar->IsNPC() && tar->GetHateAmount(g->members[counter]) && IsAttackAllowed(g->members[counter]->GetTarget())) {
|
||||||
|
AddToHateList(tar, 1);
|
||||||
|
|
||||||
if(HasPet())
|
if(HasPet())
|
||||||
GetPet()->AddToHateList(g->members[counter]->GetTarget(), 1);
|
GetPet()->AddToHateList(tar, 1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -6364,6 +6361,10 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillType attack_skil
|
|||||||
|
|
||||||
SendHPUpdate();
|
SendHPUpdate();
|
||||||
|
|
||||||
|
if(this == from) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Aggro the bot's group members
|
// Aggro the bot's group members
|
||||||
if(IsGrouped())
|
if(IsGrouped())
|
||||||
{
|
{
|
||||||
@ -6372,7 +6373,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillType attack_skil
|
|||||||
{
|
{
|
||||||
for(int i=0; i<MAX_GROUP_MEMBERS; i++)
|
for(int i=0; i<MAX_GROUP_MEMBERS; i++)
|
||||||
{
|
{
|
||||||
if(g->members[i] && g->members[i]->IsBot() && from && !g->members[i]->CheckAggro(from))
|
if(g->members[i] && g->members[i]->IsBot() && from && !g->members[i]->CheckAggro(from) && g->members[i]->IsAttackAllowed(from))
|
||||||
{
|
{
|
||||||
g->members[i]->AddToHateList(from, 1);
|
g->members[i]->AddToHateList(from, 1);
|
||||||
}
|
}
|
||||||
@ -9034,7 +9035,12 @@ bool Bot::IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined)
|
|||||||
|
|
||||||
if(attacker && target)
|
if(attacker && target)
|
||||||
{
|
{
|
||||||
if(attacker->IsClient() && target->IsBot() && attacker->CastToClient()->GetPVP() && target->CastToBot()->GetBotOwner()->CastToClient()->GetPVP())
|
if(attacker == target)
|
||||||
|
{
|
||||||
|
hasRuleDefined = true;
|
||||||
|
Result = false;
|
||||||
|
}
|
||||||
|
else if(attacker->IsClient() && target->IsBot() && attacker->CastToClient()->GetPVP() && target->CastToBot()->GetBotOwner()->CastToClient()->GetPVP())
|
||||||
{
|
{
|
||||||
hasRuleDefined = true;
|
hasRuleDefined = true;
|
||||||
Result = true;
|
Result = true;
|
||||||
|
|||||||
@ -308,7 +308,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 iSpellTypes) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// no buffs with illusions.. use #bot command to cast illusions
|
// no buffs with illusions.. use #bot command to cast illusions
|
||||||
if(IsEffectInSpell(selectedBotSpell.SpellId, SE_Illusion))
|
if(IsEffectInSpell(selectedBotSpell.SpellId, SE_Illusion) && tar != this)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//no teleport spells use #bot command to cast teleports
|
//no teleport spells use #bot command to cast teleports
|
||||||
|
|||||||
@ -61,6 +61,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
|||||||
skills[r] = database.GetSkillCap(GetClass(),(SkillType)r,GetLevel());
|
skills[r] = database.GetSkillCap(GetClass(),(SkillType)r,GetLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetMercSize();
|
||||||
CalcBonuses();
|
CalcBonuses();
|
||||||
|
|
||||||
SetHP(GetMaxHP());
|
SetHP(GetMaxHP());
|
||||||
@ -80,7 +81,6 @@ Merc::~Merc() {
|
|||||||
void Merc::CalcBonuses()
|
void Merc::CalcBonuses()
|
||||||
{
|
{
|
||||||
//_ZP(Merc_CalcBonuses);
|
//_ZP(Merc_CalcBonuses);
|
||||||
GenerateBaseStats();
|
|
||||||
memset(&itembonuses, 0, sizeof(StatBonuses));
|
memset(&itembonuses, 0, sizeof(StatBonuses));
|
||||||
memset(&aabonuses, 0, sizeof(StatBonuses));
|
memset(&aabonuses, 0, sizeof(StatBonuses));
|
||||||
CalcItemBonuses(&itembonuses);
|
CalcItemBonuses(&itembonuses);
|
||||||
@ -117,59 +117,7 @@ void Merc::CalcBonuses()
|
|||||||
rooted = FindType(SE_Root);
|
rooted = FindType(SE_Root);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Merc::GenerateBaseStats() {
|
void Merc::GetMercSize() {
|
||||||
|
|
||||||
// base stats
|
|
||||||
uint16 Strength = _baseSTR;
|
|
||||||
uint16 Stamina = _baseSTA;
|
|
||||||
uint16 Dexterity = _baseDEX;
|
|
||||||
uint16 Agility = _baseAGI;
|
|
||||||
uint16 Wisdom = _baseWIS;
|
|
||||||
uint16 Intelligence = _baseINT;
|
|
||||||
uint16 Charisma = _baseCHA;
|
|
||||||
uint16 Attack = _baseATK;
|
|
||||||
uint16 MagicResist = _baseMR;
|
|
||||||
uint16 FireResist = _baseFR;
|
|
||||||
uint16 DiseaseResist = _baseDR;
|
|
||||||
uint16 PoisonResist = _basePR;
|
|
||||||
uint16 ColdResist = _baseCR;
|
|
||||||
uint16 CorruptionResist = _baseCorrup;
|
|
||||||
|
|
||||||
switch(this->GetClass()) {
|
|
||||||
case 1: // Warrior
|
|
||||||
Strength += 10;
|
|
||||||
Stamina += 20;
|
|
||||||
Agility += 10;
|
|
||||||
Dexterity += 10;
|
|
||||||
Attack += 12;
|
|
||||||
break;
|
|
||||||
case 2: // Cleric
|
|
||||||
Strength += 5;
|
|
||||||
Stamina += 5;
|
|
||||||
Agility += 10;
|
|
||||||
Wisdom += 30;
|
|
||||||
Attack += 8;
|
|
||||||
break;
|
|
||||||
case 4: // Ranger
|
|
||||||
Strength += 15;
|
|
||||||
Stamina += 10;
|
|
||||||
Agility += 10;
|
|
||||||
Wisdom += 15;
|
|
||||||
Attack += 17;
|
|
||||||
break;
|
|
||||||
case 9: // Rogue
|
|
||||||
Strength += 10;
|
|
||||||
Stamina += 20;
|
|
||||||
Agility += 10;
|
|
||||||
Dexterity += 10;
|
|
||||||
Attack += 12;
|
|
||||||
break;
|
|
||||||
case 12: // Wizard
|
|
||||||
Stamina += 20;
|
|
||||||
Intelligence += 30;
|
|
||||||
Attack += 5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
float MercSize = GetSize();
|
float MercSize = GetSize();
|
||||||
|
|
||||||
@ -220,20 +168,6 @@ void Merc::GenerateBaseStats() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->_baseSTR = Strength;
|
|
||||||
this->_baseSTA = Stamina;
|
|
||||||
this->_baseDEX = Dexterity;
|
|
||||||
this->_baseAGI = Agility;
|
|
||||||
this->_baseWIS = Wisdom;
|
|
||||||
this->_baseINT = Intelligence;
|
|
||||||
this->_baseCHA = Charisma;
|
|
||||||
this->_baseATK = Attack;
|
|
||||||
this->_baseMR = MagicResist;
|
|
||||||
this->_baseFR = FireResist;
|
|
||||||
this->_baseDR = DiseaseResist;
|
|
||||||
this->_basePR = PoisonResist;
|
|
||||||
this->_baseCR = ColdResist;
|
|
||||||
this->_baseCorrup = CorruptionResist;
|
|
||||||
this->size = MercSize;
|
this->size = MercSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -940,7 +874,7 @@ int16 Merc::CalcCorrup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int16 Merc::CalcATK() {
|
int16 Merc::CalcATK() {
|
||||||
ATK = _baseATK + itembonuses.ATK + spellbonuses.ATK + aabonuses.ATK + GroupLeadershipAAOffenseEnhancement() + ((GetSTR() + GetSkill(OFFENSE)) * 9 / 10);
|
ATK = _baseATK + itembonuses.ATK + spellbonuses.ATK + aabonuses.ATK + GroupLeadershipAAOffenseEnhancement();
|
||||||
return(ATK);
|
return(ATK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -328,7 +328,7 @@ private:
|
|||||||
int GroupLeadershipAAHealthRegeneration();
|
int GroupLeadershipAAHealthRegeneration();
|
||||||
int GroupLeadershipAAOffenseEnhancement();
|
int GroupLeadershipAAOffenseEnhancement();
|
||||||
|
|
||||||
void GenerateBaseStats();
|
void GetMercSize();
|
||||||
void GenerateAppearance();
|
void GenerateAppearance();
|
||||||
|
|
||||||
bool LoadMercSpells();
|
bool LoadMercSpells();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user