Identify the rest of Action/CombatDamage structs

This commit is contained in:
Michael Cook (mackal)
2018-02-28 19:21:03 -05:00
parent 29f89cdfbc
commit 06d22fa009
17 changed files with 261 additions and 290 deletions
+3 -3
View File
@@ -3611,15 +3611,15 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
a->special = 2;
else
a->special = 0;
a->meleepush_xy = attacker ? attacker->GetHeading() : 0.0f;
a->hit_heading = attacker ? attacker->GetHeading() : 0.0f;
if (RuleB(Combat, MeleePush) && damage > 0 && !IsRooted() &&
(IsClient() || zone->random.Roll(RuleI(Combat, MeleePushChance)))) {
a->force = EQEmu::skills::GetSkillMeleePushForce(skill_used);
if (IsNPC())
a->force *= 0.10f; // force against NPCs is divided by 10 I guess? ex bash is 0.3, parsed 0.03 against an NPC
// update NPC stuff
auto new_pos = glm::vec3(m_Position.x + (a->force * std::cos(a->meleepush_xy) + m_Delta.x),
m_Position.y + (a->force * std::sin(a->meleepush_xy) + m_Delta.y), m_Position.z);
auto new_pos = glm::vec3(m_Position.x + (a->force * std::cos(a->hit_heading) + m_Delta.x),
m_Position.y + (a->force * std::sin(a->hit_heading) + m_Delta.y), m_Position.z);
if (zone->zonemap && zone->zonemap->CheckLoS(glm::vec3(m_Position), new_pos)) { // If we have LoS on the new loc it should be reachable.
if (IsNPC()) {
// Is this adequate?
+9 -9
View File
@@ -913,16 +913,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
action->source = caster ? caster->GetID() : GetID();
action->level = 65;
action->instrument_mod = 10;
action->sequence = static_cast<uint32>((GetHeading() * 12345 / 2));
action->hit_heading = GetHeading();
action->type = 231;
action->spell = spell_id;
action->buff_unknown = 4;
action->effect_flag = 4;
cd->target = action->target;
cd->source = action->source;
cd->type = action->type;
cd->spellid = action->spell;
cd->meleepush_xy = action->sequence;
cd->hit_heading = action->hit_heading;
CastToClient()->QueuePacket(action_packet);
if(caster && caster->IsClient() && caster != this)
@@ -964,16 +964,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
action->source = caster ? caster->GetID() : GetID();
action->level = 65;
action->instrument_mod = 10;
action->sequence = static_cast<uint32>((GetHeading() * 12345 / 2));
action->hit_heading = GetHeading();
action->type = 231;
action->spell = spell_id;
action->buff_unknown = 4;
action->effect_flag = 4;
cd->target = action->target;
cd->source = action->source;
cd->type = action->type;
cd->spellid = action->spell;
cd->meleepush_xy = action->sequence;
cd->hit_heading = action->hit_heading;
CastToClient()->QueuePacket(action_packet);
if(caster->IsClient() && caster != this)
@@ -1002,16 +1002,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
action->source = caster ? caster->GetID() : GetID();
action->level = 65;
action->instrument_mod = 10;
action->sequence = static_cast<uint32>((GetHeading() * 12345 / 2));
action->hit_heading = GetHeading();
action->type = 231;
action->spell = spell_id;
action->buff_unknown = 4;
action->effect_flag = 4;
cd->target = action->target;
cd->source = action->source;
cd->type = action->type;
cd->spellid = action->spell;
cd->meleepush_xy = action->sequence;
cd->hit_heading = action->hit_heading;
CastToClient()->QueuePacket(action_packet);
if(caster->IsClient() && caster != this)
+14 -14
View File
@@ -2652,18 +2652,18 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) {
action->source = caster->GetID();
action->target = GetID();
action->spell = spell_id;
action->sequence = (uint32) (GetHeading()); // just some random number
action->hit_heading = GetHeading();
action->instrument_mod = caster->GetInstrumentMod(spell_id);
action->buff_unknown = 0;
action->level = buffs[buffs_i].casterlevel;
action->effect_flag = 0;
action->spell_level = action->level = buffs[buffs_i].casterlevel;
action->type = DamageTypeSpell;
entity_list.QueueCloseClients(this, packet, false, RuleI(Range, SongMessages), 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells);
action->buff_unknown = 4;
action->effect_flag = 4;
if(IsEffectInSpell(spell_id, SE_TossUp))
{
action->buff_unknown = 0;
action->effect_flag = 0;
}
else if(spells[spell_id].pushback > 0 || spells[spell_id].pushup > 0)
{
@@ -2673,7 +2673,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) {
{
CastToClient()->SetKnockBackExemption(true);
action->buff_unknown = 0;
action->effect_flag = 0;
auto outapp_push = new EQApplicationPacket(
OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)outapp_push->pBuffer;
@@ -2725,7 +2725,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) {
cd->source = action->source;
cd->type = DamageTypeSpell;
cd->spellid = action->spell;
cd->meleepush_xy = action->sequence;
cd->hit_heading = action->hit_heading;
cd->damage = 0;
if(!IsEffectInSpell(spell_id, SE_BindAffinity))
{
@@ -3536,9 +3536,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
action->level = caster_level; // caster level, for animation only
action->type = 231; // 231 means a spell
action->spell = spell_id;
action->sequence = (uint32) (GetHeading()); // just some random number
action->hit_heading = GetHeading();
action->instrument_mod = GetInstrumentMod(spell_id);
action->buff_unknown = 0;
action->effect_flag = 0;
if(spelltar != this && spelltar->IsClient()) // send to target
spelltar->CastToClient()->QueuePacket(action_packet);
@@ -3965,11 +3965,11 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
// NOTE: this is what causes the buff icon to appear on the client, if
// this is a buff - but it sortof relies on the first packet.
// the complete sequence is 2 actions and 1 damage message
action->buff_unknown = 0x04; // this is a success flag
action->effect_flag = 0x04; // this is a success flag
if(IsEffectInSpell(spell_id, SE_TossUp))
{
action->buff_unknown = 0;
action->effect_flag = 0;
}
else if(spells[spell_id].pushback > 0 || spells[spell_id].pushup > 0)
{
@@ -3979,7 +3979,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
{
spelltar->CastToClient()->SetKnockBackExemption(true);
action->buff_unknown = 0;
action->effect_flag = 0;
auto outapp_push =
new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)outapp_push->pBuffer;
@@ -4039,7 +4039,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
cd->source = action->source;
cd->type = action->type;
cd->spellid = action->spell;
cd->meleepush_xy = action->sequence;
cd->hit_heading = action->hit_heading;
cd->damage = 0;
if(!IsEffectInSpell(spell_id, SE_BindAffinity)){
entity_list.QueueCloseClients(
@@ -5722,7 +5722,7 @@ void Client::SendSpellAnim(uint16 targetid, uint16 spell_id)
a->source = this->GetID();
a->type = 231;
a->spell = spell_id;
a->sequence = 231;
a->hit_heading = GetHeading();
app.priority = 1;
entity_list.QueueCloseClients(this, &app, false, RuleI(Range, SpellParticles));
+1 -1
View File
@@ -216,7 +216,7 @@ void Trap::Trigger(Mob* trigger)
int dmg = zone->random.Int(effectvalue, effectvalue2);
trigger->SetHP(trigger->GetHP() - dmg);
a->damage = dmg;
a->meleepush_xy = zone->random.Int(0, 1234567);
a->hit_heading = 0.0f;
a->source = GetHiddenTrigger()!=nullptr ? GetHiddenTrigger()->GetID() : trigger->GetID();
a->spellid = 0;
a->target = trigger->GetID();