Set stat based on dynamic chance

drewrobidrewrobi Posts: 13
edited February 8 in General Modding
Hello all again, it has been a while. I'm back to modding and I'm trying to get a skill to work that is alluding me. My goal is to have a boolean stat set onto targets that either hit by a "normal hit" or by a particular skill (not all skill hits). I would like the chance that this stat is set based on the player's current charge. So if the character has a 50% charge, then I would like to apply the stat with 50% probability and at 100% charge there is a 100% chance to set the stat. So my thought is (1) use a skill that is called by a trigger or an AFFIX on hit that cannot be proc'd from skill hits. This skill would apply the AFFIX with a SET STAT effect on the target and (2) use in the skill I want to be able to set the stat from to use an AFFIX that uses CAST SKILL with the StatWatcher set to the PLAYER CHARGE PERCENT so that the skill is dynamic.

I got this working but the problem was that the CAST SKILL from my other skill did not work. In the console I saw that "PunchBag cast apply_stat_skill on PunchBag" and not "EdPlayer cast apply_stat_skill on PunchBag" in GUTS. I tried but failed to get "CAST SKILL ON TARGET" and "CAST SKILL AT TARGET" to work at all.

So, at the moment, it is not working. I'm not sure if there is an easier way to do this. I don't see a way to use a STATWATCHER that can compare the "PLAYER CHARGE PERCENT" to a random number. Also I'm not aware of any way I can make a skill launch from any non-skill hit and specific skill hits only to avoid it firing on all DPS based skills.

My goal is to have a "convicted of sin" (for a prophet class) UNIT_THEME and STAT set so that there is a chance to proc other skills when units with this "convicted of sin" stat are hit (mark on the first hit, then another skill may launch when that marked unit is hit).

I'm very early in the development of this class, so if this proves too hard, I don't mind changing my approach and not going the way of marking+proc, but I thought it would be a fun, different type of implementation for class skills.

This is one of the things I tried and did not work:
Skill that being cast and is doing the damage that should trigger the stat:
[SKILL]
	<STRING>NAME:PROPHET_CONDEMNATION
	<TRANSLATE>DISPLAYNAME:Condemnation
	<STRING>SKILL_ICON:skillicon_prophet_condemnation
	<STRING>SKILL_ICON_INACTIVE:skillicon_prophet_condemnation_gray
	<STRING>ACTIVATION_TYPE:NORMAL
	<STRING>TARGET_ALIGNMENT:EVIL
	<STRING>ANIMATION:Staff2
	<FLOAT>RANDOMRANGE:0
	<FLOAT>RANGE:15
	<FLOAT>RANGEMIN:2
	<STRING>MANA_COST_GRAPH:MANACOST_NORMAL
	<FLOAT>MANA_GRAPH_SCALE:1.25
	<FLOAT>SPEED:1.5
	<INTEGER>COOLDOWNMS:1000
	<FLOAT>FINDTARGETANGLE:90
	<FLOAT>TURNRATEOVERRIDE:-1
	<STRING>REQUIREMENT_GRAPH:SKILLTIER1
	<BOOL>CAN_BE_SILENCED:0
	<INTEGER>LEVEL_REQUIRED:0
	<INTEGER>MAX_INVEST_LEVEL:15
	<BOOL>CAN_LEFT_MAP:true
	<INTEGER64>UNIQUE_GUID:-8176657057797479671
	[LEVEL1]
		[EVENT_TRIGGER]
			<STRING>FILE:media/skills/prophet/judgement/condemnation/condemnation_1_2_3.layout
			<FLOAT>WEAPONDAMAGEPCT:50
			<FLOAT>SOAKSCALEPCT:30
			<FLOAT>MAXHEIGHTDIFFERENCE:7
			<BOOL>USEDPS:1
			<BOOL>BUILD_CHARGE:1
			[AFFIXES]
				<INTEGER>AFFIXLEVEL:1
				<STRING>TARGET:ENEMY
				<STRING>AFFIX:PROPHET_CONVICT_SIN
			[/AFFIXES]
		[/EVENT_TRIGGER]
	[/LEVEL1]
[/SKILL]

