-
Posts
1,658 -
Joined
-
Last visited
-
Days Won
67
Community Answers
-
sader1992's post in Callfunc error was marked as the answer
function script my_global_func { mes "this message from 'my_global_func' function from out the npc"; return; } prontera,0,0,0 script func_test 444,{ function my_func; my_func(); next; my_global_func(); next; callfunc("my_other_global_func"); end; function my_func { mes "this message from 'my_func' function from inside the npc"; return; } } function script my_other_global_func { mes "this message from 'my_other_global_func' function from out the npc"; return; }
-
sader1992's post in item shower was marked as the answer
set .item_id, 12903; // next item id to shower to
set .item_id1, 12903; // next item id to shower and
[email protected] = rand(2); makeitem [email protected]?.item_id:.item_id2,1,[email protected]$,[email protected]_diff,[email protected]_diff; // <<< im stuck on this to
makeitem getd(".item_id" + rand(1,8)),1,[email protected]$,[email protected]_diff,[email protected]_diff; // <<< im stuck on this
And this is a better way to do your script
- script Sample -1,{ OnInit: set .amount, 10; // amount of item to shower setarray .ItemID,12903,12904,12905,12906,12907,12908,13576,13584; .Size = getarraysize(.ItemID); bindatcmd "itemshower",strnpcinfo(3)+"::OnShower"; end; OnShower: getmapxy([email protected]$, [email protected], [email protected], BL_PC); while ( .count < .amount ) { do { [email protected]_diff = [email protected] + rand(1,5); [email protected]_diff = [email protected] + rand(1,5); } while (!checkcell([email protected]$,[email protected]_diff,[email protected]_diff,cell_chkpass)); makeitem .ItemID[rand(.Size)],1,[email protected]$,[email protected]_diff,[email protected]_diff; // <<< im stuck on this set .count, .count + 1; } set .count, 0; end; }
btw "bindatcmd "itemshower",strnpcinfo(3)+"::OnShower";" means any player can use the command
-
sader1992's post in How do I place a unique_id gepard check on this npc? was marked as the answer
or you can do something like
if(getd("$QID_" + get_unique_id())){ //already got }else{ //get something setd("$QID_" + get_unique_id(),true); }
-
sader1992's post in Mvp room with prize for killing an Mvp was marked as the answer
- script on_mvp_kill_item -1,{ OnNPCKillEvent: getunitdata(killedgid,[email protected]); if(([email protected][UMOB_MODE]&MD_MVP)){ //item id 501 , count 1 , drop item under the mvp location on death makeitem(501,1,mapid2name([email protected][UMOB_MAPID]),[email protected][UMOB_X],[email protected][UMOB_Y]); } end; }
-
sader1992's post in Limiting a (Shadow) Refiner to refine only 1-2 items was marked as the answer
setarray [email protected], EQI_SHADOW_ARMOR, EQI_SHADOW_WEAPON; for([email protected]=0;[email protected]<getarraysize([email protected]);[email protected]++){ if(getequipisequiped([email protected][[email protected]])) [email protected]$ += F_getpositionname([email protected][[email protected]]) + "[ " + getequipname([email protected][[email protected]]) + " ]"; [email protected]$ += ":"; } [email protected] = [email protected][select([email protected]$) -1];
-
sader1992's post in How to add Randomoption to ProduceItem was marked as the answer
sometimes this happen when you add random options in random positions , foe example , if you add an option at 0 and at 2 (and you skipped 1) your item might glitch
make sure you don't skip a positions in the random options slots.
-
sader1992's post in Enchanted itens Doesnt trade was marked as the answer
look like you enchantment npc give bound items , if you still have this issue , you can post the script you are using here.
if anyone have this problem, here is the solution ^
-
sader1992's post in Official Job Change Script was marked as the answer
you are using the custom job changer , I am asking about the official quest , all the quest are enabled by default , so just remove the job changer and people would be forced to go do their job quest.
-
sader1992's post in Gepard License was marked as the answer
you should talk to the server owner , and ask him to contact @Functor and ask him about the issue.
-
sader1992's post in clear-up monster was marked as the answer
prontera,0,0,0 script Clear-Monsters 444,{ [email protected] = 10000000; mes "do you like to clear all the monsters in this map ?"; mes "It will cost you " + F_InsertComma([email protected]) + "z"; if(select("Yes:No") == 2) end; clear; if(Zeny < [email protected]){ mes "you don't have " + F_InsertComma([email protected]) + "z"; end; } Zeny -= [email protected]; killmonsterall(strnpcinfo(4)); mes "Done!"; end; }
-
sader1992's post in Disable custom command use during WoE was marked as the answer
// Heroes of Vanaheim ==================== //======================================== - script at_veil_cmd -1,{ OnVeilWarp: if(agitcheck() || agitcheck2() || agitcheck3()){ mes "you can't use this command while the WoE is running!"; end; } warp "veil",120,145; end; OnInit: bindatcmd "veil", strnpcinfo(0)+"::OnVeilWarp"; }
-
sader1992's post in Get value from a char variable was marked as the answer
int64 value = pc_readregistry(sd, reference_uid(add_str("VARIABLE"), 0)); 0 = THE Index if you are using array , if not leave it 0
-
sader1992's post in npc with access restriction was marked as the answer
I didn't test it
// credits to Annieruru - script Stylist -1,{ if(vip_status(VIP_STATUS_ACTIVE)) setarray [email protected]_style,getbattleflag( "max_hair_style" ),getbattleflag( "max_hair_color" ),getbattleflag( "max_cloth_color" ); else setarray [email protected]_style,29,80,180; cutin "hairstyle_"+Sex, 3; mes .npc_name$; mes "Eu posso mudar sua aparência."; if( .item_size ){ mes " "; mes "^777777[ TAXAS DO SERVIÇO ]^000000"; for( [email protected] = 0; [email protected] < .menu_size; [email protected]++ ) if( .npc_mode & ( 1 << [email protected] ) ) if( .item[[email protected]] ) mes "^0055FF"+.menu_name$[[email protected]]+" : ^777777"+ .item[[email protected]] +" x "+getitemname(7420)+"^000000"; else mes "^0055FF"+.menu_name$[[email protected]]+" : ^777777Free of Charge^000000"; } next; [email protected] = ( select( .npc_menu$ ) - 1 ); [email protected]_value = getlook( .look_type[[email protected]] ); deletearray [email protected]; switch( [email protected] ){ Case 0: [email protected]$ = ","+getd( ".blacklist_hairstyle_"+Sex+"$" )+","; break; Case 1: [email protected]$ = ","+getd( ".blacklist_haircolor_"+Sex+"$" )+","; break; Case 2: [email protected]$ = ","+getd( ".blacklist_clothe_"+Sex+"$" )+","; break; default: break; } [email protected]_number = .min_style[[email protected]]; do{ next; mes .npc_name$; mes "Current "+.menu_name$[[email protected]]+" : ^0055FF"[email protected]_number+"th^000000"; mes " "; [email protected] = 0; if( compare( [email protected]$,","[email protected]_number+"," ) ){ mes "^FF0000NOTE : This style REMOVED^000000"; [email protected] = 1; setlook .look_type[[email protected]],.min_style[[email protected]]; }else{ setlook .look_type[[email protected]],[email protected]_number; if( .item[[email protected]] ){ mes "Cost : ^777777"+ .item[[email protected]] +" x "+getitemname(7420)+"^000000"; mes " "; } } [email protected] = [email protected]_number + 1; [email protected] = [email protected]_number - 1; if( [email protected] > [email protected]_style[[email protected]] ) [email protected] = .min_style[[email protected]]; if( [email protected] < .min_style[[email protected]] ) [email protected] = [email protected]_style[[email protected]]; [email protected] = prompt( "Próximo - [ ^777777"[email protected]+"th Style^000000 ]", "Voltar - [ ^777777"[email protected]+"th Style^000000 ]", "Pular para...", ( [email protected] )?"":"^0055FFCerto, eu quero esse "+.menu_name$[[email protected]]+"^000000" ); switch( [email protected] ){ Case 1: [email protected]_number = [email protected]; break; Case 2: [email protected]_number = [email protected]; break; Case 3: mes "Available Style : ^0055FF"+.min_style[[email protected]]+" ~ "[email protected]_style[[email protected]]+"^000000."; input [email protected]_number,.min_style[[email protected]],[email protected]_style[[email protected]]; break; Case 4: if( [email protected]_value == [email protected]_number ){ mes "Swt..this is your original hairstyles."; } else if( .item[[email protected]] && countitem(7420) < .item[[email protected]] ){ mes "Você não tem suficientes "+getitemname(7420)+" para mudar a "+.menu_name$[[email protected]]+"."; }else{ mes "Aproveite seu ^0055FFNEW "+.menu_name$[[email protected]]+" !!"; if( .item[[email protected]] ) delitem 7420, .item[[email protected]]; [email protected]_value = [email protected]_number; } default: setlook .look_type[[email protected]],[email protected]_value; break; } }while( [email protected] != 4 && [email protected] != 255 ); close; OnInit: waitingroom "[Estilista]",0; // NPC name .npc_name$ = "[^0055FF ::: Estilista ::: ^000000]"; // NPC Mode ( Bitmask ) // 1 - Enable Hairstyle // 2 - Enable Hair Color // 4 - Enable Cloth Color .npc_mode = 7; // Menu Name setarray .menu_name$, "Estilo do Cabelo", "Cor do Cabelo", "Cor da Roupa"; // Payment (7420) setarray .item, 5, // Hairstyle 5, // Hair Color 5; // Cloth Color // Blacklisted Style for each style and each gender. // --- Female --- .blacklist_hairstyle_0$ = "2,4,6"; .blacklist_haircolor_0$ = "1,3,5"; .blacklist_cloth_0$ = "143,188,261"; // --- Male --- .blacklist_hairstyle_1$ = "3,5,7"; .blacklist_haircolor_1$ = "2,4,6"; .blacklist_cloth_1$ = "143,188,261"; // Dont edit setarray .min_style,getbattleflag( "min_hair_style" ),getbattleflag( "min_hair_color" ),getbattleflag( "min_cloth_color" ); .menu_size = getarraysize( .menu_name$ ); .item_size = getarraysize( .item ); setarray .look_type,LOOK_HAIR,LOOK_HAIR_COLOR,LOOK_CLOTHES_COLOR; for( .npc_menu$ = ""; [email protected] < .menu_size; [email protected]++ ) .npc_menu$ = .npc_menu$ + ( ( .npc_mode & ( 1 << [email protected] ) )? .menu_name$[[email protected]]:"" ) +":"; end; } // NPC Lists prontera,175,202,4 duplicate(Stylist) Estilista#4 878
-
sader1992's post in Quest NPC With Random Reward was marked as the answer
prontera,0,0,0 script quest 444,{ mes "do you want to exchange the items:"; for([email protected]=0;[email protected]<getarraysize(.requirements);[email protected]+=2){ mes "(" + .requirements[[email protected] +1] + ") " + getitemname(.requirements[[email protected]]); } mes "for a random reward ?"; if(select("yes:no") == 2) end; for([email protected]=0;[email protected]<getarraysize(.requirements);[email protected]+=2){ if(countitem(.requirements[[email protected]]) < .requirements[[email protected]+1]){ mes "you dont have (" + .requirements[[email protected] +1] + ") " + getitemname(.requirements[[email protected]]); end; } } for([email protected]=0;[email protected]<getarraysize(.requirements);[email protected]+=2){ delitem .requirements[[email protected]],.requirements[[email protected] +1]; } getitem .rewards[rand(getarraysize(.rewards))],1; announce "player: " + strcharinfo(0) + "Did the quest!!!!",bc_all; end; OnInit: setarray .rewards,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082; setarray .requirements,7020,10,1054,50,7035,15,1009,50,7442,50; end; }
-
sader1992's post in Script Event Random was marked as the answer
something like this ?
// OnClock<hour><minute>: donpcevent "<npc_name>::OnStart"; OnClock0000: OnClock0400: OnClock0800: OnClock1200: OnClock1600: OnClock2000: switch(rand(1,6)){ case 1: donpcevent "Event_1::OnStart"; end; case 2: donpcevent "Event_2::OnStart"; end; case 3: donpcevent "Event_3::OnStart"; end; case 4: donpcevent "Event_4::OnStart"; end; case 5: donpcevent "Event_5::OnStart"; end; case 6: donpcevent "Event_6::OnStart"; end; } or
// OnClock<hour><minute>: donpcevent "<npc_name>::OnStart"; OnClock0000: OnClock0400: OnClock0800: OnClock1200: OnClock1600: OnClock2000: donpcevent "Event_" + rand(1,6) + "::OnStart"; end;
-
sader1992's post in Give Item to specific account_id please help ! was marked as the answer
setarray [email protected],2000001,2000034,2000075,2000002,2000007; if(!#give70 && inarray([email protected],getcharid(3)) != -1){ getitem <id>,<count>; #give70 = true; }
-
sader1992's post in 1 day rental with 1 click was marked as the answer
prontera,154,180,0 script rental item 444,{ if(#CASHPOINTS){ rentitem <item id>,<time>;//time in seconds, 1 day = 86400 #CASHPOINTS -= 1; } end; OnInit: waitingroom "[ Click Me! ]",0; end; }
-
sader1992's post in Adding monster was marked as the answer
this wont excite anyway
try to use OnInstanceInit: , also with what mentioned above about the map name,
also for the npc name *instance_npcname("<npc name>"{,<instance id>})
job_thief1,1,1,0 script #testmobs HIDDEN_WARP_NPC,{ //mes "Hi there"; close; OnInstanceInit: [email protected]$ = instance_mapname("job_thief1"); [email protected]$ = instance_npcname("#testmobs"); monster [email protected]$,0,0,"Apocalypse",30001,34,[email protected]$ + "::OnMobsKilled"; monster [email protected]$,0,0,"Civil Servant",30002,37,[email protected]$ + "::OnMobsKilled"; monster [email protected]$,0,0,"Undoer",30003,33,[email protected]$ + "::OnMobsKilled"; monster [email protected]$,0,0,"Leaf Cat",30004,35,[email protected]$ + "::OnMobsKilled"; monster [email protected]$,0,0,"Enchanter",30005,32,[email protected]$ + "::OnMobsKilled"; monster [email protected]$,0,0,"Garm",30006,5,[email protected]$ + "::OnMobsKilled"; monster [email protected]$,0,0,"Raydric DeadEye",30007,35,[email protected]$ + "::OnMobsKilled"; monster [email protected]$,0,0,"Monkey Fist",30008,22,[email protected]$ + "::OnMobsKilled"; OnMobsKilled: //announce "Hey, " + strcharinfo(0) + " just killed a Poringz0rd!",bc_blue|bc_all; end; }
-
sader1992's post in Custom Autoloot - No Cards and MvPs was marked as the answer
on clean
https://github.com/rathena/rathena/compare/master...sader1992:autoloot_no_mvp_no_card
you should remove what I sent before
https://github.com/sader1992/rathena/commit/57018fda8f80db4b9a5e8faa20924ad96c75fb5b
(this include the undo of the before)
-
sader1992's post in Ubuntu 18 - Make Server Failure was marked as the answer
try cmake
mkdir build && cd build && cmake -G"Unix Makefiles" -DINSTALL_TO_SOURCE=ON .. && make
-
sader1992's post in @warp payment required was marked as the answer
try this
- script war_pay -1,{ OnInit: bindatcmd "warp",strnpcinfo(3)+"::OnWarpCommand"; end; OnWarpCommand: if([email protected]_numparameters != 1 && [email protected]cmd_numparameters != 3){ dispbottom "@warp Failed."; dispbottom "@warp <map_name> <x> <y>"; dispbottom "@warp <map_name>,<x>,<y>"; end; } [email protected]$ = strtolower([email protected]_parameters$[0]); [email protected] = atoi([email protected]_parameters$[1]); [email protected] = atoi([email protected]_parameters$[2]); if([email protected]_numparameters == 1){ if(compare([email protected]$,",")){ explode([email protected]$, [email protected]$, ","); [email protected]$ = [email protected]$[0]; [email protected] = atoi([email protected]$[1]); [email protected] = atoi([email protected]$[2]); } } dispbottom "It cost you 1,000 zeny to warp."; if ( Zeny > 1000 ){ set Zeny, Zeny - 1000; warp [email protected]$,[email protected],[email protected]; end; } dispbottom "Can't warp you. You don't have zeny."; end; }
-
sader1992's post in Check if monster is attacking a player was marked as the answer
*getunitdata <GID>,<arrayname>; UMOB_TARGETID
-
sader1992's post in [REMAKE] Happy Hour EXP "extended" was marked as the answer
happy_hour_npc (1) (1).txt
-
sader1992's post in HELP - stat bonus bug was marked as the answer
https://github.com/rathena/rathena/pull/4885/files