Jump to content

Attribute stealing enchantment script backfiring


dweezer

Recommended Posts

Posted

I really hope this section can answer my question.

 

So, I've expanded my Macromancy custom edition to include learnable weapon enchantments so that non-mage characters can have fun too. However, I find with (at least, just this one for sure) the height enchantment script, that it can backfire in horrible ways if the enemy blocks and/or attacks back while I hold the weapon, and I shrink so much, that I'm inverted and quickly die with negative health (as Macromancy scales health and carrying capacity to a percentage of your height). So my question is, how do I fix my script as below to prevent the enemy from stealing my height if they're not holding the weapon?

float change = 0.0 
Event OnEffectStart(Actor akVictim, Actor akHolder)
	Change = akHolder.GetAV("Enchanting") * 0.004 / ((akVictim.GetAV("MagicResist")/10) + 1) ;need a semi-neutral stat to track against for the player
	if akVictim.GetAV("Fame") > 0.04 && akVictim != akHolder
				float tHeight = akVictim.GetAV("Fame")
				float cHeight = akHolder.GetAV("Fame")
				float cMaxHeight = akHolder.GetAV("infamy")
				tHeight -= Change
				cHeight += Change
				cMaxHeight += Change
				if tHeight < 0.00
					tHeight = 0.004
				endIf
				if cHeight < 0.0000
					cHeight = 0.04
				endif
				akVictim.SetAv("Fame", tHeight)
				NetImmerse.SetNodeScale(akVictim, "NPC", tHeight, false)
				NetImmerse.SetNodeScale(akVictim, "NPC", tHeight, true)
				if tHeight < 0.4 && akVictim != Game.GetPlayer()
					akVictim.Kill(akHolder)
				endIf
				
				if akHolder.GetAV("Fame") > akHolder.GetAV("Infamy")
					akHolder.ForceAV("fame", akHolder.GetAV("Infamy"))
				EndIf
				akHolder.SetAv("Fame", cHeight)
				akHolder.setAV("Infamy", cMaxHeight)
				NetImmerse.SetNodeScale(akHolder, "NPC", cHeight, false)
				NetImmerse.SetNodeScale(akHolder, "NPC", cHeight, true)
		Utility.Wait(0.5)
	EndIf
EndEvent

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...