Merge pull request #759 from fryguy503/see-invis-percent

SeeInvis %
This commit is contained in:
Michael Cook (mackal) 2018-07-22 15:25:04 -04:00 committed by GitHub
commit f15ba46c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 4 deletions

View File

@ -404,10 +404,11 @@ Mob::Mob(const char* in_name,
pStandingPetOrder = SPO_Follow;
pseudo_rooted = false;
see_invis = in_see_invis;
see_invis_undead = in_see_invis_undead != 0;
see_hide = in_see_hide != 0;
see_improved_hide = in_see_improved_hide != 0;
see_invis = GetSeeInvisible(in_see_invis);
see_invis_undead = GetSeeInvisible(in_see_invis_undead);
see_hide = GetSeeInvisible(in_see_hide);
see_improved_hide = GetSeeInvisible(in_see_improved_hide);
qglobal = in_qglobal != 0;
// Bind wound
@ -5679,6 +5680,21 @@ float Mob::HeadingAngleToMob(float other_x, float other_y)
return (90.0f - angle + 270.0f) * 511.5f * 0.0027777778f;
}
bool Mob::GetSeeInvisible(uint8 see_invis)
{
if(see_invis > 0)
{
if(see_invis == 1)
return true;
else
{
if (zone->random.Int(0, 99) < see_invis)
return true;
}
}
return false;
}
int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot)
{
if (!IsValidSpell(spell_id))

View File

@ -256,6 +256,7 @@ public:
inline bool SeeInvisibleUndead() const { return see_invis_undead; }
inline bool SeeHide() const { return see_hide; }
inline bool SeeImprovedHide() const { return see_improved_hide; }
inline bool GetSeeInvisible(uint8 see_invis);
bool IsInvisible(Mob* other = 0) const;
void SetInvisible(uint8 state);
EQEmu::skills::SkillType AttackAnimation(int Hand, const EQEmu::ItemInstance* weapon, EQEmu::skills::SkillType skillinuse = EQEmu::skills::Skill1HBlunt);