-
Notifications
You must be signed in to change notification settings - Fork 241
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
Commands to modify max-vitals and skills #2219
Commands to modify max-vitals and skills #2219
Conversation
public static void HandleModifyVital(Session session, params string[] parameters) | ||
{ | ||
var lastAppraised = CommandHandlerHelper.GetLastAppraisedObject(session); | ||
if (lastAppraised == null || !(lastAppraised is Creature)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be useful to output text to the admin letting them know why the command failed.
[CommandHandler("modifyvital", AccessLevel.Admin, CommandHandlerFlag.None, 2, "Adjusts the maximum vital attribute for the last appraised mob/player and restores full vitals", "<Health|Stamina|Mana> <delta>")] | ||
public static void HandleModifyVital(Session session, params string[] parameters) | ||
{ | ||
var lastAppraised = CommandHandlerHelper.GetLastAppraisedObject(session); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only concern about GetLastAppraisedObject() is how decal can automatically appraise other objects invisibly / behind-the-scenes, and unintentionally change the intended target of the player
there is also a field in ACE which points to the 'currently selected creature target' (anything with vitals), and this selection is not automatically changed by decal, as far as i know... perhaps it would be worth considering to use that variant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good idea. I found the selectedTarget
field in Player class but it's a Guid. What's the easiest way to convert that to a Creature instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this should work:
Creature targetCreature = CurrentLandblock?.GetObject(Guid) as Creature;
Adds two new admin commands for (1) modifying the max vitals for an NPC or player, (2) modifying the skill levels for an NPC or player
#2209 and #2208