[FUNCTION RANDLOCATION]
IF (<VAR0.RANDLOCATION.TRIES> > 250) && (<ISITEM>)
REMOVE
RETURN 1
ENDIF
DORAND 7
P=<eval {112 2800}>,<eval {232 3992}>
P=<eval {112 2800}>,<eval {232 3992}>
P=<eval {288 1734}>,<eval {548 1290}>,0,2
P=<eval {878 2335}>,<eval {318 1704}>,0,3
P=<eval {112 2800}>,<eval {232 3992}>
P=<eval {1824 3504}>,<eval {0 1500}>
P=<eval {112 2800}>,<eval {232 3992}>
ENDDO
LOCAL.TMP2=<NEW>
LOCAL.TMP=<OBJ>
SERV.NEWNPC C_ZOMBIE
NEW.REMOVEFROMVIEW
NEW.FLAGS |= STATF_INVISIBLE
NEW.P=<P>
NEW.FIX
OBJ=<region.uid>
IF (<obj.isamulti>)
NEW.REMOVE
NEW=<LOCAL.TMP2>
OBJ=<LOCAL.TMP>
VAR0.RANDLOCATION.TRIES ++
RANDLOCATION
RETURN 1
ELIF (<region.flags>&region_flag_guarded) || (<region.flags>&region_flag_safe) || (<NEW.ISSTUCK>)
NEW.REMOVE
NEW=<LOCAL.TMP2>
OBJ=<LOCAL.TMP>
VAR0.RANDLOCATION.TRIES ++
RANDLOCATION
RETURN 1
ENDIF
FIX
VAR.RANDLOCATION.TRIES=
NEW.REMOVE
NEW=<LOCAL.TMP2>
OBJ=<LOCAL.TMP>

////////////////////

[function f_lootback]
FORCONT <uid> 0
	IF (<TYPE> != T_HAIR)
		IF (!(<TAG0.THIS.WASEQUIPPED>))
		BOUNCE
		ELSEIF (<SRC.STR> >= <REQSTR>) && (<TAG0.THIS.WASEQUIPPED>)
		TAG.THIS.WASEQUIPPED=
		EQUIP
		ELSEIF (<SRC.STR> < <REQSTR>) && (<TAG0.THIS.WASEQUIPPED>)
		TAG.THIS.WASEQUIPPED=
		BOUNCE
		ENDIF
	ENDIF
ENDFOR

////////////////////////

