The Guide to Almost All Missile Functions

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

User avatar
Nagahaku
Junior Member
Paladin
Posts: 120
Joined: Sat Nov 30, 2019 1:11 am

Re: The Guide to Almost All Missile Functions

Post by Nagahaku » Thu May 25, 2023 1:26 pm

Cypress wrote:
Thu May 25, 2023 1:38 am
But you are saying that you do get some clthitsubmissiles appearing despite that
Hmmm... I think i might not have expressed myself clearly.. there would be no hitsubmissiles mistakely appeared with vanilla frozenorb's hit functions if clientcol=0, it would just do what it should and no bugs. what i talked about is the pclthitfunc=4 and psrvhitfunc=5 novas, along with collidekill & pierce behaviors. as i what i got in my testings, psrvhitfunc=5 would always die on impact, overriding collidekll=0, while pclthitfunc=4 has another problem that if collidekill=1 and pierce=1, it sometimes would not display the piercing missiles or submissiles. when using skill_pierce stat, it seldomly shows piercing, and if using item_pierce, it would show piercing with a chance about 66-75%, better but still buggy...

Luc94
Posts: 2
Joined: Tue May 23, 2023 3:14 pm
Germany

Re: The Guide to Almost All Missile Functions

Post by Luc94 » Thu May 25, 2023 10:08 pm

hey i got a question relating the baal spawn monsters skill. Is there a way to change what monsters baal is spawning?

User avatar
Cypress
Moderator
Champion of the Light
Posts: 448
Joined: Fri Dec 01, 2017 2:08 am

Re: The Guide to Almost All Missile Functions

Post by Cypress » Fri May 26, 2023 1:41 am

I see Nagahaku, I misunderstood. But it actually turns out that the problem can be solved with skill_pierce, just be aware you must have the Pierce state (ID=69) or skill_pierce won't work properly. I used to think it required you to be an Amazon as well, but that isn't actually required.

Hey Luc94, you'll want to go into monstats.txt and superuniques.txt. Namely:
Baal Wave 1 is made of superuniques.txt hcIdx 61 (Baal Subject 1)
Baal Wave 2 is made of superuniques.txt hcIdx 62 (Baal Subject 2) and monstats.txt ID 381 (skmage_cold3)
Baal Wave 3 is made of superuniques.txt hcIdx 63 (Baal Subject 3)
Baal Wave 4 is made of superuniques.txt hcIdx 64 (Baal Subject 4)
Baal Wave 5 is made of superuniques.txt hcIdx 65 (Baal Subject 5)

Note that the superunique entries spawned by Baal are hardcoded to the hcIdx, NOT to the row. Meaning, you can change Corpsefire to hcIdx=61 and Baal will spawn Corpsefire instead of Baal Subject 1 for the first wave since that makes Corpsefire the first superunique with hcIdx=61. The skmage_cold3 is not hardcoded to the ID but to the row, so row 381 will always spawn.

EDIT: And thanks Nagahaku, your frozenorb is much more useful for modding!

Luc94
Posts: 2
Joined: Tue May 23, 2023 3:14 pm
Germany

Re: The Guide to Almost All Missile Functions

Post by Luc94 » Fri May 26, 2023 3:08 pm

Cypress, Thank you for your quick reply. Ill check out the superunique.txt.

So as i understand it, the only thing to change about the baal waves by textediting is what super uniques will be picked for each wave? correct me if im wrong please.

So anything beyond that, like spawning more than 5 waves would require me to start checking out the code editing section of this forum, right?

Anyway, thanks again.

BTW: is the "So you want to start code editing" thread still up to date?

User avatar
Cypress
Moderator
Champion of the Light
Posts: 448
Joined: Fri Dec 01, 2017 2:08 am

Re: The Guide to Almost All Missile Functions

Post by Cypress » Fri May 26, 2023 6:09 pm

That's right Luc94, all you can do is change the 5 different superuniques that spawn (and in the case of wave 2, the extra monsters that spawn).

