Jump to content

GM Incarnation

Members
  • Posts

    75
  • Joined

  • Last visited

Posts posted by GM Incarnation

  1. In src/map/atcommand.c:

    Find:

    /*==========================================
    *
    *------------------------------------------*/
    ACMD_FUNC(monster)
    {
    char name[NAME_LENGTH];
    char monster[NAME_LENGTH];
    char eventname[EVENT_NAME_LENGTH] = "";
    int mob_id;
    int number = 0;
    

    Before add:

    static int monsterBlock(int compareid){
     FILE *fp;
    char line[1024];
    int ln=0;
    int nameid;
    char filename[255];
    snprintf(filename, 255, "%s/"DBPATH"monster_block.txt", db_path);
    
    if( (fp=fopen(filename,"r"))==NULL ){
      ShowError("can't read %s\n", filename);
     return -1;
    }
    while(fgets(line, sizeof(line), fp))
    {
     if(line[0] == '\n' || line[0] == '\r' || line[0] == ' ' || (line[0]=='/' && line[1]=='/'))
      continue;
     nameid = atoi(line);
     if(compareid == nameid)
      return 1; // Monster Blocked
    }
    fclose(fp);
    return 0; // Monster Accepted
    
    }
    

    Within ACMD_FUNC(monster) find:

    int mob_id;
    

    Replace with:

    int mob_id, mB = 0;
    

    Find:

    if (mob_id == MOBID_EMPERIUM) {
     clif_displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned.
     return -1;
    }
    

    After add:

    if(pc_get_group_level(sd) < 99 && (mB  = monsterBlock(mob_id)))
     if(mB == 1){
      clif_displaymessage(fd, "Acess_Restriction: Administrator restricted this monster from being called by @monster direct command.");
      return -1;
     }
    

    Go to db path and create a file called: monster_block.txt

    Put into it ID from monsters you want to block, like this:

    //Comments

    1001 //Scorpion

    1002

    1003 //etc

    --------------------------------------------------------------------------------------------------------

    Admin level 99 can still summon any monster, if you don't want it change it:

    if(pc_get_group_level(sd) < 99 && (mB  = monsterBlock(mob_id)))
    

    To:

    if((mB = monsterBlock(mob_id)))
    

    Hi MarkZD

    Pls adivse where i must pu Before add:

    thanks

×
×
  • Create New...