//****************************************************************************
// SPHERE by : Menasoft ©1997-2017
// www.sphereserver.net
// All SPHERE script files and formats are copyright Menasoft & Partners.
// This file may be freely edited for personal use, but may not be distributed
// in whole or in part, in any format without express written permission from
// Menasoft & Partners.  All donations and contributions
// become the property of Menasoft & Partners.
//****************************************************************************
// FILE LAST UPDATED: Monday, Feb 13, 2017
//
VERSION=0.56d


[COMMENT sphere_item_magic_mysticism]

This file contains all things relating to Mysticism, such as:

* Scrolls
* Spellbooks
* Spellstones
* Healing stones
* The "eagle strike" projectile


[ITEMDEF 02d9d]
DEFNAME=i_spellbook_mystic
NAME=Mysticism Spellbook
TYPE=t_spellbook_mystic
TDATA3=677
TDATA4=16
VALUE=16
WEIGHT=3.0
RESOURCES=10 i_scroll_blank
SKILLMAKE=Inscription 50.0,i_pen_and_ink
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Books
DESCRIPTION=Mysticism Spellbook
ON=@Create
	ATTR=attr_magic|attr_newbie


[ITEMDEF 02d9e]
DEFNAME=i_scroll_nether_bolt
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_black_pearl,1 i_reag_sulfur_ash
SKILLMAKE=Inscription 0.0,Mysticism 0.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Nether Bolt
ON=@Create
	ATTR=attr_magic
	MOREX=s_nether_bolt
	MOREY={10 50}

[ITEMDEF 02d9f]
DEFNAME=i_scroll_healing_stone
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_bone,1 i_reag_garlic,1 i_reag_ginseng,1 i_reag_spider_silk
SKILLMAKE=Inscription 0.0,Mysticism 0.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Healing Stone
ON=@Create
	ATTR=attr_magic
	MOREX=s_healing_stone
	MOREY={10 50}

[ITEMDEF 02da0]
DEFNAME=i_scroll_purge_magic
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_fertile_dirt,1 i_reag_garlic,1 i_reag_mandrake_root,1 i_reag_sulfur_ash
SKILLMAKE=Inscription 0.0,Mysticism 8.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Purge Magic
ON=@Create
	ATTR=attr_magic
	MOREX=s_purge_magic
	MOREY={20 60}

[ITEMDEF 02da1]
DEFNAME=i_scroll_enchant
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_spider_silk,1 i_reag_mandrake_root,1 i_reag_sulfur_ash
SKILLMAKE=Inscription 0.0,Mysticism 20.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Enchant
ON=@Create
	ATTR=attr_magic
	MOREX=s_enchant
	MOREY={20 60}

[ITEMDEF 02da2]
DEFNAME=i_scroll_sleep
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_nightshade,1 i_reag_spider_silk,1 i_reag_black_pearl
SKILLMAKE=Inscription 3.5,Mysticism 20.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Sleep
ON=@Create
	ATTR=attr_magic
	MOREX=s_sleep
	MOREY={30 70}

[ITEMDEF 02da3]
DEFNAME=i_scroll_eagle_strike
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_blood_moss,1 i_reag_bone,1 i_reag_spider_silk,1 i_reag_mandrake_root
SKILLMAKE=Inscription 3.5,Mysticism 20.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Eagle Strike
ON=@Create
	ATTR=attr_magic
	MOREX=s_eagle_strike
	MOREY={30 70}

[ITEMDEF 02da4]
DEFNAME=i_scroll_animated_weapon
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_bone,1 i_reag_black_pearl,1 i_reag_mandrake_root,1 i_reag_nightshade
SKILLMAKE=Inscription 17.8,Mysticism 33.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Animated Weapon
ON=@Create
	ATTR=attr_magic
	MOREX=s_animated_weapon
	MOREY={40 75}

[ITEMDEF 02da5]
DEFNAME=i_scroll_stone_form
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_blood_moss,1 i_reag_fertile_dirt,1 i_reag_garlic
SKILLMAKE=Inscription 17.8,Mysticism 33.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Stone Form
ON=@Create
	ATTR=attr_magic
	MOREX=s_stone_form
	MOREY={40 75}

[ITEMDEF 02da6]
DEFNAME=i_scroll_spell_trigger
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_dragon_blood,1 i_reag_garlic,1 i_reag_mandrake_root,1 i_reag_spider_silk
SKILLMAKE=Inscription 32.1,Mysticism 45.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Spell Trigger
ON=@Create
	ATTR=attr_magic
	MOREX=s_spell_trigger
	MOREY={50 80}

[ITEMDEF 02da7]
DEFNAME=i_scroll_mass_sleep
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_ginseng,1 i_reag_nightshade,1 i_reag_spider_silk
SKILLMAKE=Inscription 32.1,Mysticism 45.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Mass Sleep
ON=@Create
	ATTR=attr_magic
	MOREX=s_mass_sleep
	MOREY={50 80}

[ITEMDEF 02da8]
DEFNAME=i_scroll_cleansing_winds
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_dragon_blood,1 i_reag_garlic,1 i_reag_ginseng,1 i_reag_mandrake_root
SKILLMAKE=Inscription 46.4,Mysticism 58.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Cleansing Winds
ON=@Create
	ATTR=attr_magic
	MOREX=s_cleansing_winds
	MOREY={60 85}

