[ITEMDEF i_enticement_armor_fix]
ID=i_memory
NAME=Enticement
TYPE=T_EQ_SCRIPT

ON=@Timer
CONT.MODAR += <dMORE1>
CONT.MODSTR += <TAG0.STRCHANGED>
CONT.MODDEX += <TAG0.DEXCHANGED>
CONT.MODINT += <TAG0.INTCHANGED>
CONT.MAXHITS += <TAG0.HITSCHANGED>
CONT.MAXMANA += <TAG0.MANACHANGED>
CONT.MAXSTAM += <TAG0.STAMCHANGED>
CONT.EFFECT 3,i_fx_sparkle,16,30
REMOVE
RETURN 1

[SKILL 15]
DEFNAME=Skill_Enticement
KEY=Enticement
TITLE=Bard
PROMPT_MSG=@,,2 500873
DELAY=2.0
STAT_DEX=125
STAT_INT=125
STAT_STR=125
BONUS_STR=0
BONUS_DEX=30
BONUS_INT=70
BONUS_STATS=0
GAINRADIUS=120.0 //30
ADV_RATE=5.0,15.0,30.0

ON=@Fail
SRC.MESSAGE @,,2 500883

ON=@Start
IF (<FINDTYPE.t_musical>)
	IF (!(<CTAG0.IJUSTENTICED>))
		IF (<ACT> != <UID>)
			IF ((!(<ACT.ISPLAYER>)) && (!(<ACT.ISVENDOR>)) && (<ACT.NPC> != BRAIN_HUMAN))
				IF (<ACT.TAG0.ENTICED>)
				SYSMESSAGE @,,2 500879
				ELSE
				LOCAL.ARMORMODIFIER=<EVAL (<Enticement>/65)>
					IF (<LOCAL.ARMORMODIFIER>)
						IF (<EVAL <ACT.AC>-<LOCAL.ARMORMODIFIER>> >= 1)
						LOCAL.REALDIFF=<EVAL (<ACT.BARDDIFF <UID>>-10)>
						FLOAT.CHANCE=<FLOATVAL (50+(2*((((<ENTICEMENT>/2)+(<MUSICIANSHIP>/2)+10))-<dLOCAL.REALDIFF>)))/100>
							IF (<FLOAT.CHANCE> < <FLOATVAL 0.01>)
							FLOAT.CHANCE=<FLOATVAL 0.01>
							ENDIF
							IF (<FLOAT.CHANCE> > <RANDOMDOUBLE>)
							ACT.MODAR -= <LOCAL.ARMORMODIFIER>
							LOCAL.STATMODIFIER=<EVAL (<Enticement>/45)>
								IF (<ACT.BARDDIFF> == 160)
								LOCAL.STATMODIFIER /= 2
								ENDIF
							SERV.NEWITEM i_enticement_armor_fix,1,<ACT.UID>
							NEW.MORE1=<LOCAL.ARMORMODIFIER>
								IF (<EVAL <ACT.OSTR>-((<ACT.OSTR>*<LOCAL.STATMODIFIER>)/100)> > 15)
								NEW.TAG.STRCHANGED=<EVAL (<ACT.OSTR>*<LOCAL.STATMODIFIER>)/100>
								ACT.MODSTR -= <NEW.TAG.STRCHANGED>
								ENDIF
								IF (<EVAL <ACT.ODEX>-((<ACT.ODEX>*<LOCAL.STATMODIFIER>)/100)> > 15)
								NEW.TAG.DEXCHANGED=<EVAL ((<ACT.ODEX>*<LOCAL.STATMODIFIER>)/100)>
								ACT.MODDEX -= <NEW.TAG.DEXCHANGED>
								ENDIF
								IF (<EVAL <ACT.OINT>-((<ACT.OINT>*<LOCAL.STATMODIFIER>)/100)> > 15)
								NEW.TAG.INTCHANGED=<EVAL (<ACT.OINT>*<LOCAL.STATMODIFIER>)/100>
								ACT.MODINT -= <NEW.TAG.INTCHANGED>
								ENDIF
								IF (<EVAL <ACT.MAXHITS>-((<ACT.MAXHITS>*<LOCAL.STATMODIFIER>)/100)> > 15)
								NEW.TAG.HITSCHANGED=<EVAL (<ACT.MAXHITS>*<LOCAL.STATMODIFIER>)/100>
								ACT.MAXHITS -= <NEW.TAG.HITSCHANGED>
								ENDIF
								IF (<EVAL <ACT.MAXMANA>-((<ACT.MAXMANA>*<LOCAL.STATMODIFIER>)/100)> > 15)
								NEW.TAG.MANACHANGED=<EVAL (<ACT.MAXMANA>*<LOCAL.STATMODIFIER>)/100>
								ACT.MAXMANA -= <NEW.TAG.MANACHANGED>
								ENDIF
								IF (<EVAL <ACT.MAXSTAM>-((<ACT.MAXSTAM>*<LOCAL.STATMODIFIER>)/100)> > 15)
								NEW.TAG.STAMCHANGED=<EVAL (<ACT.MAXSTAM>*<LOCAL.STATMODIFIER>)/100>
								ACT.MAXSTAM -= <NEW.TAG.STAMCHANGED>
								ENDIF
							NEW.TIMER=<EVAL <ENTICEMENT>/12>
							ACT.TIMERF <EVAL <ENTICEMENT>/12>,TAG.ENTICED=
							ACT.TAG.ENTICED=1
							SKILLGAIN Enticement <EVAL (<ENTICEMENT>/10)+1>
							CTAG.IJUSTENTICED=1
							TIMERF 5,CTAG.IJUSTENTICED
							SYSMESSAGE @,,2 1049539
							ACT.EFFECT 3,i_fx_sparkle,16,30
							ACT.SOUND 1420
							ELSE
							MESSAGE @,,2 501599
							SKILLGAIN Enticement <EVAL (<ENTICEMENT>/10)+1>
							ENDIF
						ELSE
						SYSMESSAGE @946,3,1 <ACT.NAME> is too weak to be enticed.
						ENDIF
					ENDIF
				ENDIF
			ELSE
			SYSMESSAGELOC -1,500879
			ENDIF
		ELSE
		SYSMESSAGELOC -1,500880
		ENDIF
	ELSE
	SYSMESSAGE @946,3,1 You must wait before enticing another creature!
	ENDIF
ELSE
SYSMESSAGE @946,3,1 You must have an instrument with you.
ENDIF
RETURN 1

[EOF]