Justin Knight Posted March 16, 2016 Author Share Posted March 16, 2016 Is there any script I could use to change the alignment of a monster from attack-on-sight to attack-when-attacked? I want to make a spell that lets you "tame" monsters. Link to comment Share on other sites More sharing options...
Xlithan Posted March 16, 2016 Share Posted March 16, 2016 Actually this would be more simple than you think. All of the NPCs are loaded into memory when the server starts. You could copy some of the code from HandleSaveNPC. This is the routine that runs when you save an NPC from the NPC editor.So when you cast the spell, you could just have it run a new sub routine, change the behaviour by doing **NPC(NPCNum).Behaviour = NPC_BEHAVIOUR_FRIENDLY**.Then just use some of the code from the HandleSaveNPC to update the NPC for everybody else.If you have some programming knowledge, and knowledge of the engine itself, this shouldn't be too hard.However, this simple code would only work for a unique NPC. It would change the core data of the NPC, thus all of those NPCs would then be friendly. This would work if you only had 1 spawning of an NPC. Otherwise you will have to start going more complex, and adding an array for MapNPC, then adding code that would over-ride the core behaviour variable. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now