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

Commands to modify max-vitals and skills #2219

Merged
merged 3 commits into from
Sep 15, 2019

Conversation

dgarson
Copy link
Contributor

@dgarson dgarson commented Aug 11, 2019

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

@dgarson dgarson changed the title [WIP] Modify vital and skills via admin commands Commands to modify max-vitals and skills Aug 11, 2019
public static void HandleModifyVital(Session session, params string[] parameters)
{
var lastAppraised = CommandHandlerHelper.GetLastAppraisedObject(session);
if (lastAppraised == null || !(lastAppraised is Creature)) return;
Copy link
Contributor

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);
Copy link
Collaborator

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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;

@LtRipley36706 LtRipley36706 merged commit 28492fe into ACEmulator:master Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants