Jump to content

x13th

Members
  • Content Count

    78
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by x13th


  1. -Cough- should totally bring the Clan System to Hercules x13th with a nice ole PR...

     

    We're so behind on actual content it's not even funny, and I love Hercules..

    Yeah. Me too love Hercules thats why i didnt switch to rAthena. :D

    Finally I converted it to Herc. I want to share it but we have rules we cant share if we're not the author.


  2. I'm trying to convert rAthena Clan system to Herc and now after compiling no error shows up until when i run the server the char server stopped. I'm using windows btw.

     

    I found what causing it but dont know why.

    If I add

    inter_clan->sql_init();

    to

    int inter_init_sql(const char *file)

    the char server will stopped working

     

    so here's the whole code

    int inter_init_sql(const char *file)
    {
    	inter->config_read(file, false);
    
    	//DB connection initialized
    	inter->sql_handle = SQL->Malloc();
    	ShowInfo("Connect Character DB server.... (Character Server)\n");
    	if( SQL_ERROR == SQL->Connect(inter->sql_handle, char_server_id, char_server_pw, char_server_ip, (uint16)char_server_port, char_server_db) )
    	{
    		Sql_ShowDebug(inter->sql_handle);
    		SQL->Free(inter->sql_handle);
    		exit(EXIT_FAILURE);
    	}
    
    	if( *default_codepage ) {
    		if( SQL_ERROR == SQL->SetEncoding(inter->sql_handle, default_codepage) )
    			Sql_ShowDebug(inter->sql_handle);
    	}
    
    	wis_db = idb_alloc(DB_OPT_RELEASE_DATA);
    	inter_guild->sql_init();
    	inter_storage->sql_init();
    	inter_party->sql_init();
    	inter_pet->sql_init();
    	inter_homunculus->sql_init();
    	inter_mercenary->sql_init();
    	inter_elemental->sql_init();
    	inter_mail->sql_init();
    	inter_auction->sql_init();
            inter_clan->sql_init();
    
    	geoip->init();
    	inter->msg_config_read("conf/messages.conf", false);
    	return 0;
    }
    

     

    here's my int_clan.c

    http://upaste.me/97313640759e978d3

     

    and my int_clan.h

    http://upaste.me/f64c36408e18094f3


  3. add this function below Restrict function

    function VIP {
            // getarg(0) is the level of the vip that can access the map
    	if ( getarg(0) > getgmlevel() ) {
    	    if (getarg(1,0)) {
                	@vip_block = 0;
                	for (.@i = 1; .@i < getargcount(); .@i++)
                		@vip_block = @vip_block | (1<<getarg(.@i));
                } else {
    		    message strcharinfo(PC_NAME),"Only VIP have access in this map.";
    		    close;
                }
    	}
    	return;
    }
    

     

    replace function Pick with this

    function Pick {
    	.@warp_block = @warp_block;
    	@warp_block = 0;
    	.@vip_block = @vip_block;
    	@vip_block = 0;
    	.@select = select(@menu$);
    	if (getarg(0) == "") {
    		.@i = .@select;
    		.@map$ = getarg(.@i);
    	} else {
    		.@i = .@select-getarg(1,0);
    		.@map$ = getarg(0)+((.@i<10)?"0":"")+.@i;
    	}
    	if (.@warp_block & (1<<.@select)) {
    		message strcharinfo(PC_NAME),"This map is not enabled in "+(RENEWAL?"":"Pre-")+"Renewal.";
    		end;
    	}
    	if (.@vip_block & (1<<.@select)) {
        		message strcharinfo(PC_NAME),"Only VIP have access in this map.";
        		close;
        }
    	.@x = @c[.@i*2];
    	.@y = @c[.@i*2+1];
    	deletearray @c[0],getarraysize(@c);
    	Go(.@map$,.@x,.@y);
    }
    

    How to use?

    Call the function VIP before the warp function.

     

    Example

    For town warps:

     

    VIP(1) = the number 1 is the level that can access the map

    T1: VIP(1);
        Go("prontera",155,183);
    

    For fields and dungeons:

    F5: VIP(1,2,9);
        Restrict("Pre-RE",5);
    	setarray @c[2],180,178,231,160,191,172,228,194,224,203,190,223,234,177,194,175,172,172;
    	Disp("Comodo Field",1,9); Pick("cmd_fild");
    

    As you can see we have 3 argument, ( 1, 2 , 9 )

    1 = the number 1 is the level that can access the map

    2 = is the second comodo field that have restriction

    9 = is the 9th comodo field that have restriction

     

    You can add more arguments. VIP(1, 1,2,3... )

     

    Hope this will fulfill your request :)


  4. For the restrictions part, show us or tell us how your vip system works.

    If its like the others changing group level to 1 you just need to add if statement,

    e.g

    if(getgmlevel() >= 1){
      // Do this
    }
    

  5.  

     

    replace this code

    // Nothing stripped.
    			if (sd && !rate)
    clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    

    to

    // Nothing stripped.
    if (sd && !rate){
          int item_id = 7139; // Glistening Coat
          int ii;
          ARR_FIND(0, MAX_INVENTORY, ii, sd->status.inventory[ii].nameid == item_id);
          if (ii < MAX_INVENTORY) {
             pc->delitem(sd, ii, 1, 0, 0, LOG_TYPE_CONSUME);
          }
          clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    }
    

    This script of yours is not from dastgir's Plugin

    I refer to the link you gave. Start line 194, I just copied the code. Anyway you said its solved so why bother.


  6. replace this code

    // Nothing stripped.
    			if (sd && !rate)
    clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    

    to

    // Nothing stripped.
    if (sd && !rate){
          int item_id = 7139; // Glistening Coat
          int ii;
          ARR_FIND(0, MAX_INVENTORY, ii, sd->status.inventory[ii].nameid == item_id);
          if (ii < MAX_INVENTORY) {
             pc->delitem(sd, ii, 1, 0, 0, LOG_TYPE_CONSUME);
          }
          clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
    }
    
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.