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:
Michael Cook (mackal)
2018-02-28 19:47:23 -05:00
parent 06d22fa009
commit 1b84905941
2 changed files with 10 additions and 130 deletions
-55
View File
@@ -2075,61 +2075,6 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Toss Up: %d", effect_value);
#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;
}