Alias_ThalmorGuard01.GetActorRef().SetRelationshipRank(Game.GetPlayer(), -4)
But one thing I need to account for is what if the player decides they just want to fight and start attacking - even if they have passed the challenges and negotiated a peaceful release? If this happened, I want ALL the bad guys to immediately become hostile to the player, and attack. I'm not sure, but wouldn't I need to use an OnHit script placed on each of my bad guys? If so, here's what I have come up with so far:
Scriptname BalokOnHitSetStage extends Actorimport gameimport debugQuest Property MyQuest autoInt Property stage Autoauto State waiting Event onHit(objectReference akAggressor, Form akWeapon, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) MyQuest.SetCurrentStageID(stage) gotoState ("allDone") endEventendStateState allDone ;do nothingendState
This compiles, but I don't think it is right. I picked up bits of this from another default OnHit script to get this far.
Basically, if I wrote it in English, I think I need to do this:
"If the player hits the bad guy, set my stage to 63. If stage 63 has already been set, then do nothing because they should already be set to hostile anyway."
Also, could I set their hostility via a quest variable of some type or something? Would that be a cleaner way to do it? I don't know much about setting up and using quest variables to control stuff, so you might have to walk me through it if so.
One last thing, most of these bad guys are just generic "Thalmor Soldiers" that I've created. I will be returning to the prison at a later stage in my main quest, so I want to be able to respawn them and use them again since they are generic. The second time to the prison, they should be completely hostile from the beginning which I should be able to set like I did with this:
Alias_ThalmorGuard01.GetActorRef().SetRelationshipRank(Game.GetPlayer(), -4)