Jump to content

DeadlySilence

Members
  • Posts

    181
  • Joined

  • Last visited

  • Days Won

    2

Community Answers

  1. DeadlySilence's post in Check max 3 ids of array in the inventory ! was marked as the answer   
    You want to check if the user has fewer than three of an array of items?
     
    setarray .@rental[0],990,991,992,993; .@itmCnt = 0; for (.@i = 0; .@i < getarraysize(.@rental); .@i++) { if (countitem(.@rental[.@i])) { .@itmCnt++; } } if (2 < .@itmCnt) { mes "You can have a maximum of two out of the following list:"; for (.@i = 0; .@i < getarraysize(.@rental); .@i++) { mes "" + getitemname(.@rental[.@i]) + ""; } close; }  
    This should be what you're looking for, then.
  2. DeadlySilence's post in SQL Warning: "Too many columns" was marked as the answer   
    The problem is you're selecting more columns than you assign to variables.
    For example
    query_sql("SELECT `account_id`, `name` FROM `char`", .@ids, .@names$); would not produce a warning, but
    query_sql("SELECT `account_id`, `name` FROM `char`", .@ids); will produce a warning as the number of variables does not match the number of columns selected.
  3. DeadlySilence's post in Question regarding Query SQL. was marked as the answer   
    ALTER TABLE `inventory` ADD COLUMN `durability` INT NULL;

  4. DeadlySilence's post in SQL function support... was marked as the answer   
    UPDATE `char` SET `zeny` = 0 WHERE `char_id` >= 150200;
  5. DeadlySilence's post in Injustice "NO STOP" Sonic Blow when attacking was marked as the answer   
    This will most likely produce errors. You use an else if without an if.
    if (skill == AS_SONICBLOW) pc_stop_attack(sd); //Special case, Sonic Blow autospell should stop the player attacking. else if (skill == PF_SPIDERWEB) //Special case, due to its nature of coding. type = CAST_GROUND;  
    to
    if (skill == PF_SPIDERWEB) //Special case, due to its nature of coding. type = CAST_GROUND;  
    could work.
  6. DeadlySilence's post in How to do this on my mvp's? was marked as the answer   
    It's not very hard, I'll show you an example.
     
    You open the file you want to modify (monsters are located unter npc/(pre-)re/mobs). In my example it'll be the Beach Dungeon.
     
    //===== rAthena Script ======================================= //= Beach Dungeon Monster Spawn Script //===== By: ================================================== //= Athena (1.0) //===== Current Version: ===================================== //= 1.4 //===== Compatible With: ===================================== //= Any Athena Version //===== Additional Comments: ================================= //= 1.1 Official kRO 10.1 spawns [Playtester] //= 1.2 Small 11.1 spawn update [Playtester] //= 1.3 More accurate spawns [Playtester] //= 1.4 Corrected MVP spawn variance. [L0ne_W0lf] //============================================================ //================================================== // beach_dun - Karu, the West cave //================================================== beach_dun,0,0,0,0 monster Medusa 1148,60,5000,0,0 beach_dun,0,0,0,0 monster Nereid 1255,20,5000,0,0 beach_dun,0,0,0,0 monster Pest 1256,20,5000,0,0 beach_dun,0,0,0,0 monster Merman 1264,3,5000,0,0 beach_dun,0,0,0,0 boss_monster Tao Gunka 1583,1,18000000,600000,0 //================================================== // beach_dun2 - Ruande the northern cave //================================================== beach_dun2,0,0,0,0 monster Stalactic Golem 1278,65,5000,0,0 beach_dun2,0,0,0,0 monster Tri Joint 1279,20,5000,0,0 beach_dun2,0,0,0,0 monster Megalith 1274,15,5000,0,0 beach_dun2,0,0,0,0 monster Hydra 1068,10,5000,0,0 beach_dun2,0,0,0,0 monster Nereid 1255,3,5000,0,0 //================================================== // beach_dun3 - Mao, the East Cave //================================================== beach_dun3,0,0,0,0 monster Thara Frog 1034,50,5000,0,0 beach_dun3,0,0,0,0 monster Megalodon 1064,30,5000,0,0 beach_dun3,0,0,0,0 monster Hydra 1068,30,5000,0,0 beach_dun3,0,0,0,0 monster Nereid 1255,1,5000,0,0  
    Search for the line where the MVP is located.
    beach_dun,0,0,0,0 boss_monster Tao Gunka 1583,1,18000000,600000,0 There you can modify the monster spawn. To change the size you have to modify the 13th property, which does not exist in this example, so you add it.
    The result will be this:
    beach_dun,0,0,0,0 boss_monster Tao Gunka 1583,1,18000000,600000,0,2  
    Reload the scripts (@reloadscript) and the Tao Gunka inside the Beach Dungeon should be big.
  7. DeadlySilence's post in Whisper ToolDealer not working was marked as the answer   
    //===== rAthena Script ======================================= //= Whisper Tool dealer //===== By: ================================================== //= Poseidon //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena //===== Description: ========================================= //= Whisper Tool dealer //===== Additional Comments: ================================= //============================================================ - script Shop -1,{ OnInit: bindatcmd "sell", strnpcinfo(0)+"::OnAtcommand"; end; OnAtcommand: callshop "ToolDealer", 0; end; } - shop ToolDealer -,611:-1,1750:-1,501:-1,502:-1,503:-1,504:-1,506:-1,645:-1,656:-1,601:-1,602:-1,1065:-1,2239:-1  
    This should do it.
  8. DeadlySilence's post in Doubt Initial items was marked as the answer   
    Should the player get only one item from the list or are multiple items possible? If only one, it wouldn't make sense to put there an item with a chance of 100%.
     
    This should work as you wanted.
     
    prontera,150,105,4 script Items 98,{ mes "[Gambler]"; mes "Hello, I'm the gambler."; mes "If you bring me some items you can gamble for some pretty nice rewards."; switch(select("Gamble:Which items?:Which rewards?")) { next; case 1: for (.@i = 0; .@i < getarraysize(.required); .@i++) { if (countitem(.required[.@i]) >= .reqAmnt[.@i]) { .@enoughItems++; } } if (.@enoughItems != getarraysize(.required)) { mes "[Gambler]"; mes "You don't have all the items I need."; mes "Please come back when you have everything."; close; } mes "[Gambler]"; mes "So, you have everything."; mes "Are you sure you want to bet the items I want for one attempt to win a price?"; if (select("Yes:No") == 2) { next; mes "[Gambler]"; mes "Come back when you are ready."; close; } close2; for (.@i = 0; .@i < getarraysize(.required); .@i++) { delitem .required[.@i], .reqAmnt[.@i]; } for (.@i = 0; .@i < getarraysize(.items); .@i++) { if (rand(1, 10000) <= .chances[.@i]) { if (.chances[.@i] <= .announceAt) { announce strcharinfo(0) + " has won " + .qnt[.@i] + "x " + getitemname(.items[.@i]) + "!",bc_all; } dispbottom "You have won " + .qnt[.@i] + "x " + getitemname(.items[.@i]) + "!"; getitem .items[.@i], .qnt[.@i]; } } end; case 2: mes "[Gambler]"; mes "The items I need are those:"; for (.@i = 0; .@i < getarraysize(.required); .@i++) { mes .reqAmnt[.@i] + "x " + getitemname(.required[.@i]) + " (ID: " + .required[.@i] + ")"; } close; case 3: mes "[Gambler]"; mes "The rewards can be a one or more of these:"; for (.@i = 0; .@i < getarraysize(.items); .@i++) { mes .qnt[.@i] + "x " + getitemname(.items[.@i]) + " (ID: " + .items[.@i] + ")"; } close; } next; OnInit: // announce if chance was lower or equal to ... .announceAt = 100; // Arrays for the rewards setarray .items, 607, 608, 609, 610, 611, 612; setarray .qnt, 10, 10, 15, 15, 20, 20; setarray .chances, 1, 10, 20, 50, 100, 10000; // Arrays for the required items setarray .required, 6040, 6075, 6080, 6095, 713; setarray .reqAmnt, 100, 50, 50, 50, 1; }  

     
  9. DeadlySilence's post in requesting freebies was marked as the answer   
    There is a semicolon missing.
     
    prontera,150,150,0 script Freebies 100,{ if ( #Freebies ) end; mes .npc$; mes "Welcome to Our Ragnarok Online!"; next; mes .npc$; mes "Here is your freebies, " +strcharinfo(0); next; for ( set .@i, 0; .@i < getarraysize(.freebie_items); set .@i, .@i + 2 ) getitem .freebie_items[.@i], .freebie_items[.@i + 1]; set #CASHPOINTS, #CASHPOINTS + .cash_amount; dispbottom "You've gained " +.cash_amount+ " cash points."; set #Freebies, 1; end; OnInit: setarray .freebie_items[0], 7227,10,7179,10; // <item id>,<amount> set .cash_amount, 100; // cash points amount set .npc$, "[ " +strnpcinfo(1)+ " ]"; end; }
  10. DeadlySilence's post in Checkweight ~ was marked as the answer   
    prontera,150,190,5    script    Test    100,{
        .@weight = 100 * Weight / MaxWeight;
        if (50 <= .@weight) {
            mes "You are currently at " + .@weight + " percent of your maximum weight.";
            close;
        }
        
        mes "Your weight is ok.";
        close;
    }

  11. DeadlySilence's post in Cutin not gone after click close? was marked as the answer   
    The usual way is this:
    close2; cutin "", 255; end; If this doesn't work, something is wrong on your side.
  12. DeadlySilence's post in About r17427 was marked as the answer   
    I think there is a misunderstanding
    Euphy means the new group system has been implemented for a very long time.
    You can keep your current version, but you have to change the group_id in your database. For the groups and how to add new groups you can look at conf/groups.conf
  13. DeadlySilence's post in SQL Count was marked as the answer   
    You can do it like this:
    query_sql("SELECT `balance` FROM `cp_credits` WHERE `account_id` = " + getcharid(3), .@balance);  
    For every column you select you have to add another value at the end. If you want to select `balance` and `account_id`, you'd do it like this:
    query_sql("SELECT `balance`, `account_id` FROM `cp_credits`", .@balance, .@accountId); 
  14. DeadlySilence's post in query_sql problem was marked as the answer   
    I think the query should look like this:
    query_sql "UPDATE `cp_credits` SET `balance` = `balance` + " + @vote + " WHERE `account_id` = " + getcharid(3) + " AND `balance` <> 0;";  
     
     
     
    <> is the operator for "not equal", the same as !=
  15. DeadlySilence's post in Random amount getitem was marked as the answer   
    if (.@check_level > 4) { getitem 508, rand(1, 10); } else { getitem 507, rand(1, 10); } Like this.
  16. DeadlySilence's post in How to update rAthena in specific revision was marked as the answer   
    If you use Linux, you can do this:
    svn checkout http://svn.code.sf.net/p/rathena/svn/trunk/ -r 123
    or
    svn update -r 123
    if you already have a working copy. Replace the number by the revision you want.
     
    If you use Windows and TortoiseSVN you can specify the revision here:

  17. DeadlySilence's post in login-server_sql.exe,map-server_sql.exe,char-server_sql.exe for r17384 was marked as the answer   
    You have to compile it. http://rathena.org/wiki/Compiling
  18. DeadlySilence's post in help Petite Room Warper ERROR was marked as the answer   
    The Problem is that the chatroom would be created every time the NPC is clicked, but since that's impossible, it throws this error.
     
    Try this:
     
    prontera.gat,142,180,0 script Petite Room Warper 1156,{ mes "[Petite Room Warper]"; mes "Hello Guys, Im Petite Room Warper"; mes "Do You Want to Use My Service ??"; next; menu "Yes",L_TELEPORT,"No thanks",L_Bye; close; L_TELEPORT: mes "Ok Wait here, I Will Send You To Petite Room"; next; warp "mjolnir_03.gat",208,213; end; L_Bye: mes "Okay,No Problem Thanks"; close; OnInit: waitingroom "Petite Room",0; end; } This way, the waiting room will only be created once.
  19. DeadlySilence's post in SQL DB Error Need Help. was marked as the answer   
    The problem is the name.
    The string 'Lope's Clue'  is interrupted by the apostrophe after Lope.
    You have to write the string like this: 'Lope\'s Clue'
  20. DeadlySilence's post in Subtracting different variables. was marked as the answer   
    mes "You still need to kill " + quincykill - quincy2 + " Whispers!";  
    This should work.
    If you put the mathematic symbol between quotes, it is interpreted as a string rather than a mathematic function.
×
×
  • Create New...