그룹경험치 소스

2007.04.12 11:42

그리움 조회 수:220 추천:62

그룹경험치 부분
/**********************************************************************/
/* 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;

번호 제목 글쓴이 날짜 조회 수
57 도배방지 그리움 2007.04.12 222
» 그룹경험치 소스 그리움 2007.04.12 220
55 패거리전쟁중 "휴전" 그리움 2007.04.12 220
54 직업 추가하기 그리움 2007.04.12 218
53 자동으로 돈줍기 소스 그리움 2007.04.12 213
52 경매는 이렇게 그리움 2007.04.12 213
51 어디 그리움 2007.04.12 211
50 무한에서 안시 넣는 방법 그리움 2007.04.12 210
49 방설명 지우기 그리움 2007.04.12 209
48 특수 아이템 만들기 그리움 2007.04.12 209
47 복권 소스 그리움 2007.04.12 207
46 혼자 말하는 몹 그리움 2007.04.12 206
45 자동 이벤트 그리움 2007.04.12 204
44 낮과 밤이 되면 어둡고 환하게 그리움 2007.04.12 203
43 귀환장소 변경 소스 #1 그리움 2007.04.12 202
42 개량형 우체국 그리움 2007.04.12 202
41 주문추가 소스 그리움 2007.04.12 201
40 출구모양 개량 소스 그리움 2007.04.12 201
39 자동수련 소스 그리움 2007.04.12 201
38 잡담 안시 사용하기 그리움 2007.04.12 200


XE Login