[DEFNAME SummonFamiliarStuff]
c_horde_minion c_night_imp
Familiar_TotalFamiliars 5
Familiar_1 c_horde_minion
Familiar_2 c_Shadow_Wisp
Familiar_3 c_Dark_Wolf
Familiar_4 c_Death_Adder
Familiar_5 c_Vampire_Bat

Familiar_1_LabelName 1060146
Familiar_2_LabelName 1060142
Familiar_3_LabelName 1060143
Familiar_4_LabelName 1060145
Familiar_5_LabelName 1060144

Familiar_1_SkillReq 30.0
Familiar_2_SkillReq 50.0
Familiar_3_SkillReq 60.0
Familiar_4_SkillReq 80.0
Familiar_5_SkillReq 100.0

[CHARDEF c_dark_wolf]
ID=c_wolf
NAME=Dark Wolf
DAM=11,17
ARMOR=20
CAN=MT_WALK
MOVERATE=30

ON=@Create
STR=120
MAXHITS=200
DEX=86
INT=40
WRESTLING=73.0
TACTICS=50.9
COLOR=0497

[CHARDEF c_death_adder]
ID=c_snake_giant
NAME=Death Adder
CAN=MT_WALK
MOVERATE=40

ON=@Create
STR=120
MAXHITS=200
DEX=86
INT=40
WRESTLING=73.0
TACTICS=60.9
ANATOMY=40.0
COLOR=0497

[Spell 112]
DEFNAME=s_Summon_Familiar
NAME=Summon Familiar
SOUND=
RUNES=
CAST_TIME=2.0
RESOURCES=1 i_reag_batwing,1 i_reag_grave_dust,1 i_reag_daemon_blood
RUNE_ITEM=0
SCROLL_ITEM=0
FLAGS=spellflag_playeronly
EFFECT_ID=
EFFECT=
DURATION=0.0
MANAUSE=17
SKILLREQ=SKILL_NECROMANCY 30.0
INTERRUPT=0.0,0.0

ON=@Start
IF (<ISPLAYER>)
SAY @,3,1 Kal Xen Bal
ENDIF

ON=@Effect
IF (<dLIST.Familiar_<UID>.COUNT>)
REF1=<LIST.Familiar_<UID>.0>
REF1.P=<P>
REF1.HITS=0
SYSMESSAGELOC -1,1061605 // You already have a familiar.
ENDIF
DIALOG d_Summon_Familiar

[DIALOG d_Summon_Familiar]
200,100
src.closealldialogs

PAGE 0

resizepic 10 10 9270 250 178
checkertrans 20 20 230 158

gumppic 220 20 10464
gumppic 220 72 10464
gumppic 220 124 10464

tilepic 188 16 6883
tilepic 198 168 6881
tilepic 8 15 6882
tilepic 2 168 6880

xmfhtmlgumpcolor 30 26 200 20 1060147 0 0 3872

LOCAL.Necro=<SRC.Necromancy>
LOCAL.Spirit=<SRC.SpiritSpeak>

FOR <DEF.Familiar_TotalFamiliars>
LOCAL.Enabled=0
	IF ((<LOCAL.Necro> >= <DEF.Familiar_<dLOCAL._FOR>_SkillReq>) && (<LOCAL.Spirit> >= <DEF.Familiar_<dLOCAL._FOR>_SkillReq>))
	LOCAL.Enabled=1
	ENDIF
button 27 <EVAL 53+((<LOCAL._FOR>-1)*21)> 9702 9703 1 0 <dLOCAL._FOR>
xmfhtmlgumpcolor 50 <EVAL 51+((<LOCAL._FOR>-1)*21)> 150 20 <EVAL <DEF.Familiar_<dLOCAL._FOR>_LabelName>> 0 0 <QVAL <LOCAL.Enabled> ? 3872:9770>
ENDFOR

[DIALOG d_Summon_Familiar BUTTON]
ON=0
SRC.SYSMESSAGELOC -1,1061825 //You decide not to summon a familiar.

ON=1 5
IF ((<SpiritSpeak> < <DEF.Familiar_<ARGN1>_SkillReq>) || (<Necromancy> < <DEF.Familiar_<ARGN1>_SkillReq>))
SYSMESSAGELOC -1,1061606,<EVAL <dDEF.Familiar_<ARGN1>_SkillReq>/10>,<EVAL <dDEF.Familiar_<ARGN1>_SkillReq>/10>
DIALOG d_Summon_Familiar
ELIF (<dLIST.Familiar_<UID>.COUNT> >= 1)
SYSMESSAGELOC -1,1061605 //You already have a familiar.
ELIF (<EVAL <CURFOLLOWER>+1> > <MAXFOLLOWER>)
SYSMESSAGELOC -1,1049645
ELSE
EFFECT=3,03728,1,20,5,67,9910
SOUND=<SERV.CHARDEF.<DEF.Familiar_<ARGN1>>.SOUND>
LOCAL.OLDNEW=<NEW>
SERV.NEWNPC <DEF.Familiar_<ARGN1>>
TAME <NEW>
NEW.TAMING=1.0
NEW.TAG.NoControl=1
NEW.TAG.Caster=<UID>
NEW.EVENTS +e_Familiar
LIST.Familiar_<UID>.ADD <NEW>
NEW.FINDLAYER.21.EMPTY
NEW=<LOCAL.OLDNEW>
ENDIF