[FUNCTION RANDMAGICITEM]
LOCAL.FIRSTNEW=<NEW>
DORAND 11
SERV.NEWITEM {i_lute 1 i_lyre 1 i_tambourine 1 i_drum 1}
SERV.NEWITEM {i_elven_composite_longbow 1 i_magical_shortbow 1 i_Elven_Spellblade 1 i_sword_Assassin_Spike 1 i_sword_leafblade 1 i_sword_warcleaver 1 i_elven_Machete 1 i_Ornate_Axe 1 i_Radiant_Scimitar 1 i_Rune_Blade 1 i_mace_diamondmace 1 i_mace_Wildstaff 1}
SERV.NEWITEM {i_double_blade 1 i_lance 1 i_scyth 1 i_bone_harvester 1 i_scepter 1 i_bladed_staff 1 i_pike 1 i_double_bladed_staff 1 i_nodachi 1 i_daicho 1 i_sai 1 i_tekagi 1 i_horseman_bow 1 i_composite_bow 1 i_yumi 1 i_bokuto 1}
SERV.NEWITEM RANDOM_WEAPON
SERV.NEWITEM {i_ring_gold 1 i_bracelet_gold 1}
SERV.NEWITEM RANDOM_ARMOR
SERV.NEWITEM {i_elven_composite_longbow 1 i_magical_shortbow 1 i_Elven_Spellblade 1 i_sword_Assassin_Spike 1 i_sword_leafblade 1 i_sword_warcleaver 1 i_elven_Machete 1 i_Ornate_Axe 1 i_Radiant_Scimitar 1 i_Rune_Blade 1 i_mace_diamondmace 1 i_mace_Wildstaff 1}
SERV.NEWITEM {i_double_blade 1 i_lance 1 i_scyth 1 i_bone_harvester 1 i_scepter 1 i_bladed_staff 1 i_pike 1 i_double_bladed_staff 1 i_nodachi 1 i_daicho 1 i_sai 1 i_tekagi 1 i_horseman_bow 1 i_composite_bow 1 i_yumi 1 i_bokuto 1}
SERV.NEWITEM RANDOM_WEAPON
SERV.NEWITEM {i_ring_gold 1 i_bracelet_gold 1}
SERV.NEWITEM RANDOM_ARMOR
ENDDO
LOCAL.NEW=<NEW>
IF (<NEW.TYPE> == T_CONTAINER)
NEW=<NEW.FINDCONT.0.UID>
ENDIF
NEW.GIVEITEMEVENT T_PROPRIEDADES
IF (<NEW.ISWEAPON>)
	IF !(<R15>)
	NEW.SETSLAYER
	ENDIF
	IF !(<R3>)
	NEW.TAG.DAMINCREASE=<R5,25>
	ENDIF
	IF !(<R3>)
	NEW.TAG.SWINGINCREASE=<R5,20>
	ENDIF
	IF !(<R4>)
	NEW.TAG.HITCHANCEINCREASE=<R3,8>
	ENDIF
	IF !(<R10>)
	NEW.TAG.USEBESTWEAPONSKILL=1
	ENDIF
	IF !(<R5>)
	NEW.TAG.LIFELEECH=<R10,25>
	ENDIF
	IF !(<R4>)
	NEW.TAG.STAMLEECH=<R5,25>
	ENDIF
	IF !(<R6>)
	NEW.TAG.MANALEECH=<R5,25>
	ENDIF
	IF (!(<R6>))
		DORAND 5
		NEW.TAG.HITDISPEL=<R10,35>
		NEW.TAG.HITFIREBALL=<R10,35>
		NEW.TAG.HITHARM=<R10,35>
		NEW.TAG.HITLIGHTNING=<R10,35>
		NEW.TAG.MAGICARROW=<R10,35>
		ENDDO
	ENDIF
	IF (<R10> == 1)
	NEW.TAG.SPELLCHANNELING=1
	ENDIF
	IF (<NEW.TYPE>==T_WEAPON_BOW) || (<NEW.TYPE>==T_WEAPON_XBOW)
		IF !(<R6>)
		NEW.TAG.BALANCED=1
		ENDIF
	ENDIF
ELIF (<NEW.TYPE>==t_shield)
NEW.TAG.HITCHANCEDECREASE=<R3,10>
	IF (<R20> == 1)
	NEW.TAG.SPELLCHANNELING=1
	ENDIF
