viewing paste Unknown #1616 | Diff

Posted on the
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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
Index: char/char.c
===================================================================
--- char/char.c (revision 16936)
+++ char/char.c (working copy)
@@ -105,7 +105,7 @@
 #define TRIM_CHARS "\255\xA0\032\t\x0A\x0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]
 char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) in a character name. by [Yor]
 
-int char_per_account = 0; //Maximum charas per account (default unlimited) [Sirius]
+int char_per_account = 0; //Maximum chars per account (default unlimited) [Sirius]
 int char_del_level = 0; //From which level u can delete character [Lupus]
 int char_del_delay = 86400;
 
@@ -1338,10 +1338,10 @@
 {
    char_db_= idb_alloc(DB_OPT_RELEASE_DATA);
 
-   if(char_per_account == 0){
-       ShowStatus("Chars per Account: 'Unlimited'.......\n");
-   }else{
-       ShowStatus("Chars per Account: '%d'.......\n", char_per_account);
+   if (char_per_account == 0) {
+       ShowStatus("Characters per Account: 'Unlimited'\n");
+   } else {
+       ShowStatus("Characters per Account: '%d'\n", char_per_account);
    }
 
    //the 'set offline' part is now in check_login_conn ...
@@ -4592,6 +4592,10 @@
            safestrncpy(char_name_letters, w2, sizeof(char_name_letters));
        } else if (strcmpi(w1, "chars_per_account") == 0) { //maxchars per account [Sirius]
            char_per_account = atoi(w2);
+           if( char_per_account > MAX_CHARS ) {
+               ShowWarning("Max chars per account '%d' exceeded limit. Defaulting to '%d'.\n", char_per_account, MAX_CHARS);
+               char_per_account = MAX_CHARS;
+           }
        } else if (strcmpi(w1, "char_del_level") == 0) { //disable/enable char deletion by its level condition [Lupus]
            char_del_level = atoi(w2);
        } else if (strcmpi(w1, "char_del_delay") == 0) {
Index: common/mmo.h
===================================================================
--- common/mmo.h    (revision 16936)
+++ common/mmo.h    (working copy)
@@ -220,7 +220,8 @@
 struct s_skill {
    unsigned short id;
    unsigned char lv;
-   unsigned char flag; // see enum e_skill_flag
+   int flag; // see enum e_skill_flag
+   int kaka;
 };
 
 struct global_reg {
Index: map/pc.c
===================================================================
--- map/pc.c    (revision 16936)
+++ map/pc.c    (working copy)
@@ -927,7 +927,7 @@
  *------------------------------------------*/
 bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers)
 {
-   int i;
+   int i, bclass;
    unsigned long tick = gettick();
    uint32 ip = session[sd->fd]->client_addr;
 
@@ -1097,6 +1097,17 @@
         **/
        clif_changemap(sd,sd->mapindex,sd->bl.x,sd->bl.y);
    }
+   
+   for (i = 0; i < MAX_SKILL; ++i) {
+       if ((bclass = sd->status.skill[i].id) != 0 ) {
+           printf("aaaaaa - %d - %d - %d\n", bclass, sd->status.skill[bclass].flag, sd->status.skill[bclass].kaka);
+           if (sd->status.skill[bclass].flag == 666) {
+               printf ("\nbbb\n");
+           }
+           if(sd->status.skill[bclass].kaka == 1)
+               printf ("\nahau\n");
+       }
+   }
 
    /**
     * Check if player have any cool downs on
@@ -1296,7 +1307,10 @@
 
    for( i = 0; i < MAX_SKILL; i++ )
    {
-       if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED ) //Don't touch plagiarized skills
+           if (sd->status.skill[i].flag == 666) {
+                       printf ("\nshut up xxx\n");
+                   }
+       else if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) //Don't touch plagiarized skills
            sd->status.skill[i].id = 0; //First clear skills.
    }
 
@@ -1304,8 +1318,11 @@
    {
        if( sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED )
        { // Restore original level of skills after deleting earned skills.
+       if (sd->status.skill[i].flag == 666) {
+                       printf ("\nshut up xxx\n");
+                   }else{
            sd->status.skill[i].lv = (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY) ? 0 : sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
-           sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;
+           sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;}
        }
 
        if( sd->sc.count && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_BARDDANCER && i >= DC_HUMMING && i<= DC_SERVICEFORYOU )
@@ -1429,6 +1446,10 @@
        {
            if( (skill_get_inf2(id)&(INF2_QUEST_SKILL|INF2_WEDDING_SKILL)) )
                continue; //Do not include Quest/Wedding skills.
+               
+               if (sd->status.skill[i].flag == 666) {
+                       printf ("\nshut up xxx\n");
+                   }else
 
            if( sd->status.skill[id].id == 0 )
            {
@@ -1515,14 +1536,16 @@
 {
    int i;
    for (i = 0; i < MAX_SKILL; i++){
-       if (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY || sd->status.skill[i].flag == SKILL_FLAG_PLAGIARIZED)
+       if (sd->status.skill[i].flag == 666) {
+           printf ("\nshut up\n");
+       }
+       else if (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY || sd->status.skill[i].flag == SKILL_FLAG_PLAGIARIZED)
        {
            sd->status.skill[i].id = 0;
            sd->status.skill[i].lv = 0;
            sd->status.skill[i].flag = 0;
        }
-       else
-       if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0){
+       else if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0){
            sd->status.skill[i].lv = sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
            sd->status.skill[i].flag = 0;
        }
@@ -3395,7 +3418,20 @@
        return 0;
    }
 
+   printf ("pcskill flag=%d\n", flag);
+
    switch( flag ){
+   case 666:
+       printf ("\ngot in case flag 666\n");
+       sd->status.skill[id].id   = id;
+       sd->status.skill[id].lv   = level;
+       sd->status.skill[id].flag = 666;
+       sd->status.skill[id].kaka = 1;
+       clif_addskill(sd,id);
+       if( !skill_get_inf(id) ) //Only recalculate for passive skills.
+           status_calc_pc(sd, 0);
+       printf ("\nholy before break = %d\n", sd->status.skill[id].flag);
+   break;
    case 0: //Set skill data overwriting whatever was there before.
        sd->status.skill[id].id   = id;
        sd->status.skill[id].lv   = level;
@@ -5995,10 +6031,13 @@
 
    for(i=0;i<MAX_SKILL;i++){
        if (sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) {
+       if (sd->status.skill[i].flag == 666) {
+                       printf ("\nshut up xxx\n");
+                   }else{
            sd->status.skill[i].lv = (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY) ? 0 : sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
            sd->status.skill[i].flag = SKILL_FLAG_PERMANENT;
            if (sd->status.skill[i].lv == 0)
-               sd->status.skill[i].id = 0;
+               sd->status.skill[i].id = 0;}
        }
    }
 
@@ -6274,8 +6313,11 @@
        { //Only handle quest skills in a special way when you can't learn them manually
            if( battle_config.quest_skill_reset && !(flag&2) )
            {   //Wipe them
+                   if (sd->status.skill[i].flag == 666) {
+                       printf ("\nshut up xxx\n");
+                   }else{
                sd->status.skill[i].lv = 0;
-               sd->status.skill[i].flag = 0;
+               sd->status.skill[i].flag = 0;}
            }
            continue;
        }
@@ -6287,8 +6329,11 @@
 
        if( !(flag&2) )
        {// reset
+               if (sd->status.skill[i].flag == 666) {
+           printf ("\nshut up\n");
+       }else{
            sd->status.skill[i].lv = 0;
-           sd->status.skill[i].flag = 0;
+           sd->status.skill[i].flag = 0;}
        }
    }
 
Index: map/script.c
===================================================================
--- map/script.c    (revision 16936)
+++ map/script.c    (working copy)
@@ -7952,6 +7952,7 @@
    level = script_getnum(st,3);
    if( script_hasdata(st,4) )
        flag = script_getnum(st,4);
+   printf ("scriptc flag=%d\n", flag);
    pc_skill(sd, id, level, flag);
 
    return 0;
Viewed 819 times, submitted by Guest.