summaryrefslogtreecommitdiff
path: root/lib/scpt/s_yavann.lua
blob: 2f594e8507ea05767129b440c1c92f02d5dca7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
-- Handle Yavanna kementari magic school

YAVANNA_CHARM_ANIMAL = add_spell
{
	["name"] =      "Charm Animal",
	["school"] =    {SCHOOL_YAVANNA},
	["level"] =     1,
	["mana"] =      10,
	["mana_max"] =  100,
	["fail"] =      30,
	-- Uses piety to cast
	["piety"] =     TRUE,
	["stat"] =      A_WIS,
	["random"] =    SKILL_SPIRITUALITY,
	["spell"] =     function()
			local ret, dir = get_aim_dir()
			if ret == FALSE then return end

			return fire_ball(GF_CONTROL_ANIMAL, dir, 10 + get_level(YAVANNA_CHARM_ANIMAL, 170), get_level(YAVANNA_CHARM_ANIMAL, 2))
	end,
	["info"] =      function()
			return "power "..(10 + get_level(YAVANNA_CHARM_ANIMAL, 170)).." rad "..(get_level(YAVANNA_CHARM_ANIMAL, 2))
	end,
	["desc"] =      {
			"It tries to tame an animal",
	}
}

YAVANNA_GROW_GRASS = add_spell
{
	["name"] =      "Grow Grass",
	["school"] =    {SCHOOL_YAVANNA},
	["level"] =     10,
	["mana"] =      70,
	["mana_max"] =  150,
	["fail"] =      65,
	-- Uses piety to cast
	["piety"] =     TRUE,
	["stat"] =      A_WIS,
	["random"] =    SKILL_SPIRITUALITY,
	["spell"] =     function()
			grow_grass(get_level(YAVANNA_GROW_GRASS, 4))
			return TRUE
	end,
	["info"] =      function()
			return "rad "..(get_level(YAVANNA_GROW_GRASS, 4))
	end,
	["desc"] =      {
			"Create a floor of grass around you. While on grass and praying",
			"a worshipper of Yavanna will know a greater regeneration rate"
	}
}

YAVANNA_TREE_ROOTS = add_spell
{
	["name"] =      "Tree Roots",
	["school"] =    {SCHOOL_YAVANNA},
	["level"] =     15,
	["mana"] =      50,
	["mana_max"] =  1000,
	["fail"] =      70,
	-- Uses piety to cast
	["piety"] =     TRUE,
	["stat"] =      A_WIS,
	["random"] =    SKILL_SPIRITUALITY,
	["spell"] =     function()
			return set_roots(10 + get_level(YAVANNA_TREE_ROOTS, 30), 10 + get_level(YAVANNA_TREE_ROOTS, 60), 10 + get_level(YAVANNA_TREE_ROOTS, 20))
	end,
	["info"] =      function()
			return "dur "..(10 + get_level(YAVANNA_TREE_ROOTS, 30)).." AC "..(10 + get_level(YAVANNA_TREE_ROOTS, 60)).." dam "..(10 + get_level(YAVANNA_TREE_ROOTS, 20))
	end,
	["desc"] =      {
			"Creates roots deep in the floor from your feet, making you more stable and able",
			"to make stronger attacks, but prevents any movement (even teleportation).",
			"It also makes you recover from stunning almost immediately."
	}
}

YAVANNA_WATER_BITE = add_spell
{
	["name"] =      "Water Bite",
	["school"] =    {SCHOOL_YAVANNA},
	["level"] =     20,
	["mana"] =      150,
	["mana_max"] =  300,
	["fail"] =      90,
	-- Uses piety to cast
	["piety"] =     TRUE,
	["stat"] =      A_WIS,
	["random"] =    SKILL_SPIRITUALITY,
	["spell"] =     function()
			local rad

			rad = 0
			if get_level(YAVANNA_WATER_BITE) >= 25 then rad = 1 end

			return set_project(randint(30) + 30 + get_level(YAVANNA_WATER_BITE, 150),
				    GF_WATER,
				    10 + get_level(YAVANNA_WATER_BITE),
				    rad,
				    bor(PROJECT_STOP, PROJECT_KILL))
	end,
	["info"] =      function()
			return "dur "..(30 + get_level(YAVANNA_WATER_BITE, 150)).."+d30 dam "..(10 + get_level(YAVANNA_WATER_BITE)).."/blow"
	end,
	["desc"] =      {
			"Imbues your melee weapon with a natural stream of water",
			"At level 25, it spreads over a 1 radius zone around your target"
	}
}

YAVANNA_UPROOT = add_spell
{
	["name"] =      "Uproot",
	["school"] =    {SCHOOL_YAVANNA},
	["level"] =     35,
	["mana"] =      250,
	["mana_max"] =  350,
	["fail"] =      95,
	-- Uses piety to cast
	["piety"] =     TRUE,
	["stat"] =      A_WIS,
	["random"] =    SKILL_SPIRITUALITY,
	["spell"] =     function()
			local m_idx, x, y, c_ptr, ret, dir

			ret, dir = get_rep_dir()
			if ret == FALSE then return end
			y, x = explode_dir(dir)
			y, x = y + player.py, x + player.px
			c_ptr = cave(y, x)

			if c_ptr.feat == FEAT_TREES then
				cave_set_feat(y, x, FEAT_GRASS);

				-- Summon it
				y, x = find_position(y, x)
				m_idx = place_monster_one(y, x, test_monster_name("Ent"), 0, FALSE, MSTATUS_FRIEND)

				-- level it
				if m_idx ~= 0 then
					monster_set_level(m_idx, 30 + get_level(YAVANNA_UPROOT, 70))
				end

				msg_print("The tree awakes!");
			else
				msg_print("There is no tree there.")
			end
			return TRUE
	end,
	["info"] =      function()
			return "lev "..(30 + get_level(YAVANNA_UPROOT, 70))
	end,
	["desc"] =      {
			"Awakes a tree to help you battle the forces of Morgoth",
	}
}