Jump to content

Winterfox

Members
  • Posts

    238
  • Joined

  • Last visited

  • Days Won

    18

Community Answers

  1. Winterfox's post in command to show book interface was marked as the answer   
    You could combine bindatcmd and readbook.
    *bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. Each atcommand is only allowed one binding. If you rebind, it will override the original binding. Note: The default level for atcommand is 0 while the default level for charcommand is 100. The following variables are set upon execution: .@atcmd_command$ = The name of the @command used. .@atcmd_parameters$[] = Array containing the given parameters, starting from an index of 0. .@atcmd_numparameters = The number of parameters defined. Example: When a user types the command "@test", an angel effect will be shown. - script atcmd_example -1,{ OnInit: bindatcmd "test",strnpcinfo(3) + "::OnAtcommand"; end; OnAtcommand: specialeffect2 EF_ANGEL2; end; } *readbook <book id>,<page>; This command will open a book item at the specified page.  
  2. Winterfox's post in Gacha Pull - Sink Zeny System was marked as the answer   
    prontera,167,163,4 script Lotto Girl 72,{ mes "[ " + .npc_name$ + " ]"; mes "I'm " + .npc_name$ + "! I'll exchange"; mes "Random Prizes for every"; mes "^ff0000" + F_InsertComma(.pull_price) + " zeny^000000."; next; mes "[ " + .npc_name$ + " ]"; mes "Our Grand prize is:"; mes "^ff0000 x1 TCG Card^000000"; mes "^ff0000 x1 Costume set^000000"; mes "Consolations are:"; mes "^ff0000 x?? Gold Coin^000000"; mes "^ff0000 x?? Gold^000000"; mes "^ff0000 x?? Treasure Box^000000"; mes "^ff0000 x?? Oridecon^000000"; mes "^ff0000 x?? Elunium^000000"; mes "And many more!!"; next; mes "[ " + .npc_name$ + " ]"; mes "Do you want to pull?"; next; if(select("Sure!:No.") == 2) { mes "[ " + .npc_name$ + " ]"; mes "Come back if you change"; mes "your mind."; close; } mes "[ " + .npc_name$ + " ]"; mes "How many pulls do you want?"; next; .@range = input(.@pullAmt, .min_pulls, .max_pulls); if(.@range != 0) { mes "[ " + .npc_name$ + " ]"; mes "The " + ((.@range > -1) ? "maximum" : "minimum") + " number of pulls is " + ((.@range > -1) ? .max_pulls : .min_pulls) + "."; close; } if (Zeny < .pull_price * .@pullAmt) { mes "[ " + .npc_name$ + " ]"; mes "You don't have enough zeny."; close; } freeloop(1); for(.@i = 0; .@i < .@pullAmt; .@i++) { if (Weight * 100 / MaxWeight >= .weight_cap) { mes "[ " + .npc_name$ + " ]"; mes "You can't do anymore"; mes "pulls because you are"; mes "nearing your weight limit"; close; } Zeny -= .pull_price; .@priceNo = rand(0, getarraysize(.prices) - 1); .@priceIdx = .@priceNo * 4; if (rand(1, 100) <= .prices[.@priceIdx]) { .@itemId = .prices[.@priceIdx + 1]; .@itemAmt = rand(.prices[.@priceIdx + 2], .prices[.@priceIdx + 3]); if(.prices[.@priceIdx] <= .announce_limit) { announce("Hey! " + strcharinfo(0) + " just received " + getitemname(.@itemId) + " x " + .@itemAmt + " from " + .npc_name$ + "!", bc_all); specialeffect2(248); } } else { .@itemId = rand(.default[0], .default[1]); .@itemAmt = rand(.default[2], .default[3]); } getitem(.@itemId, .@itemAmt); } freeloop(0); mes "[ " + .npc_name$ + " ]"; mes "Here you go!"; close; OnInit: .npc_name$ = strnpcinfo(1); .pull_price = 50000; .announce_limit = 5; .weight_cap = 90; .min_pulls = 1; .max_pulls = 500; //<Chance in %>, <ItemID>, <MinAmount>, <MaxAmount> setarray(.prices[0], 1, 35031, 1, 1, // demoniac mid 1, 35081, 1, 1, // demoniac upper 1, 35099, 1, 1, // demoniac low 2, 7227, 1, 1, // tcg 5, 7539, 1, 2, // diablo coin 8, 969, 1, 3, // gold 10, 604, 1, 3, // deadbranch 8, 7444, 1, 3, // treasurebox 8, 12208, 1, 2, // battle manual 20, 985, 3, 8, // elu 25, 7063, 2, 5, // alice apron 25, 7047, 2, 5, // soft feather 20, 984, 3, 8, // ori 15, 748, 1, 3 // witherless ); //<MinItemID>, <MaxItemID>, <MinAmount>, <MaxAmount> setarray(.default[0], 901, 926, 5, 15); delwaitingroom; waitingroom("Try your Luck?", 0); }  
  3. Winterfox's post in R > 2023 accessoryid.lub was marked as the answer   
    It isn't empty. Look at the Size it says 90.9 KB.
    Your problem is that you are in the tree view of the lub file. You need to switch to the raw view.

  4. Winterfox's post in How to set can't input same values in NPC? was marked as the answer   
    mes "Pick your number!"; next; input(.@number); .@rowCount = query_sql("SELECT `number` FROM numberdb WHERE `number` = " + .@number + ";"); if(.@rowCount == 1) { mes "This number is already used. Try again."; close; } query_sql("INSERT INTO numberdb (`number`) VALUES (" + .@number + ");");  
  5. Winterfox's post in What is the best client to patch using Warp/Nemo for new Renewal + 4th classes? was marked as the answer   
    I think supportwise the best option is to use a client with a date according to the packet version rathena uses by default or earlier, since I assume the packet version defined by rathena is the latest stable one and backwards compatibility is given by the server naturally growing with the version numbers of the client.
     
  6. Winterfox's post in Max Deposit on Bank Agent was marked as the answer   
    //===== rAthena Script ======================================= //= Banker Script //===== By: ================================================== //= Syrus22 (1.0) //===== Current Version: ===================================== //= 2.0 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= An account wide Banker to store Zeny //===== Additional Comments: ================================= //= Syrus22 - There's an optional transaction fee at the top of //= the script. To use it simply change the first set command //= to set the cost variable to whatever you want the fee to be. //= Version 2.0: Optimized and brought the script up to standard. [Jguy] //============================================================ verus04,174,216,5 script Banker 109,{ //prontera,132,217,5 script Banker 109,{ mes "[Banker]"; mes "Welcome to the First Bank of Prontera. How can I help you today?"; next; switch(select("I'd like to make a deposit.:I'd like to make a withdrawal.:What's my current balance?:Cancel")) { case 1: mes "[Banker]"; mes "Very well... How much would you like to deposit? The maximum you can deposit at once is ^00FF00999,999^000000 zeny."; next; if (.transactionFee > 0) { mes "[Banker]"; mes "Oh, and do realize there is a ^00FF00" + .transactionFee + "^000000 zeny charge on all transactions!"; next; } input(.@deposit); if (.@deposit < 1) { mes "[Banker]"; mes "Make sure you ask me to deposit a real amount."; close; } if (.@deposit > Zeny) { mes "[Banker]"; mes "It does not appear like you have the amount of zeny you're trying to deposit!"; close; } if (.@deposit + .transactionFee > Zeny) { mes "[Banker]"; mes "You need ^00FF00" +.transactionFee + "^000000 Zeny to cover the transaction fee!"; close; } if(#bankstorage + .@deposit > .maxDeposit) { mes "[Banker]"; mes "Your deposit would break the limit of ^00FF00" + .maxDeposit + "^000000 zeny!"; close; } Zeny -= .@deposit + .transactionFee; #bankstorage += .@deposit; mes "[Banker]"; mes "Thank you very much... Your zeny is in good hands."; close; case 2: mes "[Banker]"; mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is ^00FF00999,999^000000 zeny"; next; if (.transactionFee > 0) { mes "[Banker]"; mes "Oh, and do realize there is a ^00FF00" + .transactionFee + "^000000 zeny charge on all transactions!"; next; } input(.@withdrawal); if (.@withdrawal < 1) { mes "Please don't play games. I need a real amount to withdraw."; close; } if (.@withdrawal > #bankstorage) { mes "You only have ^00FF00" + callfunc("F_InsertComma", #bankstorage) +"^000000 zeny in your account!"; close; } if (.transactionFee > Zeny && .@withdrawal > .transactionFee) { mes "[Banker]"; mes "You don't have the Zeny for the transaction fee right now. Would you like me to take the fee directly from your withdrawal?"; next; switch(select("Yes please.:No, Thanks")) { case 1: mes "[Banker]"; mes "Removing ^00FF00" + .transactionFee + "^000000 from your withdrawal to cover the deposit fee..."; .@withdrawal -= .transactionFee; #bankstorage -= .transactionFee; next; #bankstorage -= .@withdrawal; Zeny += .@withdrawal; mes "[Banker]"; mes "There's your Zeny. Have a good day."; close; case 2: mes "[Banker]"; mes "Very well... come again soon."; close; } } if(.transactionFee > Zeny) { mes "[Banker]"; mes "You need ^00FF00" + .transactionFee + "^000000 zeny to cover the transaction fee!"; close; } #bankstorage -= .@withdrawal; Zeny -= .transactionFee; Zeny += .@withdrawal; mes "[Banker]"; mes "There's your zeny. Have a good day."; close; case 3: mes "[Banker]"; mes "Hmmmm... let me check some paper work."; next; mes "*Rustle, Rustle*"; next; mes "[Banker]"; mes "You currently have ^00FF00" + callfunc("F_InsertComma", #bankstorage) + "^000000 zeny in your account."; close; case 4: mes "[Banker]"; mes "Very well... come again soon."; close; } OnInit: .transactionFee = 500; .maxDeposit = 1000000; }  
  7. Winterfox's post in Hello please help how to delete sc_data of SC_BOSSMAPINFO everytime to login was marked as the answer   
    Hello,
    what do you exactly want to achieve with this script?
    If you want to simply remove SC_BOSSMAPINFO state from a player on login, you can use this:
    - script delete_scbossmapinfo FAKE_NPC,{ OnPCLoginEvent: sc_end(SC_BOSSMAPINFO); }  
  8. Winterfox's post in How to Change Getitem to Dropitem was marked as the answer   
    -   script  GetRed  FAKE_NPC,{     OnNPCKillEvent:         #KILLED_MONSTERS += 1;           if (#KILLED_MONSTERS % .mobsPerDrop != 0) end;           getunitdata(killedgid, .@mobData);         makeitem(.itemDropId, .itemDropAmt, mapid2name(.@mobData[UMOB_MAPID]), .@mobData[UMOB_X], .@mobData[UMOB_Y]);         dispbottom "[ระบบ] : ยินดีด้วย คุณได้รับดรอปไอเทม " + getitemname(.itemDropId) + " จากการกำจัดมอนเตอร์";     end;       OnInit:         .itemDropId = 501;         .itemDropAmt = 1;         .mobsPerDrop = 100; }
  9. Winterfox's post in Please help me how to edit Guild Vip System smoothly was marked as the answer   
    Hello,
    try this:
    mall01, 92, 135, 5 script Guild Vip Registrar 612,{ if(getcharid(2) == 0) { mes .NPC$; mes "You need to be in a guild to use my services."; close; } query_sql("SELECT TIMESTAMPDIFF(SECOND, NOW(), expiration_time) FROM vip_guild WHERE `guild_id` = " + getcharid(2), .@secondsUntilExpiration); if (.@secondsUntilExpiration > 0) { mes .NPC$; mes "Dear " + strcharinfo(0) + ", your guild " + strcharinfo(2) + " has still vip status. So there is nothing i can really help you with."; close; } mes .NPC$; mes "Hello " + strcharinfo(0) + ", What can i do for you?"; next; if (select("- I want to make my guild vip:- Nothing") - 1) close; mes .NPC$; mes "Okay, to make your guild vip you need the following: "; mes "- " + .Amount + " x " + getitemname(.ID); next; mes .NPC$; mes "So what do you want now?"; next; if (select("Yes, i have those requirements:I'll think over it again") - 1) close; mes .NPC$; mes "Let me check your items to ensure that you meet the requirements."; next; if (countitem(.ID) < .Amount) { mes .NPC$; mes "Sorry " + strcharinfo(0) + ", it seems like you don't meet the requirements."; close; } mes .NPC$; mes "Alright then, i will register your guild as a vip guild."; query_sql "INSERT INTO `vip_guild` (`guild_id`, `expiration_time`) VALUES (" + getcharid(2) + ", DATE_ADD(NOW(), INTERVAL 1 MONTH))"; delitem .ID, .Amount; close; OnPCLoginEvent: .@rowCount = query_sql("SELECT TIMESTAMPDIFF(DAY, NOW(), expiration_time), TIMESTAMPDIFF(SECOND, NOW(), expiration_time) FROM vip_guild WHERE `guild_id` = " + getcharid(2), .@daysUntilExpiration, .@secondsUntilExpiration); if(.@rowCount == 0) end; if (.@secondsUntilExpiration <= 0) { dispbottom "Your guilds vip state has expired"; query_sql("DELETE FROM `vip_guild` WHERE `guild_id` = " + getcharid(2)); end; } dispbottom "Hello " +strcharinfo(0)+ ", your guilds vip state ends in " + callfunc("F_InsertPlural", .@daysUntilExpiration, "day") + "."; end; OnInit: .NPC$ = "[ " +strnpcinfo(1)+ " ]"; .Amount = 30; .ID = 51582; query_sql("CREATE TABLE IF NOT EXISTS `vip_guild` (`guild_id` INT NOT NULL, `expiration_time` DATETIME NOT NULL, PRIMARY KEY (guild_id)) ENGINE=INNODB"); }  
  10. Winterfox's post in [WTA] How make custom commands script or bindcommand cannot use in certain mapflag was marked as the answer   
    Hello,
    you should read the documentation more carefully, getmapflag takes at least two arguments.
    *getmapflag("<map name>",<flag>{,<type>}) So you need to input the map the user is on as the first argument. 
    Based on your example, a working solution would be this:
    - script at_mall -1,{ OnMallWarp: if(getmapflag(strcharinfo(3), gvg_castle)){ dispbottom "You cannot use this command inside a War of Emperium castle.", 0xFF0000; end; } warp "prontera",152,252; end; OnInit: bindatcmd "Mall", strnpcinfo(0)+"::OnMallWarp"; }  
×
×
  • Create New...