Xahstur Posted February 14, 2012 Share Posted February 14, 2012 Hi all, i wanna make a new perk to add it in Lycanthropy perk tree (which is the part of CoH: Br project) as a last perk. Anyway the perk/skill should have effect: Perk:Rabies (same as from Diablo 2) Werewolf bits the target and infects it with disease,disease is highly epidemic and it will pass to next enemies that are close to first target who was bitten,the Disease has effects: 20 Poison damage for 10 seconds, 10 Stamina Damage over 5 seconds, 5 % chance to paralyze for 5 seconds. Link to comment Share on other sites More sharing options...
MofoMojo Posted February 14, 2012 Share Posted February 14, 2012 (edited) Potentially. Considering you can apply magic effects to NPCs via spells, and that the magic effect can be a script. The scripts OnEffectStart event could do the damage etc, you could register for update time to handle damage over time and whatnot while the effect is active (or simply use multiple effects in the spell to handle those things). Anyway, using something like FindRandomActor in your Update you could look for random actors within a certain distance, check HasMagicEffect to make sure the target isn't already infected and then.... if they aren't, have the reference actor cast the spell on the target actor to infect them. If they are, maybe try one or two more actors and then break until the next update interval. Seems....doable.... having not actually tried it. I bet I could write a Proof of Concept....after Valentines day. :) -MM Edit: Maybe go check out how chain lightning works too... don't have the kit in front of me. Edited February 14, 2012 by MofoMojo Link to comment Share on other sites More sharing options...
Xahstur Posted February 14, 2012 Author Share Posted February 14, 2012 Potentially. Considering you can apply magic effects to NPCs via spells, and that the magic effect can be a script. The scripts OnEffectStart event could do the damage etc, you could register for update time to handle damage over time and whatnot while the effect is active (or simply use multiple effects in the spell to handle those things). Anyway, using something like FindRandomActor in your Update you could look for random actors within a certain distance, check HasMagicEffect to make sure the target isn't already infected and then.... if they aren't, have the reference actor cast the spell on the target actor to infect them. If they are, maybe try one or two more actors and then break until the next update interval. Seems....doable.... having not actually tried it. I bet I could write a Proof of Concept....after Valentines day. :) -MM Edit: Maybe go check out how chain lightning works too... don't have the kit in front of me. Good idea for chain lightning! Ty dude didnt thought of that myself ;) tnx very much :D,oh yes btw kudos for this little help and proof of concept sounds good for you right? :D Link to comment Share on other sites More sharing options...
NanoCrudele Posted February 14, 2012 Share Posted February 14, 2012 you can try a remodeled cloak spell like cloak of fire but increase the radius on contact you activate this disease cloak on your target, the cloack wraps the bitten target not the castersadly my knowledge of ck is limited, the real spreading is out of my league Link to comment Share on other sites More sharing options...
MofoMojo Posted February 15, 2012 Share Posted February 15, 2012 (edited) Ok, got it worked out. And it's pretty much what I thought. The main thing that REALLY tripped me up was that FindRandomActorByRef's distance value is NOTHING like the AREA distance values for DetectLife. 300 is the value I used in the script and that's like....5 - 6 feet. In AREA spells that would be like 300 yards. Here's the main script that does most of the work: Scriptname mm_Rabies extends activemagiceffect Spell Property mm_RabiesSpell2 auto MagicEffect Property mm_RabiesScriptEffect auto Message Property mm_AnotherInfectedRabies auto Actor originalTarget Event OnEffectStart(Actor akTarget, Actor akCaster) ; Every 3 seconds get an update RegisterForUpdate(3) originalTarget = akTarget EndEvent Event OnUpdate() ;Debug.MessageBox("updating...") int count = 1 ; Basically try 5 times to find a valid target to infect while(count <= 10) ; This thing tripped me up....apparently the distance value for FindRandomActorFromRef is NOTHING like the AREA values for DetectLife, etc,. Actor newTarget = Game.FindRandomActorFromRef(originalTarget as ObjectReference, 300) ; don't apply to yourself (if that's possible with FindRandomActorFromRef ; don't apply to the player ; don't apply to anyone that already has the effect if(newTarget.HasMagicEffect(mm_RabiesScriptEffect) != 1 && newTarget != Game.GetPlayer() && newTarget != originalTarget) ;Debug.MessageBox("Found a victim" + newTarget) ; Cast the secondary rabies spell onto yourself mister newTarget. mm_RabiesSpell2.Cast(newTarget,newTarget) ; Show a visual notification that rabies has infected someone... mm_AnotherInfectedRabies.Show() count = 11 endif count += 1 endWhile EndEvent I ended up creating two spells, primarily because there's some interesting side effects of SPELL.CAST when using actors. Actors have to be facing their targets. So, the secondary spell is actually a SELF spell that the script can just cause the intended victim to cast on themselves. The primary spell/effect/script is a very simple targetted spell. The script for the starter spell effectively just causes the first victim to cast the secondary spell onto themselves which starts the real work above. Sorry, I didn't implement casting animations, or health detriment etc,. You can EASILY tack on additional effects to the secondary spell. To see this in game, load the mod and then from console: help "Rabid Disease" That should return a Rabid Disease spell ID (ignore the SELF spell if it too returns). Just add the spell to your player, select it under the destruction tree and cast it on someone. People standing in groups will ultimately pass the disease around between themselves as the disease lingers around and infects someone that just lost the affect. You could mitigate some of this by throwing in random chances of infection, and other things. If anyone ends up using this, I'd love some credit! :) -MM Edit: All the source files, compiled scripts, etc,. included in the archive. Edited February 15, 2012 by MofoMojo Link to comment Share on other sites More sharing options...
Xahstur Posted February 15, 2012 Author Share Posted February 15, 2012 Ok, got it worked out. And it's pretty much what I thought. The main thing that REALLY tripped me up was that FindRandomActorByRef's distance value is NOTHING like the AREA distance values for DetectLife. 300 is the value I used in the script and that's like....5 - 6 feet. In AREA spells that would be like 300 yards. Here's the main script that does most of the work: Scriptname mm_Rabies extends activemagiceffect Spell Property mm_RabiesSpell2 auto MagicEffect Property mm_RabiesScriptEffect auto Message Property mm_AnotherInfectedRabies auto Actor originalTarget Event OnEffectStart(Actor akTarget, Actor akCaster) ; Every 3 seconds get an update RegisterForUpdate(3) originalTarget = akTarget EndEvent Event OnUpdate() ;Debug.MessageBox("updating...") int count = 1 ; Basically try 5 times to find a valid target to infect while(count <= 10) ; This thing tripped me up....apparently the distance value for FindRandomActorFromRef is NOTHING like the AREA values for DetectLife, etc,. Actor newTarget = Game.FindRandomActorFromRef(originalTarget as ObjectReference, 300) ; don't apply to yourself (if that's possible with FindRandomActorFromRef ; don't apply to the player ; don't apply to anyone that already has the effect if(newTarget.HasMagicEffect(mm_RabiesScriptEffect) != 1 && newTarget != Game.GetPlayer() && newTarget != originalTarget) ;Debug.MessageBox("Found a victim" + newTarget) ; Cast the secondary rabies spell onto yourself mister newTarget. mm_RabiesSpell2.Cast(newTarget,newTarget) ; Show a visual notification that rabies has infected someone... mm_AnotherInfectedRabies.Show() count = 11 endif count += 1 endWhile EndEvent I ended up creating two spells, primarily because there's some interesting side effects of SPELL.CAST when using actors. Actors have to be facing their targets. So, the secondary spell is actually a SELF spell that the script can just cause the intended victim to cast on themselves. The primary spell/effect/script is a very simple targetted spell. The script for the starter spell effectively just causes the first victim to cast the secondary spell onto themselves which starts the real work above. Sorry, I didn't implement casting animations, or health detriment etc,. You can EASILY tack on additional effects to the secondary spell. To see this in game, load the mod and then from console: help "Rabid Disease" That should return a Rabid Disease spell ID (ignore the SELF spell if it too returns). Just add the spell to your player, select it under the destruction tree and cast it on someone. People standing in groups will ultimately pass the disease around between themselves as the disease lingers around and infects someone that just lost the affect. You could mitigate some of this by throwing in random chances of infection, and other things. If anyone ends up using this, I'd love some credit! :) -MM Edit: All the source files, compiled scripts, etc,. included in the archive. That is exactly what i tried to create but i f up in some commands...xD f***ing Papyrus cant get use to it...although CK is nice.Moving on...The effect on rabies should work on contact (with Werewolf claws),will this work if i create new magic effect then set it to contact? Link to comment Share on other sites More sharing options...
6TemplaR9 Posted February 15, 2012 Share Posted February 15, 2012 If you can wait until weekend I'll do it... Link to comment Share on other sites More sharing options...
Recommended Posts