I would make the following suggestions:
- don't use OBJ (OBJ is a global reference and some other script could clobber your reference or you could clobber theirs), use a REFn instead
- when you are checking a TAG in an IF statement, use IF (<TAG0.whatever>) instead of IF (0<TAG.Whatever>)
- instead of using ARGN to get passed-in arguments, use ARGV to see how many there are and ARGV[0] to get the first one and ARGV[1] to get the second one etc...
- I would avoid creating tags that are just numeric... (in your example you are using TAG.<eval <ARGN>> and stuff like that... if gets confusing. Instead use TAG.Skill_<dARGN>
- Since you don't use the LOCAL.tagcount inside the loops, this:
Code:
ON=@Equip
local.tagcount = <tagcount> -1
IF <dLOCAL.tagcount> >= 0
FOR 0 <local.tagcount>
...do stuff
ENDFOR
ENDIF
could be simplified to:
Code:
ON=@Equip
FOR 0 <eval <tagcount> -1>
...do stuff
ENDFOR
I think it would also greatly simplify the @unequip trigger to do that... At a glance I don't understand whats going on though.