I don't know anything about code editing, so I can't comment on that. I'm only interested in softcoding, and would approach extra Baal Waves by simulating the way it works and adding in invisible monsters that spawn additional fake baal waves between the normal hardcoded Baal Waves. You could also easily add in a superunique, boss pack or whatever to Baal's Throne Room so that it is as if you have a baal wave 0. If you are interested, I could write up a guide, although it would also help if I knew exactly what you were trying to accomplish.

User avatar
Nagahaku
Junior Member
Paladin
Posts: 120
Joined: Sat Nov 30, 2019 1:11 am

Re: The Guide to Almost All Missile Functions

Post by Nagahaku » Sat May 27, 2023 9:06 am

Cypress wrote:
Fri May 26, 2023 1:41 am
it actually turns out that the problem can be solved with skill_pierce, just be aware you must have the Pierce state (ID=69) or skill_pierce won't work properly. I used to think it required you to be an Amazon as well, but that isn't actually required.
thank you so much, i can finnally have my 5 explodes frozen orb! :D
that's very interesting as some stat must match a specific state to get function normal...

User avatar
Nagahaku
Junior Member
Paladin
Posts: 120
Joined: Sat Nov 30, 2019 1:11 am

Re: The Guide to Almost All Missile Functions

Post by Nagahaku » Tue May 30, 2023 7:08 am

Cypress wrote:
Sat Apr 15, 2023 2:47 pm
but the aurastats only seem to be applied if you apply the state twice in a row
Hi, i found an interesting way to bypass this, when combined with strafe skill function behaviors.
psrvhitfunc=16 seems unable to deal damage, just a state deployer, and psrvhitfunc=19 could deal damage, so i made a strafe skill that would release a invisible srvmissile along with srvmissilea or b, using psrvhitfunc=16, to deploy the state 1st time.
then in missiles.txt i made the real damaging strafe missiles have psrvhitfunc=19, to deploy the state 2nd time.
so when the visible strafe missile hits, it is already a twice apply for the state, and the stats are activated rightaway.
howerver if a srvmissile is given to a strafe skill, it could only release 1 strafe missile without notable bugs or desyncing, but i think it's enough to make a 'marking arrow' skill :D
this is what i did in skills.txt, i replaced dru's raven with a marking arrow skill

Code: Select all

