I have a class (NpcCommands.cs) that contains general methods like GetPlayer(), SendMessage(), etc.
Is there a way to write scripts in javascript, lua, python, ruby, etc that my program can load and execute that are in some way connected to my class. By this I mean if in the script I called
NC.GetPlayer().SetHealth(15);
Where NC is a reference to my NpcCommands class it would run the GetPlayer() method which returns my player object, then be able to run a method from that object such as SetHealth();
The reason why I want it to be scripted is because there are going to be multiple Npc each with their own conditions and responses such as
if (NC.GetPlayer().HasItem(cookie)) {
NC.GetPlayer().SetHealth(15);
} else {
NC.SendMessage("No cookies :c");
}