Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Community Answers

  1. Capuche's post in Disable @storage was marked as the answer   
    Try mapflag notrade
  2. Capuche's post in Temporary Item Array was marked as the answer   
    izlude,128,124,0 script dumb menu A 4_F_01,{ mes "what do you want to do"; while (true) { next; if (select( "^FF0000Add an item^000000", "Close" ) == 2) end; mes "Input Item ID :"; input .@tmp_item; if (getitemname(.@tmp_item) == "null") { mes "Invalid item ID " + .@tmp_item; continue; } mes "Input Amount :"; input .@tmp_amount; if (.@tmp_amount == 0) { mes "Invalid amount."; continue; } .@item_id[ .@size ] = .@tmp_item; .@amount[ .@size ] = .@tmp_amount; .@size++; mes "Item list :"; for ( .@i = 0; .@i < .@size; .@i++ ) mes (.@i+1) + "/ x" + .@amount[.@i] + " ^ff0000" + getitemname(.@item_id[.@i]) + "^000000"; } }  
  3. 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) .@cost = 40000; else if (BaseLevel < 90) .@cost = 70000; else .@cost = 100000; mes "Reset Stats: " + .@cost + "z."; mes "Reset Skills: " + .@cost + "z."; mes "Please select the service you want:"; next; .@s = select( "Reset Skills", "Reset Stats" ); mes "[Reset Girl]"; if (Zeny < .@cost) { mes "Sorry, you don't have enough Zeny."; close; } Zeny -= .@cost; if (.@s == 2) resetstatus; else { sc_end_class; resetskill; } mes "There you go!"; close; case 1:// advanced class .@cost = 1000000; if (BaseLevel > 89) .@cost += 500000; mes "Reset Stats: " + .@cost + "z + 1 Monster Card."; mes "Reset Skills: " + .@cost + "z + 1 Monster Card."; mes "Please select the service you want:"; next; .@s = select( "Reset Skills", "Reset Stats" ); mes "[Reset Girl]"; if (Zeny < .@cost) { mes "Sorry, you don't have enough Zeny."; close; } getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if (getiteminfo(@inventorylist_id[.@i],2) != 6) continue; .@card_id[.@card_size] = @inventorylist_id[.@i]; .@card_name$[.@card_size] = getitemname( @inventorylist_id[.@i] ); .@card_size++; } if (.@card_size < 1) { mes "Sorry, you don't have enough Card."; close; } mes "Which card do you want to use?"; next; .@index = select( implode(.@card_name$,":") ) - 1; mes "[Reset Girl]"; if (Zeny < .@cost) { mes "It shouldn't happen."; close; } if (countitem(.@card_id[.@index]) < 1) { mes "It shouldn't happen."; close; } Zeny -= .@cost; delitem .@card_id[.@index],1; if (.@s == 2) resetstatus; else { sc_end_class; resetskill; } mes "There you go!"; close; } }  
  4. 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?
  5. 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!
  6. Capuche's post in Check party for duplicate job? was marked as the answer   
    Untested
    getpartymember getcharid(1),1; getpartymember getcharid(1),2; for ( .@i = 0; .@i < $@partymembercount; .@i++ ) if (isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) == 0) continue; .@class = readparam( Class, $@partymembercid[.@i] ); if (compare( .@job_list$, "|" + .@class + "|" ) == 1) { mes "Sorry, only one " + jobname(.@class) + " is allowed."; close; } .@job_list$ += "|" + .@class + "|"; }  
    EDIT : should still work
     
  7. 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,{ .@party_id = getcharid(1); .@p_name$ = getpartyname(.@party_id); .@md_name$ = "Bossnia"; if (!instance_check_party(.@party_id)) { mes "Why don't you make a party with more than 1 person and talk to me again?"; close; } if (getcharid(0) == getpartyleader(.@party_id,2)) .@menu$ = "Generate Instance"; switch( select( .@menu$, "Enter " + .@md_name$ + "", "Cancel" ) ) { case 1: switch( instance_create(.@md_name$) ) { case -3: dispbottom "Memorial Dungeon, '" + .@md_name$ + "' is already in progress.",0xFFFFFF; end; case -4: case -2: case -1: mes "Party Name: " + .@p_name$; mes "Party Leader: " + strcharinfo(0); mes "^0000ff" + .@md_name$ + "^000000 - time gap generation failed."; close; } end; case 2: switch( instance_enter(.@md_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), .@p_name$ + " party member " + strcharinfo(0) + " enters " + .@md_name$ + "",bc_map,"0x00ff99"; end; } case 3: end; } } The script create an instance attached to the party. All party member can enter.
  8. Capuche's post in Script from 2014 was marked as the answer   
    Replace
    sd = script_rid2sd(st); by
    sd = map_id2sd(st->rid);  
  9. 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 ( .@i = 0; .@i < 5; .@i++ ) { if (countitem(.ID[.@i]) < .AM[.@i]) .@missing$ += (.AM[.@i] - countitem(.ID[.@i])) + " x " + getitemname(.ID[.@i]) + "\n"; } if (.@missing$ != "") { mes "You are missing the following items:"; mes .@missing$; close; }  
  10. 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 .@n$, "[Lucy]"; setarray .@donation_Zeny[0], 5000000, 10000000, 15000000, 25000000; // Zeny Detector if (Zeny < .@donation_Zeny[0]) { mes .@n$; 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 .@n$; 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 .@n$; mes "Okay then. See you later."; close; } mes .@n$; 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 .@n$; mes "You can only donate 1,000,000z or 5,000,000z.";// different from menu next; mes .@n$; 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 .@n$; mes "How much money you want to donate?"; mes "Once you donate, I can't your money back."; next; .@size = getarraysize( .@donation_Zeny ); for ( .@i = 0; .@i < .@size; .@i++ ) .@menu$ += callfunc( "F_InsertComma", .@donation_Zeny[.@i] ) + ":"; // dynamical menu .@s = select(.@menu$) - 1; if ($totaldonate >= 75000000) { // already on mes .@n$; mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny."; close; } if (Zeny < .@donation_Zeny[.@s]) { // re-check player zeny amount mes .@n$; 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 - .@donation_Zeny[.@s]; set $totaldonate, $totaldonate + .@donation_Zeny[.@s]; mes .@n$; mes "Thank you for donating " + callfunc( "F_InsertComma", .@donation_Zeny[.@s] ) + "z!"; mes "We appreciate your generosity."; announce "[Charity Lucy: "+strcharinfo(0)+"] has donated [" + callfunc( "F_InsertComma", .@donation_Zeny[.@s] ) + "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 .@n$; mes "The total amount I collected is : ^0000CD[" + $totaldonate + "]^000000 Zeny."; close; function Display_Timer { .@time = getarg(0); .@hour = .@time / 3600; .@mins = ( .@time % 3600 ) / 60; .@secs = .@time % 60; .@string$ = (.@hour ? .@hour + " hour" : ""); .@string$ += (.@string$ != "" ? " " : "") + (.@mins ? .@mins + " min" + (.@mins > 1 ? "s" : "" ) : ""); .@string$ += (.@string$ != "" ? " " : "") + (.@secs + " sec") + (.@secs > 1 ? "s" : "" ); return .@string$; } OnInit: if ($totaldonate < 75000000) end; .@time_left = $donation_timer - gettimetick(2); if (.@time_left <= 0) $totaldonate = 0; else { // unhide npc while (.@time_left > 0) { waitingroom Display_Timer( .@time_left ),0; sleep 1000; delwaitingroom; .@time_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 >.<
  11. 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  
  12. 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.
  13. 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 $@mobid[]. What does that mean ?
    For example your synthax is wrong in
    'TNM_TRAP = monster(instance_mapname("1@tnm3"),1,1,"",2960,1); setunitdata 'TNM_TRAP, 29, 1; You need to replace it by
    monster(instance_mapname("1@tnm3"),1,1,"",2960,1); 'TNM_TRAP = $@mobid[0]; setunitdata 'TNM_TRAP, 29, 1;  
     
  14. Capuche's post in Hunting Mission Null Mobs was marked as the answer   
    Header :
    //= NOTE: Requires SQL mob database.
  15. Capuche's post in Temporal Boots Bug (SOLVED) was marked as the answer   
    1/
    if (.@card2 == 0) {// <-- condition == 1 => script continue (re-enchant) if (.@max == 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 .@enchant,.@enchant4th[5];// .@enchant4th[5] unset in your Hugin's Craftsman NPC @@ -110,8 +110,7 @@ glast_01,212,273,4 script Hugin's Magic Master 66, .@card3 == .@enchant4th[3] || .@card3 == .@enchant4th[4] || .@card3 == .@enchant4th[5]) { set .@card2,getequipcardid(.@part,2); set .@cost,.@enchant_cost[4]; - if (.@card2 == 0) { - if (.@max == 1) { + if (.@card2 > 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 (.@card3) { + switch (.@card3) { 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 .@max,1; set .@enchant,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 .@equip_id,1,1,.@equip_refine,0,0,0,.@enchant,.@card3; close; - } } } - } + else { + mes "An unknown error has occurred."; + close; + } //4th slot 2nd try enchanting if (.@card3 == .@enchant1st[0]) set .@enchant,.@enchant2nd[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 .@random,rand(100,100); + set .@random,rand(100); if (.@random <= 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 .@part,EQI_SHOES; - set .@equip_refine,getequiprefinerycnt(.@part); - set .@enchant,.@enchant4th[5]; - set .@card3,getequipcardid(.@part,3); + set .@part,EQI_SHOES; + set .@equip_refine,getequiprefinerycnt(.@part); + set .@enchant,getequipcardid(.@part,2); + set .@card3,getequipcardid(.@part,3); mes "[Hugin's Craftsman]"; //Custom text
  16. Capuche's post in SealedShrine instance was marked as the answer   
    Typo : isbeginquest must be isbegin_quest
  17. 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...
  18. Capuche's post in Instance Time was marked as the answer   
    Your character is warped on the 'main' map 1@spa, not in the instance map.
    1@spa,54,28,0 script #gp3warp WARPNPC,1,1,{ if ( instance_id() < 0 ) end; if( !'gp5 && instance_mapname("1@spa") != "" ) warp instance_mapname("1@spa"),218,186; else { if (checkquest(40024) == -1) setquest 40024; warp "dali",49,127; } end; }
  19. Capuche's post in Npc Talk was marked as the answer   
    https://rathena.org/wiki/Timers_(Scripting)#Use_Number_3:_Deny_Usage
  20. Capuche's post in showevent not working in custom city was marked as the answer   
    mapflag ?
  21. 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
  22. 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
  23. 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 ) { .@timer = ( .global_buff - gettimetick(1) ) * 1000; sc_start SC_STRFood, .@timer,10; } end; OnPCLogoutEvent: if ( .global_buff - gettimetick(1) > 0 )// remove the buff to update the timer on login sc_end SC_STRFood; end; }
  24. Capuche's post in Check if the player is dead was marked as the answer   
    if(Hp == 0){

  25. 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 ( .@i = 0; .@i < 10; .@i++ ) { monster "prontera",0,0,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ .@i; .mob_gid[.@i] = $@mobid[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),.@array; // dispbottom "Coordonnée x : "+ .@array[6]; // dispbottom "Coordonnée y : "+ .@array[7]; for ( .@i = 0; .@i < rand(2); .@i++ ) makeitem 909, 1, strcharinfo(3), ( .@array[6]+rand(2)-1 ), ( .@array[7]+rand(2)-1 ); monster "alberta",94,54,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ getarg(0); .mob_gid[ getarg(0) ] = $@mobid[0]; end; } It's true it would be better to return the mob unique id to use getunitdata. Maybe we should implement it
×
×
  • Create New...