RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Help with Corpse Resurrection

MontegroXD

Wanderer
This one may take a bit of explaining... I'm currently working on a new boss monster for my shard, and I want the difficulty of this monster to be relatively high. So one thing I thought would be cool would be to write a corpse resurrection method. Essentially, if you are killed by this boss, it will raise your corpse, this will create a new enemy using your name and equipment to fight you.

That being explained... I have a few issues and features I'm missing that I'd like to add. Currently I have literally only just begun, so there's hardly a script to show just yet. First things first, I would greatly appreciate a re-direct if someone has already written something similar, because if they have, I could just use some of their code to start off/write my own. Other than that, I'd like the resurrected corpse to contain the name of the one that the creature resurrected, maybe have similar stats that I could multiply by a decimal to make the corpse a little weaker than the original character. If possible, this might be the hardest of all of that to figure out, but based on stats, if we could, change which AI Type the creature is, such as if the original killed character has high magery and int, then the AI for his resurrected corpse would have the mage AI, if they have a high weapon skill, then the warrior AI. Any suggestions or code snippets anyone could submit to help me finish this project would be greatly appreciated. I do plan to release this creature once it's finished to my liking, and I'll be sure to give credit out where credit is due.
 

Murzin

Knight
a lot of runuo servers have no skill cap.

so people have all their weapon skills and their magery 100-120.

what do you do then?

creating a new human npc is fine, copying the stats is fine, even copying the skills is fine. its the checking to see if the mob killed the player that will be your challenge.

inside whatever check you have to see if it killed the player, run a call to a method passing a reference to that player. inside that method, have it spawn a new npc, copy the players stats and skills, apply them to the mobile, set the mobiles group to the same as the monster, then move that mobile to the monster.

you could also if you want set the mobiles target to be the same as the monster after the move if you want to speed up how fast it joins the combat.


i would recommend searching the script release or script archive for a simulacrum or doppleganger and see if any of those scripts help you out.
 

Vaul

Traveler
I would think the contagious zombie script would be of some use to you. But have it maybe have a time/distance decay & code it so there isn't 12 copies of playerX & 30 of playerY. Only maybe 2 copies of each player at max. Maybe copy the mirror image or whatever it's called code to do it.
 

MontegroXD

Wanderer
a lot of runuo servers have no skill cap.

so people have all their weapon skills and their magery 100-120.

what do you do then?

creating a new human npc is fine, copying the stats is fine, even copying the skills is fine. its the checking to see if the mob killed the player that will be your challenge.

inside whatever check you have to see if it killed the player, run a call to a method passing a reference to that player. inside that method, have it spawn a new npc, copy the players stats and skills, apply them to the mobile, set the mobiles group to the same as the monster, then move that mobile to the monster.

you could also if you want set the mobiles target to be the same as the monster after the move if you want to speed up how fast it joins the combat.


i would recommend searching the script release or script archive for a simulacrum or doppleganger and see if any of those scripts help you out.
For the first bit with no skill caps? I already thought of that and planned a nested if/else function favoring the mage AI, I just don't know how to have it change the AI exactly. So there would be a bit of math involved, but suffice it to say if both Melee and Magery would match up in point values, then the script would favor the Mage AI. This could be done with the nested if/else or handled through something like If MagePoint>MeleePoint Then AIMage Else If MeleePoint>MagePoint Then AIMelee Else AIMage.

Finding if the mob killed the player could be something. But what if instead if the corpse were in range of the creature, it would resurrect it? Such as something similar to the ShardCleaner's method of finding corpses. The problem would be determining who/what the corpse was. I was thinking of making it even more difficult, something that would not only create a resurrected human, but also maybe their pet dragon if it fell.

I have the method for creating a new creature and setting it to the same group as Resurrex (temporary name for the boss) already written, as well as spawning the creature near the boss and setting its target to the bosses target (though I'd probably leave setting the target to the same target out, would make battle more exciting, let it find its own target) but thank you for pointing me in the right direction for which scripts to find and reference.
 

MontegroXD

Wanderer
I would think the contagious zombie script would be of some use to you. But have it maybe have a time/distance decay & code it so there isn't 12 copies of playerX & 30 of playerY. Only maybe 2 copies of each player at max. Maybe copy the mirror image or whatever it's called code to do it.
That's an interesting point, and thanks for pointing me in a good direction for what to look for code-wise. I saw the contagious zombie script earlier, I might consider putting that functionality of decaying in... But I was thinking of allowing it to do as many copies of the same person as it killed, that being one of the sole scare factors. Maybe I'll leave that be in the one I use on my own shard, but when I release it I'll leave in some commented out lines of code in there for anyone who takes up on it to use to put those limitations in for the betterment of their own shard.
 
Top