[ITEMDEF i_potion_shrink]
ID=i_bottle_empty
NAME=Shrink Potion
VALUE=30000
TYPE=T_POTION
TDATA1=i_bottle_empty
RESOURCES=10 i_reag_batwing,1 i_scourge,i_bottle_EMPTY
SKILLMAKE=SKILL_ALCHEMY 100.0
WEIGHT=0.1

CATEGORY=Other
SUBSECTION=Potions
DESCRIPTION=Shrink Potion

ON=@Create
MORE2=100.0
COLOR=0498

ON=@DCLICK
IF (<SRC.RESTEST 1 i_potion_shrink>)
SRC.SYSMESSAGE @946,3,1 Target the animal to shrink.
TARGET
ELSE
SRC.SYSMESSAGE @946,3,1 The potion must be with you.
ENDIF
return 1

ON=@TARGON_ITEM 
SRC.MESSAGE @946,3,1 You can't shrink items. 
RETURN 1 

ON=@TARGON_CHAR
IF (<TOPOBJ.UID>==<SRC>)
IF (<SRC.TARG.BODY>==c_man) || (<SRC.TARG.BODY>==c_woman) || (<SRC.TARG.BODY>==c_elf_male) || (<SRC.TARG.BODY>==c_elf_female) || (<SRC.TARG.ISPLAYER>)
SRC.SYSMESSAGE You can't shrink a human being.
ELSEIF (<src.targ.flags>&statf_conjured)
src.sysmessage You can't shrink a summoned animal!
ELSEIF (<src.targ.flags>&statf_war)
src.sysmessage This animal is too wild to be shrinked!
ELSEIF (<SRC.TARG.ISMYPET>)
IF ((<SRC.TARG.ISEVENT.e_bonded>) && (<SRC.TARG.FLAGS>&STATF_DEAD))
SRC.SYSMESSAGE @946,3,1 This animal is currently bonded and can't be shrinked.
ELSE
SERV.NEWITEM=<SRC.TARG.ICON> 
NEW.NAME=<SRC.TARG.NAME> 
NEW.COLOR=<SRC.TARG.COLOR> 
NEW.TAG.ID=<SRC.TARG.BASEID>
IF (<SRC.TARG.ISEVENT.e_bonded>)
NEW.TAG.BONDED=1
NEW.TAG.BONDEDOWNER=<SRC.TARG.TAG0.DONO>
ELIF (<SRC.TARG.TAG0.BONDEDTIME>)
NEW.TAG.BONDEDTIME=<SRC.TARG.TAG0.BONDEDTIME>
SRC.TARG.TAG.BONDEDTIME
ENDIF
SRC.TARG.TIMERF CLEAR
NEW.TAG.CANTRAINSTRTO=<SRC.TARG.TAG.CANTRAINSTRTO>
NEW.TAG.STR=<SRC.TARG.STR>
NEW.TAG.DEX=<SRC.TARG.DEX>
NEW.TAG.INT=<SRC.TARG.INT>
NEW.TAG.FAME=<SRC.TARG.FAME>
NEW.TAG.KARMA=<SRC.TARG.KARMA>
NEW.TAG.NAMEHUE=<SRC.TARG.TAG.NAME.HUE>
NEW.TAG.HITS=<SRC.TARG.HITS>
NEW.TAG.MANA=<SRC.TARG.MANA>
NEW.TAG.STAM=<SRC.TARG.STAM>
NEW.TAG.MAXHITS=<SRC.TARG.MAXHITS>
NEW.TAG.MAXMANA=<SRC.TARG.MAXMANA>
NEW.TAG.MAXSTAM=<SRC.TARG.MAXSTAM>
NEW.TAG.MAGICRESIST=<SRC.TARG.MAGICRESISTANCE>
NEW.TAG.WRESTLING=<SRC.TARG.WRESTLING>
NEW.TAG.MAGERY=<SRC.TARG.MAGERY>
NEW.TAG.TACTICS=<SRC.TARG.TACTICS>
NEW.TAG.ANATOMY=<SRC.TARG.ANATOMY>
NEW.TAG.LEVEL=<SRC.TARG.LEVEL>
NEW.TAG.EXP=<SRC.TARG.EXP>
NEW.TAG.JADROPOUSTAT=<SRC.TARG.TAG.JADROPOUSTAT>
NEW.TYPE=t_shrink_fix
NEW.BOUNCE

SRC.TARG.REMOVE 
CONSUME 1
ENDIF
ELSE
SRC.MESSAGE This animal does not belong to you.
ENDIF
ELSE
SRC.SYSMESSAGE The potion must be with you.
ENDIF
RETURN 1

