diff --git a/Changelog.txt b/Changelog.txt index eb6bead1f..840163527 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4077,3 +4077,6 @@ When setting a property like MORE to the a spell or skill defname, trying to rea - Changed: Object timers are now saved in worldsave files as TIMERMS, to avoid ambiguity and reliance on git build number to determine if TIMER expressed a number in seconds or milliseconds. - Changed: Added 5 seconds timeout to DNS hostname resolution at startup (avoid getting stuck when connectivity is enabled but not working). - Changed: CANMASK formatted in worldsave files as hexadecimal number, instead of decimal. + +29-11-2025, canerksk +- Added: A new spell flag, SPELLFLAG_TARG_ONLYSELF, has been added. This flag is for spells that can only be cast on ourselves. When we removed SPELLFLAG_FX_TARG, we were only casting spells on ourselves, but this time the spells weren't behaving as they should, so a new spell flag has been added that works in conjunction with SPELLFLAG_FX_TARG, allowing us to target only ourselves. \ No newline at end of file diff --git a/src/game/clients/CClientTarg.cpp b/src/game/clients/CClientTarg.cpp index 54547dc51..5981b4458 100644 --- a/src/game/clients/CClientTarg.cpp +++ b/src/game/clients/CClientTarg.cpp @@ -1489,11 +1489,26 @@ bool CClient::OnTarg_Skill_Magery( CObjBase * pObj, const CPointMap & pt ) } } - if (pObj == m_pChar && pSpell->IsSpellType( SPELLFLAG_TARG_NOSELF ) && !IsPriv(PRIV_GM) ) - { - SysMessageDefault( DEFMSG_MAGERY_3 ); - return true; - } + if (!IsPriv(PRIV_GM)) + { + if (pObj == m_pChar) + { + if (pSpell->IsSpellType(SPELLFLAG_TARG_NOSELF)) + { + SysMessageDefault(DEFMSG_MAGERY_3); + return true; + } + } + else + { + if (pSpell->IsSpellType(SPELLFLAG_TARG_ONLYSELF)) + { + SysMessageDefault(DEFMSG_MAGERY_9); + return true; + } + } + } + } m_pChar->m_atMagery.m_iSpell = m_tmSkillMagery.m_iSpell; diff --git a/src/game/game_macros.h b/src/game/game_macros.h index c6757441c..f298bbf16 100644 --- a/src/game/game_macros.h +++ b/src/game/game_macros.h @@ -108,5 +108,6 @@ typedef uint32_t DAMAGE_TYPE; // describe a type of damage. #define SPELLFLAG_CURSE 0x20000000 // Curses just like Weaken,Purge Magic,Curse,etc. #define SPELLFLAG_HEAL 0x40000000 // Healing spell #define SPELLFLAG_TICK 0x80000000 // A ticking spell like Poison. +#define SPELLFLAG_TARG_ONLYSELF 0x100000000 // Only target self #endif // _INC_GAME_MACROS_H diff --git a/src/tables/defmessages.tbl b/src/tables/defmessages.tbl index 9838b04cc..351d4945f 100644 --- a/src/tables/defmessages.tbl +++ b/src/tables/defmessages.tbl @@ -342,6 +342,7 @@ MSG(MAGERY_5, "You have not yet finished preparing the spell.") MSG(MAGERY_6, "An anti-magic field disturbs the spell.") MSG(MAGERY_7, "You cannot target a player with this spell.") MSG(MAGERY_8, "You cannot target an NPC with this spell.") +MSG(MAGERY_9, "You can only target yourself with this spell.") MSG(MAKESUCCESS_1, "Due to your poor skill, the item is of shoddy quality") MSG(MAKESUCCESS_2, "You were barely able to make this item. It is of poor quality") MSG(MAKESUCCESS_3, "You make the item, but it is of below average quality")