skill	Id	charclass	skilldesc	srvstfunc	srvdofunc	prgstack	srvprgfunc1	srvprgfunc2	srvprgfunc3	prgcalc1	prgcalc2	prgcalc3	prgdam	srvmissile	decquant	lob	srvmissilea	srvmissileb	srvmissilec	srvoverlay	aurafilter	aurastate	auratargetstate	auralencalc	aurarangecalc	aurastat1	aurastatcalc1	aurastat2	aurastatcalc2	aurastat3	aurastatcalc3	aurastat4	aurastatcalc4	aurastat5	aurastatcalc5	aurastat6	aurastatcalc6	auraevent1	auraeventfunc1	auraevent2	auraeventfunc2	auraevent3	auraeventfunc3	auratgtevent	auratgteventfunc	passivestate	passiveitype	passivestat1	passivecalc1	passivestat2	passivecalc2	passivestat3	passivecalc3	passivestat4	passivecalc4	passivestat5	passivecalc5	passiveevent	passiveeventfunc	summon	pettype	petmax	summode	sumskill1	sumsk1calc	sumskill2	sumsk2calc	sumskill3	sumsk3calc	sumskill4	sumsk4calc	sumskill5	sumsk5calc	sumumod	sumoverlay	stsuccessonly	stsound	stsoundclass	stsounddelay	weaponsnd	dosound	dosound a	dosound b	tgtoverlay	tgtsound	prgoverlay	prgsound	castoverlay	cltoverlaya	cltoverlayb	cltstfunc	cltdofunc	cltprgfunc1	cltprgfunc2	cltprgfunc3	cltmissile	cltmissilea	cltmissileb	cltmissilec	cltmissiled	cltcalc1	*cltcalc1 desc	cltcalc2	*cltcalc2 desc	cltcalc3	*cltcalc3 desc	warp	immediate	enhanceable	attackrank	noammo	range	weapsel	itypea1	itypea2	itypea3	etypea1	etypea2	itypeb1	itypeb2	itypeb3	etypeb1	etypeb2	anim	seqtrans	monanim	seqnum	seqinput	durability	UseAttackRate	LineOfSight	TargetableOnly	SearchEnemyXY	SearchEnemyNear	SearchOpenXY	SelectProc	TargetCorpse	TargetPet	TargetAlly	TargetItem	AttackNoMana	TgtPlaceCheck	ItemEffect	ItemCltEffect	ItemTgtDo	ItemTarget	ItemCheckStart	ItemCltCheckStart	ItemCastSound	ItemCastOverlay	skpoints	reqlevel	maxlvl	reqstr	reqdex	reqint	reqvit	reqskill1	reqskill2	reqskill3	restrict	State1	State2	State3	delay	leftskill	repeat	checkfunc	nocostinstate	usemanaondo	startmana	minmana	manashift	mana	lvlmana	interrupt	InTown	aura	periodic	perdelay	finishing	passive	progressive	general	scroll	calc1	*calc1 desc	calc2	*calc2 desc	calc3	*calc3 desc	calc4	*calc4 desc	Param1	*Param1 Description	Param2	*Param2 Description	Param3	*Param3 Description	Param4	*Param4 Description	Param5	*Param5 Description	Param6	*Param6 Description	Param7	*Param7 Description	Param8	*Param8 Description	InGame	ToHit	LevToHit	ToHitCalc	ResultFlags	HitFlags	HitClass	Kick	HitShift	SrcDam	MinDam	MinLevDam1	MinLevDam2	MinLevDam3	MinLevDam4	MinLevDam5	MaxDam	MaxLevDam1	MaxLevDam2	MaxLevDam3	MaxLevDam4	MaxLevDam5	DmgSymPerCalc	EType	EMin	EMinLev1	EMinLev2	EMinLev3	EMinLev4	EMinLev5	EMax	EMaxLev1	EMaxLev2	EMaxLev3	EMaxLev4	EMaxLev5	EDmgSymPerCalc	ELen	ELevLen1	ELevLen2	ELevLen3	ELenSymPerCalc	aitype	aibonus	cost mult	cost add
Raven	221	dru	raven	8	12									markarrow			ravenarrow	ravenbolt					dodge	300	par5	skill_armor_percent	0	item_fastergethitrate	0	item_fasterblockrate	0																										(skill('Plague Poppy'.blvl)+skill('Summon Spirit Wolf'.blvl)+skill('Oak Sage'.blvl)+skill('Cycle of Life'.blvl)+skill('Heart of Wolverine'.blvl)+skill('Summon Fenris'.blvl)+skill('Vines'.blvl)+skill('Spirit of Barbs'.blvl)+skill('Summon Grizzly'.blvl))*5																									paladin_charge									13	20					ravenarrow	ravenbolt											1	0		rng		miss										A1	A1	xx				1																						1	20													1		1				1	5	24	-1	1										1	#missiles	pst5*(100+dm12*(skill('fireb'.ast2)+skill('ltngb'.ast2))/100)/100	damage %	1	min # missiles	300	aura len	0	convert min	100	convert max		Base Shots to take (+1 per level)		Max shots to take	35	Radius	100	% frame rollback	0	dumb min	20	dumb max	1								8	128																																			256	1000
and these are the related missiles

Code: Select all

