- 阅读权限
- 10
- 注册时间
- 2011-7-15
- 最后登录
- 2011-7-18
|
void random_gift(mapping my, int select)
{
int i = 10, j;
int tmpstr, tmpint, tmpcon, tmpdex;
tmpstr = tmpint = tmpcon = tmpdex = 10;
switch (select) {
case 1: tmpstr = i = my["str"]; break;
case 2: tmpint = i = my["int"]; break;
case 3: tmpcon = i = my["con"]; break;
case 4: tmpdex = i = my["dex"];
}
i = 50 - i;
while (i--) {
j = random(4);
if (j == select - 1) {
i++;
continue;
}
switch (j) {
case 0: tmpstr++; break;
case 1: tmpint++; break;
case 2: tmpcon++; break;
case 3: tmpdex++; break;
}
}
if (tmpstr <= 30) my["str"] = tmpstr; else my["str"] = 30;
if (tmpint <= 30) my["int"] = tmpint; else my["int"] = 30;
if (tmpcon <= 30) my["con"] = tmpcon; else my["con"] = 30;
if (tmpdex <= 30) my["dex"] = tmpdex; else my["dex"] = 30;
my["kar"] = 10 + random(21);
my["per"] = 10 + random(21);
}
如果这里的代码这个函数也是这样的,那么就是有问题的。 |
|
|
|
|