Merge pull request #43 from mackal/pet_fixes

Fix pet message to use StringIDs, most should be correct related to pet ...
This commit is contained in:
Derision 2013-03-31 04:06:16 -07:00
commit fb0add070b
5 changed files with 29 additions and 18 deletions

View File

@ -1,6 +1,9 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50) EQEMu Changelog (Started on Sept 24, 2003 15:50)
------------------------------------------------------- -------------------------------------------------------
== 03/30/2013 ==
demonstar55: Fixed most of the pet talking, all use StringIDs now. Pet now informs you when it taunts.
== 03/23/2013 == == 03/23/2013 ==
demonstar55: Fix issues with escape not always working and fixed SE_FadingMemories to have the message since the message isn't part of the spell data. demonstar55: Fix issues with escape not always working and fixed SE_FadingMemories to have the message since the message isn't part of the spell data.
Escape now uses just the spell and not the AA Actoin Escape now uses just the spell and not the AA Actoin

View File

@ -125,6 +125,7 @@
#define OTHER_HIT_NONMELEE 434 //%1 was hit by non-melee for %2 points of damage. #define OTHER_HIT_NONMELEE 434 //%1 was hit by non-melee for %2 points of damage.
#define SPELL_WORN_OFF_OF 436 //Your %1 spell has worn off of %2. #define SPELL_WORN_OFF_OF 436 //Your %1 spell has worn off of %2.
#define SPELL_WORN_OFF 437 //Your %1 spell has worn off. #define SPELL_WORN_OFF 437 //Your %1 spell has worn off.
#define PET_TAUNTING 438 //Taunting attacker, Master.
#define INTERRUPT_SPELL 439 //Your spell is interrupted. #define INTERRUPT_SPELL 439 //Your spell is interrupted.
#define LOSE_LEVEL 442 //You LOST a level! You are now level %1! #define LOSE_LEVEL 442 //You LOST a level! You are now level %1!
#define GAIN_ABILITY_POINT 446 //You have gained an ability point! You now have %1 ability point%2. #define GAIN_ABILITY_POINT 446 //You have gained an ability point! You now have %1 ability point%2.
@ -137,6 +138,8 @@
#define FACTION_BEST 471 //Your faction standing with %1 could not possibly get any better. #define FACTION_BEST 471 //Your faction standing with %1 could not possibly get any better.
#define FACTION_BETTER 472 //Your faction standing with %1 got better. #define FACTION_BETTER 472 //Your faction standing with %1 got better.
#define PET_REPORT_HP 488 //I have %1 percent of my hit points left. #define PET_REPORT_HP 488 //I have %1 percent of my hit points left.
#define PET_NO_TAUNT 489 //No longer taunting attackers, Master.
#define PET_DO_TAUNT 490 //Taunting attackers as normal, Master.
#define CORPSE_DECAY1 495 //This corpse will decay in %1 minute(s) %2 seconds. #define CORPSE_DECAY1 495 //This corpse will decay in %1 minute(s) %2 seconds.
#define DISC_LEVEL_ERROR 503 //You must be a level %1 ... to use this discipline. #define DISC_LEVEL_ERROR 503 //You must be a level %1 ... to use this discipline.
#define DISCIPLINE_CANUSEIN 504 //You can use a new discipline in %1 minutes %2 seconds. #define DISCIPLINE_CANUSEIN 504 //You can use a new discipline in %1 minutes %2 seconds.
@ -176,6 +179,8 @@
#define PET_GETLOST_STRING 1135 //As you wish, oh great one. #define PET_GETLOST_STRING 1135 //As you wish, oh great one.
#define PET_LEADERIS 1136 //My leader is %3. #define PET_LEADERIS 1136 //My leader is %3.
#define I_FOLLOW_NOONE 1137 //I follow no one. #define I_FOLLOW_NOONE 1137 //I follow no one.
#define PET_ON_HOLD 1138 //Waiting for your order to attack, Master.
#define NOT_LEGAL_TARGET 1139 //I beg forgiveness, Master. That is not a legal target.
#define MERCHANT_BUSY 1143 //I'm sorry, I am busy right now. #define MERCHANT_BUSY 1143 //I'm sorry, I am busy right now.
#define MERCHANT_GREETING 1144 //Welcome to my shop, %3. #define MERCHANT_GREETING 1144 //Welcome to my shop, %3.
#define MERCHANT_HANDY_ITEM1 1145 //Hello there, %3. How about a nice %4? #define MERCHANT_HANDY_ITEM1 1145 //Hello there, %3. How about a nice %4?
@ -273,6 +278,10 @@
#define STRIKETHROUGH_STRING 9078 //You strike through your opponent's defenses! #define STRIKETHROUGH_STRING 9078 //You strike through your opponent's defenses!
#define SPELL_REFLECT 9082 //%1's spell has been reflected by %2. #define SPELL_REFLECT 9082 //%1's spell has been reflected by %2.
#define NEW_SPELLS_AVAIL 9149 //You have new spells available to you. Check the merchants near your guild master. #define NEW_SPELLS_AVAIL 9149 //You have new spells available to you. Check the merchants near your guild master.
#define PET_NOW_FOCUSING 9254 //Focusing on one target, Master.
#define PET_NOT_FOCUSING 9263 //No longer focusing on one target, Master.
#define PET_NOT_CASTING 9264 //Not casting spells, Master.
#define PET_CASTING 9291 //Casting spells normally, Master.
#define AE_RAMPAGE 11015 //%1 goes on a WILD RAMPAGE! #define AE_RAMPAGE 11015 //%1 goes on a WILD RAMPAGE!
#define FACE_ACCEPTED 12028 //Facial features accepted. #define FACE_ACCEPTED 12028 //Facial features accepted.
#define SPELL_LEVEL_TO_LOW 12048 //You will have to achieve level %1 before you can scribe the %2. #define SPELL_LEVEL_TO_LOW 12048 //You will have to achieve level %1 before you can scribe the %2.

