-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path1032102.js
157 lines (155 loc) · 7.57 KB
/
1032102.js
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
var status = 0;
var pet = null;
var theitems = Array();
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0) {
cm.sendOk("好的,下次再见。");
cm.dispose();
return;
}
if (mode == 1) {
status++;
} else {
status--;
}
if (status == 0) {
cm.sendSimple("初次见面~我是在#m101000000#研究多种魔法的#p1032102#,我特别感兴趣的是有关生命的魔法。生命多么神秘呀...我正在研究怎么创造那样生命。#b\r\n#L0#我要把宝贝龙进化#l\r\n#L1#我要把罗伯进化#l\r\n#L2#我要把我的宠物复活#l#k");
} else if (status == 1) {
if (selection == 0) {
var currentpet = null;
for (var i = 0; i < 3; i++) {
currentpet = cm.getPlayer().getSpawnPet(i);
if (currentpet != null && pet == null) {
if (currentpet.getSummoned() && currentpet.getPetItemId() > 5000028 && currentpet.getPetItemId() < 5000034 && currentpet.getLevel() >= 15) {
pet = currentpet;
break;
}
}
}
if (pet == null || !cm.haveItem(5380000, 1)) {
cm.sendOk("您的条件不符。 您必须要有 #i5380000##t5380000#, 以及任意一只15级以上的 #d#i5000029##t5000029##k 。\r\n\r\n您将会随机获得:\r\n\r\n#g#i5000030##t5000030##k, #r#i5000035##t5000035##k, #b#i5000032##t5000032##k, 和 #e#i5000033##t5000033##n");
cm.dispose();
} else {
var id = pet.getPetItemId();
var name = pet.getName();
var level = pet.getLevel();
var closeness = pet.getCloseness();
var fullness = pet.getFullness();
var slot = pet.getInventoryPosition();
var flag = pet.getFlags();
var rand = 0;
var after = id;
while (after == id) {
rand = 1 + Math.floor(Math.random() * 10);
if (rand >= 1 && rand <= 3) {
after = 5000030; //绿龙
} else if (rand >= 4 && rand <= 6) {
after = 5000035; //红龙
} else if (rand >= 7 && rand <= 9) {
after = 5000032; //蓝龙
} else if (rand == 10) {
after = 5000033; //黑龙
}
}
if (name.equals(cm.getItemName(id))) {
name = cm.getItemName(after);
}
cm.getPlayer().unequipSpawnPet(pet, true, false);
cm.gainItem(5380000, -1);
cm.removeSlot(5, slot, 1);
cm.gainPet(after, name, level, closeness, fullness, 45, flag);
cm.getPlayer().spawnPet(slot);
cm.sendOk("Your dragon has now evolved!! It used to be a #i" + id + "##t" + id + "#, and now it's a #i" + after + "##t" + after + "#!");
cm.dispose();
}
} else if (selection == 1) {
var currentpet = null;
for (var i = 0; i < 3; i++) {
currentpet = cm.getPlayer().getSpawnPet(i);
if (currentpet != null && pet == null) {
if (currentpet.getSummoned() && currentpet.getPetItemId() > 5000047 && currentpet.getPetItemId() < 5000054 && currentpet.getLevel() >= 15) {
pet = currentpet;
break;
}
}
}
if (pet == null || !cm.haveItem(5380000, 1)) {
cm.sendOk("您的条件不符。 您必须要有 #i5380000##t5380000#, 以及任意一只15级以上的 #g#i5000048##t5000048##k 。\r\n\r\n您将会随机获得:\r\n\r\n#r#i5000049##t5000049##k, #b#i5000050##t5000050##k, #d#i5000051##t5000051##k, #d#i5000052##t5000052##k, 和 #e#i5000053##t5000053##n");
cm.dispose();
} else {
var id = pet.getPetItemId();
var name = pet.getName();
var level = pet.getLevel();
var closeness = pet.getCloseness();
var fullness = pet.getFullness();
var slot = pet.getInventoryPosition();
var flag = pet.getFlags();
var rand = 0;
var after = id;
while (after == id) {
rand = 1 + Math.floor(Math.random() * 9);
if (rand >= 1 && rand <= 2) {
after = 5000049;
} else if (rand >= 3 && rand <= 4) {
after = 5000050;
} else if (rand >= 5 && rand <= 6) {
after = 5000051;
} else if (rand >= 7 && rand <= 8) {
after = 5000052;
} else if (rand == 9) {
after = 5000053;
}
}
if (name.equals(cm.getItemName(id))) {
name = cm.getItemName(after);
}
cm.getPlayer().unequipSpawnPet(pet, true, false);
cm.gainItem(5380000, -1);
cm.removeSlot(5, slot, 1);
cm.gainPet(after, name, level, closeness, fullness, 45, flag);
cm.getPlayer().spawnPet(slot);
cm.sendOk("Your robo has now evolved!! It used to be a #i" + id + "##t" + id + "#, and now it's a #i" + after + "##t" + after + "#!");
cm.dispose();
}
} else if (selection == 2) { //复活宠物
var inv = cm.getInventory(5);
var pets = cm.getPlayer().getPets(); //includes non-summon
for (var i = 0; i <= inv.getSlotLimit(); i++) {
var it = inv.getItem(i);
if (it != null && it.getItemId() >= 5000000 && it.getItemId() < 5010000 && it.getExpiration() > 0 && it.getExpiration() < cm.getCurrentTime()) {
theitems.push(it);
}
}
if (theitems.length <= 0) {
cm.sendOk("没有可需要复活的宠物.");
cm.dispose();
} else {
var selStr = "请选择需要复活的宠物,注意:必须要有#b#i5180000# #t5180000##k我才能帮您复活宠物。#b\r\n";
for (var i = 0; i < theitems.length; i++) {
selStr += "\r\n#L" + i + "##i" + theitems[i].getItemId() + "##t" + theitems[i].getItemId() + "##l";
}
cm.sendSimple(selStr);
}
}
} else if (status == 2) {
if (theitems.length <= 0) {
cm.sendOk("没有可需要复活的宠物.");
} else if (!cm.haveItem(5180000, 1)) {
cm.sendOk("您好像还没有 #b#i5180000# #t5180000##k 吧.");
} else {
theitems[selection].setExpiration(cm.getCurrentTime() + (45 * 24 * 60 * 60 * 1000));
cm.getPlayer().fakeRelog();
cm.sendOk("恭喜您复活宠物成功,宠物使用时间延长45天。");
cm.gainItem(5180000, -1);
}
cm.dispose();
}
}
}