ELIF (<NEW.TYPE> == T_MUSICAL)
NEW.SETSLAYER
ELIF (<NEW.TYPE>==t_jewelry)
	DORAND 4
	NEW.TAG.ENCHANCEPOTIONS=<R1,20>
	NEW.TAG.GOLDINCREASE=<R1,12>
	NEW.TAG.HITCHANCEDECREASE=<R1,8>
	NEW.TAG.FASTERCASTRECOVERY=<R1,3>
	ENDDO
	IF (<R10> == 1)
	NEW.GIVEITEMEVENT T_PROPRIEDADES
	NEW.TAG0.LOWERREAGENTCOST=<R5,15>
	ENDIF
	IF (!(<R5>))
	NEW.GIVEITEMEVENT T_PROPRIEDADES
	NEW.TAG.MAGICDAMINCREASE=<R3,10>
	ENDIF
	IF (!(<R5>))
	NEW.GIVEITEMEVENT T_PROPRIEDADES
	NEW.TAG.DAMINCREASE=<R3,10>
	ENDIF
	IF (!(<R4>))
	NEW.GIVEITEMEVENT T_PROPRIEDADES
	NEW.TAG.LOWERMANACOST=<R1,6>
	ENDIF
	IF (!(<R7>))
	NEW.GIVEITEMEVENT T_PROPRIEDADES
	NEW.TAG.FASTERCASTING=<R1,2>
	ENDIF
	IF (!(<R5>))
	NEW.GIVEITEMEVENT t_status_bonus
		DORAND 3
		NEW.TAG.MANAINCREASE=<R3,8>
		NEW.TAG.HITSINCREASE=<R3,8>
		NEW.TAG.STAMINCREASE=<R3,8>
		ENDDO
	ENDIF
	IF (!(<R4>))
	NEW.GIVEITEMEVENT t_status_bonus
		DORAND 3
		NEW.TAG.MANAREGENERATION=<R1,2>
		NEW.TAG.HITSREGENERATION=<R1,2>
		NEW.TAG.STAMREGENERATION=<R1,3>
		ENDDO
	ENDIF
	IF (!(<R5>))
	NEW.GIVEITEMEVENT t_status_bonus
		DORAND 25
		NEW.TAG.SKILLINCREASE=Swordsmanship
		NEW.TAG.SKILLINCREASE=Anatomy
		NEW.TAG.SKILLINCREASE=Lumberjacking
		NEW.TAG.SKILLINCREASE=SpiritSpeak
		NEW.TAG.SKILLINCREASE=Fencing
		NEW.TAG.SKILLINCREASE=Macefighting
		NEW.TAG.SKILLINCREASE=Meditation
		NEW.TAG.SKILLINCREASE=Focus
		NEW.TAG.SKILLINCREASE=Magery
		NEW.TAG.SKILLINCREASE=Magicresistance
		NEW.TAG.SKILLINCREASE=Evaluatingintel
		NEW.TAG.SKILLINCREASE=Healing
		NEW.TAG.SKILLINCREASE=Veterinary
		NEW.TAG.SKILLINCREASE=Stealing
		NEW.TAG.SKILLINCREASE=Musicianship
		NEW.TAG.SKILLINCREASE=Peacemaking
		NEW.TAG.SKILLINCREASE=Provocation
		NEW.TAG.SKILLINCREASE=Enticement
		NEW.TAG.SKILLINCREASE=AnimalLore
		NEW.TAG.SKILLINCREASE=Parrying
		NEW.TAG.SKILLINCREASE=Bushido
		NEW.TAG.SKILLINCREASE=Wrestling
		NEW.TAG.SKILLINCREASE=Tactics
		NEW.TAG.SKILLINCREASE=Archery
		NEW.TAG.SKILLINCREASE=Taming
		ENDDO
	NEW.TAG.SKILLINCREASEVALUE=<HVAL {10 1 20 1 30 1 40 1 50 1 60 1 70 1 80 1}>
	ENDIF
ENDIF
IF (<NEW.TYPE> != T_MUSICAL) && (!(<NEW.ISWEAPON>))
	IF (20 >= <R1,100>)
	NEW.EVENTS +T_LUCK_ITEM
	NEW.TAG.LUCK=<R1,55>
	ENDIF
ENDIF
NEW=<LOCAL.NEW>
IF !(<ISITEM>)
BOUNCE <NEW>
ELSE
NEW.CONT=<UID>
ENDIF
NEW=<LOCAL.FIRSTNEW>

//////////////////////////

[FUNCTION guildlogo]
IF (STRMATCH(<ASC http:>*,<ASC <ARGS>>))
SRC.SYSMESSAGE Sem http://
ELSE
OBJ=<GUILD>
IF (<OBJ.BASEID>==I_GUILDSTONE)
IF (<OBJ.MASTERUID>==<SRC>)
OBJ.TAG.LOGO=<ARGS>
ENDIF
ENDIF
ENDIF

[FUNCTION GUILDIMG]
IF (<ISEMPTY <TAG.LOGO>>)
RETURN img263.echo.cx/img263/6233/guildsemlogo1ek.jpg
ELSE
RETURN <TAG0.LOGO>
ENDIF

///////////////////////////