[ITEMDEF 02da9]
DEFNAME=i_scroll_bombard
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_blood_moss,1 i_reag_dragon_blood,1 i_reag_garlic,1 i_reag_sulfur_ash
SKILLMAKE=Inscription 46.4,Mysticism 58.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Bombard
ON=@Create
	ATTR=attr_magic
	MOREX=s_bombard
	MOREY={60 85}

[ITEMDEF 02daa]
DEFNAME=i_scroll_spell_plague
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_daemon_bone,1 i_reag_dragon_blood,1 i_reag_nightshade,1 i_reag_sulfur_ash
SKILLMAKE=Inscription 60.7,Mysticism 70.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Spell Plague
ON=@Create
	ATTR=attr_magic
	MOREX=s_spell_plague
	MOREY={70 90}

[ITEMDEF 02dab]
DEFNAME=i_scroll_hail_storm
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_dragon_blood,1 i_reag_blood_moss,1 i_reag_black_pearl,1 i_reag_mandrake_root
SKILLMAKE=Inscription 60.7,Mysticism 70.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Hail Storm
ON=@Create
	ATTR=attr_magic
	MOREX=s_hail_storm
	MOREY={70 90}

[ITEMDEF 02dac]
DEFNAME=i_scroll_nether_cyclone
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_mandrake_root,1 i_reag_nightshade,1 i_reag_sulfur_ash,1 i_reag_blood_moss
SKILLMAKE=Inscription 75.0,MYSTICISM 83.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Nether Cyclone
ON=@Create
	ATTR=attr_magic
	MOREX=s_nether_cyclone
	MOREY={80 100}

[ITEMDEF 02dad]
DEFNAME=i_scroll_rising_colossus
TYPE=t_scroll
WEIGHT=1
RESOURCES=1 i_scroll_blank,1 i_reag_daemon_bone,1 i_reag_dragon_blood,1 i_reag_fertile_dirt,1 i_reag_nightshade
SKILLMAKE=Inscription 75.0,Mysticism 83.0
CATEGORY=Provisions - Alchemy & Magic
SUBSECTION=Scrolls - Mysticism
DESCRIPTION=Rising Colossus
ON=@Create
	ATTR=attr_magic
	MOREX=s_rising_colossus
	MOREY={80 100}

[ITEMDEF 02dae]
//old healing stone (see 04078)

[ITEMDEF 02daf]
//old spell stone (see 04079)


[ITEMDEF 04078]
DEFNAME=i_healing_stone
NAME=healing stone
TYPE=t_spell
WEIGHT=0.1
CATEGORY=Magic
SUBSECTION=Mysticism
DESCRIPTION=Healing Stone
//more1 = Healing Amount: The total energy stored for healing.
//more2 = Healing Power : The maximum energy that can be used each time.
//morex = Total Healing : The maximum amount of energy the stone can store.
//morey don't set it, bad things can happen.
//morez = Cooldown 0/1 : Each time it's used morey will be set to 1 (it canno't be used) until 2 seconds pass.

ON=@Create
attr=attr_blessed
morex=<eval <src.Mysticism>/12> + (<src.Focus>/50 + <src.Imbuing>/50)>
more1=<morex>
more2=<morex>/3

ON=@DClick
if (<morey>>0)	// It's on cooldown, we cannot use it.
	return 1
endif
if (<more1> < <more2>)	// Healing Amount is lesser than Healing Power, we cannot use it.
	return 1
endif
if (<src.hits> >= <src.maxhits>)	// We have max HP, no need of use it.
	return 1
endif
more1 -= <more2>
src.hits +=<more2>
if (<src.hits> > <src.maxhits>)
	src.hits=<src.maxhits>
endif
morez = 1
timerf 2,morez=0
if (<timer> < 0)	// Is timer stopped?
	timer = 1	// activate it again
endif
return 1

ON=@Timer
local.restore = <eval <morex>/15>	// Each 15 seconds the stone replenish totally its energy, so the energy restored in 1 second = total energy / 15
more1 += <local.restore>
if (<more1> < <morex> )	// Stone still not reached it Total Healing
	timer = 1
else	// Healing Amount is equal or higher than Total Healing
	if (<more1> > <morex>)	// Stone passed the Total Healing
		more1 = <morex>		// so Healing Amount reverted to it's limit.
	endif
	timer = -1	//	Reached the Total Healing value, no need to continue ticking.
endif
return 1

ON=@DropOn_Char
   RETURN 1
ON=@DropOn_Ground
   REMOVE
ON=@DropOn_Item
   IF (<ARGO>!=<SRC.FINDLAYER(21).UID>)
      RETURN 1
   ENDIF

[ITEMDEF 04079]
//Stores one Mysticism spell in a spell stone. The stone can be activated to instantly cast the stored spell.
DEFNAME=i_spell_stone
NAME=spell stone
TYPE=t_normal
WEIGHT=0.1
CATEGORY=Magic
SUBSECTION=Mysticism
DESCRIPTION=Spell Stone
ON=@DropOn_Char
   RETURN 1
ON=@DropOn_Ground
   REMOVE
ON=@DropOn_Item
   IF (<ARGO>!=<SRC.FINDLAYER(21).UID>)
      RETURN 1
   ENDIF

[ITEMDEF 0407a]
DEFNAME=i_eagle_strike_projectile
//eagle strike projectile


[EOF]
