[EVENTS e_paragon]
ON=@Death
FOR <R2,3>
RANDMAGICITEM
ENDFOR
IF (<ATTACKER>)
	FOR 0 <EVAL <ATTACKER>-1>
		IF (<ATTACKER.<dLOCAL._FOR>.DAM>)
		REF1=<ATTACKER.<dLOCAL._FOR>>
			IF (<REF1.FLAGS>&STATF_PET)
			REF1=<REF1.OWNER>
			ENDIF
			IF (<REF1.ISPLAYER>)
			FLOAT.POINTSMODIFIER=<FLOATVAL (<ATTACKER.<dLOCAL._FOR>.DAM>/<MAXHITS>)>
				IF (<FLOAT.POINTSMODIFIER> > 1.000000)
				FLOAT.POINTSMODIFIER=<FLOATVAL 1>
				ENDIF
			FLOAT.POINTSMODIFIER=<FLOATVAL (0.1+<FLOAT.POINTSMODIFIER>+(<FAME>/10000))>
			FLOAT.POINTSMODIFIER=<FLOATVAL (<FLOAT.POINTSMODIFIER>+(<REF1.LUCK>/3000))>
			FLOAT.POINTS=<FLOATVAL 0.07*<FLOAT.POINTSMODIFIER>>
			REF1.TAG0.PARAGONPOINTS=<FLOATVAL <REF1.TAG0.PARAGONPOINTS>+<FLOAT.POINTS>>
			FLOAT.DROPCHANCE=<FLOATVAL (<REF1.TAG0.PARAGONPOINTS>/100)>
				IF ((<FLOAT.DROPCHANCE> > <RANDOMDOUBLE>) && (!(<LOCAL.GAVEARTY>)))
				LOCAL.OLDNEW=<NEW>
				SERV.NEWITEM <HVAL <DEF.MINORARTIS>>
				REF1.BOUNCE <NEW>
				REF1.SYSMESSAGELOC -1,1062317
				REF1.TAG.PARAGONPOINTS=
				LOCAL.GAVEARTY=1
				NEW=<LOCAL.OLDNEW>
				ENDIF
			ENDIF
		ENDIF
	ENDFOR
ENDIF
IF (<FLOATVAL 0.1> > <RANDOMDOUBLE>)
RANDMAGICITEMGREAT
ENDIF
NEWGOLD=<EVAL <RESCOUNT I_GOLD>*3>

[FUNCTION F_CREATE_PARAGON]
IF (((<FLAGS>&statf_spawned) && (!(<ISEVENT.e_paragon>))) || (<ARGN1>))
	IF ((!(<TAG0.IAMACHAMPION>)) && (!(<ISEVENT.e_exodusdung_monster>)) && (!(<FLAGS>&STATF_PET)) && (!(<ISVENDOR>)))
		IF (<MAXHITS> > 10)
			IF (<FLOATVAL 0.05> > <RANDOMDOUBLE>)
			SERV.LOG <NAME> (<UID>) spawned as paragon on <REGION.NAME> (<P>)
			COLOR=0501
			NAME=<NAME> (Paragon)
			TAMING=0
			OSTR += <EVAL ((<OSTR>*10)/100)>
			ODEX += <EVAL ((<ODEX>*20)/100)>
			OINT += <EVAL ((<OINT>*20)/100)>
			MAXHITS *= 5
			HITS=<MAXHITS>
			STAM=<MAXSTAM>
			MANA=<MAXMANA>
			KARMA += <EVAL ((<KARMA>*40)/100)>
			FAME += <EVAL ((<FAME>*40)/100)>
			TAG.OVERRIDE.MOVERATE=<EVAL <MOVERATE>-((40*<MOVERATE>)/100)>
				IF (<TAG0.OVERRIDE.MOVERATE> < 20)
				TAG.OVERRIDE.MOVERATE=20
				ENDIF
				FOR 0 54
					IF (<I.<SERV.SKILL.<dLOCAL._FOR>.KEY>>)
					TRY I.<SERV.SKILL.<dLOCAL._FOR>.KEY>=<EVAL ((<I.<SERV.SKILL.<dLOCAL._FOR>.KEY>>*120)/100)>
					ENDIF
				ENDFOR
			NPC=brain_monster
			TAG.OVERRIDE.REGENVAL_0=10
			TAG.OVERRIDE.REGENVAL_2=10
			EVENTS +e_paragon
			TAG0.TREASUREMAP.LEVEL ++
			ENDIF
		ENDIF
	ENDIF
ENDIF

[EOF]