Missile	Id	pCltDoFunc	pCltHitFunc	pSrvDoFunc	pSrvHitFunc	pSrvDmgFunc	SrvCalc1	*srv calc 1 desc	Param1	*param1 desc	Param2	*param2 desc	Param3	*param3 desc	Param4	*param4 desc	Param5	*param5 desc	CltCalc1	*client calc 1 desc	CltParam1	*client param1 desc	CltParam2	*client param2 desc	CltParam3	*client param3 desc	CltParam4	*client param4 desc	CltParam5	*client param5 desc	{filtered}	*server hit calc 1 desc	{filtered}	*server hit param1 desc	{filtered}	*server hit param2 desc	{filtered}	*server hit param3 desc	CHitCalc1	*client hit calc1 desc	cHitPar1	*client hit param1 desc	cHitPar2	*client hit param2 desc	cHitPar3	*client hit param3 desc	DmgCalc1	*damage calc 1	dParam1	*damage param1 desc	dParam2	*damage param2 desc	Vel	MaxVel	VelLev	Accel	Range	LevRange	Light	Flicker	Red	Green	Blue	InitSteps	Activate	LoopAnim	CelFile	animrate	AnimLen	AnimSpeed	RandStart	SubLoop	SubStart	SubStop	CollideType	CollideKill	CollideFriend	LastCollide	Collision	ClientCol	ClientSend	NextHit	NextDelay	xoffset	yoffset	zoffset	Size	SrcTown	CltSrcTown	CanDestroy	ToHit	AlwaysExplode	Explosion	Town	NoUniqueMod	NoMultiShot	Holy	CanSlow	ReturnFire	GetHit	SoftHit	KnockBack	Trans	Qty	Pierce	SpecialSetup	MissileSkill	Skill	ResultFlags	HitFlags	HitShift	ApplyMastery	SrcDamage	Half2HSrc	SrcMissDmg	MinDamage	MinLevDam1	MinLevDam2	MinLevDam3	MinLevDam4	MinLevDam5	MaxDamage	MaxLevDam1	MaxLevDam2	MaxLevDam3	MaxLevDam4	MaxLevDam5	DmgSymPerCalc	EType	EMin	MinELev1	MinELev2	MinELev3	MinELev4	MinELev5	Emax	MaxELev1	MaxELev2	MaxELev3	MaxELev4	MaxELev5	EDmgSymPerCalc	ELen	ELevLen1	ELevLen2	ELevLen3	HitClass	NumDirections	LocalBlood	DamageRate	TravelSound	HitSound	ProgSound	ProgOverlay	ExplosionMissile	SubMissile1	SubMissile2	SubMissile3	HitSubMissile1	HitSubMissile2	HitSubMissile3	HitSubMissile4	CltSubMissile1	CltSubMissile2	CltSubMissile3	CltHitSubMissile1	CltHitSubMissile2	CltHitSubMissile3	CltHitSubMissile4	EOL
markarrow	XXX	1		1	16																																																24	24			50				255	178	64	1	0	1	null	1024	8	16					3	1		1		1							1											1	1	1			1		1				4		8	1	128																																			32																						0
ravenarrow	XXX	1		1	19	1																																									dd12	convert to elemental%	0		100		24	24			50		2		255	178	64	1	0	1	FireArrow	1024	8	16					3	1		1		1							1											1	1	1			1		1				4		8	1	128																fire																			32			amazon_firearrow_1																			0
ravenbolt	XXX	1		1	19	1																																									dd12	convert to elemental%	0		100		24	24			50		2		255	255	255	1	0	1	SafeArrow	1024	1	16					3	1		1		1							1											1	1	1			1		1				4		8	1	128																ltng																			32			sorceress_nova																			0

User avatar
Nagahaku
Junior Member
Paladin
Posts: 120
Joined: Sat Nov 30, 2019 1:11 am

Re: The Guide to Almost All Missile Functions

Post by Nagahaku » Wed Jun 07, 2023 4:50 am

