Jump to content

Brian

Members
  • Posts

    2223
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by Brian

  1. Add this getgroupid check at the beginning:

     

    -	script	vip_for_1week	-1,{
    OnPCLoginEvent:
    	if (getgroupid() != 0) end;
    	
    	// first time logging into this account
    	if (#VIP_expire == 0) {
    		set #VIP_expire, gettimetick(2) + (7*86400); // 7 days
    		dispbottom "Welcome to the server!";
    		dispbottom "You have been upgraded to a VIP for 1 week.";
    	}
    	
    	if (#VIP_expire > gettimetick(2)) {
    		// they still have time left
    		dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire);
    		atcommand "@adjgroup 1";
    		deltimer strnpcinfo(3)+"::OnPCLoginEvent";
    		if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error
    			addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnPCLoginEvent";
    		} else {
    			addtimer 2147483000, strnpcinfo(3)+"::OnPCLoginEvent";
    		}
    	} else if (#VIP_expire > 1) {
    		set #VIP_expire, 1;
    		atcommand "@adjgroup 0";
    		dispbottom "Your VIP Rental has expired.";
    	}
    	end;
    }
  2. -	script	vip_for_1week	-1,{
    OnPCLoginEvent:
    	// first time logging into this account
    	if (#VIP_expire == 0) {
    		set #VIP_expire, gettimetick(2) + (7*86400); // 7 days
    		dispbottom "Welcome to the server!";
    		dispbottom "You have been upgraded to a VIP for 1 week.";
    	}
    	
    	if (#VIP_expire > gettimetick(2)) {
    		// they still have time left
    		dispbottom "VIP Rental : expires in " + callfunc("Time2Str",#VIP_expire);
    		atcommand "@adjgroup 1";
    		deltimer strnpcinfo(3)+"::OnPCLoginEvent";
    		if ((#VIP_expire - gettimetick(2)) < 2147483) { // prevent overflow error
    			addtimer (#VIP_expire - gettimetick(2)) *1000, strnpcinfo(3)+"::OnPCLoginEvent";
    		} else {
    			addtimer 2147483000, strnpcinfo(3)+"::OnPCLoginEvent";
    		}
    	} else if (#VIP_expire > 1) {
    		set #VIP_expire, 1;
    		atcommand "@adjgroup 0";
    		dispbottom "Your VIP Rental has expired.";
    	}
    	end;
    }
    The values of the variable #VIP_expire

    0 = they never logged in

    1 = they used VIP for 1 week and now it's over

    gettimetick(2) = VIP is active and that's the UNIX time when it expires

  3. Here's another way to do it with script commands:

     

    	// Identify all unidentified items
    	getinventorylist;
    	for( set .@i,0; .@i < @inventorylist_count; set .@i, .@i +1 ) {
    		if ( @inventorylist_identify[.@i] == 1 ) continue;
    		delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;
    		getitem @inventorylist_id[.@i],1;
    		set .@count, .@count +1;
    	}
    	if (.@count) dispbottom .@count +" items identified.";
    
    • Upvote 1
  4. poring_w01,100,100,0	script	test	910,{

    query_sql "SELECT `char`.`name` FROM `char` WHERE `online` ORDER BY `name` ASC", .@name$;

    for (set .@i,0; .@i < getarraysize(.@name$); set .@i,.@i+1) {

    set .@menu$, .@menu$ + .@name$[.@i]+":";

    }

    mes "Please choose the player that you want:";

    set .@num, select(.@menu$);

    mes "You picked " + .@name$[.@num-1];

    // do other stuff here

    close;

    }

    I think there's a limit to how long a menu string can be, but I'm not sure what that length is.
  5. Yes you could remove these lines from /src/map/pc.c

     

    		// Message of the Day [Valaris]
    		for(i=0; i < MOTD_LINE_SIZE && motd_text[i][0]; i++) {
    			if (battle_config.motd_type)
    				clif_disp_onlyself(sd,motd_text[i],strlen(motd_text[i]));
    			else
    				clif_displaymessage(sd->fd, motd_text[i]);
    		}
    • Upvote 1
  6. motd_txt: conf/motd.txt
    ^ this line just sets the config setting "motd_txt" to the value "conf/motd.txt"

    I believe that's also hard-coded to a default value (of "conf/motd.txt") somewhere in /src.

    So if you comment out the line, the setting is just set to the default value: conf/motd.txt

    To actually remove the motd, just edit the file conf/motd.txt delete everything, and save the file.

  7. "bc_red" is not a valid flag, so the constant gets converted to 0, and flag 0 is the same as bc_all.

    bc_all	0
    bc_map	1
    bc_area	2
    bc_self	3
    bc_pc	0
    bc_npc	8
    bc_yellow	0
    bc_blue	16
    bc_woe	32
    Flag should be bc_self (or bc_map for the whole map), and then specify the color after.

    // announce "<text>",<flag>,<fontColor>;
    announce "You suddenly hear a ghastly voice", bc_self,"0xFF0000";
    sleep2 5000;
    announce "Faint Voice: You, who have known my existence.", bc_map,"0xFF0000";
    sleep2 8000;
    
  8. None of the SQL files in rAthena's /sql-files/ folder contain "playtime".

    Is this from a custom source modification you added?

    Did the source mod list any SQL queries you needed to run to modify your SQL tables?

  9. You have the right idea in your 1st post, but this line

    set .@pvp_maps,getmapusers("pvp_y_room") + getmapusers("pvp_y_1-2") + getmapusers("pvp_2v2");
    needs to be inside the while loop so it recalculates the 'getmapusers' every loop.

    When it's before the loop, it only runs once OnInit and the count is never recalculated.

     

    OnInit:
    	while (1) {
    		delwaitingroom;
    		set .@count, getmapusers("pvp_y_room") + getmapusers("pvp_y_1-2") + getmapusers("pvp_2v2");
    		waitingroom "PvP Room ["+ .@count + ((.@count==1) ? " User" : " Users") +"]",0;
    		sleep 1000;
    	}
    }
  10. Yes, a script could display a MVP Ladder using the info from the mvplog table.

    Turn on mvplog in /conf/log_athena.conf

    // Log MVP Monster Drops (Note 1)
    // Outdated. Use Pick_Log instead. But this log could be useful to keep track slayed MVPs
    log_mvpdrop: yes
     

    Each mvp monsters has a different points to give dependin on its difficulty.

    Can you post a list of what you want the points to be for each MVP?

  11. They are saved in RAM and deleted when the character logs out or when the @var is deleted (set to 0 or string set to ""). Since there is no secondary storage, there is no "save interval". They are updated (in RAM) only when the @var changes.

  12. From within the script if you use strnpcinfo(3) that will reference the NPC's unique name, and in duplicated NPCs, that will be the unique name of the duplicate NPC.

     

    To call a label, use donpcevent.

    getvariableofnpc can only fetch npc-bound variables, but not arrays.

    If you're planning on accessing variables of other NPCs on the map or triggering event labels in other NPCs on the map, I suggest name the NPCs like this: NPCNAME#mapname

    BattleNPC#poring_w01

    testnpc#poring_w01

    BattleNPC#anothermap

    testnpc#anothermap

    Then if you want BattleNPC#poring_w01 to trigger something in testnpc#poring_w01 you could do:

    donpcevent "testnpc#" + strnpcinfo(4);
    which will be "testnpc#poring_w01" because strnpcinfo(4) returns the name of the map the NPC is in.

    When you create duplicates on different maps, strnpcinfo(4) will return the mapname and it will work (as long as your npcs are named NPCNAME#mapname.

  13. but this only can teleport on fix where i need one not fix warp

    Instead of coordinates x,y use coordinates 0,0. This will warp them to a random spot on the map. Or do you have a list of specific coordinates you want to use (ex: random corner of a PVP map) ?
  14. Your script shows the query that created the `mvprank` table:

    OnInit:
    query_sql "CREATE TABLE IF NOT EXISTS `mvprank` (`id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0',`name` VARCHAR( 23 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,`mvpkills` BIGINT UNSIGNED NOT NULL ,UNIQUE (`id`)) ENGINE = MYISAM";
    But how did you create the `mvp` table? Can you post the SQL query you used?
×
×
  • Create New...