[TYPEDEF t_shrink_fix]
ON=@Dclick
IF (0<TOPOBJ.UID>!=<SRC>)
SRC.SYSMESSAGE The shrinked animal must be with you.
ELIF ((((<SERV.CHARDEF.<TAG.ID>.TAG0.FOLLOWERCONSUME>) && (<EVAL <SRC.CURFOLLOWER>+<SERV.CHARDEF.<TAG.ID>.TAG0.FOLLOWERCONSUME>> > 5))) || ((!(<SERV.CHARDEF.<TAG.ID>.TAG0.FOLLOWERCONSUME>)) && (<EVAL <SRC.CURFOLLOWER>+1> > 5)))
src.sysmessage @946,3,1 You must release some pets before unshrinking this one.
ELSE
SERV.NEWNPC=<TAG.ID>
NEW.FINDLAYER.21.REMOVE
NEW.P=<SRC.P>
NEW.COLOR=<COLOR>
NEW.STR=<TAG.STR>
NEW.DEX=<TAG.DEX>
NEW.INT=<TAG.INT>
NEW.FAME=<TAG.FAME>
NEW.KARMA=<TAG.KARMA>
NEW.NAME=<NAME>
NEW.MAGICRESISTANCE=<TAG.MAGICRESIST>
NEW.WRESTLING=<TAG.WRESTLING>
NEW.MAGERY=<TAG.MAGERY>
IF (<TAG0.BONDED>)
NEW.EVENTS +e_bonded
NEW.TAG.DONO=<TAG0.BONDEDOWNER>
ELIF (<TAG0.BONDEDTIME>)
NEW.TAG0.BONDEDTIME=<TAG0.BONDEDTIME>
REF323=<NEW> //pet
SERV.NEWITEM=i_bonded_check
NEW.TIMERF 1,CONT=<REF323.UID>
NEW.TIMER=<EVAL 60*60*<DEF.TAMING_BONDED_CHECK_TIMER>>
NEW=<REF323>
ENDIF
NEW.TACTICS=<TAG.TACTICS>
NEW.ANATOMY=<TAG.ANATOMY>
NEW.MAXHITS=<TAG.MAXHITS>
NEW.MAXMANA=<TAG.MAXMANA>
NEW.MAXSTAM=<TAG.MAXSTAM>
NEW.HITS=<TAG.HITS>
NEW.MANA=<TAG.MANA>
NEW.STAM=<TAG.STAM>
NEW.LEVEL=<TAG.LEVEL>
NEW.EXP=<TAG.EXP>
NEW.TAG.CANTRAINSTRTO=<TAG.CANTRAINSTRTO>
NEW.TAG.NAME.HUE=<TAG.NAMEHUE>
NEW.TAG.JADROPOUSTAT=<TAG.JADROPOUSTAT>
SRC.TAME <NEW>
IF (!(<NEW.TAG0.JADROPOUSTAT>))
NEW.TAG.JADROPOUSTAT=
ENDIF
REMOVE
ENDIF
RETURN 1

ON=@ClientToolTip
SRC.ADDCLILOC 1060658,Original Animal,<SERV.CHARDEF.<TAG0.ID>.NAME>

[FUNCTION SHRINK2]
SERV.NEWITEM=<ICON> 
NEW.NAME=<NAME> 
NEW.COLOR=<COLOR> 
NEW.TAG.ID=<BASEID>
NEW.TAG.STR=<STR>
NEW.TAG.DEX=<DEX>
NEW.TAG.INT=<INT>
NEW.TAG.FAME=<FAME>
NEW.TAG.KARMA=<KARMA>
NEW.TAG.NAMEHUE=<TAG.NAME.HUE>
NEW.TAG.HITS=<HITS>
NEW.TAG.MANA=<MANA>
NEW.TAG.STAM=<STAM>
NEW.TAG.CANTRAINSTRTO=<TAG.CANTRAINSTRTO>
NEW.TAG.MAXHITS=<MAXHITS>
NEW.TAG.MAXMANA=<MAXMANA>
NEW.TAG.MAXSTAM=<MAXSTAM>
IF (<ISEVENT.e_bonded>)
NEW.TAG.BONDED=1
NEW.TAG.BONDEDOWNER=<TAG0.DONO>
ELIF (<TAG0.BONDEDTIME>)
NEW.TAG.BONDEDTIME=<TAG0.BONDEDTIME>
TAG.BONDEDTIME
ENDIF
TIMERF CLEAR
NEW.TAG.MAGICRESIST=<MAGICRESISTANCE>
NEW.TAG.WRESTLING=<WRESTLING>
NEW.TAG.MAGERY=<MAGERY>
NEW.TAG.TACTICS=<TACTICS>
NEW.TAG.ANATOMY=<ANATOMY>
NEW.TAG.LEVEL=<LEVEL>
NEW.TAG.EXP=<EXP>
NEW.TAG.JADROPOUSTAT=<TAG0.JADROPOUSTAT>
NEW.TYPE=t_shrink_fix

VAR.SHRINK=<NEW>
REMOVE

[function dismount]
IF (<findlayer.25>)
obj=<findlayer.25.more2>
obj.p=<p>
OBJ.SHRINK2
findlayer.25.remove
flags &= ~080000000
BOUNCE <var0.SHRINK>
IF (0<ARGN2>==1)
TAG.EVENT.MOUNT=<var0.SHRINK>
ENDIF
IF (0<ARGN1>==1)
TRY UID.<var0.SHRINK>.CONT=<FINDLAYER.29>
BANKSELF
TRY UID.<var0.SHRINK>.UPDATE
FINDLAYER.29.UPDATEX
ENDIF
findlayer.21.updatex
updatex
VAR.SHRINK
ENDIF

[EOF]