Jump to content

Jonne

Members
  • Posts

    149
  • Joined

  • Last visited

Community Answers

  1. Jonne's post in Leveling System was marked as the answer   
    Can't give you a diff because I work on a project and don't want to create a new branch, but here is what you do:
    In ./src/map/mob.c look for the mob_dead function
    if (map[m].flag.nobaseexp || !md->db->base_exp) base_exp = 0; And change it to the following:
    if (map[m].flag.nobaseexp || !md->db->base_exp || tmpsd[i]->status.base_level >= 90) base_exp = 0;
  2. Jonne's post in var2string(); & string2var(); was marked as the answer   
    Var to String should be tought. Other way around, check for SetD and GetD
  3. Jonne's post in Max Charname length was marked as the answer   
    Here you go: http://rathena.org/board/pastebin/p6v4bmirpzc/ Limits the namelength to NAME_LENGTH - 5 (only on creation!)
  4. Jonne's post in REQUEST: Custom setcell like cell_basilica was marked as the answer   
    Try this. You also should add the cell to your const.txt for easier script usage. Here it would be cell number 10, but if you added another cell, it might be higher. Check the CELL_* enum in map.h
    diff --git a/src/map/battle.c b/src/map/battle.c index 6b7cf4b..63c1c4b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -763,6 +763,9 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam   if( battle_config.ksprotection && mob_ksprotected(src, bl) )   return 0;   + if (map_getcell(bl->m, bl->x, bl->y, CELL_CHKSAFECELL)) + return 0; +   if( map_getcell(bl->m, bl->x, bl->y, CELL_CHKMAELSTROM) && skill_get_type(skill_id) != BF_MISC   && skill_get_casttype(skill_id) == CAST_GROUND )   return 0; diff --git a/src/map/map.c b/src/map/map.c index 2c8bf35..ced139c 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2718,6 +2718,7 @@ void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag)   case CELL_NOCHAT:        map[m].cell[j].nochat = flag;        break;   case CELL_MAELSTROM: map[m].cell[j].maelstrom = flag;  break;   case CELL_ICEWALL: map[m].cell[j].icewall = flag;  break; + case CELL_SAFECELL: map[m].cell[j].safecell = flag;  break;   default:   ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell);   break; diff --git a/src/map/map.h b/src/map/map.h index c584671..26f8b52 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -460,6 +460,7 @@ typedef enum {   CELL_NOCHAT,   CELL_MAELSTROM,   CELL_ICEWALL, + CELL_SAFECELL    } cell_t;   @@ -484,6 +485,7 @@ typedef enum {   CELL_CHKNOCHAT,   CELL_CHKMAELSTROM,   CELL_CHKICEWALL, + CELL_CHKSAFECELL    } cell_chk;   @@ -503,7 +505,8 @@ struct mapcell   novending : 1,   nochat : 1,   maelstrom : 1, - icewall : 1; + icewall : 1, + safecell : 1;    #ifdef CELL_NOSTACK   unsigned char cell_bl; //Holds amount of bls in this cell. diff --git a/src/map/skill.c b/src/map/skill.c index 117c0a7..efb1aab 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2247,6 +2247,8 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in   break;   case BL_PC: {   struct map_session_data *sd = BL_CAST(BL_PC, target); + if (map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_CHKSAFECELL)) + return 0;   if( sd->sc.data[SC_BASILICA] && sd->sc.data[SC_BASILICA]->val4 == sd->bl.id && !is_boss(src))   return 0; // Basilica caster can't be knocked-back by normal monsters.   if( !(flag&0x2) && src != target && sd->special_state.no_knockback )  
  5. Jonne's post in change IP to GM was marked as the answer   
    Pardon me, what?
    So everything a GM (Level 90+) logs in, the IP saved for him in the login table is changed to 127.0.0.1?
    I'd recommend a SRC edits, but if you want a NPC:

    -%TAB%script%TAB%name%TAB%-,{ OnPCLoginEvent: if (GetGMLevel() >= 90) { SQL_Query("UPDATE `login` SET `last_ip` = '127.0.0.1' WHERE `account_id` = '" + GetCharID(3) + "' LIMIT 1"); } End(); }
    Not tested, should work though.
×
×
  • Create New...