Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
25 changes: 20 additions & 5 deletions src/game/clients/CClientTarg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/game/game_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/tables/defmessages.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down