Brian
Members-
Posts
2223 -
Joined
-
Last visited
-
Days Won
24
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Brian
-
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; }
-
Help Random WOE Castle not compatible Rathena
Brian replied to alcapone's question in Scripting Support
Here you go: agit_controller_random.txt I updated the warp names to match the changes in 49459d342ec4e3b5d2ca8dbf85ab924ffa89faca. -
- 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_expire0 = 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
-
Here's an example of how you could edit the zeny of an offline player: zeny_transfer.txt query_sql "UPDATE `char` SET `zeny`=`zeny`+'"+.@amt+"' WHERE `char_id`='"+.@char_id+"'";
-
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.";
-
I don't think there's a way to change/refresh 'mes' text once it's sent to the client. If the NPC is displaying text with waitingroom, you could have that refresh on a timer or triggered with doevent/donpcevent.
-
Change these 3 variables from temporary character variables to permanent character variables: @lastwarpmap$ @lastwarpx @lastwarpy Find all occurrences of each one and replace with: lastwarpmap$ lastwarpx lastwarpy
-
Did you setup 2 SQL databases (and configure in inter_athena.conf), one for each RO server?
-
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.
-
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]); }
-
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.
-
A little help with these simple lines
Brian replied to PandaLovesHamster's question in Scripting Support
"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 32Flag 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; -
Here you go, try this: http://rathena.kpaste.net/e5d94?raw I wasn't sure what the item_id of your custom MVP Reward is, so just edit line 72: // give item to player getitem 55555,1, .@reward_accountid; end;
-
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?
-
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; } }