그룹경험치 소스
2007.04.12 11:42
그룹경험치 부분
/**********************************************************************/
/* die */
/**********************************************************************/
/* This function is called whenever a player or a monster dies. The */
/* first parameter contains a pointer to the creature that has died. */
/* The second contains a pointer to the creature who did the dirty */
/* deed. Different chains of events are taken depending on whether */
/* the deceased was a player or a monster. */
void die(crt_ptr, att_ptr)
creature *crt_ptr;
creature *att_ptr;
{
otag *op, *temp;
etag *ep;
ctag *cp, *prev;
creature *ply_ptr;
room *rom_ptr;
object *obj_ptr;
char str[2048];
long i, t, profloss, total, xpv;
int n, levels = 0, expdiv, lessthanzero=0, expgroup=0, exp = 0;
str[0] =0;
if(crt_ptr->type == MONSTER) {
ep = crt_ptr->first_enm;
while(ep) {
ply_ptr = find_who(ep->enemy);
if(ply_ptr)
levels += ((ply_ptr->level+3)/4);
ep = ep->next_tag;
}
expdiv = crt_ptr->experience / levels;
ep = crt_ptr->first_enm;
while(ep) {
ply_ptr = find_who(ep->enemy);
if(ply_ptr) {
expdiv = (crt_ptr->experience * ep->damage) /
MAX(crt_ptr->hpmax,1);
if (cp) {
expgroup = (expdiv + (crt_ptr->experience/10));
}
else {
expgroup = expdiv;
}
if (ply_ptr->following) {
cp = ply_ptr->following->first_fol;
}
else {
cp = ply_ptr->first_fol;
}
if (cp) {
expgroup = MIN(expgroup, crt_ptr->experience);
exp = MIN(expgroup/3, crt_ptr->experience);
ply_ptr->experience += expgroup;
ply_ptr->experience += exp;
print(ply_ptr->fd, "\n당신은 %M%j 죽여 경험치 %d를 받았습니다.", crt_pt
r, "3", expgroup);
print(ply_ptr->fd, "\n당신은 그룹경험치로 %d를 받았습니다.", exp);
}
else {
expgroup = MIN(expgroup, crt_ptr->experience);
ply_ptr->experience += expgroup;
print(ply_ptr->fd, "\n당신은 %M%j 죽여 경험치 %d를 받았습니다.", crt_ptr
, "3", expgroup);
}
check_level_up(ply_ptr);
ply_ptr->alignment -= crt_ptr->alignment/5;
if(ply_ptr->alignment > 1000)
ply_ptr->alignment = 1000;
if(ply_ptr->alignment < -1000)
ply_ptr->alignment = -1000;
}
ep = ep->next_tag;
}
if(!F_ISSET(crt_ptr, MTRADE)) {
sprintf(str, "\n%s%s 가지고 있던것: ", crt_str(crt_ptr, 0,INV),under_han
(crt_str(crt_ptr, 0,INV))?"이":"가");
n = strlen(str);
i = list_obj(&str[n], att_ptr, crt_ptr->first_obj);
}
if(F_ISSET(crt_ptr, MPERMT))
die_perm_crt(ply_ptr, crt_ptr);
op = crt_ptr->first_obj;
while(op) {
temp = op->next_tag;
obj_ptr = op->obj;
del_obj_crt(obj_ptr, crt_ptr);
if(!F_ISSET(crt_ptr, MTRADE)){
add_obj_rom(obj_ptr, crt_ptr->parent_rom);
}
op = temp;
}
if(crt_ptr->gold) {
load_obj(0, &obj_ptr);
sprintf(obj_ptr->name, "", crt_ptr->gold);
strcat(str, obj_ptr->name);
obj_ptr->value = crt_ptr->gold;
ply_ptr->gold +=crt_ptr->gold;
print(ply_ptr->fd, "\n당신은 %s에게서 %d냥을 꺼내 가집니다.\n", crt_
ptr, crt_ptr->gold);
print(ply_ptr->fd, "당신은 이제 %d냥을 가지고 있습니다.\n", ply_ptr-
>gold);
}
if(F_ISSET(crt_ptr, MDMFOL)) {
ply_ptr = crt_ptr->following;
/**********************************************************************/
/* die */
/**********************************************************************/
/* This function is called whenever a player or a monster dies. The */
/* first parameter contains a pointer to the creature that has died. */
/* The second contains a pointer to the creature who did the dirty */
/* deed. Different chains of events are taken depending on whether */
/* the deceased was a player or a monster. */
void die(crt_ptr, att_ptr)
creature *crt_ptr;
creature *att_ptr;
{
otag *op, *temp;
etag *ep;
ctag *cp, *prev;
creature *ply_ptr;
room *rom_ptr;
object *obj_ptr;
char str[2048];
long i, t, profloss, total, xpv;
int n, levels = 0, expdiv, lessthanzero=0, expgroup=0, exp = 0;
str[0] =0;
if(crt_ptr->type == MONSTER) {
ep = crt_ptr->first_enm;
while(ep) {
ply_ptr = find_who(ep->enemy);
if(ply_ptr)
levels += ((ply_ptr->level+3)/4);
ep = ep->next_tag;
}
expdiv = crt_ptr->experience / levels;
ep = crt_ptr->first_enm;
while(ep) {
ply_ptr = find_who(ep->enemy);
if(ply_ptr) {
expdiv = (crt_ptr->experience * ep->damage) /
MAX(crt_ptr->hpmax,1);
if (cp) {
expgroup = (expdiv + (crt_ptr->experience/10));
}
else {
expgroup = expdiv;
}
if (ply_ptr->following) {
cp = ply_ptr->following->first_fol;
}
else {
cp = ply_ptr->first_fol;
}
if (cp) {
expgroup = MIN(expgroup, crt_ptr->experience);
exp = MIN(expgroup/3, crt_ptr->experience);
ply_ptr->experience += expgroup;
ply_ptr->experience += exp;
print(ply_ptr->fd, "\n당신은 %M%j 죽여 경험치 %d를 받았습니다.", crt_pt
r, "3", expgroup);
print(ply_ptr->fd, "\n당신은 그룹경험치로 %d를 받았습니다.", exp);
}
else {
expgroup = MIN(expgroup, crt_ptr->experience);
ply_ptr->experience += expgroup;
print(ply_ptr->fd, "\n당신은 %M%j 죽여 경험치 %d를 받았습니다.", crt_ptr
, "3", expgroup);
}
check_level_up(ply_ptr);
ply_ptr->alignment -= crt_ptr->alignment/5;
if(ply_ptr->alignment > 1000)
ply_ptr->alignment = 1000;
if(ply_ptr->alignment < -1000)
ply_ptr->alignment = -1000;
}
ep = ep->next_tag;
}
if(!F_ISSET(crt_ptr, MTRADE)) {
sprintf(str, "\n%s%s 가지고 있던것: ", crt_str(crt_ptr, 0,INV),under_han
(crt_str(crt_ptr, 0,INV))?"이":"가");
n = strlen(str);
i = list_obj(&str[n], att_ptr, crt_ptr->first_obj);
}
if(F_ISSET(crt_ptr, MPERMT))
die_perm_crt(ply_ptr, crt_ptr);
op = crt_ptr->first_obj;
while(op) {
temp = op->next_tag;
obj_ptr = op->obj;
del_obj_crt(obj_ptr, crt_ptr);
if(!F_ISSET(crt_ptr, MTRADE)){
add_obj_rom(obj_ptr, crt_ptr->parent_rom);
}
op = temp;
}
if(crt_ptr->gold) {
load_obj(0, &obj_ptr);
sprintf(obj_ptr->name, "", crt_ptr->gold);
strcat(str, obj_ptr->name);
obj_ptr->value = crt_ptr->gold;
ply_ptr->gold +=crt_ptr->gold;
print(ply_ptr->fd, "\n당신은 %s에게서 %d냥을 꺼내 가집니다.\n", crt_
ptr, crt_ptr->gold);
print(ply_ptr->fd, "당신은 이제 %d냥을 가지고 있습니다.\n", ply_ptr-
>gold);
}
if(F_ISSET(crt_ptr, MDMFOL)) {
ply_ptr = crt_ptr->following;
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
17 | 방설명 지우기 | 그리움 | 2007.04.12 | 252 |
» | 그룹경험치 소스 | 그리움 | 2007.04.12 | 254 |
15 | 자동수련 소스 | 그리움 | 2007.04.12 | 234 |
14 | 귀환장소 변경소스 #2 | 그리움 | 2007.04.12 | 228 |
13 | 귀환장소 변경 소스 #1 | 그리움 | 2007.04.12 | 238 |
12 | 출구모양 개량 소스 | 그리움 | 2007.04.12 | 247 |
11 | 자기 아파트 자기가 방설명 넣기 | 그리움 | 2007.04.12 | 233 |
10 | 혼자 말하는 몹 | 그리움 | 2007.04.12 | 239 |
9 | 패거리 레벨 조정 소스 | 그리움 | 2007.04.12 | 234 |
8 | 방 전체공격 소스 | 그리움 | 2007.04.12 | 234 |
7 | 주문추가 소스 | 그리움 | 2007.04.12 | 234 |
6 | 패거리창고 소스 | 그리움 | 2007.04.12 | 229 |
5 | 자동으로 돈줍기 소스 | 그리움 | 2007.04.12 | 252 |
4 | 복권 소스 | 그리움 | 2007.04.12 | 238 |
3 | 무한에서 안시 넣는 방법 | 그리움 | 2007.04.12 | 243 |
2 | 배경색 바꾸기 | 그리움 | 2007.04.12 | 234 |
1 | 어디 | 그리움 | 2007.04.12 | 252 |