Morxeton
Sorceror
Possess Command
Summary:
A possess command that requires the least amount of editting of PlayerMobile.cs as possible. I created this script due to everyone having problems with the current possess commands released in script submissions. This script was written from scratch. "Credit for the idea" goes to whoever written the first possess command (I was informed this was Omega_Red. Thanks for the idea).
Description:
You can type [possess and target a mobile to possess them. You will take on their bodyvalue, basesoundID, hue, name, title, and stats. When you are killed while possessed, you don't actually die. Instead, a duplicate of the creature you possessed will be created and killed. You will return to your previous form... stats, name, title, etc... will return to how they were before you possessed anybody. This duplicate creature will have the exact items on it as the creature you possessed. You never possess their belongings. I saw no point into possessing those. When you type [unpossess, a duplicate of the creature you possessed will be created and spawned at your location. They will have all the same stats, items, etc. as the creature you possessed. Their HP, stamina, and mana will be at the same percentage as yours was before you unpossessed. There is an option with the possess command that allows you to not take on their stats. Type [possess nostatmod to achieve this. Also, [unpossess you can specify whether the creature will take your damage or be at full health when unpossessing. Type [unpossess nodamage to achieve this.
So the commands are:
In order to get away with minimal editting of the PlayerMobile.cs, during every worldsave an XML file is created with all the information for anyone that is possessing a creature. You may customize the XML filename at the top of the script. You may also change the accesslevel required at the top of the script as well. Anyone that does not meet the accesslevel, the script does not even process anything for OnBeforeDeath, it always returns true (which means they will die, same as return base.OnBeforeDeath() ). Anyone that is possessed and the server goes down, if the server saved them while they were possessed, you may unpossess yourself after server has started up again.
NOTE: This currently does not support tamed pets. I suggest not possessing anything tamed until I add it in. I am too busy to do it right now. If you do possess anything tamed, you will screw up the tame and when unpossessing it will no longer be tamed. Also, this does not support players with a bodymod value greater than 0. I will work on that as well.
Installation:
Place the script in your Scripts/Custom directory.
You MUST edit PlayerMobile.cs, but don't worry, it's an EASY edit.
Open PlayerMobile.cs and find this (at line 1008 in an unmodified PlayerMobile.cs):
Change it to:
Fire up your server and enjoy!
Summary:
A possess command that requires the least amount of editting of PlayerMobile.cs as possible. I created this script due to everyone having problems with the current possess commands released in script submissions. This script was written from scratch. "Credit for the idea" goes to whoever written the first possess command (I was informed this was Omega_Red. Thanks for the idea).
Description:
You can type [possess and target a mobile to possess them. You will take on their bodyvalue, basesoundID, hue, name, title, and stats. When you are killed while possessed, you don't actually die. Instead, a duplicate of the creature you possessed will be created and killed. You will return to your previous form... stats, name, title, etc... will return to how they were before you possessed anybody. This duplicate creature will have the exact items on it as the creature you possessed. You never possess their belongings. I saw no point into possessing those. When you type [unpossess, a duplicate of the creature you possessed will be created and spawned at your location. They will have all the same stats, items, etc. as the creature you possessed. Their HP, stamina, and mana will be at the same percentage as yours was before you unpossessed. There is an option with the possess command that allows you to not take on their stats. Type [possess nostatmod to achieve this. Also, [unpossess you can specify whether the creature will take your damage or be at full health when unpossessing. Type [unpossess nodamage to achieve this.
So the commands are:
[possess - Target a mobile to possess. You will take on their stats.
[possess nostatmod - Target a mobile to possess. You will not take on their stats.
[unpossess - Unpossess the creature. They will have your HP, stamina, and mana percent.
[unpossess nodamage - Unpossess the creature. They will be at full health, stamina, and mana.
In order to get away with minimal editting of the PlayerMobile.cs, during every worldsave an XML file is created with all the information for anyone that is possessing a creature. You may customize the XML filename at the top of the script. You may also change the accesslevel required at the top of the script as well. Anyone that does not meet the accesslevel, the script does not even process anything for OnBeforeDeath, it always returns true (which means they will die, same as return base.OnBeforeDeath() ). Anyone that is possessed and the server goes down, if the server saved them while they were possessed, you may unpossess yourself after server has started up again.
NOTE: This currently does not support tamed pets. I suggest not possessing anything tamed until I add it in. I am too busy to do it right now. If you do possess anything tamed, you will screw up the tame and when unpossessing it will no longer be tamed. Also, this does not support players with a bodymod value greater than 0. I will work on that as well.
Installation:
Place the script in your Scripts/Custom directory.
You MUST edit PlayerMobile.cs, but don't worry, it's an EASY edit.
Open PlayerMobile.cs and find this (at line 1008 in an unmodified PlayerMobile.cs):
Code:
return base.OnBeforeDeath();
Code:
return PossessCommand.UnpossessDeath( (Mobile) this );
Fire up your server and enjoy!