madgod4384 Posted May 25, 2007 Share Posted May 25, 2007 Im new to coding things but i need some help.... what's the code to yeild someone.... for example im making a club that restores someones health.. and i dont want them to attack me..... any help... please? Link to comment Share on other sites More sharing options...
Vagrant0 Posted May 26, 2007 Share Posted May 26, 2007 Im new to coding things but i need some help.... what's the code to yeild someone.... for example im making a club that restores someones health.. and i dont want them to attack me..... any help... please?You really can't without still having the side effects of crime, disposition loss, and some hit counting. Yes, having a setignorefriendlyhits function on the weapon's enchantment, but it still requires you to have hit them once (enchantment effects happen after the target has been hit). And would still be counting the number of hits outside combat. In order for it to work, you would essentially have to make it (by changing gameplay > settings) so that hitting anyone with anything no longer counts as a crime, no longer causes a disposition loss, and have the friendly hits allowed setting to be very high. As these would apply to everything, and not a specfic weapon, it isn't advised unless you want to get rid of this aspect entirely. In addition to those changes, you would probably still have to script the weapon to setignorefriendlyhits if it isn't already set, and stopcombat with te player if the player is the combattarget and the NPC is in combat... Then you would probably need to make an adjustment to the assaults counter as it is hard coded to increase when you hit anything that isn't in combat with you, even if there is no crime associated with it. Even then, you will still probably trigger NPCs running away or guards attacking you because of that same hard coding. I have my game setup where I cannot get any sort of bounty, yet I still accumulate frequent assaults and murders against me. Guards still respond to these actions. You could probably break that too if you were determined to have a healing club, but I wouldn't think it worth it... Considder a staff with a healing effect instead. Link to comment Share on other sites More sharing options...
Hsandman_1 Posted May 26, 2007 Share Posted May 26, 2007 Im new to coding things but i need some help.... what's the code to yeild someone.... for example im making a club that restores someones health.. and i dont want them to attack me..... any help... please? Can you give more information on what are you trying to do? Why are you making a club(?) that heals npc that you are hiting it with? Vagrant ^ is right if the only purpose you have for the club is to use it as a "lay on hands" heal spell. You could make it to work, but the way i think about it, it would be realy complex way to go about it. On hit you would need to use script to change that targets faction to evil,so the next hits will not be crime, then you would need to use script to pay crime gold for the first atack. You would need to stop the npc from atacking or runing away from you. Maybe use some sort of calm spell on hit, or use script to disable the AI on that target "setignorefriendlyhits" etc. You would have to make sure that that club does not do any damage to the npc, but casts a heal spell on the target. Then use timer to enable the AI, remove evil faction... probly some more stuff. Just curious on what is it that you are trying to achieve...? You could probably break that too if you were determined to have a healing club, but I wouldn't think it worth it... Considder a staff with a healing effect instead. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.