Jump to content

Z3R0

Members
  • Posts

    615
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Z3R0

  1. Z3R0

    Request: Poker

    Possible sure, anything is possible
  2. npc header { // Variable ID's .@cards[0],id1,id2,id3; // Item ID's to Get as Reward (Card ID) .@cards[0],a,b,c .@reqs[0],1001,1002,1003; // Item ID's to Turn In .@reqs[0],a,b,c .@req_amount[0],10,50,100; // Amount of Required Items to Turn in... .@req_amount[0],a,b,c // all 'a' corresponds to 1 item, all 'b' corresponds to another, and all 'c' corresponds to another. // Welcome Dialog mes "Hello nub..."; mes "Pick Something"; // Create Menu set .@menu$, getitemname(.@cards[0]); for (set .@a, 1; .@a < getarraysize(.@cards); set .@a, .@a + 1) { set .@menu$, .@menu$ + ":" + .@cards[@a]; } // Query Player Selection set .@choice, select(.@menu$) - 1; // Display Requirements of Selected Item mes "You will need: " + .@req_amount[.@choice] + " of " + .@reqs[.@choice]; mes "Let me see if you have them..."; // Check Requirements of Selected Item if (countitem(.@reqs[.@choice]) >= .@req_amount[.@choice]) { mes "Great! You do!"; mes "Would you like to exchange?"; // Requirements Verified - Ask Player to Swap if (select("Yes:No") == 1) { mes "Ok!"; delitem .@reqs[.@choice], .@req_amount[.@choice]; getitem .@cards[.@choice], 1; mes "Enjoy!"; close; } else { mes "Come back soon"; close; } else { mes "Sorry you don't seem to have what I need..."; close; } }
  3. Yea yea no need to make such a fuss ;) lolz

  4. as far as the first error, that could be because of the way they are loaded... seeing as how #CP is loaded before #EVT... maybe move them around in the text file? maybe the spaces between the arguments is throwing it off? bc_map|bc_blue and not bc_map | bc_blue? according to the example on dj's site announce "This is my message just for you",bc_blue|bc_self; however... that could just be a typo in the order
  5. while(1) { if (.@style == 26 && .@s == 2) { mes "Hair Color #26 Has Issues."; mes "Skipping to Hair #27"; close2; set .@style, 27; } setlook .@Look[.@s], .@Style; message strcharinfo(0),"This is style #"+.@Style+"."; set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ Revert to original (^0055FF"+.@Revert+"^000000)"; switch(select(.@menu$)) { case 1: set .@Style, ((.@Style!=.@Styles[.@s])?.@Style+1:1); break; case 2: set .@Style, ((.@Style!=1)?.@Style-1:.@Styles[.@s]); break; case 3: message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+"."; input .@Style,0,.@Styles[.@s]; if (!.@Style) set .@Style, rand(1,.@Styles[.@s]); break; case 4: set .@Style, .@Revert; setlook .@Look[.@s], .@Revert; break; } }
  6. You need to getpartymember; and then attachrid(); of each party member getpartymember attachrid Then you will be able to access the stored variable on each player.
  7. Z3R0

    Daily Reward

    // Check Value Against Stored Value if (gettimestr("%Y-%m/%d") == lastTimeTalked$) { mes "You have already talked to me today"; close; } // Do NPC Dialog // Store as a String (YearMonthDay) set lastTimeTalked$, gettimestr("%Y-%m/%d"); // Do Whatever Else Dialog // You do not need to worry about time changing, because it's already dependent on the year/month/day // when the date changes, the variable changes // If you would like this be a PER ACCOUNT, instead of PER CHAR, simply change the lastTimeTalked$ to #lastTimeTalked$ // Enjoy
  8. Z3R0

    R> Basic Mall

    I'm there are a slew of these out there... before someone goes and remakes one, please do some looking around...
  9. I have no idea what kind of npc you are looking for... a regular npc? a shop npc? one that uses discounts? one that doesn't use discounts? please explain further.
  10. Easily done with sql ... the question is whether or not you want the messages to actually contain the items, if for instance, someone sees a message S> 1 Red Potion @ 50z (could they buy it then or would they have to message the user?)
  11. First, you need to store their current equipped headgear item ID set .@old_helm, getequipid(1); Use the command "rentitem" to give them an item for 15 seconds... they would have plenty of time to view the item (and even show their calculated stats) but 15 seconds, should not give them enough time to actually make any use of the item... http://rathena.org/w...?title=Rentitem Use a menu system to select which helm to view... OnViewHelm: rentitem <helm_id>, 15; equip <helm_id>; // return to menu OnKeepItem: getitem <helm_id>, 1; OnNevermind: equip .@old_helm; very similar to that
  12. lol @ Keyworld... my first script was also "Whack a Mole" lol... In any case, I learned by example... Figured out something I wanted to do, browsed through the /npc/ folder for a script that did it, figured out how each thing ran, implemented it into my own script, and viola! I made a NPC... The best thing is to read through every script you can find, and figure out how and what does what... Once you understand how the commands work, you can start piecing together one of your own... http://ea.dj-yhn.com // helped me out greatly, although this is now outdated... /doc/scripting_commands.txt always helps (but can be a pain, if you don't know what you're looking for)... asking questions when you aren't sure (always ask, don't be afraid) start with the basics... understand variables, understand scopes, then move on to harder stuff, and learn how that works... I remember when I was sooooo excited when I first created a NPC that said something in game, I thought I was the shit... and then I created "Whack a Mole" and released it, it did great, people loved it, then I moved on to bigger and better things, and look where I'm at now? Sure it's taken me 6 years, but it was well worth it
  13. Awesome ! where'd the command go? although you could just "deactivatepset" rather than killing it
  14. Taking a look at it My apologies... Forgot getarraysize() does not like 0 parameters... modified... use Item ID == 1 for Zeny and Amount = Zeny Amount in place of Item ID it will now work // By Z3R0 prontera,155,181,5 script Sample 757,{ // Create the Category Array setarray .@main_menu$[0],"Sword","Spear","Dagger"; // Item ID's (The Number 0 is the Index of the Category "Sword") setarray .@equip_0[0],13439,13435,13436,4,5,6,7,8,9; // Item ID's (The Number 1 is the Index of the Category "Bow") setarray .@equip_1[0],1443,1439,3,4,5,6,7,8,9; // Item ID's (The Number 2 is the Index of the Category "Dagger") setarray .@equip_2[0],1,2,3,4,5,6,7,8,9; // Create Item Hunt Group Arrays (By Category) // For adding Zeny, use Item ID 1, and in Amount, use Amount of Zeny setarray .@items_0[0],501,502,503; setarray .@items_amount_0[0],1000,2,3; setarray .@items_1[0],501,502,503; setarray .@items_amount_1[0],1,2,3; setarray .@items_2[0],501,502,503; setarray .@items_amount_2[0],1,2,3; // Build Primary Section (Oops Forgot This) for (set .@a, 0; .@a < getarraysize(.@main_menu$); set .@a, .@a + 1) { set .@primary_menu$, .@primary_menu$ + (.@primary_menu$ == "" ? "" : ":") + .@main_menu$[.@a]; } // Display Categories to Player and Store Answer as Index (-1 Stores as Array Index) set .@category, select(.@primary_menu$) - 1; // Now Build the Menu Based on This Selection for (set .@a, 0; .@a < getarraysize(getd(".@equip_" + .@category)); set .@a, .@a + 1) { set .@sub_menu$, .@sub_menu$ + (.@sub_menu$ == "" ? "" : ":") + getitemname(getd(".@equip_" + .@category + "[" + .@a + "]")); } // Now Offer the New Menu to the Player as Index (-1 Stores as Array Index) set .@item_choice, select(.@sub_menu$) - 1; // Determine If Player Has Required Items for (set .@a, 0; .@a < getarraysize(getd(".@items_" + .@category)); set .@a, .@a + 1) { set .@item_id, getd(".@items_" + .@category + "[" + .@a + "]"); set .@item_requires, getd(".@items_amount_" + .@category + "[" + .@a + "]"); if (.@item_id != 1) { set .@player_has, countitem(.@item_id); set .@item_name$, getitemname(.@item_id); if (.@player_has < .@item_requires) { set .@errors$[getarraysize(.@errors$)], "You Still Need " + (.@item_requires - .@player_has) + " " + .@item_name$ + ((.@item_requires - .@player_has) > 1 ? "'s." : "."); } } else { // Is Zeny if (Zeny < .@item_requires) { set .@errors$[getarraysize(.@errors$)], "You Still Need " + (.@item_requires - Zeny) + " z."; } } } // Determine Errors to Display if (getarraysize(.@errors$)) { for (set .@a, 0; .@a < getarraysize(.@errors$); set .@a, .@a + 1) { mes .@errors$[.@a]; } close; } // Now For Debugging Purposes mes "Item ID Chosen: " + getd(".@equip_" + .@category + "[" + .@item_choice + "]"); mes "Item Name: " + getitemname(getd(".@equip_" + .@category + "[" + .@item_choice + "]")); // Take Items Away for (set .@a, 0; .@a < getarraysize(getd(".@items_" + .@category)); set .@a, .@a + 1) { delitem getd(".@items_" + .@category + "[" + .@a + "]"), getd(".@items_amount_" + .@category + "[" + .@a + "]"); } // Give Item getitem getd(".@equip_" + .@category + "[" + .@item_choice + "]"), 1; close; }
  15. Z3R0

    This or That?

    Single Celled Organism (Is that an animal or human?) Nintendo or Sega?
  16. Reading... lol I forgot to build the menu.... for the first one... prontera,155,181,5 script Sample 757,{ // I Was just talking with Brian about this last night actually... // Create the Category Array setarray .@main_menu$[0],"Sword","Spear","Dagger"; // Item ID's (The Number 0 is the Index of the Category "Sword") setarray .@equip_0[0],13439,13435,13436,4,5,6,7,8,9; // Item ID's (The Number 1 is the Index of the Category "Bow") setarray .@equip_1[0],1443,1439,3,4,5,6,7,8,9; // Item ID's (The Number 2 is the Index of the Category "Dagger") setarray .@equip_2[0],1,2,3,4,5,6,7,8,9; // Create Item Hunt Group Arrays (By Category) // For adding Zeny, use Item ID 0, and in Amount, use Amount of Zeny setarray .@items_0[0],501,502,503; setarray .@items_amount_0[0],1000,2,3; setarray .@items_1[0],501,502,503; setarray .@items_amount_1[0],1,2,3; setarray .@items_2[0],501,502,503; setarray .@items_amount_2[0],1,2,3; // Build Primary Section (Oops Forgot This) for (set .@a, 0; .@a < getarraysize(.@main_menu$); set .@a, .@a + 1) { set .@primary_menu$, .@primary_menu$ + (.@primary_menu$ == "" ? "" : ":") + .@main_menu$[.@a]; } // Display Categories to Player and Store Answer as Index (-1 Stores as Array Index) set .@category, select(.@primary_menu$) - 1; // Now Build the Menu Based on This Selection for (set .@a, 0; .@a < getarraysize(getd(".@equip_" + .@category)); set .@a, .@a + 1) { set .@sub_menu$, .@sub_menu$ + (.@sub_menu$ == "" ? "" : ":") + getitemname(getd(".@equip_" + .@category + "[" + .@a + "]")); } // Now Offer the New Menu to the Player as Index (-1 Stores as Array Index) set .@item_choice, select(.@sub_menu$) - 1; // Determine If Player Has Required Items for (set .@a, 0; .@a < getarraysize(getd(".@items_" + .@category)); set .@a, .@a + 1) { set .@item_id, getd(".@items_" + .@category + "[" + .@a + "]"); set .@item_requires, getd(".@items_amount_" + .@category + "[" + .@a + "]"); if (.@item_id) { set .@player_has, countitem(.@item_id); set .@item_name$, getitemname(.@item_id); if (.@player_has < .@item_requires) { set .@errors$[getarraysize(.@errors$)], "You Still Need " + (.@item_requires - .@player_has) + " " + .@item_name$ + ((.@item_requires - .@player_has) > 1 ? "'s." : "."); } } else { // Is Zeny if (Zeny < .@item_requires) { set .@errors$[getarraysize(.@errors$)], "You Still Need " + (.@item_requires - Zeny) + " z."; } } } // Determine Errors to Display if (getarraysize(.@errors$)) { for (set .@a, 0; .@a < getarraysize(.@errors$); set .@a, .@a + 1) { mes .@errors$[.@a]; } close; } // Now For Debugging Purposes mes "Item ID Chosen: " + getd(".@equip_" + .@category + "[" + .@item_choice + "]"); mes "Item Name: " + getitemname(getd(".@equip_" + .@category + "[" + .@item_choice + "]")); // Take Items Away for (set .@a, 0; .@a < getarraysize(getd(".@items_" + .@category)); set .@a, .@a + 1) { delitem getd(".@items_" + .@category + "[" + .@a + "]"), getd(".@items_amount_" + .@category + "[" + .@a + "]"); } // Give Item getitem getd(".@equip_" + .@category + "[" + .@item_choice + "]"), 1; close; } Also, be sure to remove any ID's that are invalid from your array... for example: setarray .@equip_0[0],13439,13435,13436,4,5,6,7,8,9; the Item ID's 4,5,6,7,8,9 are not valid item ID's, so remove them so you are left with... setarray .@equip_0[0],13439,13435,13436;
  17. I don't believe you can actually check guild level via a script command (single command) you can get the name of the guild, if they are in one, and then read the SQL DB for the level value
  18. Looks stupid Just kidding man, looks great! If I used a GRF I would give this 5 stars ftw
  19. No, but you can simply add the line: announce strcharinfo(0) + " just broke the emp!",0; or whatever on the OnAgitBreak: event in the siege scripts...
  20. Z3R0

    Show equip

    Sure, but the player must be online... Take a look at this: http://ea.dj-yhn.com/index.php?c=attachrid
  21. { atcommand "@disguise 1001"; } http://ea.dj-yhn.com/index.php?c=atcommand
  22. I'm really confused, because that's not even close to the same script you asked for support on O.o
  23. I have never tinkered with global account vars... please try to see if #newbiegift works the variable is not wrong, it's a global account variable... (usually only used when you have multiple map servers...) don't know if they work, if you don't...
  24. This made yet ? get to work!
×
×
  • Create New...