Implemented spell Target Type (45) 'Target Rings' on Underfoot.

Thanks to Lecht for figuring out op code side of it.
This commit is contained in:
KayenEQ
2014-11-09 22:37:12 -05:00
parent d8a8b8e6dc
commit d656db843a
11 changed files with 62 additions and 6 deletions
+4
View File
@@ -4034,6 +4034,10 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
return;
}
targetring_x = castspell->x_pos;
targetring_y = castspell->y_pos;
targetring_z = castspell->z_pos;
CastSpell(spell_to_cast, castspell->target_id, castspell->slot);
}
/* Spell Slot or Potion Belt Slot */
+1
View File
@@ -494,6 +494,7 @@ typedef enum {
GroupSpell, // causes effect to caster + target's group
CAHateList, // causes effect to all people on caster's hate list within some range
DirectionalAE,
TargetRing,
CastActUnknown
} CastAction_type;
+11 -3
View File
@@ -764,8 +764,14 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
continue;
if (curmob == caster && !affect_caster) //watch for caster too
continue;
dist_targ = center->DistNoRoot(*curmob);
if (spells[spell_id].targettype == ST_Ring){
dist_targ = curmob->DistNoRoot(caster->GetTargetRingX(), caster->GetTargetRingY(),caster->GetTargetRingZ());
}
else if (center){
dist_targ = center->DistNoRoot(*curmob);
}
if (dist_targ > dist2) //make sure they are in range
continue;
if (dist_targ < min_range2) //make sure they are in range
@@ -787,7 +793,9 @@ void EntityList::AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_
if (bad) {
if (!caster->IsAttackAllowed(curmob, true))
continue;
if (!center->CheckLosFN(curmob))
if (center && !center->CheckLosFN(curmob))
continue;
if (!center && !caster->CheckLosFN(caster->GetTargetRingX(), caster->GetTargetRingY(),caster->GetTargetRingZ(), curmob->GetSize()))
continue;
} else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
// This does not check faction for beneficial AE buffs..only agro and attackable.
+4
View File
@@ -369,6 +369,10 @@ Mob::Mob(const char* in_name,
nimbus_effect3 = 0;
m_targetable = true;
targetring_x = 0.0f;
targetring_y = 0.0f;
targetring_z = 0.0f;
flymode = FlyMode3;
// Pathing
PathingLOSState = UnknownLOS;
+7
View File
@@ -287,6 +287,9 @@ public:
inline virtual uint32 GetNimbusEffect2() const { return nimbus_effect2; }
inline virtual uint32 GetNimbusEffect3() const { return nimbus_effect3; }
void RemoveNimbusEffect(int effectid);
inline float GetTargetRingX() const { return targetring_x; }
inline float GetTargetRingY() const { return targetring_y; }
inline float GetTargetRingZ() const { return targetring_z; }
//Basic Stats/Inventory
virtual void SetLevel(uint8 in_level, bool command = false) { level = in_level; }
@@ -1231,6 +1234,10 @@ protected:
float tar_vz;
float test_vector;
float targetring_x;
float targetring_y;
float targetring_z;
uint32 m_spellHitsLeft[38]; // Used to track which spells will have their numhits incremented when spell finishes casting, 38 Buffslots
int flymode;
bool m_targetable;
+14
View File
@@ -368,6 +368,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
if((IsGroupSpell(spell_id) ||
spell.targettype == ST_Self ||
spell.targettype == ST_AECaster ||
spell.targettype == ST_Ring ||
spell.targettype == ST_TargetOptional) && target_id == 0)
{
mlog(SPELLS__CASTING, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype);
@@ -1802,6 +1803,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
break;
}
case ST_Ring:
{
CastAction = TargetRing;
spell_target = nullptr;
ae_center = nullptr;
break;
}
default:
{
mlog(SPELLS__CASTING_ERR, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name);
@@ -2165,6 +2174,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
}
break;
}
case TargetRing:{
entity_list.AESpell(this, nullptr, spell_id, false, resist_adjust);
break;
}
}
DoAnim(spells[spell_id].CastingAnim, 0, true, IsClient() ? FilterPCSpells : FilterNPCSpells);