Weapons allow NPCs to facestab

This commit is contained in:
Michael Cook (mackal) 2017-01-31 17:25:05 -05:00
parent da9792160d
commit d8519bc270
4 changed files with 9 additions and 3 deletions

View File

@ -332,8 +332,10 @@ void NPC::AddLootDrop(const EQEmu::ItemData *item2, ItemList* itemlist, int16 ch
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
eslot = EQEmu::textures::weaponPrimary;
if (item2->Damage > 0)
if (item2->Damage > 0) {
SendAddPlayerState(PlayerState::PrimaryWeaponEquipped);
SetFacestab(true);
}
if (item2->IsType2HWeapon())
SetTwoHanderEquipped(true);
}

View File

@ -213,6 +213,7 @@ Mob::Mob(const char* in_name,
has_shieldequiped = false;
has_twohandbluntequiped = false;
has_twohanderequipped = false;
can_facestab = false;
has_numhits = false;
has_MGB = false;
has_ProjectIllusion = false;

View File

@ -373,6 +373,8 @@ public:
inline void SetTwoHandBluntEquiped(bool val) { has_twohandbluntequiped = val; }
bool HasTwoHanderEquipped() { return has_twohanderequipped; }
void SetTwoHanderEquipped(bool val) { has_twohanderequipped = val; }
bool CanFacestab() { return can_facestab; }
void SetFacestab(bool val) { can_facestab = val; }
virtual uint16 GetSkill(EQEmu::skills::SkillType skill_num) const { return 0; }
virtual uint32 GetEquipment(uint8 material_slot) const { return(0); }
virtual int32 GetEquipmentMaterial(uint8 material_slot) const;
@ -1298,6 +1300,7 @@ protected:
bool has_shieldequiped;
bool has_twohandbluntequiped;
bool has_twohanderequipped;
bool can_facestab;
bool has_numhits;
bool has_MGB;
bool has_ProjectIllusion;

View File

@ -528,8 +528,8 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
bCanFrontalBS = true;
}
if (bIsBehind || bCanFrontalBS){ // Player is behind other OR can do Frontal Backstab
if (bCanFrontalBS)
if (bIsBehind || bCanFrontalBS || (IsNPC() && CanFacestab())) { // Player is behind other OR can do Frontal Backstab
if (bCanFrontalBS && IsClient()) // I don't think there is any message ...
CastToClient()->Message(0,"Your fierce attack is executed with such grace, your target did not see it coming!");
RogueBackstab(other,false,ReuseTime);