Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc Caitsith plumbing #4627

Merged
merged 3 commits into from
Oct 22, 2023
Merged
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
1 change: 1 addition & 0 deletions scripts/enum/msg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ xi.msg.basic =
JA_MISS = 158, -- <user> uses <ability>, but misses. (no name included)
USES_JA_TAKE_DAMAGE = 317, -- The <player> uses .. <target> takes .. points of damage.
JA_GAIN_EFFECT = 266, -- <target> gains the effect of <ability>.
JA_GAIN_EFFECT_2 = 316, -- <user> uses <ability>. <target> gains the effect of <effect>.
JA_REMOVE_EFFECT_2 = 321, -- <user> uses <ability>. <target>'s <status> wears off.
JA_NO_EFFECT_2 = 323, -- <user> uses <ability>. No effect on <target>. (2 line msg)
JA_MISS_2 = 324, -- <user> uses <ability>, but misses <target>. (includes target name)
Expand Down
12 changes: 12 additions & 0 deletions src/map/lua/lua_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ void CLuaAction::ID(uint32 actionTargetID, uint32 newActionTargetID)
}
}

// Get the first (primary) target's long ID, if available.
uint32 CLuaAction::getPrimaryTargetID()
{
if (!m_PLuaAction->actionLists.empty())
{
return m_PLuaAction->actionLists[0].ActionTargetID;
}

return 0;
}

void CLuaAction::setRecast(uint16 recast)
{
m_PLuaAction->recast = recast;
Expand Down Expand Up @@ -225,6 +236,7 @@ void CLuaAction::Register()
{
SOL_USERTYPE("CAction", CLuaAction);
SOL_REGISTER("ID", CLuaAction::ID);
SOL_REGISTER("getPrimaryTargetID", CLuaAction::getPrimaryTargetID);
SOL_REGISTER("getRecast", CLuaAction::getRecast);
SOL_REGISTER("setRecast", CLuaAction::setRecast);
SOL_REGISTER("actionID", CLuaAction::actionID);
Expand Down
1 change: 1 addition & 0 deletions src/map/lua/lua_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CLuaAction
friend std::ostream& operator<<(std::ostream& out, const CLuaAction& action);

void ID(uint32 actionTargetID, uint32 newActionTargetID);
uint32 getPrimaryTargetID();
void setRecast(uint16 recast);
uint16 getRecast();
void actionID(uint16 actionid);
Expand Down