Jump to content

Capuche

Developer
  • Posts

    2,407
  • Joined

  • Last visited

  • Days Won

    49

Community Answers

  1. Capuche's post in R> Custom Reset NPC was marked as the answer   
    Untested
    prontera,150,193,4 script Reset Girl 124,{ disable_items; disable_command; mes "[Reset Girl]"; switch( Upper ) { case 0:// normal class case 2:// baby class if (BaseLevel < 50) [email protected] = 40000; else if (BaseLevel < 90) [email protected] = 70000; else [email protected] = 100000; mes "Reset Stats: " + [email protected] + "z."; mes "Reset Skills: " + [email protected] + "z."; mes "Please select the service you want:"; next; [email protected] = select( "Reset Skills", "Reset Stats" ); mes "[Reset Girl]"; if (Zeny < [email protected]) { mes "Sorry, you don't have enough Zeny."; close; } Zeny -= [email protected]; if ([email protected] == 2) resetstatus; else { sc_end_class; resetskill; } mes "There you go!"; close; case 1:// advanced class [email protected] = 1000000; if (BaseLevel > 89) [email protected] += 500000; mes "Reset Stats: " + [email protected] + "z + 1 Monster Card."; mes "Reset Skills: " + [email protected] + "z + 1 Monster Card."; mes "Please select the service you want:"; next; [email protected] = select( "Reset Skills", "Reset Stats" ); mes "[Reset Girl]"; if (Zeny < [email protected]) { mes "Sorry, you don't have enough Zeny."; close; } getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected]++ ) { if (getiteminfo(@inventorylist_id[[email protected]],2) != 6) continue; [email protected]_id[[email protected]_size] = @inventorylist_id[[email protected]]; [email protected]_name$[[email protected]_size] = getitemname( @inventorylist_id[[email protected]] ); [email protected]_size++; } if ([email protected]_size < 1) { mes "Sorry, you don't have enough Card."; close; } mes "Which card do you want to use?"; next; [email protected] = select( implode([email protected]_name$,":") ) - 1; mes "[Reset Girl]"; if (Zeny < [email protected]) { mes "It shouldn't happen."; close; } if (countitem([email protected]_id[[email protected]]) < 1) { mes "It shouldn't happen."; close; } Zeny -= [email protected]; delitem [email protected]_id[[email protected]],1; if ([email protected] == 2) resetstatus; else { sc_end_class; resetskill; } mes "There you go!"; close; } }  
  2. Capuche's post in Asking about warp2 script command was marked as the answer   
    https://github.com/rathena/rathena/commit/809754379b75371c1442e08b9b6a6c01aa15228e
    Will you patch this manually?
  3. Capuche's post in OnPcDieEvent in instances was marked as the answer   
    - script Controller -1,{ OnPcDieEvent: if (strcharinfo(3) == instance_mapname("geffen")) { 'chance++; if ('chance == 3) mapwarp instance_mapname("geffen"),"prontera",150,150; else mapannounce instance_mapname("geffen"), "" + strcharinfo(0) + " has died! you only have " + (3 - 'chance) + " lives remaining.", bc_all; } end; } should work.
     
    About the script with the timer : forget it. After reading the commit, https://github.com/rathena/rathena/commit/9c46f3e6ba288c71f098b12834ea25779eadbc0e just prevent to duplicate npcs with script event in instance.
     
    Notes:
    - strcharinfo(3) return the real map name of the player.
    - instance_mapname doc :
    If no instance ID is specified, the instance the script is attached to is used. If the script is not attached to an instance, the instance of the currently attached player is used (if it is a character, party, guild or clan mode). Within your OnPCDieEvent instance_mapname will use by default the instance id attached to the player.
     
    EDIT: @crazyarashi please double check your script before posting!
  4. Capuche's post in Check party for duplicate job? was marked as the answer   
    Untested
    getpartymember getcharid(1),1; getpartymember getcharid(1),2; for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) if (isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) == 0) continue; [email protected] = readparam( Class, [email protected][[email protected]] ); if (compare( [email protected]_list$, "|" + [email protected] + "|" ) == 1) { mes "Sorry, only one " + jobname([email protected]) + " is allowed."; close; } [email protected]_list$ += "|" + [email protected] + "|"; }  
    EDIT : should still work
     
  5. Capuche's post in Instance/timer script help was marked as the answer   
    Untested
    // instance_db.txt // 100,Bossnia,1800,1800,guild_vs2,0,0 prontera,154,187,5 script test5 100,{ [email protected]_id = getcharid(1); [email protected]_name$ = getpartyname([email protected]_id); [email protected]_name$ = "Bossnia"; if (!instance_check_party([email protected]_id)) { mes "Why don't you make a party with more than 1 person and talk to me again?"; close; } if (getcharid(0) == getpartyleader([email protected]_id,2)) [email protected]$ = "Generate Instance"; switch( select( [email protected]$, "Enter " + [email protected]_name$ + "", "Cancel" ) ) { case 1: switch( instance_create([email protected]_name$) ) { case -3: dispbottom "Memorial Dungeon, '" + [email protected]_name$ + "' is already in progress.",0xFFFFFF; end; case -4: case -2: case -1: mes "Party Name: " + [email protected]_name$; mes "Party Leader: " + strcharinfo(0); mes "^0000ff" + [email protected]_name$ + "^000000 - time gap generation failed."; close; } end; case 2: switch( instance_enter([email protected]_name$) ) { case IE_OTHER: mes "An unknown error has occurred."; close; case IE_NOINSTANCE: mes "The time gap is not yet open."; close; case IE_NOMEMBER: mes "Your body is not fit to enter the time gap. You won't be able to get in if you're not in a party."; close; case IE_OK: mapannounce strnpcinfo(4), [email protected]_name$ + " party member " + strcharinfo(0) + " enters " + [email protected]_name$ + "",bc_map,"0x00ff99"; end; } case 3: end; } } The script create an instance attached to the party. All party member can enter.
  6. Capuche's post in Script from 2014 was marked as the answer   
    Replace
    sd = script_rid2sd(st); by
    sd = map_id2sd(st->rid);  
  7. Capuche's post in Arrays on countitem was marked as the answer   
    setarray .ID[0],501,502,503,504,505; setarray .AM[0],1,2,3,4,5; for ( [email protected] = 0; [email protected] < 5; [email protected]++ ) { if (countitem(.ID[[email protected]]) < .AM[[email protected]]) [email protected]$ += (.AM[[email protected]] - countitem(.ID[[email protected]])) + " x " + getitemname(.ID[[email protected]]) + "\n"; } if ([email protected]$ != "") { mes "You are missing the following items:"; mes [email protected]$; close; }  
  8. Capuche's post in Charity NPC - Help pls. was marked as the answer   
    Like this? (untested)
    //Charity NPC// //Ryonin// izlude,124,139,6 script Lucy 101,{ function Display_Timer; // define function if ($totaldonate >= 75000000) end; // Variables set [email protected]$, "[Lucy]"; setarray [email protected]_Zeny[0], 5000000, 10000000, 15000000, 25000000; // Zeny Detector if (Zeny < [email protected]_Zeny[0]) { mes [email protected]$; mes "Sorry, you dont have enough money to talk to me."; mes "You need to have atleast ^FF00005,000,000z^000000."; mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny."; // '$' for permanent server variable close; // don't need end after close } // Start mes [email protected]$; mes "Hello, Citizen of Ragnarok Offline."; mes "Can I help you with something?"; next; if (select("Yes, I would like to donate:No, Thank you") == 1) { mes [email protected]$; mes "Okay then. See you later."; close; } mes [email protected]$; mes "I was assigned by the ^DAA520 GM Team^000000 to collect the donation money."; mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny."; next; mes [email protected]$; mes "You can only donate 1,000,000z or 5,000,000z.";// different from menu next; mes [email protected]$; mes "If I collected a total amount of ^FF000075,000,000^000000z."; mes "I can activate this event:"; mes "Event: ^8B008BComodo Hat Festival Quest^000000."; mes "Event Duration: ^006400[2 DAYS]^000000."; next; mes [email protected]$; mes "How much money you want to donate?"; mes "Once you donate, I can't your money back."; next; [email protected] = getarraysize( [email protected]_Zeny ); for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) [email protected]$ += callfunc( "F_InsertComma", [email protected]_Zeny[[email protected]] ) + ":"; // dynamical menu [email protected] = select([email protected]$) - 1; if ($totaldonate >= 75000000) { // already on mes [email protected]$; mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny."; close; } if (Zeny < [email protected]_Zeny[[email protected]]) { // re-check player zeny amount mes [email protected]$; mes "Sorry, you dont have enough money to talk to me."; mes "You need to have atleast ^FF00005,000,000z^000000."; mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny."; close; } set Zeny, Zeny - [email protected]_Zeny[[email protected]]; set $totaldonate, $totaldonate + [email protected]_Zeny[[email protected]]; mes [email protected]$; mes "Thank you for donating " + callfunc( "F_InsertComma", [email protected]_Zeny[[email protected]] ) + "z!"; mes "We appreciate your generosity."; announce "[Charity Lucy: "+strcharinfo(0)+"] has donated [" + callfunc( "F_InsertComma", [email protected]_Zeny[[email protected]] ) + "z] to Charity! We appreciate your generosity.",0; if ($totaldonate >= 75000000) { $donation_timer = gettimetick(2) + 86400; // 86400 seconds = 2 days donpcevent strnpcinfo(3) + "::OnInit"; } next; mes [email protected]$; mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny."; close; function Display_Timer { [email protected] = getarg(0); [email protected] = [email protected] / 3600; [email protected] = ( [email protected] % 3600 ) / 60; [email protected] = [email protected] % 60; [email protected]$ = ([email protected] ? [email protected] + " hour" : ""); [email protected]$ += ([email protected]$ != "" ? " " : "") + ([email protected] ? [email protected] + " min" + ([email protected] > 1 ? "s" : "" ) : ""); [email protected]$ += ([email protected]$ != "" ? " " : "") + ([email protected] + " sec") + ([email protected] > 1 ? "s" : "" ); return [email protected]$; } OnInit: if ($totaldonate < 75000000) end; [email protected]_left = $donation_timer - gettimetick(2); if ([email protected]_left <= 0) $totaldonate = 0; else { // unhide npc while ([email protected]_left > 0) { waitingroom Display_Timer( [email protected]_left ),0; sleep 1000; delwaitingroom; [email protected]_left--; } // hidenpc set $totaldonate, 0; $donation_timer = 0; announce "Charity Lucy: Charity Event for 2 Days has ended. Don't forget to donate to activate.",0; sleep 10000; announce "Charity Lucy: Thank you for your generosity.",0; } end; }  
    EDIT : oh well I wasn't supposed to post the whole script in support section >.<
  9. Capuche's post in Abyss Lake Instance Crashes The Server was marked as the answer   
    We changed the structure for instance_db.txt
    // ID,Name,LimitTime,IdleTimeOut,EnterMap,EnterX,EnterY,Map2,...,Map255 It should be for example
    12,Abyss Lake Instance,3600,300,abyss_03,160,155  
  10. Capuche's post in Are there unforeseen repercutions to implementing these Free Eden Equipment Vendors I wrote ? was marked as the answer   
    None issue. But you can't use the NPCs to upgrade the equipment without doing the quest.
  11. Capuche's post in help Warnings in Setunitdata - Error in finding object with given game ID 0! was marked as the answer   
    *monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>}; *areamonster "<map name>",<x1>,<y1>,<x2>,<y2>,"<name to show>",<mob id>,<amount>{,"<event label>",<size>,<ai>}; ... Returned value is an array with the game ID of the spawned monster(s) depending on the amount spawned. Array is stored in [email protected][]. What does that mean ?
    For example your synthax is wrong in
    'TNM_TRAP = monster(instance_mapname("[email protected]"),1,1,"",2960,1); setunitdata 'TNM_TRAP, 29, 1; You need to replace it by
    monster(instance_mapname("[email protected]"),1,1,"",2960,1); 'TNM_TRAP = [email protected][0]; setunitdata 'TNM_TRAP, 29, 1;  
     
  12. Capuche's post in Hunting Mission Null Mobs was marked as the answer   
    Header :
    //= NOTE: Requires SQL mob database.
  13. Capuche's post in Temporal Boots Bug (SOLVED) was marked as the answer   
    1/
    if ([email protected] == 0) {// <-- condition == 1 => script continue (re-enchant) if ([email protected] == 1) {// <-- max is always == 0 in your script mes "[Hugin's Magic Master]"; //Custom text mes "Your shoes have reached the maximum option to enchant."; mes "Please bring me a new one if you want me to enchant again."; close; } else { 2/
    set [email protected],[email protected][5];// [email protected][5] unset in your Hugin's Craftsman NPC @@ -110,8 +110,7 @@ glast_01,212,273,4 script Hugin's Magic Master 66, [email protected] == [email protected][3] || [email protected] == [email protected][4] || [email protected] == [email protected][5]) { set [email protected],getequipcardid([email protected],2); set [email protected],[email protected]_cost[4]; - if ([email protected] == 0) { - if ([email protected] == 1) { + if ([email protected] > 0) { mes "[Hugin's Magic Master]"; //Custom text mes "Your shoes have reached the maximum option to enchant."; mes "Please bring me a new one if you want me to enchant again."; @@ -118,7 +117,7 @@ glast_01,212,273,4 script Hugin's Magic Master 66, close; } else { //3rd slot random enchanting - switch ([email protected]) { + switch ([email protected]) { case 4822: //Fighting_Spirit7 case 4835: //Expert_Archer4 case 4826: //Spell5 @@ -125,7 +124,6 @@ glast_01,212,273,4 script Hugin's Magic Master 66, case 4862: //MHP2 case 4881: //DelayafterAttack4Lv case 4755: //Luck6 - set [email protected],1; set [email protected],callfunc("F_Rand",4875,4876,4877,4878,4879,4880); //Bear's_Power,Runaway_Magic,Speed_Of_Light,Muscle_Fool,Hawkeye,Lucky_Day mes "[Hugin's Magic Master]"; //Custom text mes "Seems you already completed the best upgrade option in your 4th slot."; @@ -154,11 +152,13 @@ glast_01,212,273,4 script Hugin's Magic Master 66, mes "Thank you for believing in me."; getitem2 [email protected]_id,1,1,[email protected]_refine,0,0,0,[email protected],[email protected]; close; - } } } - } + else { + mes "An unknown error has occurred."; + close; + } //4th slot 2nd try enchanting if ([email protected] == [email protected][0]) set [email protected],[email protected][0]; @@ -289,7 +289,7 @@ glast_01,210,270,8 script Hugin's Craftsman 726,{ mes "You must bring ^0000FF5 Temporal Crystal items^000000. Nothing is free you know..."; close; } - set [email protected],rand(100,100); + set [email protected],rand(100); if ([email protected] <= 80) { //Custom rates mes "[Hugin's Craftsman]"; mes "Arrggg, we failed. Better luck next time."; @@ -301,10 +301,10 @@ glast_01,210,270,8 script Hugin's Craftsman 726,{ // Magic Copy - set [email protected],EQI_SHOES; - set [email protected]_refine,getequiprefinerycnt([email protected]); - set [email protected],[email protected][5]; - set [email protected],getequipcardid([email protected],3); + set [email protected],EQI_SHOES; + set [email protected]_refine,getequiprefinerycnt([email protected]); + set [email protected],getequipcardid([email protected],2); + set [email protected],getequipcardid([email protected],3); mes "[Hugin's Craftsman]"; //Custom text
  14. Capuche's post in SealedShrine instance was marked as the answer   
    Typo : isbeginquest must be isbegin_quest
  15. Capuche's post in FAW enchanter no longer working in the latest rathena update was marked as the answer   
    Use constant name instead if int for getequipcardid
    https://rathena.org/board/topic/105842-eqi-constant-refactor/
    getequipcardid(5... -> getequipcardid(EQI_GARMENT...
  16. Capuche's post in Instance Time was marked as the answer   
    Your character is warped on the 'main' map [email protected], not in the instance map.
    [email protected],54,28,0 script #gp3warp WARPNPC,1,1,{ if ( instance_id() < 0 ) end; if( !'gp5 && instance_mapname("[email protected]") != "" ) warp instance_mapname("[email protected]"),218,186; else { if (checkquest(40024) == -1) setquest 40024; warp "dali",49,127; } end; }
  17. Capuche's post in Npc Talk was marked as the answer   
    https://rathena.org/wiki/Timers_(Scripting)#Use_Number_3:_Deny_Usage
  18. Capuche's post in showevent not working in custom city was marked as the answer   
    mapflag ?
  19. Capuche's post in bindatcmd unknown command BUT in @commands was marked as the answer   
    Bindatcmd use the equivalent of gm level in parameter, not the group
    *bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; Check the gm level of your GM group and maybe raise it
  20. Capuche's post in quests_eclage.txt and Encounter in a Strange Land Quest was marked as the answer   
    To enter in the instance you must create a party and talk to the NPC named "It is closed shut." https://github.com/rathena/rathena/blob/master/npc/re/instances/EclageInterior.txt#L57
  21. Capuche's post in sc_start on all characters was marked as the answer   
    prontera,150,180,6 script dfghgf 56,{ if ( .global_buff - gettimetick(1) > 0 ) { mes "There is already a special buff. Come later !"; close; } mes "Everyone will get a buff for 6 mins."; close2; .global_buff = gettimetick(1) + 360;// 360 secs addrid 0; sc_start SC_STRFood,360000,10;// 360 secs end; OnPCLoginEvent: if ( .global_buff - gettimetick(1) > 0 ) { [email protected] = ( .global_buff - gettimetick(1) ) * 1000; sc_start SC_STRFood, [email protected],10; } end; OnPCLogoutEvent: if ( .global_buff - gettimetick(1) > 0 )// remove the buff to update the timer on login sc_end SC_STRFood; end; }
  22. Capuche's post in Check if the player is dead was marked as the answer   
    if(Hp == 0){

  23. Capuche's post in how to make script mob drop item? was marked as the answer   
    Without mod
    - script Weird Plant -1,{ OnInit: .mobid = 2135; //2135 for ( [email protected] = 0; [email protected] < 10; [email protected]++ ) { monster "prontera",0,0,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ [email protected]; .mob_gid[[email protected]] = [email protected][0]; } end; OnMyMobDead0: callsub S_Makeitem, 0,.mob_gid[0]; OnMyMobDead1: callsub S_Makeitem, 1,.mob_gid[1]; OnMyMobDead2: callsub S_Makeitem, 2,.mob_gid[2]; OnMyMobDead3: callsub S_Makeitem, 3,.mob_gid[3]; OnMyMobDead4: callsub S_Makeitem, 4,.mob_gid[4]; OnMyMobDead5: callsub S_Makeitem, 5,.mob_gid[5]; OnMyMobDead6: callsub S_Makeitem, 6,.mob_gid[6]; OnMyMobDead7: callsub S_Makeitem, 7,.mob_gid[7]; OnMyMobDead8: callsub S_Makeitem, 8,.mob_gid[8]; OnMyMobDead9: callsub S_Makeitem, 9,.mob_gid[9]; S_Makeitem: getunitdata getarg(1),[email protected]; // dispbottom "Coordonnée x : "+ [email protected][6]; // dispbottom "Coordonnée y : "+ [email protected][7]; for ( [email protected] = 0; [email protected] < rand(2); [email protected]++ ) makeitem 909, 1, strcharinfo(3), ( [email protected][6]+rand(2)-1 ), ( [email protected][7]+rand(2)-1 ); monster "alberta",94,54,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ getarg(0); .mob_gid[ getarg(0) ] = [email protected][0]; end; } It's true it would be better to return the mob unique id to use getunitdata. Maybe we should implement it
  24. Capuche's post in How to detect the item bought from shops and the map where it was bought was marked as the answer   
    This ? https://github.com/rathena/rathena/blob/master/conf/log_athena.conf#L16
    then check your picklog table
  25. Capuche's post in Request script pls! was marked as the answer   
    what about
    select account_id from `char` where online = 1 and account_id not in ( select account_id from vendings ) order by rand() limit 1 to exclude vendor?
×
×
  • Create New...

Important Information

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