mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 14:38:20 +00:00
updates
This commit is contained in:
+26
-10
@@ -5278,29 +5278,45 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
|
|||||||
|
|
||||||
hit.damage_done += (hit.damage_done * pct_damage_reduction / 100) + (defender->GetFcDamageAmtIncoming(this, 0, true, hit.skill));
|
hit.damage_done += (hit.damage_done * pct_damage_reduction / 100) + (defender->GetFcDamageAmtIncoming(this, 0, true, hit.skill));
|
||||||
|
|
||||||
if (defender->shield_ability.shielder_id) {
|
Shout("Shielder ID [%i]", defender->GetShielderID());
|
||||||
hit.damage_done *= 0.50;//Don't round.
|
|
||||||
|
if (defender->GetShielderID()) {
|
||||||
|
hit.damage_done = hit.damage_done * 50 / 100;//Don't round.
|
||||||
DoShieldDamageOnShielder(defender, hit.damage_done, hit.skill);
|
DoShieldDamageOnShielder(defender, hit.damage_done, hit.skill);
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
|
CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::DoShieldDamageOnShielder(Mob* shield_target, int shielder_damage_taken, EQ::skills::SkillType skillInUse)
|
void Mob::DoShieldDamageOnShielder(Mob* shielder_target, int hit_damage_done, EQ::skills::SkillType skillInUse)
|
||||||
{
|
{
|
||||||
if (!shield_target) {
|
if (!shielder_target) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob *current_shielder = entity_list.GetMob(shield_target->shield_ability.shielder_id);
|
Mob *shielder = entity_list.GetMob(shielder_target->GetShielderID());
|
||||||
|
|
||||||
if (!current_shielder) {
|
if (!shielder) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//AA to increase SPA 230 extended shielding
|
||||||
|
int max_shielder_distance = 15;
|
||||||
|
int distance_mod = aabonuses.ExtendedShielding + itembonuses.ExtendedShielding + spellbonuses.ExtendedShielding;
|
||||||
|
max_shielder_distance += max_shielder_distance * distance_mod / 100;
|
||||||
|
max_shielder_distance = std::max(max_shielder_distance, 0);
|
||||||
|
|
||||||
|
if (shielder_target->CalculateDistance(shielder->GetX(), shielder->GetY(), shielder->GetZ()) > static_cast<float>(max_shielder_distance)) {
|
||||||
|
//Clear variables Shield end
|
||||||
|
Shout("Clear variables shield end");
|
||||||
|
shielder->SetShieldTargetID(0);
|
||||||
|
shielder_target->SetShielderID(0);
|
||||||
|
return; //Too far away, no message is given thoughh.
|
||||||
|
}
|
||||||
|
|
||||||
int mitigation = 75;
|
int mitigation = 75;
|
||||||
|
|
||||||
if (current_shielder->HasShieldEquiped() && current_shielder->IsClient()) {
|
if (shielder->HasShieldEquiped() && shielder->IsClient()) {
|
||||||
|
|
||||||
EQ::ItemInstance* inst = CastToClient()->GetInv().GetItem(EQ::invslot::slotSecondary);
|
EQ::ItemInstance* inst = CastToClient()->GetInv().GetItem(EQ::invslot::slotSecondary);
|
||||||
|
|
||||||
@@ -5315,10 +5331,10 @@ void Mob::DoShieldDamageOnShielder(Mob* shield_target, int shielder_damage_taken
|
|||||||
|
|
||||||
mitigation = std::max(mitigation, 50);
|
mitigation = std::max(mitigation, 50);
|
||||||
|
|
||||||
shielder_damage_taken = shielder_damage_taken * mitigation / 100;
|
hit_damage_done = hit_damage_done * mitigation / 100;
|
||||||
|
|
||||||
current_shielder->Damage(this, shielder_damage_taken, SPELL_UNKNOWN, skillInUse, true, -1, false, m_specialattacks);
|
shielder->Damage(this, hit_damage_done, SPELL_UNKNOWN, skillInUse, true, -1, false, m_specialattacks);
|
||||||
current_shielder->CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
|
shielder->CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::CommonBreakInvisibleFromCombat()
|
void Mob::CommonBreakInvisibleFromCombat()
|
||||||
|
|||||||
@@ -138,7 +138,6 @@ Client::Client(EQStreamInterface* ieqs)
|
|||||||
linkdead_timer(RuleI(Zone,ClientLinkdeadMS)),
|
linkdead_timer(RuleI(Zone,ClientLinkdeadMS)),
|
||||||
dead_timer(2000),
|
dead_timer(2000),
|
||||||
global_channel_timer(1000),
|
global_channel_timer(1000),
|
||||||
shield_timer(500),
|
|
||||||
fishing_timer(8000),
|
fishing_timer(8000),
|
||||||
endupkeep_timer(1000),
|
endupkeep_timer(1000),
|
||||||
forget_timer(0),
|
forget_timer(0),
|
||||||
@@ -200,7 +199,6 @@ Client::Client(EQStreamInterface* ieqs)
|
|||||||
account_id = 0;
|
account_id = 0;
|
||||||
admin = 0;
|
admin = 0;
|
||||||
lsaccountid = 0;
|
lsaccountid = 0;
|
||||||
shield_target = nullptr;
|
|
||||||
guild_id = GUILD_NONE;
|
guild_id = GUILD_NONE;
|
||||||
guildrank = 0;
|
guildrank = 0;
|
||||||
GuildBanker = false;
|
GuildBanker = false;
|
||||||
@@ -236,7 +234,6 @@ Client::Client(EQStreamInterface* ieqs)
|
|||||||
pQueuedSaveWorkID = 0;
|
pQueuedSaveWorkID = 0;
|
||||||
position_update_same_count = 0;
|
position_update_same_count = 0;
|
||||||
fishing_timer.Disable();
|
fishing_timer.Disable();
|
||||||
shield_timer.Disable();
|
|
||||||
dead_timer.Disable();
|
dead_timer.Disable();
|
||||||
camp_timer.Disable();
|
camp_timer.Disable();
|
||||||
autosave_timer.Disable();
|
autosave_timer.Disable();
|
||||||
@@ -420,16 +417,6 @@ Client::~Client() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shield_target) {
|
|
||||||
for (int y = 0; y < 2; y++) {
|
|
||||||
if (shield_target->shielder[y].shielder_id == GetID()) {
|
|
||||||
shield_target->shielder[y].shielder_id = 0;
|
|
||||||
shield_target->shielder[y].shielder_bonus = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shield_target = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(GetTarget())
|
if(GetTarget())
|
||||||
GetTarget()->IsTargeted(-1);
|
GetTarget()->IsTargeted(-1);
|
||||||
|
|
||||||
|
|||||||
@@ -1797,7 +1797,6 @@ private:
|
|||||||
Timer linkdead_timer;
|
Timer linkdead_timer;
|
||||||
Timer dead_timer;
|
Timer dead_timer;
|
||||||
Timer global_channel_timer;
|
Timer global_channel_timer;
|
||||||
Timer shield_timer;
|
|
||||||
Timer fishing_timer;
|
Timer fishing_timer;
|
||||||
Timer endupkeep_timer;
|
Timer endupkeep_timer;
|
||||||
Timer forget_timer; // our 2 min everybody forgets you timer
|
Timer forget_timer; // our 2 min everybody forgets you timer
|
||||||
|
|||||||
+22
-16
@@ -12810,9 +12810,10 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Defensive makes it not cast?
|
//TODO: Defensive makes it not cast?
|
||||||
|
//TODO: Bankers ect don't let you shjield 6826 You can not perform shielding while you are speaking with a banker, a merchant, or a guildmaster.
|
||||||
|
|
||||||
if (GetLevel() < 30) {
|
if (GetLevel() < 30) { //Client gives message
|
||||||
return; //Client gives message
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetClass() != WARRIOR){
|
if (GetClass() != WARRIOR){
|
||||||
@@ -12821,7 +12822,10 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
|
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
|
||||||
|
|
||||||
shield_target = entity_list.GetMob(shield->target_id);
|
Mob* shield_target = entity_list.GetMob(shield->target_id);
|
||||||
|
|
||||||
|
Shout("PACKET Shielder %i", shield_target->GetShielderID());
|
||||||
|
Shout("PACKET Shield Target %i", GetShieldTargetID());
|
||||||
|
|
||||||
if (!shield_target) {
|
if (!shield_target) {
|
||||||
return;
|
return;
|
||||||
@@ -12838,13 +12842,13 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Does 'Shield Target' already have a 'Shielder'
|
//Does 'Shield Target' already have a 'Shielder'
|
||||||
if (shield_target->shield_ability.shielder_id = GetID()) {
|
if (shield_target->GetShielderID() == GetID()) {
|
||||||
MessageString(Chat::White, ALREADY_SHIELDED);
|
MessageString(Chat::White, ALREADY_SHIELDED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Does 'Shielder' already have a 'Shield Target' already have a shielder
|
//Does 'Shielder' already have a 'Shield Target'
|
||||||
if (shield_ability.shielder_id = GetID()) {
|
if (GetShieldTargetID() == GetID()) {
|
||||||
MessageString(Chat::White, ALREADY_SHIELDED);
|
MessageString(Chat::White, ALREADY_SHIELDED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -12853,29 +12857,31 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
|
|||||||
int max_shielder_distance = 15;
|
int max_shielder_distance = 15;
|
||||||
int distance_mod = aabonuses.ExtendedShielding + itembonuses.ExtendedShielding + spellbonuses.ExtendedShielding;
|
int distance_mod = aabonuses.ExtendedShielding + itembonuses.ExtendedShielding + spellbonuses.ExtendedShielding;
|
||||||
max_shielder_distance += max_shielder_distance * distance_mod / 100;
|
max_shielder_distance += max_shielder_distance * distance_mod / 100;
|
||||||
max_shielder_distance = std::max(max_shielder_distance, 1); //Incase of negative effects limit it to range of 1
|
max_shielder_distance = std::max(max_shielder_distance, 0);
|
||||||
|
|
||||||
if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast<float>(max_shielder_distance)) {
|
if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast<float>(max_shielder_distance)) {
|
||||||
return; //Too far away, no message is given thoughh. //TODO: Timer to enforce distance check
|
return; //Too far away, no message is given thoughh.
|
||||||
}
|
}
|
||||||
|
|
||||||
entity_list.MessageCloseString(this, false, 100, 0, START_SHIELDING, GetName(), shield_target->GetName());
|
entity_list.MessageCloseString(this, false, 100, 0, START_SHIELDING, GetName(), shield_target->GetName());
|
||||||
|
|
||||||
//Apply to Shielder
|
//Apply to Shielder
|
||||||
shield_ability.shielder_id = GetID();
|
//shield_ability.shield_target_id = shield_target->GetID();
|
||||||
shield_ability.shield_target_id = shield_target->GetID();
|
|
||||||
|
|
||||||
//Apply to Shield Target
|
//Apply to Shield Target
|
||||||
shield_target->shield_ability.shielder_id = GetID();
|
//shield_target->shield_ability.shielder_id = GetID();
|
||||||
shield_target->shield_ability.shield_target_id = shield_target->GetID();
|
|
||||||
|
SetShieldTargetID(shield_target->GetID());
|
||||||
|
shield_target->SetShielderID(GetID());
|
||||||
|
|
||||||
|
|
||||||
//Calculate AA for adding time SPA 255 extend shield duration
|
//Calculate AA for adding time SPA 255 extend shield duration
|
||||||
int shield_duration = 12000;
|
int shield_duration = 12000;
|
||||||
|
Shout("1 Duration %i", shield_duration);
|
||||||
shield_duration += (aabonuses.ShieldDuration + itembonuses.ShieldDuration + spellbonuses.ShieldDuration) * 1000;
|
shield_duration += (aabonuses.ShieldDuration + itembonuses.ShieldDuration + spellbonuses.ShieldDuration) * 1000;
|
||||||
|
Shout("2 Duration %i", shield_duration);
|
||||||
shield_duration = std::max(shield_duration, 1000); //Incase of negative modifiers lets just make min duration 1 second.
|
shield_duration = std::max(shield_duration, 1); //Incase of negative modifiers lets just make min duration 1 ms.
|
||||||
|
Shout("3 Duration %i", shield_duration);
|
||||||
shield_timer.Start(shield_duration);
|
shield_timer.Start(shield_duration);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
+7
-24
@@ -460,32 +460,15 @@ bool Client::Process() {
|
|||||||
DoGravityEffect();
|
DoGravityEffect();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shield_timer.Check())
|
if (shield_timer.Check()) {
|
||||||
{
|
Mob *current_shield_target = entity_list.GetMob(GetShieldTargetID());
|
||||||
if (shield_target)
|
|
||||||
{
|
if (current_shield_target) {
|
||||||
if (!CombatRange(shield_target))
|
entity_list.MessageCloseString(this, false, 100, 0, END_SHIELDING, GetCleanName(), current_shield_target->GetCleanName());
|
||||||
{
|
|
||||||
entity_list.MessageCloseString(
|
|
||||||
this, false, 100, 0,
|
|
||||||
END_SHIELDING, GetCleanName(), shield_target->GetCleanName());
|
|
||||||
for (int y = 0; y < 2; y++)
|
|
||||||
{
|
|
||||||
if (shield_target->shielder[y].shielder_id == GetID())
|
|
||||||
{
|
|
||||||
shield_target->shielder[y].shielder_id = 0;
|
|
||||||
shield_target->shielder[y].shielder_bonus = 0;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
shield_target = 0;
|
|
||||||
shield_timer.Disable();
|
shield_timer.Disable();
|
||||||
}
|
SetShieldTargetID(0);
|
||||||
}
|
current_shield_target->SetShielderID(0);
|
||||||
else
|
|
||||||
{
|
|
||||||
shield_target = 0;
|
|
||||||
shield_timer.Disable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SpellProcess();
|
SpellProcess();
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
#define SEE_POSITION 0.5f //ratio of GetSize() where NPCs try to see for LOS
|
#define SEE_POSITION 0.5f //ratio of GetSize() where NPCs try to see for LOS
|
||||||
#define CHECK_LOS_STEP 1.0f
|
#define CHECK_LOS_STEP 1.0f
|
||||||
|
|
||||||
#define MAX_SHIELDERS 2 //I dont know if this is based on a client limit
|
|
||||||
|
|
||||||
#define ARCHETYPE_HYBRID 1
|
#define ARCHETYPE_HYBRID 1
|
||||||
#define ARCHETYPE_CASTER 2
|
#define ARCHETYPE_CASTER 2
|
||||||
#define ARCHETYPE_MELEE 3
|
#define ARCHETYPE_MELEE 3
|
||||||
@@ -679,18 +677,6 @@ typedef struct
|
|||||||
int level_override;
|
int level_override;
|
||||||
} tProc;
|
} tProc;
|
||||||
|
|
||||||
struct Shielders_Struct {
|
|
||||||
|
|
||||||
uint32 shielder_id;
|
|
||||||
uint16 shielder_bonus;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ShieldAbility_Struct{
|
|
||||||
|
|
||||||
uint32 shield_target_id;
|
|
||||||
uint32 shielder_id;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint16 increment;
|
uint16 increment;
|
||||||
|
|||||||
+3
-8
@@ -260,7 +260,6 @@ Mob::Mob(
|
|||||||
MR = CR = FR = DR = PR = Corrup = PhR = 0;
|
MR = CR = FR = DR = PR = Corrup = PhR = 0;
|
||||||
ExtraHaste = 0;
|
ExtraHaste = 0;
|
||||||
bEnraged = false;
|
bEnraged = false;
|
||||||
shield_target = nullptr;
|
|
||||||
current_mana = 0;
|
current_mana = 0;
|
||||||
max_mana = 0;
|
max_mana = 0;
|
||||||
hp_regen = in_hp_regen;
|
hp_regen = in_hp_regen;
|
||||||
@@ -375,14 +374,10 @@ Mob::Mob(
|
|||||||
silenced = false;
|
silenced = false;
|
||||||
amnesiad = false;
|
amnesiad = false;
|
||||||
inWater = false;
|
inWater = false;
|
||||||
int m;
|
|
||||||
for (m = 0; m < MAX_SHIELDERS; m++) {
|
|
||||||
shielder[m].shielder_id = 0;
|
|
||||||
shielder[m].shielder_bonus = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
shield_ability.shield_target_id = 0;
|
shield_timer.Disable();
|
||||||
shield_ability.shielder_id = 0;
|
shield_target_id = 0;
|
||||||
|
shielder_id = 0;
|
||||||
|
|
||||||
destructibleobject = false;
|
destructibleobject = false;
|
||||||
wandertype = 0;
|
wandertype = 0;
|
||||||
|
|||||||
+9
-12
@@ -1086,8 +1086,6 @@ public:
|
|||||||
|
|
||||||
void InstillDoubt(Mob *who);
|
void InstillDoubt(Mob *who);
|
||||||
int16 GetResist(uint8 type) const;
|
int16 GetResist(uint8 type) const;
|
||||||
Mob* GetShieldTarget() const { return shield_target; }
|
|
||||||
void SetShieldTarget(Mob* mob) { shield_target = mob; }
|
|
||||||
bool HasActiveSong() const { return(bardsong != 0); }
|
bool HasActiveSong() const { return(bardsong != 0); }
|
||||||
bool Charmed() const { return typeofpet == petCharmed; }
|
bool Charmed() const { return typeofpet == petCharmed; }
|
||||||
static uint32 GetLevelHP(uint8 tlevel);
|
static uint32 GetLevelHP(uint8 tlevel);
|
||||||
@@ -1125,16 +1123,13 @@ public:
|
|||||||
bool IsMoved() { return moved; }
|
bool IsMoved() { return moved; }
|
||||||
void SetMoved(bool moveflag) { moved = moveflag; }
|
void SetMoved(bool moveflag) { moved = moveflag; }
|
||||||
|
|
||||||
Shielders_Struct shielder[MAX_SHIELDERS];
|
|
||||||
|
|
||||||
Trade* trade;
|
Trade* trade;
|
||||||
|
|
||||||
ShieldAbility_Struct shield_ability;
|
void DoShieldDamageOnShielder(Mob* shield_target, int hit_damage_done, EQ::skills::SkillType skillInUse);
|
||||||
void DoShieldDamageOnShielder(Mob* shield_target, int shielder_damage_taken, EQ::skills::SkillType skillInUse);
|
inline int GetShielderID() const { return shielder_id; }
|
||||||
inline int GetShielderID() { return shield_ability.shielder_id; }
|
inline void SetShielderID(int ent_id) { shielder_id = ent_id; }
|
||||||
inline int SetShielderID(int ent_id) { shield_ability.shielder_id = ent_id; }
|
inline int GetShieldTargetID() const { return shield_target_id; }
|
||||||
inline int GetShieldTargetID() { return shield_ability.shield_target_id; }
|
inline void SetShieldTargetID(int ent_id) { shield_target_id = ent_id; }
|
||||||
inline int SetShieldTargetID(int ent_id) { shield_ability.shield_target_id = ent_id; }
|
|
||||||
|
|
||||||
inline glm::vec4 GetCurrentWayPoint() const { return m_CurrentWayPoint; }
|
inline glm::vec4 GetCurrentWayPoint() const { return m_CurrentWayPoint; }
|
||||||
inline float GetCWPP() const { return(static_cast<float>(cur_wp_pause)); }
|
inline float GetCWPP() const { return(static_cast<float>(cur_wp_pause)); }
|
||||||
@@ -1435,6 +1430,10 @@ protected:
|
|||||||
Timer mana_timer;
|
Timer mana_timer;
|
||||||
Timer focus_proc_limit_timer;
|
Timer focus_proc_limit_timer;
|
||||||
|
|
||||||
|
Timer shield_timer;
|
||||||
|
uint32 shield_target_id;
|
||||||
|
uint32 shielder_id;
|
||||||
|
|
||||||
//spell casting vars
|
//spell casting vars
|
||||||
Timer spellend_timer;
|
Timer spellend_timer;
|
||||||
uint16 casting_spell_id;
|
uint16 casting_spell_id;
|
||||||
@@ -1481,8 +1480,6 @@ protected:
|
|||||||
|
|
||||||
uint8 aa_title;
|
uint8 aa_title;
|
||||||
|
|
||||||
Mob* shield_target;
|
|
||||||
|
|
||||||
int ExtraHaste; // for the #haste command
|
int ExtraHaste; // for the #haste command
|
||||||
bool mezzed;
|
bool mezzed;
|
||||||
bool stunned;
|
bool stunned;
|
||||||
|
|||||||
+2
-2
@@ -4188,7 +4188,7 @@ XS(XS_Mob_GetShieldTarget) {
|
|||||||
Mob *THIS;
|
Mob *THIS;
|
||||||
Mob *RETVAL;
|
Mob *RETVAL;
|
||||||
VALIDATE_THIS_IS_MOB;
|
VALIDATE_THIS_IS_MOB;
|
||||||
RETVAL = THIS->GetShieldTarget();
|
//RETVAL = THIS->GetShieldTarget();
|
||||||
ST(0) = sv_newmortal();
|
ST(0) = sv_newmortal();
|
||||||
sv_setref_pv(ST(0), "Mob", (void *) RETVAL);
|
sv_setref_pv(ST(0), "Mob", (void *) RETVAL);
|
||||||
}
|
}
|
||||||
@@ -4212,7 +4212,7 @@ XS(XS_Mob_SetShieldTarget) {
|
|||||||
if (mob == nullptr)
|
if (mob == nullptr)
|
||||||
Perl_croak(aTHX_ "mob is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "mob is nullptr, avoiding crash.");
|
||||||
|
|
||||||
THIS->SetShieldTarget(mob);
|
//THIS->SetShieldTarget(mob);
|
||||||
}
|
}
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user