mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-01 07:12:26 +00:00
Fix spell push
This now uses the spell data correctly, still need to write a system for NPCs though SE_TossUp needs to be implemented to, it just damages NPCs only
This commit is contained in:
parent
06d22fa009
commit
1b84905941
@ -2075,61 +2075,6 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
|||||||
#ifdef SPELL_EFFECT_SPAM
|
#ifdef SPELL_EFFECT_SPAM
|
||||||
snprintf(effect_desc, _EDLEN, "Toss Up: %d", effect_value);
|
snprintf(effect_desc, _EDLEN, "Toss Up: %d", effect_value);
|
||||||
#endif
|
#endif
|
||||||
double toss_amt = (double)spells[spell_id].base[i];
|
|
||||||
if(toss_amt < 0)
|
|
||||||
toss_amt = -toss_amt;
|
|
||||||
|
|
||||||
if(IsNPC())
|
|
||||||
{
|
|
||||||
Stun(static_cast<int>(toss_amt));
|
|
||||||
}
|
|
||||||
toss_amt = sqrt(toss_amt)-2.0;
|
|
||||||
|
|
||||||
if(toss_amt < 0.0)
|
|
||||||
toss_amt = 0.0;
|
|
||||||
|
|
||||||
if(toss_amt > 20.0)
|
|
||||||
toss_amt = 20.0;
|
|
||||||
|
|
||||||
if(IsClient())
|
|
||||||
{
|
|
||||||
CastToClient()->SetKnockBackExemption(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
double look_heading = GetHeading();
|
|
||||||
look_heading /= 256;
|
|
||||||
look_heading *= 360;
|
|
||||||
look_heading += 180;
|
|
||||||
if(look_heading > 360)
|
|
||||||
look_heading -= 360;
|
|
||||||
|
|
||||||
//x and y are crossed mkay
|
|
||||||
double new_x = spells[spell_id].pushback * sin(double(look_heading * 3.141592 / 180.0));
|
|
||||||
double new_y = spells[spell_id].pushback * cos(double(look_heading * 3.141592 / 180.0));
|
|
||||||
|
|
||||||
auto outapp_push =
|
|
||||||
new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
|
||||||
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)outapp_push->pBuffer;
|
|
||||||
|
|
||||||
spu->spawn_id = GetID();
|
|
||||||
spu->x_pos = FloatToEQ19(GetX());
|
|
||||||
spu->y_pos = FloatToEQ19(GetY());
|
|
||||||
spu->z_pos = FloatToEQ19(GetZ());
|
|
||||||
spu->delta_x = FloatToEQ13(new_x);
|
|
||||||
spu->delta_y = FloatToEQ13(new_y);
|
|
||||||
spu->delta_z = FloatToEQ13(toss_amt);
|
|
||||||
spu->heading = FloatToEQ12(GetHeading());
|
|
||||||
spu->padding0002 =0;
|
|
||||||
spu->padding0006 =7;
|
|
||||||
spu->padding0014 =0x7f;
|
|
||||||
spu->padding0018 =0x5df27;
|
|
||||||
spu->animation = 0;
|
|
||||||
spu->delta_heading = FloatToEQ10(0);
|
|
||||||
outapp_push->priority = 5;
|
|
||||||
entity_list.QueueClients(this, outapp_push, true);
|
|
||||||
if(IsClient())
|
|
||||||
CastToClient()->FastQueuePacket(&outapp_push);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2652,7 +2652,9 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) {
|
|||||||
action->source = caster->GetID();
|
action->source = caster->GetID();
|
||||||
action->target = GetID();
|
action->target = GetID();
|
||||||
action->spell = spell_id;
|
action->spell = spell_id;
|
||||||
|
action->force = spells[spell_id].pushback;
|
||||||
action->hit_heading = GetHeading();
|
action->hit_heading = GetHeading();
|
||||||
|
action->hit_pitch = spells[spell_id].pushup;
|
||||||
action->instrument_mod = caster->GetInstrumentMod(spell_id);
|
action->instrument_mod = caster->GetInstrumentMod(spell_id);
|
||||||
action->effect_flag = 0;
|
action->effect_flag = 0;
|
||||||
action->spell_level = action->level = buffs[buffs_i].casterlevel;
|
action->spell_level = action->level = buffs[buffs_i].casterlevel;
|
||||||
@ -2661,11 +2663,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) {
|
|||||||
|
|
||||||
action->effect_flag = 4;
|
action->effect_flag = 4;
|
||||||
|
|
||||||
if(IsEffectInSpell(spell_id, SE_TossUp))
|
if(spells[spell_id].pushback > 0 || spells[spell_id].pushup > 0)
|
||||||
{
|
|
||||||
action->effect_flag = 0;
|
|
||||||
}
|
|
||||||
else if(spells[spell_id].pushback > 0 || spells[spell_id].pushup > 0)
|
|
||||||
{
|
{
|
||||||
if(IsClient())
|
if(IsClient())
|
||||||
{
|
{
|
||||||
@ -2673,38 +2671,6 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) {
|
|||||||
{
|
{
|
||||||
CastToClient()->SetKnockBackExemption(true);
|
CastToClient()->SetKnockBackExemption(true);
|
||||||
|
|
||||||
action->effect_flag = 0;
|
|
||||||
auto outapp_push = new EQApplicationPacket(
|
|
||||||
OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
|
||||||
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)outapp_push->pBuffer;
|
|
||||||
|
|
||||||
double look_heading = caster->CalculateHeadingToTarget(GetX(), GetY());
|
|
||||||
look_heading /= 256;
|
|
||||||
look_heading *= 360;
|
|
||||||
if(look_heading > 360)
|
|
||||||
look_heading -= 360;
|
|
||||||
|
|
||||||
//x and y are crossed mkay
|
|
||||||
double new_x = spells[spell_id].pushback * sin(double(look_heading * 3.141592 / 180.0));
|
|
||||||
double new_y = spells[spell_id].pushback * cos(double(look_heading * 3.141592 / 180.0));
|
|
||||||
|
|
||||||
spu->spawn_id = GetID();
|
|
||||||
spu->x_pos = FloatToEQ19(GetX());
|
|
||||||
spu->y_pos = FloatToEQ19(GetY());
|
|
||||||
spu->z_pos = FloatToEQ19(GetZ());
|
|
||||||
spu->delta_x = FloatToEQ13(new_x);
|
|
||||||
spu->delta_y = FloatToEQ13(new_y);
|
|
||||||
spu->delta_z = FloatToEQ13(spells[spell_id].pushup);
|
|
||||||
spu->heading = FloatToEQ12(GetHeading());
|
|
||||||
spu->padding0002 =0;
|
|
||||||
spu->padding0006 =7;
|
|
||||||
spu->padding0014 =0x7f;
|
|
||||||
spu->padding0018 =0x5df27;
|
|
||||||
spu->animation = 0;
|
|
||||||
spu->delta_heading = FloatToEQ10(0);
|
|
||||||
outapp_push->priority = 6;
|
|
||||||
entity_list.QueueClients(this, outapp_push, true);
|
|
||||||
CastToClient()->FastQueuePacket(&outapp_push);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2725,7 +2691,9 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) {
|
|||||||
cd->source = action->source;
|
cd->source = action->source;
|
||||||
cd->type = DamageTypeSpell;
|
cd->type = DamageTypeSpell;
|
||||||
cd->spellid = action->spell;
|
cd->spellid = action->spell;
|
||||||
|
cd->force = action->force;
|
||||||
cd->hit_heading = action->hit_heading;
|
cd->hit_heading = action->hit_heading;
|
||||||
|
cd->hit_pitch = action->hit_pitch;
|
||||||
cd->damage = 0;
|
cd->damage = 0;
|
||||||
if(!IsEffectInSpell(spell_id, SE_BindAffinity))
|
if(!IsEffectInSpell(spell_id, SE_BindAffinity))
|
||||||
{
|
{
|
||||||
@ -3536,7 +3504,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
|||||||
action->level = caster_level; // caster level, for animation only
|
action->level = caster_level; // caster level, for animation only
|
||||||
action->type = 231; // 231 means a spell
|
action->type = 231; // 231 means a spell
|
||||||
action->spell = spell_id;
|
action->spell = spell_id;
|
||||||
|
action->force = spells[spell_id].pushback;
|
||||||
action->hit_heading = GetHeading();
|
action->hit_heading = GetHeading();
|
||||||
|
action->hit_pitch = spells[spell_id].pushup;
|
||||||
action->instrument_mod = GetInstrumentMod(spell_id);
|
action->instrument_mod = GetInstrumentMod(spell_id);
|
||||||
action->effect_flag = 0;
|
action->effect_flag = 0;
|
||||||
|
|
||||||
@ -3967,50 +3937,13 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
|||||||
// the complete sequence is 2 actions and 1 damage message
|
// the complete sequence is 2 actions and 1 damage message
|
||||||
action->effect_flag = 0x04; // this is a success flag
|
action->effect_flag = 0x04; // this is a success flag
|
||||||
|
|
||||||
if(IsEffectInSpell(spell_id, SE_TossUp))
|
if(spells[spell_id].pushback > 0 || spells[spell_id].pushup > 0)
|
||||||
{
|
|
||||||
action->effect_flag = 0;
|
|
||||||
}
|
|
||||||
else if(spells[spell_id].pushback > 0 || spells[spell_id].pushup > 0)
|
|
||||||
{
|
{
|
||||||
if(spelltar->IsClient())
|
if(spelltar->IsClient())
|
||||||
{
|
{
|
||||||
if(!IsBuffSpell(spell_id))
|
if(!IsBuffSpell(spell_id))
|
||||||
{
|
{
|
||||||
spelltar->CastToClient()->SetKnockBackExemption(true);
|
spelltar->CastToClient()->SetKnockBackExemption(true);
|
||||||
|
|
||||||
action->effect_flag = 0;
|
|
||||||
auto outapp_push =
|
|
||||||
new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
|
||||||
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)outapp_push->pBuffer;
|
|
||||||
|
|
||||||
double look_heading = CalculateHeadingToTarget(spelltar->GetX(), spelltar->GetY());
|
|
||||||
look_heading /= 256;
|
|
||||||
look_heading *= 360;
|
|
||||||
if(look_heading > 360)
|
|
||||||
look_heading -= 360;
|
|
||||||
|
|
||||||
//x and y are crossed mkay
|
|
||||||
double new_x = spells[spell_id].pushback * sin(double(look_heading * 3.141592 / 180.0));
|
|
||||||
double new_y = spells[spell_id].pushback * cos(double(look_heading * 3.141592 / 180.0));
|
|
||||||
|
|
||||||
spu->spawn_id = spelltar->GetID();
|
|
||||||
spu->x_pos = FloatToEQ19(spelltar->GetX());
|
|
||||||
spu->y_pos = FloatToEQ19(spelltar->GetY());
|
|
||||||
spu->z_pos = FloatToEQ19(spelltar->GetZ());
|
|
||||||
spu->delta_x = FloatToEQ13(new_x);
|
|
||||||
spu->delta_y = FloatToEQ13(new_y);
|
|
||||||
spu->delta_z = FloatToEQ13(spells[spell_id].pushup);
|
|
||||||
spu->heading = FloatToEQ12(spelltar->GetHeading());
|
|
||||||
spu->padding0002 =0;
|
|
||||||
spu->padding0006 =7;
|
|
||||||
spu->padding0014 =0x7f;
|
|
||||||
spu->padding0018 =0x5df27;
|
|
||||||
spu->animation = 0;
|
|
||||||
spu->delta_heading = FloatToEQ10(0);
|
|
||||||
outapp_push->priority = 6;
|
|
||||||
entity_list.QueueClients(this, outapp_push, true);
|
|
||||||
spelltar->CastToClient()->FastQueuePacket(&outapp_push);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4039,7 +3972,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
|||||||
cd->source = action->source;
|
cd->source = action->source;
|
||||||
cd->type = action->type;
|
cd->type = action->type;
|
||||||
cd->spellid = action->spell;
|
cd->spellid = action->spell;
|
||||||
|
cd->force = action->force;
|
||||||
cd->hit_heading = action->hit_heading;
|
cd->hit_heading = action->hit_heading;
|
||||||
|
cd->hit_pitch = action->hit_pitch;
|
||||||
cd->damage = 0;
|
cd->damage = 0;
|
||||||
if(!IsEffectInSpell(spell_id, SE_BindAffinity)){
|
if(!IsEffectInSpell(spell_id, SE_BindAffinity)){
|
||||||
entity_list.QueueCloseClients(
|
entity_list.QueueCloseClients(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user