[DEFNAME ORBS_BUG_PREVENT]
T_ORB_EFEITO T_ORB_CLILOC

[TYPEDEF T_ORB_CLILOC]
ON=@ClientTooltip
SHOWORBDAMAGES

[FUNCTION SHOWORBDAMAGES]
IF (<TAG0.ORB.EFEITO>)
IF (<TAG0.ORB.EFEITO>&08)
LOCAL.DAMAGETYPES .= Poison Damage/
ENDIF
IF (<TAG0.ORB.EFEITO>&010)
LOCAL.DAMAGETYPES .= Fire Damage/
ENDIF
IF (<TAG0.ORB.EFEITO>&020)
LOCAL.DAMAGETYPES .= Eletric Damage/
ENDIF
IF (<TAG0.ORB.EFEITO>&0100)
LOCAL.DAMAGETYPES .= Acid Damage/
ENDIF
IF (<TAG0.ORB.EFEITO>&0200)
LOCAL.DAMAGETYPES .= Cold Damage/
ENDIF
IF (<TAG0.ORB.EFEITO>&0800)
LOCAL.DAMAGETYPES .= Piercing Damage/
ENDIF
IF (<TAG0.ORB.EFEITO>&01000)
LOCAL.DAMAGETYPES .= Area Damage/
ENDIF
LOCAL.HEHE=<EVAL (<EVAL (STRLEN(<LOCAL.DAMAGETYPES>))>-2)>
SRC.ADDCLILOC 1070722,<STRSUB 1 <LOCAL.HEHE> <LOCAL.DAMAGETYPES>>
ENDIF

[ITEMDEF i_orb]
ID=i_virtstone_1
TYPE=t_normal
NAME=Orb

ON=@Create
DORAND 7
BEGIN
MORE1=08
NAME=Poison Orb
COLOR=0ad
END
BEGIN
MORE1=010
NAME=Fire Orb
COLOR=33
END
BEGIN
MORE1=020
NAME=Eletric Orb
COLOR=55
END
BEGIN
MORE1=0100
NAME=Acid Orb
END
BEGIN
MORE1=0200
NAME=Cold Orb
COLOR=0480
END
BEGIN
MORE1=0800
NAME=Piercing Orb
COLOR=481
END
ENDDO

ON=@Dclick
IF (<MORE1> == 01)
SRC.SYSMESSAGE UNUSED ORB
RETURN 1
ENDIF
IF (<TOPOBJ.UID>==<SRC>)
TARGET @0480 To what item do you wish to add the effect of <STRARG <NAME>>?
ENDIF
RETURN 1

ON=@Targon_Item
IF (<SRC.TARG.ISWEAPON>)
IF !(<SRC.TARG.TAG0.ORB.EFEITO>)
SRC.TARG.TAG0.ORB.EFEITO |= <MORE1>
SRC.TARG.EVENTS +T_ORB_CLILOC
SRC.SYSMESSAGE @048d You add the effect of <STRARG <NAME>> on <SRC.TARG.NAME>.
SRC.TARG.RESENDTOOLTIP 1
CONSUME 1
ELSE
SRC.SYSMESSAGE This weapon already has an orb effect.
ENDIF
ELSE
SRC.SYSMESSAGE You must choose a weapon as target.
ENDIF
RETURN 1

[FUNCTION DAMAGEAREA]
IF (<SRC>)
LOCAL.UID=<SRC>
	FORCHARS 2
		IF (!(<REGION.FLAGS>&region_flag_safe)) && (!(<REGION.FLAGS>&region_flag_guarded)) && (!(<ISBENEFICIAL <SRC>>)) && (<CANSEELOS>)
		DAMAGE <EVAL (<ARGN1>/(<DISTANCE>+1))> 02 <LOCAL.UID>
		ENDIF
	ENDFOR
ENDIF

[CHARDEF c_orb_elemental]
ID=c_elem_earth
DEFNAME=c_orb_elemental
NAME=Orb Elemental
MOVERATE=60
CAN=MT_WALK|MT_USEHANDS
DAM=24,29
ARMOR=63
BLOODCOLOR=0481
CATEGORY=Monsters
SUBSECTION=Orbs
DESCRIPTION=Orb Elemental

ON=@Create
NPC=brain_monster
KARMA=-5000
FAME=5000
STR={266 500}
MAXHITS={2000 3000}
DEX={110 280}
INT={200 350}
TACTICS={100.0 400.0}
WRESTLING={50.0 400.0}
MAGERY={80.0 90.0}
COLOR=0481

ON=@NpcRestock
ITEM=i_gold,{400 800}
ITEM=i_orb

ON=@Hit
ARGN2 |= <FINDID.i_orb.TAG0.ORB.EFEITO>
IF (<ARGN2>&08) && !(<SRC.FLAGS>&statf_poisoned) && (10 >= <R1,100>)
SRC.SPELLEFFECT s_poison,<magery>,<uid>
ENDIF
IF (<ARGN2>&010)
SRC.DAMAGE <R1,10> 01 <UID>
ENDIF
IF (<ARGN2>&020)
SRC.DAMAGE <R1,10> 01 <UID>
ENDIF
IF (<ARGN2>&0200) && !(<SRC.FLAGS>&statf_freeze)
SRC.SPELLEFFECT s_paralyze,<magery>,<uid>
ENDIF

[EOF]
