Browse Source

using spell_type not target_type for the new group designation when 'single' cast functions are used

Fix #152

 alter table spells modify column spell_type enum('Unset', 'DD', 'DoT', 'Heal', 'HoT-Ward', 'Debuff', 'Buff', 'CombatBuff', 'Taunt', 'Detaunt', 'Rez', 'Cure', 'Food', 'Drink', 'Root', 'Snare', 'GroupTarget') NOT NULL default 'Unset';

update spells set target_type=2, spell_type='GroupTarget' where name='Divine Awakening';
Image 3 years ago
parent
commit
1889c95dd1
2 changed files with 9 additions and 8 deletions
  1. 8 7
      EQ2/source/WorldServer/SpellProcess.cpp
  2. 1 1
      EQ2/source/WorldServer/Spells.h

+ 8 - 7
EQ2/source/WorldServer/SpellProcess.cpp

@@ -932,7 +932,8 @@ void SpellProcess::ProcessSpell(ZoneServer* zone, Spell* spell, Entity* caster,
 			target = caster;
 
 		int8 target_type = spell->GetSpellData()->target_type;
-
+		int8 spell_type = spell->GetSpellData()->spell_type;
+		
 		lua_spell->caster = caster;
 		lua_spell->initial_caster_char_id = (caster && caster->IsPlayer()) ? ((Player*)caster)->GetCharacterID() : 0; 
 		lua_spell->spell = spell;
@@ -1048,8 +1049,7 @@ void SpellProcess::ProcessSpell(ZoneServer* zone, Spell* spell, Entity* caster,
 			DeleteSpell(lua_spell);
 			return;
 		}
-		int8 spell_type = lua_spell->spell->GetSpellData()->spell_type;
-
+		
 		LuaSpell* conflictSpell = caster->HasLinkedTimerID(lua_spell, target, (spell_type == SPELL_TYPE_DD || spell_type == SPELL_TYPE_DOT));
 		if(conflictSpell)
 		{
@@ -1125,7 +1125,7 @@ void SpellProcess::ProcessSpell(ZoneServer* zone, Spell* spell, Entity* caster,
 			return;
 		}
 
-		if (target_type != SPELL_TARGET_SELF && target_type != SPELL_TARGET_GROUP_AE && target_type != SPELL_TARGET_ALLGROUPTARGETS && target_type != SPELL_TARGET_NONE && spell->GetSpellData()->max_aoe_targets == 0)
+		if (target_type != SPELL_TARGET_SELF && target_type != SPELL_TARGET_GROUP_AE && spell_type != SPELL_TYPE_ALLGROUPTARGETS && target_type != SPELL_TARGET_NONE && spell->GetSpellData()->max_aoe_targets == 0)
 		{
 			LogWrite(SPELL__DEBUG, 1, "Spell", "%s: Not Self, Not Group AE, Not None, Max Targets = 0", spell->GetName());
 
@@ -1586,7 +1586,7 @@ bool SpellProcess::CastProcessedSpell(LuaSpell* spell, bool passive, bool in_her
 		}
 	}*/
 	
-	bool allTargets = (spell->spell->GetSpellData()->target_type == SPELL_TARGET_ALLGROUPTARGETS);
+	bool allTargets = (spell->spell->GetSpellData()->spell_type == SPELL_TYPE_ALLGROUPTARGETS);
 	if (!processedSpell)
 		processedSpell = ProcessSpell(spell, true, 0, 0, allTargets);
 
@@ -1944,6 +1944,7 @@ void SpellProcess::GetSpellTargets(LuaSpell* luaspell)
 	if (luaspell && luaspell->spell && luaspell->caster && luaspell->spell->GetSpellData()->max_aoe_targets == 0) 
 	{
 		int8 target_type = luaspell->spell->GetSpellData()->target_type;
+		int8 spell_type = luaspell->spell->GetSpellData()->spell_type;
 		Spawn* caster = luaspell->caster;
 		Spawn* target = caster->GetZone()->GetSpawnByID(luaspell->initial_target);
 		SpellData* data = luaspell->spell->GetSpellData();
@@ -2025,7 +2026,7 @@ void SpellProcess::GetSpellTargets(LuaSpell* luaspell)
 				}
 			}
 		}
-		else if (target_type == SPELL_TARGET_GROUP_AE || target_type == SPELL_TARGET_ALLGROUPTARGETS || target_type == SPELL_TARGET_RAID_AE) {
+		else if (target_type == SPELL_TARGET_GROUP_AE || spell_type == SPELL_TYPE_ALLGROUPTARGETS || target_type == SPELL_TARGET_RAID_AE) {
 
 			// player handling
 			if (target)
@@ -2107,7 +2108,7 @@ void SpellProcess::GetSpellTargets(LuaSpell* luaspell)
 
 		luaspell->MSpellTargets.writelock(__FUNCTION__, __LINE__);
 		// Group AE type                            NOTE: Add support for RAID AE to affect raid members once raids have been completed
-		if (target_type == SPELL_TARGET_GROUP_AE || target_type == SPELL_TARGET_ALLGROUPTARGETS || target_type == SPELL_TARGET_RAID_AE) 
+		if (target_type == SPELL_TARGET_GROUP_AE || spell_type == SPELL_TYPE_ALLGROUPTARGETS || target_type == SPELL_TARGET_RAID_AE) 
 		{
 			if (data->icon_backdrop == 316) // single target in a group/raid
 			{

+ 1 - 1
EQ2/source/WorldServer/Spells.h

@@ -40,7 +40,6 @@
 #define SPELL_TARGET_NONE			7
 #define SPELL_TARGET_RAID_AE		8
 #define SPELL_TARGET_OTHER_GROUP_AE	9
-#define SPELL_TARGET_ALLGROUPTARGETS 10 // use this with cast/tick only containing DIRECT target/spawn.
 
 
 #define SPELL_BOOK_TYPE_SPELL		0
@@ -190,6 +189,7 @@
 #define SPELL_TYPE_DRINK		14
 #define SPELL_TYPE_ROOT			15
 #define SPELL_TYPE_SNARE		16
+#define SPELL_TYPE_ALLGROUPTARGETS      17
 
 
 struct LUAData{