View File

@ -1707,8 +1707,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
//Check that we can attack before we calc heading and face our target //Check that we can attack before we calc heading and face our target
if (!IsAttackAllowed(other)) { if (!IsAttackAllowed(other)) {
if (this->GetOwnerID()) if (this->GetOwnerID())
entity_list.MessageClose(this, 1, 200, 10, "%s says, 'That is not a legal target master.'", this->GetCleanName()); this->Say_StringID(NOT_LEGAL_TARGET);
if(other) { if(other) {
if (other->IsClient())
other->CastToClient()->RemoveXTarget(this, false);
RemoveFromHateList(other); RemoveFromHateList(other);
mlog(COMBAT__ATTACKS, "I am not allowed to attack %s", other->GetName()); mlog(COMBAT__ATTACKS, "I am not allowed to attack %s", other->GetName());
} }
@ -4332,4 +4334,4 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type)
} }
return damage; return damage;
} }
} }

View File

@ -7077,7 +7077,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
} }
zone->AddAggroMob(); zone->AddAggroMob();
mypet->AddToHateList(GetTarget(), 1); mypet->AddToHateList(GetTarget(), 1);
Message_StringID(10, PET_ATTACKING, mypet->GetCleanName(), GetTarget()->GetCleanName()); Message_StringID(MT_PetResponse, PET_ATTACKING, mypet->GetCleanName(), GetTarget()->GetCleanName());
} }
} }
break; break;
@ -7093,7 +7093,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
break; break;
} }
case PET_HEALTHREPORT: { case PET_HEALTHREPORT: {
Message_StringID(10, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1)); Message_StringID(MT_PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1));
mypet->ShowBuffList(this); mypet->ShowBuffList(this);
//Message(10,"%s tells you, 'I have %d percent of my hit points left.'",mypet->GetName(),(uint8)mypet->GetHPRatio()); //Message(10,"%s tells you, 'I have %d percent of my hit points left.'",mypet->GetName(),(uint8)mypet->GetHPRatio());
break; break;
@ -7150,14 +7150,14 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
} }
case PET_TAUNT: { case PET_TAUNT: {
if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) { if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
Message(0,"%s says, 'Now taunting foes, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_DO_TAUNT);
mypet->CastToNPC()->SetTaunting(true); mypet->CastToNPC()->SetTaunting(true);
} }
break; break;
} }
case PET_NOTAUNT: { case PET_NOTAUNT: {
if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) { if((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
Message(0,"%s says, 'No longer taunting foes, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_NO_TAUNT);
mypet->CastToNPC()->SetTaunting(false); mypet->CastToNPC()->SetTaunting(false);
} }
break; break;
@ -7214,7 +7214,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
if (mypet->IsFeared()) if (mypet->IsFeared())
break; //could be exploited like PET_BACKOFF break; //could be exploited like PET_BACKOFF
mypet->Say("I will hold until given an order, master."); mypet->Say_StringID(PET_ON_HOLD);
mypet->WipeHateList(); mypet->WipeHateList();
mypet->SetHeld(true); mypet->SetHeld(true);
} }
@ -7225,10 +7225,10 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
if (mypet->IsFeared()) if (mypet->IsFeared())
break; break;
if (mypet->IsNoCast()) { if (mypet->IsNoCast()) {
Message(0,"%s says, 'I will now cast spells, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_CASTING);
mypet->CastToNPC()->SetNoCast(false); mypet->CastToNPC()->SetNoCast(false);
} else { } else {
Message(0,"%s says, 'I will no longer cast spells, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_NOT_CASTING);
mypet->CastToNPC()->SetNoCast(true); mypet->CastToNPC()->SetNoCast(true);
} }
} }
@ -7239,10 +7239,10 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
if (mypet->IsFeared()) if (mypet->IsFeared())
break; break;
if (mypet->IsFocused()) { if (mypet->IsFocused()) {
Message(0,"%s says, 'I am no longer focused, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_NOT_FOCUSING);
mypet->CastToNPC()->SetFocused(false); mypet->CastToNPC()->SetFocused(false);
} else { } else {
Message(0,"%s says, 'I will now focus my attention, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_NOW_FOCUSING);
mypet->CastToNPC()->SetFocused(true); mypet->CastToNPC()->SetFocused(true);
} }
} }
@ -7252,10 +7252,8 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
if(GetAA(aaAdvancedPetDiscipline) >= 1 && mypet->IsNPC()) { if(GetAA(aaAdvancedPetDiscipline) >= 1 && mypet->IsNPC()) {
if (mypet->IsFeared()) if (mypet->IsFeared())
break; break;
if (mypet->IsFocused()) { if (!mypet->IsFocused()) {
Message(0,"%s says, 'I am already focused, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_NOW_FOCUSING);
} else {
Message(0,"%s says, 'I will now focus my attention, Master!",mypet->GetCleanName());
mypet->CastToNPC()->SetFocused(true); mypet->CastToNPC()->SetFocused(true);
} }
} }
@ -7266,10 +7264,8 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
if (mypet->IsFeared()) if (mypet->IsFeared())
break; break;
if (mypet->IsFocused()) { if (mypet->IsFocused()) {
Message(0,"%s says, 'I am no longer focused, Master!",mypet->GetCleanName()); Message_StringID(MT_PetResponse, PET_NOT_FOCUSING);
mypet->CastToNPC()->SetFocused(false); mypet->CastToNPC()->SetFocused(false);
} else {
Message(0,"%s says, 'I am already not focused, Master!",mypet->GetCleanName());
} }
} }
break; break;

View File

@ -1397,6 +1397,7 @@ void NPC::DoClassAttacks(Mob *target) {
//general stuff, for all classes.... //general stuff, for all classes....
//only gets used when their primary ability get used too //only gets used when their primary ability get used too
if (taunting && HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && taunt_time) { if (taunting && HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && taunt_time) {
this->GetOwner()->Message_StringID(MT_PetResponse, PET_TAUNTING);
Taunt(target->CastToNPC(), false); Taunt(target->CastToNPC(), false);
} }