The affix I am using to only apply the stat (by casting a skill - is there a better way?):
[AFFIX]
	<STRING>NAME:PROPHET_CONVICT_SIN
	<INTEGER>RANK:0
	<INTEGER>MIN_SPAWN_RANGE:0
	<INTEGER>MAX_SPAWN_RANGE:100
	<FLOAT>DURATION:0
	<INTEGER>WEIGHT:0
	<INTEGER>SLOTS_OCCUPY:0
	[EFFECT]
		<STRING>NAME:PROPHET_CONVICT_SIN
		<STRING>ACTIVATION:DYNAMIC
		<STRING>DURATION:INSTANT
		<STRING>TYPE:CAST SKILL
		<STRING>STATMODIFYNAME:PLAYER CHARGE PERCENT
		<STRING>STATMODIFYPERCENT:100
		<BOOL>NOGRAPH:1
		<BOOL>EXCLUSIVE:1
		<FLOAT>MIN:1
		<FLOAT>MAX:1
	[/EFFECT]
[/AFFIX]

The "PROPHET_CONVICT_SIN" skill that just applies the AFFIX to the monster (not working):
[SKILL]
	<STRING>NAME:PROPHET_CONVICT_SIN
	<TRANSLATE>BASE_DESCRIPTION:Convict's an enemy of sin
	<STRING>ACTIVATION_TYPE:PROC
	<FLOAT>TURNRATEOVERRIDE:-1
	<INTEGER64>UNIQUE_GUID:2698965739747137676
	[LEVEL1]
		[AFFIXES]
			<STRING>AFFIX:PROPHET_CONVICT_SIN_APPLY
		[/AFFIXES]
	[/LEVEL1]
[/SKILL]

The PROPHET_CONVICT_SIN_APPLY affix:
[AFFIX]
	<STRING>NAME:PROPHET_CONVICT_SIN_APPLY
	<INTEGER>RANK:0
	<INTEGER>MIN_SPAWN_RANGE:0
	<INTEGER>MAX_SPAWN_RANGE:100
	<FLOAT>DURATION:0
	<INTEGER>WEIGHT:0
	<INTEGER>SLOTS_OCCUPY:0
	[EFFECT]
		<STRING>NAME:PROPHET_CONVICTED_SIN
		<STRING>ACTIVATION:DYNAMIC
		<STRING>DURATION:ALWAYS
		<STRING>TYPE:SET STAT
		<BOOL>NOGRAPH:1
		<STRING>UNITTHEME:prophet_convicted_of_sin
		<BOOL>EXCLUSIVE:1
		<FLOAT>MIN:1
		<FLOAT>MAX:1
		<FLOAT>CHANCE:100
	[/EFFECT]
[/AFFIX]

I've tried several things, but so far I've not been able to get the CAST SKILL affix to be able to have the skill actually do anything. I see that the skill is cast in the GUTS game mode console by the Punchbag on itself (it would be nice if it was from the player, but since I am just setting a stat, it doesn't have to be), but the APPLY affix above is never applied nor is the effect that sets the stat and the UNITTHEME. My first attempt was to just use the SET STAT effect, but the problem is that the STATMODIFY... is used to apply to the value of the stat and not the chance to apply the effect. I saw no way outside of using a skill to actually get the chance to work based on the player charge. My other thought which I have not yet attempted is to try to use logic in a layout file from the on hit event, but there are so very few examples of doing something like that and TL2 modding is so poorly documented, my hope that that would work is pretty low.

Thanks for the help

Comments

  • drewrobidrewrobi Posts: 13
    Thought of one way I could do this. By using stat watchers I can apply fixed percentages. So for player @ 5% charge I can enable a 5% chance AFFIX, 10% charge enable a 10% chance AFFIX and so on. So there would be steps of 5% for a total of 20 AFFIXES, but this gets around the need to use CAST SKILL affixes and I can directly use SET STAT affixes with a fixed chance. It isn't as clean, but I can definitely live with chances stepped at 5% intervals.
  • drewrobidrewrobi Posts: 13
    Unfortunately, even though the stat watcher is now working, the CHANCE for the SET STAT effect is being ignored. It always seems to have a 100% chance of applying the stat. Looks like that effect applies with a 100% chance regardless of the CHANCE property.
Sign In or Register to comment.