Cypress wrote:
Fri Apr 02, 2021 5:02 pm
[FingerMageSpider] Releases a single missile with controllable subloops{?}. Seems to lock on just like Guided Arrow.
(a,svdofunc=101,cltdofunc=57)
(clc1={subloops; not sure what this does})
Hi, i've just found something about this thing, its missile works totally differently comparing with guided arrow or bone spirit, with proper settings, it could somehow make up a better guided arrow.
in vanilla the missile has psrvdofunc=11 and pcltdofunc=15, its target locking behavior only depends on them, hit functions or skill.txt srv/cltdofunc are liberated, that's why it could apply states to the player and drain their mana...
but it requires more settings to lock targets better, or it may only tracing what you click at.

User avatar
Cypress
Moderator
Champion of the Light
Posts: 448
Joined: Fri Dec 01, 2017 2:08 am

Re: The Guide to Almost All Missile Functions

Post by Cypress » Fri Jun 09, 2023 7:51 pm

Really cool find Nagahaku! I've added the fingermagespider missiles.txt function to the list. I never knew fingermagespider was so special, I thought it was practically the same as guided arrow. But I believe it does require a skills.txt cltdofunc of 57 or 18, otherwise the missiles will disappear cltside and not appear to track (although srvside the missile still works properly if produced without skills.txt srvdofunc).

You can make it lock-on targets better with SearchEnemyXY and SearchEnemyNear.

But it does have some weird quirks:
It loses its target whenever you move.
It keeps tracking indefinitely, so with collidekill=0 and lastcollide=0 it can be a very murderous stacking missile.
Every missile produced by this function will be re-directed to the same target if within activation distance.
The missile is re-directed by any skill that selects a target.

User avatar
Nagahaku
Junior Member
Paladin
Posts: 120
Joined: Sat Nov 30, 2019 1:11 am

Re: The Guide to Almost All Missile Functions

Post by Nagahaku » Wed Jul 19, 2023 3:58 pm

Cypress wrote:
Sat Apr 15, 2023 2:47 pm
[fingermagespider] A missile that tracks a selected target. Will keep tracking the target endlessly if collidekill=0. If the user moves, the missile will lose track of its target, running off into its current direction. Note that ANY skill that selects a target will re-select the tracked target for ALL missiles with this function.
(pcltdofunc=15, psrvdofunc=11)
(param1/cltparam3=repath frame; how many frames must elapse for it to re-select the current target)
(param2/cltparam4=activation distance; the radius from the user in which the missiles can be given a new target, any missiles outside of this radius will keep repathing to their current target rather than the new target you selected)
(param3/cltparam5=delta; {???})
(cltparam1={probably subloops related})
(cltparam2={probably subloops related})
(skills.txt: needs to be created by cltmissilea, with cltdofunc=57 or cltdofunc=18, otherwise the cltside will bug out)
Hi, about fingermagespider, i think a found something useful within blizzard's mod document...
pcltdofunc=14, which is described as "fingermagespider2", it doesn't need any specific cltdofunc in skills.txt
i remade a new guided arrow with it, and it worked fine~
and this is what blizzard says in the document...

Code: Select all

14
 CltParam3

CltParam4

CltParam5
 FingerMageSpider2 - Shoot a missile that can be retargeted on a unit. The parameters control the retarget frequency, the retarget distance range, and the retarget position offset (minimum value equals 1), respectively.
  

User avatar
Cypress
Moderator
Champion of the Light
Posts: 448
Joined: Fri Dec 01, 2017 2:08 am

Re: The Guide to Almost All Missile Functions

Post by Cypress » Wed Jul 19, 2023 11:37 pm

Hi Nagahaku, that is so cool! It took me a few minutes to understand, but now I see that your fingermagespider only uses pcltdofunc and psrvdofunc, so all the skill funcs and the missile hitfuncs are free. I'll be sure to add that to the guide.

aasa0001
Posts: 15
Joined: Mon Aug 05, 2002 11:55 am

Re: The Guide to Almost All Missile Functions

Post by aasa0001 » Sat Apr 20, 2024 8:55 pm