[EVENTS e_Familiar]
ON=@Destroy
LIST.Familiar_<TAG0.Caster>.0.REMOVE
IF (!(<dLIST.Familiar_<TAG0.Caster>.COUNT>))
LIST.Familiar_<TAG0.Caster>.CLEAR
ENDIF

ON=@NpcActFollow
IF (<BASEID> == c_Shadow_Wisp)
REF1=<UID>
	IF (<TAG0.NextFlare> <= <SERV.TIME>)
	TAG.NextFlare=<EVAL <SERV.TIME>+50>
		FORCHARS 6
			IF (((<ISBENEFICIAL <TAG0.Caster>>) && (<UID> != <REF1>)) && (<KARMA> < 0))
			LOCAL.Karma=<EVAL <KARMA>*(-1)>
			MANA += <EVAL 1+(<LOCAL.Karma>/3000)>
				IF (<MANA> > <MAXMANA>)
				MANA=<MAXMANA>
				ENDIF
			EFFECT 3,03728,1,20,5,67,9910
			ENDIF
		ENDFOR
	ENDIF
ELIF (<BASEID> == <DEF.c_Horde_Minion>)
REF1=<UID>
REF2=<TAG0.EyeFixed>
	IF (!(<REF1.CanSeeLos <TAG0.EyeFixed>>))
		FORITEMS 10
			IF (<REF1.CanSeeLos <UID>>) && (!(<ATTR>&Attr_Move_Never)) && (!(<ATTR>&Attr_Static)) && (!(<ATTR>&Attr_Newbie)) && (!(<ATTR>&Attr_Blessed)) && (!(<ATTR>&Attr_Invis)) && (<TYPE> != T_Telepad)
			REF1.TAG.EyeFixed=<UID>
			REF1.GoTo <P>
			RETURN 1
			ENDIF
		ENDFOR
	ELIF ((<REF1.CanSeeLos <TAG0.EyeFixed>>) && (<REF1.Distance <TAG0.EyeFixed>> > 2))
	REF1.GoTo <REF2.P>
	RETURN 1
	ELIF ((<REF1.CanSeeLos <TAG0.EyeFixed>>) && (<REF2.Type> != T_CORPSE))
	REF1.Bounce <REF2>
	REF1.TAG.EyeFixed=
	RETURN 1
	ELIF ((<REF1.CanSeeLos <TAG0.EyeFixed>>) && (<REF2.Type> == T_CORPSE) && (<REF2.COUNT>))
	REF1.BOUNCE <REF2.FindCont.0.UID>
	REF1.TAG.EyeFixed=
	RETURN 1
	ELSE
	REF1.TAG.EyeFixed=
	RETURN 1
	ENDIF
ELIF (<BASEID> == c_Dark_Wolf)
	IF (<TAG0.NextFlare> <= <SERV.TIME>)
	TAG.NextFlare=<EVAL <SERV.TIME>+20>
	REF2=<TAG0.Caster>
	REF2.STAM += 2
		IF (<REF2.STAM> > <REF2.MAXSTAM>)
		REF2.STAM=<REF2.MAXSTAM>
		ENDIF
	ENDIF
ELIF (<BASEID> == c_death_adder)
REF1=<UID>
REF2=<TAG0.Caster>
	IF (<TAG0.NextFlare> <= <SERV.TIME>)
	TAG.NextFlare=<EVAL <SERV.TIME>+10>
		FORCHARS 8
			IF ((STRMATCH(*<BASEID>*,<DEF.SNAKE_SLAYER>)) && (<UID> != <REF1>) && (!(<ISBENEFICIAL <REF2>>)) && (<REF2.MemoryFindType.Memory_war_targ.LINK>))
			ATTACK <REF2.MemoryFindType.Memory_war_targ.LINK>
			ENDIF
		ENDFOR
	ENDIF
ENDIF

ON=@ContextMenuRequest
IF ((<BASEID> == c_Horde_Minion) && (<TAG0.Caster> == <SRC>))
SRC.AddContextEntry 301,6145
ENDIF
RETURN 1

ON=@ContextMenuSelect
IF (<ARGN> == 301) && (<TAG0.Caster> == <SRC>)
FINDLAYER.21.OPEN
ENDIF

ON=@Hit
IF (<BASEID> == c_vampire_bat)
REF1=<TAG0.Caster>
LOCAL.DAM=<EVAL <ARGN1>-((<ARGN1>*<SRC.AC>)/100)>
REF1.HITS += <LOCAL.DAM>
	IF (<REF1.HITS> > <REF1.MAXHITS>)
	REF1.HITS=<REF1.MAXHITS>
	ENDIF
ENDIF

ON=@Attack
IF ((<BASEID> == c_shadow_wisp) || (<BASEID> == c_dark_wolf))
RETURN 1
ENDIF

ON=@NPCActFight
IF ((<BASEID> == c_shadow_wisp) || (<BASEID> == c_dark_wolf))
RETURN 1
ENDIF

[EOF]