그룹경험치 소스
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
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
77 | *괴물이름 방폭 버그 수정 | 그리움 | 2007.04.12 | 533 |
76 | 연타기능 - 직업별 연타 | 그리움 | 2007.04.12 | 479 |
75 | 게시판 버그 해결 방법. | 그리움 | 2007.04.12 | 470 |
74 | 연타기능 - 연타수 자동 | 그리움 | 2007.04.12 | 447 |
73 | 무한대전 방 데이터 Convert | 그리움 | 2007.11.23 | 423 |
72 | 주민등록번호 검사 소스 | 그리움 | 2007.04.12 | 420 |
71 | 몹 소환하여 소환몹이 대신 싸우게 하기 | 그리움 | 2007.11.23 | 398 |
70 | 물건, 몹의 번호 찾아내기. | 그리움 | 2007.07.04 | 392 |
69 | 감옥/퇴소 | 그리움 | 2007.04.12 | 338 |
68 | 개척 소스 | 그리움 | 2007.04.12 | 302 |
67 | 머드에서 몹 심기 | 그리움 | 2007.04.12 | 287 |
66 | 온라인 리붓 | 그리움 | 2007.04.12 | 287 |
65 | 방전체 공격루틴 #2 | 그리움 | 2007.04.12 | 287 |
64 | 이동하는 몹 | 그리움 | 2007.04.12 | 283 |
63 | 프롬프트 그래프화 #2 | 그리움 | 2007.04.12 | 280 |
62 | 낚시 | 그리움 | 2007.04.12 | 280 |
61 | 운영자명령 "보고" | 그리움 | 2007.04.12 | 280 |
60 | Mordor에 있는 몹 소환 소스 | 그리움 | 2007.04.12 | 277 |
59 | 프롬프트 그래프화 | 그리움 | 2007.04.12 | 271 |
58 | 귀환장소 수정판 | 그리움 | 2007.04.12 | 263 |