For the three Inferno client funcs (Inferno/FetishInferno/Imp Inferno), it seems that only Imp Inferno produces 'dense' client missiles?
The other two produces 'sparse' client missiles that looks discontinuous (e.g. when using Imp Inferno's missiles).
====
And what is the damage frequency of FetishInferno/Imp Inferno?
FetishInferno's damage seems to be inconsistent from time to time.
====
I did some rough test with a druid to approach immobile fetish shaman AI.

FetishInferno seems to deal 1+ceil((firelength-9)/density) hits when density=2/3, and slightly more when density=1.
Immobile shaman can hit player reliably as long as player is near to shaman (if player is sort of away, hit count is inconsistent).

Imp Inferno is much more irregular on hit count. If target is too near or too far away, hit count can vary significantly and is inconsistent.
I got up to 107 hits when AnimExtender=100.
When both target and caster can move, hit count vary significantly and depends on some unobservable state (e.g. one previous cast hit very few, but a subsequent cast hit a lot more, although there was no visibile position or direction change).

User avatar
Cypress
Moderator
Champion of the Light
Posts: 448
Joined: Fri Dec 01, 2017 2:08 am

Re: The Guide to Almost All Missile Functions

Post by Cypress » Sat Apr 27, 2024 11:22 am

Hi aasa0001, thanks for testing! My previous formula was definitely wrong and has been revised. Now that I look into it more, it seems that the actual formula for number of missiles produced is:

2+(min(clc2,FramesPerDirection)-FrameData)/clc3

Where clc2 would be the fire length and clc3 would be the density
Where FramesPerDirection is the monster's specific animdata FramesPerDirection
Where FrameData is the monster's specific animdata activation frame Framedata###, so if the monster has an activation frame set on FrameData005 then in the formula FrameData=6 (offset by 1 because animdata counts frames starting from 0)

This formula is derived from testing data, in the format of ## Frames per Direction (TokenAnimation: FrameData), all using clc2=15:

Code: Select all


	17 FPD (FWSC: 011) 
1  →5 missiles
2-3→3 missiles
4+ →2 missiles

	25 FPD (FWA1: 009)
1  →7 missiles
2  →4 missiles
3-5→3 missiles
6+ →2 missiles

	12 FPD (DMS1: 008)
1  →5 missiles
2-3→3 missiles
4+ →2 missiles

	14 FPD (BBA2: 007)
1  →9 missiles
2  →5 missiles
3  →4 missiles
4-7→3 missiles
8+ →2 missiles

	12 FPD (BBA1: 006)
1  →10 missiles
2  →6 missiles
3-4→4 missiles
5-8→3 missiles
9+ →2 missiles

	10 FPD (BTA1: 005)
1  →11 missiles
2  →6 missiles
3  →5 missiles
4  →4 missiles
5-9→3 missiles
10 →2 missiles


For Imp Inferno, seems that:
•At least one missile is always released.
•Skill lvl increases a hidden factor, which makes the monster re-cast an Imp Inferno burst (so if length results in only 3 missiles released in a burst, then the monster will repeatedly cast 3 missiles, pause, cast 3 missiles, pause, etc, until the unknown factor duration runs out).
•The skill lvl also determines the monster's perceived missile range (cltside range, but not the srvside range), such that it will think the missile has a longer range if the skill has a higher lvl, and thus will try and engage a target at a farther distance.
•Each Imp Inferno cast releases a certain number of missiles per burst, with calc1 determining how long each burst is in frames.

Formula for missiles released might be: max(1,2+(clc1-FrameData)/2)

Where clc1 is the calc1 len value, determining length of casting
Where FrameData is the monster's specific animdata activation frame Framedata###, so if the monster has an activation frame set on FrameData005 then in the formula FrameData=6 (offset by 1 because animdata counts frames starting from 0)

Test data:

Code: Select all

	12 FPD (BBA1: 006)
6    → 1
7-9  → 2
10-12→ 3
13-15→ 4
16   → 5

Return to “General Mod Making”