[FUNCTION RANDMAGICITEMGREAT]
LOCAL.FIRSTNEW=<NEW>
DORAND 14
SERV.NEWITEM {i_double_blade 1 i_lance 1 i_scyth 1 i_bone_harvester 1 i_scepter 1 i_bladed_staff 1 i_pike 1 i_double_bladed_staff 1 i_nodachi 1 i_daicho 1 i_sai 1 i_tekagi 1 i_horseman_bow 1 i_composite_bow 1 i_yumi 1 i_bokuto 1}
SERV.NEWITEM {i_elven_composite_longbow 1 i_magical_shortbow 1 i_Elven_Spellblade 1 i_sword_Assassin_Spike 1 i_sword_leafblade 1 i_sword_warcleaver 1 i_elven_Machete 1 i_Ornate_Axe 1 i_Radiant_Scimitar 1 i_Rune_Blade 1 i_mace_diamondmace 1 i_mace_Wildstaff 1}
SERV.NEWITEM RANDOM_WEAPON
SERV.NEWITEM {i_double_blade 1 i_lance 1 i_scyth 1 i_bone_harvester 1 i_scepter 1 i_bladed_staff 1 i_pike 1 i_double_bladed_staff 1 i_nodachi 1 i_daicho 1 i_sai 1 i_tekagi 1 i_horseman_bow 1 i_composite_bow 1 i_yumi 1 i_bokuto 1}
SERV.NEWITEM RANDOM_WEAPON
SERV.NEWITEM {i_elven_composite_longbow 1 i_magical_shortbow 1 i_Elven_Spellblade 1 i_sword_Assassin_Spike 1 i_sword_leafblade 1 i_sword_warcleaver 1 i_elven_Machete 1 i_Ornate_Axe 1 i_Radiant_Scimitar 1 i_Rune_Blade 1 i_mace_diamondmace 1 i_mace_Wildstaff 1}
SERV.NEWITEM RANDOM_WEAPON
SERV.NEWITEM {i_double_blade 1 i_lance 1 i_scyth 1 i_bone_harvester 1 i_scepter 1 i_bladed_staff 1 i_pike 1 i_double_bladed_staff 1 i_nodachi 1 i_daicho 1 i_sai 1 i_tekagi 1 i_horseman_bow 1 i_composite_bow 1 i_yumi 1 i_bokuto 1}
SERV.NEWITEM {i_elven_composite_longbow 1 i_magical_shortbow 1 i_Elven_Spellblade 1 i_sword_Assassin_Spike 1 i_sword_leafblade 1 i_sword_warcleaver 1 i_elven_Machete 1 i_Ornate_Axe 1 i_Radiant_Scimitar 1 i_Rune_Blade 1 i_mace_diamondmace 1 i_mace_Wildstaff 1}
SERV.NEWITEM RANDOM_WEAPON
SERV.NEWITEM {i_elven_composite_longbow 1 i_magical_shortbow 1 i_Elven_Spellblade 1 i_sword_Assassin_Spike 1 i_sword_leafblade 1 i_sword_warcleaver 1 i_elven_Machete 1 i_Ornate_Axe 1 i_Radiant_Scimitar 1 i_Rune_Blade 1 i_mace_diamondmace 1 i_mace_Wildstaff 1}
SERV.NEWITEM {i_double_blade 1 i_lance 1 i_scyth 1 i_bone_harvester 1 i_scepter 1 i_bladed_staff 1 i_pike 1 i_double_bladed_staff 1 i_nodachi 1 i_daicho 1 i_sai 1 i_tekagi 1 i_horseman_bow 1 i_composite_bow 1 i_yumi 1 i_bokuto 1}
SERV.NEWITEM RANDOM_WEAPON
SERV.NEWITEM {i_double_blade 1 i_lance 1 i_scyth 1 i_bone_harvester 1 i_scepter 1 i_bladed_staff 1 i_pike 1 i_double_bladed_staff 1 i_nodachi 1 i_daicho 1 i_sai 1 i_tekagi 1 i_horseman_bow 1 i_composite_bow 1 i_yumi 1 i_bokuto 1}
ENDDO
NEW.GIVEITEMEVENT T_PROPRIEDADES
IF (<NEW.ISWEAPON>)
NEW.F_GIVE_PROPS <R85,90>
ENDIF
IF (!(<R3>))
NEW.COLOR=<R768,1280>
ENDIF
IF !(<ISITEM>)
BOUNCE <NEW>
ELSE
NEW.CONT=<UID>
ENDIF
NEW=<LOCAL.FIRSTNEW>

[EOF]