Sergardo Posted June 17, 2020 Share Posted June 17, 2020 (edited) .rate = 50; - if i make it 100 no point drop when killing // https://rathena.org/board/topic/108888-request-a-gold-room-drop-gold-point/ prontera,155,181,5 script Sample#goldroom 4_F_KAFRA1,{ doevent "gold_room_main::OnTalk"; } // warp portal back prontera ordeal_3-2,123,123,0 warp gold_room_back_prt 1,1,prontera,155,181 // peco peco summon ordeal_3-2,0,0,0,0 monster Peco Peco 1019,200,60000,0,"gold_room_main::OnKill" - script gold_room_main -1,{ OnInit: // gold room map .map$ = "ordeal_3-2"; // entrance fee .zeny_cost = 200000; // rate to get gold .rate = 50; - if i make it 100 no point drop when killing // gold random amount setarray .gold_amount,1,5; setmapflag .map$,mf_noteleport; setmapflag .map$,mf_pvp; setmapflag .map$,mf_pvp_noguild; setmapflag .map$,mf_pvp_noparty; setmapflag .map$,mf_nobranch; setmapflag .map$,mf_nosave; setmapflag .map$,mf_nomemo; setmapflag .map$,mf_noreturn; setmapflag .map$,mf_nowarp; setmapflag .map$,mf_nowarpto; end; OnTalk: mes "Enter Gold Room ?"; if ( .zeny_cost ) mes F_InsertComma( .zeny_cost ) + " Zeny"; switch ( select( "Enter Gold Room", "Exchange Gold Point", "Cancel" )) { case 1: if ( Zeny < .zeny_cost ) { mes "Not enough Zeny."; } else { Zeny -= .zeny_cost; warp .map$,0,0; } break; case 2: mes "You got "+F_InsertComma( #GOLDPOINTS )+" Points"; input [email protected],0,#GOLDPOINTS; if ( checkweight( 969, [email protected] ) ) { #GOLDPOINTS -= [email protected]; getitem 969,[email protected]; mes "Gained "[email protected]+" Gold."; } else { mes "You overweight."; } default: break; } close; OnKill: if ( .rate < rand( 100 ) ) { [email protected] = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "[email protected]+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now."; } end; OnPCDieEvent: [email protected] = killerrid; if ( strcharinfo(3) == .map$ && [email protected] != getcharid(3) && getmonsterinfo( [email protected],MOB_NAME ) != "null" ) { #GOLDPOINTS = 0; dispbottom "You died, you lost all the point."; } end; } Edited June 17, 2020 by Mabuhay Please use codebox next time Quote Link to comment Share on other sites More sharing options...
0 Patskie Posted June 19, 2020 Share Posted June 19, 2020 Try below prontera,155,181,5 script Sample#goldroom 4_F_KAFRA1,{ doevent "gold_room_main::OnTalk"; } // warp portal back prontera ordeal_3-2,123,123,0 warp gold_room_back_prt 1,1,prontera,155,181 // peco peco summon ordeal_3-2,0,0,0,0 monster Peco Peco 1019,200,60000,0,"gold_room_main::OnKill" - script gold_room_main -1,{ OnInit: // gold room map .map$ = "ordeal_3-2"; // entrance fee .zeny_cost = 200000; // rate to get gold .rate = 100; // gold random amount setarray .gold_amount,1,5; setmapflag .map$,mf_noteleport; setmapflag .map$,mf_pvp; setmapflag .map$,mf_pvp_noguild; setmapflag .map$,mf_pvp_noparty; setmapflag .map$,mf_nobranch; setmapflag .map$,mf_nosave; setmapflag .map$,mf_nomemo; setmapflag .map$,mf_noreturn; setmapflag .map$,mf_nowarp; setmapflag .map$,mf_nowarpto; end; OnTalk: mes "Enter Gold Room ?"; if ( .zeny_cost ) mes F_InsertComma( .zeny_cost ) + " Zeny"; switch ( select( "Enter Gold Room", "Exchange Gold Point", "Cancel" )) { case 1: if ( Zeny < .zeny_cost ) { mes "Not enough Zeny."; } else { Zeny -= .zeny_cost; warp .map$,0,0; } break; case 2: mes "You got "+F_InsertComma( #GOLDPOINTS )+" Points"; input [email protected],0,#GOLDPOINTS; if ( checkweight( 969, [email protected] ) ) { #GOLDPOINTS -= [email protected]; getitem 969,[email protected]; mes "Gained "[email protected]+" Gold."; } else { mes "You overweight."; } default: break; } close; OnKill: if ( .rate > rand( 100 ) ) { [email protected] = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "[email protected]+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now."; } end; OnPCDieEvent: [email protected] = killerrid; if ( strcharinfo(3) == .map$ && [email protected] != getcharid(3) && getmonsterinfo( [email protected],MOB_NAME ) != "null" ) { #GOLDPOINTS = 0; dispbottom "You died, you lost all the point."; } end; } Quote Link to comment Share on other sites More sharing options...
1 Katazui Posted June 17, 2020 Share Posted June 17, 2020 (edited) OnKill: if ( .rate < rand( 100 ) ) { .@point = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "+.@point+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now."; } end; to OnKill: [email protected] = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "[email protected]+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now.";\ end; Edited June 17, 2020 by Katazui Quote Link to comment Share on other sites More sharing options...
0 klitidej Posted June 18, 2020 Share Posted June 18, 2020 Default monster is 50. If party member <=5 monster +10, If party member <=10 monster +10, If party member <= 15 monster +10. Thank you for your help. Quote Link to comment Share on other sites More sharing options...
0 Sergardo Posted June 19, 2020 Author Share Posted June 19, 2020 On 6/17/2020 at 10:26 AM, Katazui said: OnKill: if ( .rate < rand( 100 ) ) { .@point = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "+.@point+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now."; } end; to OnKill: [email protected] = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "[email protected]+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now.";\ end; nothing happen sir still no point gold room with point system when killing peco pa help mga idol yung working sa 2015 + client Quote Link to comment Share on other sites More sharing options...
0 Mabuhay Posted June 19, 2020 Share Posted June 19, 2020 (edited) Execute this script command (Samples on how to use it is provided) (Source : doc/script_commands.txt). *getpartymember <party id>{,<type>{,<array_variable>}}; This command will find all members of a specified party and returns their names (or character id or account id depending on the value of "type") into an array of temporary global variables. There's actually quite a few commands like this which will fill a special variable with data upon execution and not do anything else. Upon executing this, [email protected]$[] is a global temporary string array which contains all the names of these party members (only set when type is 0 or not specified) [email protected][] is a global temporary number array which contains the character id of these party members. (only set when type is 1) [email protected][] is a global temporary number array which contains the account id of these party members. (only set when type is 2) [email protected] is the number of party members that were found. The party members will (apparently) be found regardless of whether they are online or offline. Note that the names come in no particular order. Be sure to use [email protected] to go through this array, and not 'getarraysize', because it is not cleared between runs of 'getpartymember'. If someone with 7 party members invokes this script, the array would have 7 elements. But if another person calls up the NPC, and he has a party of 5, the server will not clear the array for you, overwriting the values instead. So in addition to returning the 5 member names, the 6th and 7th elements from the last call remain, and you will get 5+2 members, of which the last 2 don't belong to the new guy's party. [email protected] will always contain the correct number, (5) unlike 'getarraysize()' which will return 7 in this case. If 'array_variable' is set, the result will be stored to that variable instead using global variable. Example 1: list party member names // get the party member names getpartymember getcharid(1),0; // It's a good idea to copy the global temporary [email protected]***** // variables to your own scope variables because if you have pauses in this // script (sleep, sleep2, next, close2, input, menu, select, or prompt), // another player could click this NPC, trigger 'getpartymember', and // overwrite the [email protected]***** variables. [email protected] = [email protected]; copyarray [email protected]$[0], [email protected]$[0], [email protected]; // list the party member names for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) mes ([email protected] +1) + ". ^0000FF" + [email protected]$[[email protected]] + "^000000"; close; Example 2: check party count (with a 'next' pause), before warping to event .register_num = 5; // How many party members are required? // get the charID and accountID of character's party members getpartymember getcharid(1), 1; getpartymember getcharid(1), 2; if ( [email protected] != .register_num ) { mes "Please form a party of " + .register_num + " to continue"; close; } // loop through both and use 'isloggedin' to count online party members for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) [email protected]_online++; // We search accountID & charID because a single party can have multiple // characters from the same account. Without searching through the charID, // if a player has 2 characters from the same account inside the party but // only 1 char online, it would count their online char twice. if ( [email protected]_online != .register_num ) { mes "All your party members must be online to continue"; close; } // copy the array to prevent players cheating the system copyarray [email protected], [email protected], .register_num; mes "Are you ready ?"; next; // careful here select("Yes"); // When a script hits a next, menu, sleep or input that pauses the script, // players can invite or /leave and make changes in their party. To prevent // this, we call getpartymember again and compare with the original values. getpartymember getcharid(1), 1; if ( [email protected] != .register_num ) { mes "You've made changes to your party !"; close; } for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) { if ( [email protected][[email protected]] != [email protected][[email protected]] ) { mes "You've made changes to your party !"; close; } } // Finally, it's safe to start the event! warpparty "event_map", 0,0, getcharid(1); Count the players on the party. Store into temp variable (or not if you prefer to) Add the arguments That should be it. Gold_Room_Script_Download Edited June 19, 2020 by Mabuhay 1 Quote Link to comment Share on other sites More sharing options...
.rate = 50; - if i make it 100 no point drop when killing
// https://rathena.org/board/topic/108888-request-a-gold-room-drop-gold-point/
prontera,155,181,5 script Sample#goldroom 4_F_KAFRA1,{ doevent "gold_room_main::OnTalk"; } // warp portal back prontera ordeal_3-2,123,123,0 warp gold_room_back_prt 1,1,prontera,155,181 // peco peco summon ordeal_3-2,0,0,0,0 monster Peco Peco 1019,200,60000,0,"gold_room_main::OnKill" - script gold_room_main -1,{ OnInit: // gold room map .map$ = "ordeal_3-2"; // entrance fee .zeny_cost = 200000; // rate to get gold .rate = 50; - if i make it 100 no point drop when killing // gold random amount setarray .gold_amount,1,5; setmapflag .map$,mf_noteleport; setmapflag .map$,mf_pvp; setmapflag .map$,mf_pvp_noguild; setmapflag .map$,mf_pvp_noparty; setmapflag .map$,mf_nobranch; setmapflag .map$,mf_nosave; setmapflag .map$,mf_nomemo; setmapflag .map$,mf_noreturn; setmapflag .map$,mf_nowarp; setmapflag .map$,mf_nowarpto; end; OnTalk: mes "Enter Gold Room ?"; if ( .zeny_cost ) mes F_InsertComma( .zeny_cost ) + " Zeny"; switch ( select( "Enter Gold Room", "Exchange Gold Point", "Cancel" )) { case 1: if ( Zeny < .zeny_cost ) { mes "Not enough Zeny."; } else { Zeny -= .zeny_cost; warp .map$,0,0; } break; case 2: mes "You got "+F_InsertComma( #GOLDPOINTS )+" Points"; input [email protected],0,#GOLDPOINTS; if ( checkweight( 969, [email protected] ) ) { #GOLDPOINTS -= [email protected]; getitem 969,[email protected]; mes "Gained "[email protected]+" Gold."; } else { mes "You overweight."; } default: break; } close; OnKill: if ( .rate < rand( 100 ) ) { [email protected] = rand( .gold_amount[0],.gold_amount[1] ); #GOLDPOINTS += [email protected]; dispbottom "Gained "[email protected]+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now."; } end; OnPCDieEvent: [email protected] = killerrid; if ( strcharinfo(3) == .map$ && [email protected] != getcharid(3) && getmonsterinfo( [email protected],MOB_NAME ) != "null" ) { #GOLDPOINTS = 0; dispbottom "You died, you lost all the point."; } end; }
Edited by MabuhayPlease use codebox next time
Link to comment
Share on other sites