-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·104 lines (102 loc) · 2.77 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Test ThusSpokeNpc</title>
<script src="index.js" type="text/javascript"></script>
<script type="text/javascript">
var npc = ThusSpokeNpc(1, speakHandler, 3000, 0, 50, 1000, [
{
conditions: {
banter: 1
},
message: 'Hey guy :D'
},
{
conditions: {
banter: 1
},
message: 'oooo shiny'
},
{
conditions: {
banter: 1
},
message: 'omg my feelings :('
},
{
conditions: {
'item:1': true
},
message: 'You found my stuff!!! Thanks!'
},
]);
/**
* Speaker Handler
*/
function speakHandler(id, message, rewards) {
document.getElementById("output").value = id + ' says: ' + message + ' (' + JSON.stringify(rewards) + ')';
}
function speak() {
ThusSpokeNpc.ask(1, { range: 10, 'item:1': true });
}
</script>
<style type="text/css">
#button {
-moz-box-shadow:inset 0px 1px 0px 0px #f29c93;
-webkit-box-shadow:inset 0px 1px 0px 0px #f29c93;
box-shadow:inset 0px 1px 0px 0px #f29c93;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fe1a00), color-stop(1, #ce0100) );
background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
background-color:#fe1a00;
-webkit-border-top-left-radius:37px;
-moz-border-radius-topleft:37px;
border-top-left-radius:37px;
-webkit-border-top-right-radius:0px;
-moz-border-radius-topright:0px;
border-top-right-radius:0px;
-webkit-border-bottom-right-radius:37px;
-moz-border-radius-bottomright:37px;
border-bottom-right-radius:37px;
-webkit-border-bottom-left-radius:0px;
-moz-border-radius-bottomleft:0px;
border-bottom-left-radius:0px;
text-indent:0;
border:1px solid #d83526;
display:inline-block;
color:#ffffff;
font-family:Arial;
font-size:15px;
font-weight:bold;
font-style:normal;
height:65px;
line-height:65px;
width:131px;
text-decoration:none;
text-align:center;
text-shadow:7px 7px 6px #000;
float: left;
}
#button:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ce0100), color-stop(1, #fe1a00) );
background:-moz-linear-gradient( center top, #ce0100 5%, #fe1a00 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00');
background-color:#ce0100;
}
#button:active {
position:relative;
top:1px;
}
#output {
width: 50%;
height: 60px;
}
</style>
</head>
<body>
<div>
<a href="#" id="button" onclick="speak();">Give Item</a>
<textarea id="output"></textarea>
</div>
</body>
</html>