Skip to content

Commit

Permalink
Merge pull request #4627 from WinterSolstice8/caitsith_plumbing
Browse files Browse the repository at this point in the history
Misc Caitsith plumbing
  • Loading branch information
zach2good authored Oct 22, 2023
2 parents c302a64 + c2d7dec commit e8593c4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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

0 comments on commit e8593c4

Please sign in to comment.