-
Notifications
You must be signed in to change notification settings - Fork 8
/
graveyard.php
146 lines (133 loc) · 4.24 KB
/
graveyard.php
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
<?php
// addnews ready.
// translator ready
// mail ready
require_once("common.php");
require_once("lib/http.php");
require_once("lib/buffs.php");
require_once("lib/events.php");
tlschema("graveyard");
page_header("The Graveyard");
$skipgraveyardtext = handle_event("graveyard");
$deathoverlord=getsetting('deathoverlord','`$Ramius');
if (!$skipgraveyardtext) {
if ($session['user']['alive']) {
redirect("village.php");
}
checkday();
}
$battle = false;
strip_all_buffs();
$max = $session['user']['level'] * 10 +$session['user']['dragonkills']*2 + 50;
$favortoheal = modulehook("favortoheal",array("favor"=>round(10 * ($max-$session['user']['soulpoints'])/$max)));
$favortoheal = (int)$favortoheal['favor'];
$op = httpget('op');
switch ($op) {
case "search":
require_once("lib/graveyard/case_battle_search.php");
break;
case "run":
if (e_rand(0,2)==1) {
output("`\$%s`) curses you for your cowardice.`n`n",$deathoverlord);
$favor = 5 + e_rand(0, $session['user']['level']);
if ($favor > $session['user']['deathpower'])
$favor = $session['user']['deathpower'];
if ($favor > 0) {
output("`)You have `\$LOST `^%s`) favor with `\$%s`).",$favor,$deathoverlord);
$session['user']['deathpower']-=$favor;
}
tlschema("nav");
addnav("G?Return to the Graveyard","graveyard.php");
tlschema();
} else {
output("`)As you try to flee, you are summoned back to the fight!`n`n");
$battle=true;
}
break;
case "fight":
$battle = true;
}
if ($battle){
//make some adjustments to the user to put them on mostly even ground
//with the undead guy.
$originalhitpoints = $session['user']['hitpoints'];
$session['user']['hitpoints'] = $session['user']['soulpoints'];
$originalattack = $session['user']['attack'];
$originaldefense = $session['user']['defense'];
// $session['user']['attack'] =
// 10 + round(($session['user']['level'] - 1) * 1.5);
// $session['user']['defense'] =
// 10 + round(($session['user']['level'] - 1) * 1.5);
require_once("battle.php");
//reverse those adjustments, battle calculations are over.
$session['user']['attack'] = $originalattack;
$session['user']['defense'] = $originaldefense;
$session['user']['soulpoints'] = $session['user']['hitpoints'];
$session['user']['hitpoints'] = $originalhitpoints;
if ($victory) {
tlschema("battle");
$msg = translate_inline($badguy['creaturelose']);
tlschema();
output_notl("`b`&%s`0`b`n", $msg);
output("`b`\$You have tormented %s!`0`b`n", $badguy['creaturename']);
output("`#You receive `^%s`# favor with `\$%s`#!`n`0", $badguy['creatureexp'],$deathoverlord);
$session['user']['deathpower']+=$badguy['creatureexp'];
$op = "";
httpset('op', "");
$skipgraveyardtext=true;
}else{
if ($defeat){
require_once("lib/taunt.php");
require_once("lib/deathmessage.php");
$taunt = select_taunt_array();
$where = translate_inline("in the graveyard");
$deathmessage=select_deathmessage_array(false,array("{where}"),array($where));
if ($deathmessage['taunt']==1) {
addnews("%s`n%s",$deathmessage['deathmessage'],$taunt);
} else {
addnews("%s",$deathmessage['deathmessage']);
}
// addnews("`)%s`) has been defeated in the graveyard by %s.`n%s",$session['user']['name'],$badguy['creaturename'],$taunt);
output("`b`&You have been defeated by `%%s`&!!!`n", $badguy['creaturename']);
output("You may not torment any more souls today.");
$session['user']['gravefights']=0;
tlschema("nav");
addnav("G?Return to the Graveyard","graveyard.php");
tlschema();
}else{
require_once("lib/fightnav.php");
fightnav(false, true, "graveyard.php");
}
}
}
modulehook("deathoverlord",array());
switch ($op) {
case "search": case "run": case "fight":
break;
case "enter":
require_once("lib/graveyard/case_enter.php");
break;
case "restore":
require_once("lib/graveyard/case_restore.php");
break;
case "resurrection":
require_once("lib/graveyard/case_resurrection.php");
break;
case "question":
require_once("lib/graveyard/case_question.php");
break;
case "haunt":
require_once("lib/graveyard/case_haunt.php");
break;
case "haunt2":
require_once("lib/graveyard/case_haunt2.php");
break;
case "haunt3":
require_once("lib/graveyard/case_haunt3.php");
break;
default:
require_once("lib/graveyard/case_default.php");
break;
}
page_footer();
?>