Jump to content

Euphy

Members
  • Posts

    2997
  • Joined

  • Last visited

  • Days Won

    74

Everything posted by Euphy

  1. Euphy

    Suggestion

    ^ That's what arrays and loops are for, silly Mystsrs. Any additional source code would just loop through the arguments anyway.
  2. Please... x.x tl;dr it counts time, that's it. No you can't ever use "timers" for offline characters.
  3. There are many examples of how gettimetick(2) works, please try searching first next time. OnInit: bindatcmd("dailyreward",strnpcinfo(0)+"::OnAtCmd"); end; OnAtCmd: if (#dailyreward > gettimetick(2)) { message strcharinfo(0),"You must wait 24 hours before receiving more items."; end; } // getitem x,y; set #dailyreward, gettimetick(2)+86400; end;
  4. Euphy

    Suggestion

    Serves no purpose, I vote no.
  5. texture/effect/asura1.tga texture/effect/asura2.tga ... texture/effect/asura16.tga ref: http://www.eathena.ws/board/index.php?showtopic=238501
  6. No, the script only executes for the attached player.
  7. You can't trigger events for offline characters. What do you need to execute when a player is offline, anyway? Calculating elapsed time with a permanent variable and gettimetick(2) OnPCLoginEvent should be sufficient.
  8. Probably in the latest SVN... (think about it)
  9. Remember to add: if (killedrid == getcharid(3)) end; // terminate on player suicide
  10. http://rathena.org/wiki/mapflag#nocommand
  11. It's complicated. You'll have to replace all countitem/delitem with countitem2/delitem2 and create a new function argument for refine rate.
  12. Haven't tested, some of the math might be off but this is the concept: - script PlayerTimer -1,{ OnPCLoginEvent: set @PlayerTimer, gettimetick(2); addtimer 86400-PlayerTimer,strnpcinfo(0)+"::OnFinish"; end; OnPCLogoutEvent: if (@PlayerTimer) set PlayerTimer, PlayerTimer+gettimetick(2)-@PlayerTimer; end; OnFinish: dispbottom "Your time has run out."; set @PlayerTimer,0; set PlayerTimer,0; end; }
  13. https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/db/mob_avail.txt I remember rewriting this article on eA but it was lost in the rollback. x.x
  14. i.e. It's not a problem with this script.
  15. ex. - shop Armor::shop -1,2306:100000,... turbo_room,75,140,4 script Armor 752,{ callshop "Armor::shop",0; end; OnInit: waitingroom "message",0; end; }
  16. So many variables... x.x Try using a bit variable to store values instead: Tips_and_Tricks_(Scripting)#Use_binary_methods_to_store_large_number_of_flags_.281_and_0.29. trunk/doc/quest_variables.txt
  17. @Vitrue: You can't have a visible NPC and the atcommand, unfortunately, because of the NPC_checknear test. You can call labels off an invisible NPC, though~ So here's a patch removing the NPC coordinates and adding bindatcmd: @@ -7,16 +7,17 @@ //===== Compatible With: ===================================== -//= rAthena SVN r15340+ +//= rAthena SVN r16471+ //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. +//= [bindatcmd] Script activated by command @quest. //============================================================ -prontera,164,203,6 script Quest Shop 998,{ +- script Quest Shop -1,{ function Add; function Chk; function Slot; function A_An; +OnMenu: if(.Shops$ != "") set .@i,1; else { set .@menu$,""; @@ -102,6 +102,7 @@ OnInit: freeloop(1); + bindatcmd("quest",strnpcinfo(0)+"::OnMenu"); // --------------------- Config --------------------- upaste: http://upaste.me/raw/5ad09654ecdbb6f (full script) If you still want the visible NPC, you'd have to write something like: prontera,164,203,6 script Quest Shop#duplicate 998,{ doevent "Quest Shop::OnMenu"; end; }
  18. You can't exactly display multiple rewards in a shop. Put them in a box?
  19. Ah, I've been meaning to write something like this for a while but forgot about it. Here's a cooler script than Joseph's, :3~ prontera,163,168,4 script Item Trader 797,{ mes "[item Trader]"; mes "Would you like to"; mes "trade something in?"; mes "The item ID must be"; mes "between ^0055FF["+.Bounds[0]+"]^000000 and ^0055FF["+.Bounds[1]+"]^000000."; next; if(select("Sure.:No, thanks.") == 2) close; mes "[item Trader]"; mes "Select a single item to trade in."; mes "You can change your mind later, don't worry."; callshop "item_trader",2; npcshopattach "item_trader"; end; OnSellItem: mes "[item Trader]"; if (@sold_nameid < .Bounds[0] || @sold_nameid > .Bounds[1]) { mes "I'm afraid I can't do anything with this ^0055FF"+getitemname(@sold_nameid)+"^000000..."; close; } mes "You want to trade in your ^0055FF"+getitemname(@sold_nameid)+"^000000?"; sleep2 1000; doevent strnpcinfo(0)+"::OnContinue"; end; OnContinue: mes "Pick one item you'd like, then."; callshop "item_trader",1; npcshopattach "item_trader"; end; OnBuyItem: mes "[item Trader]"; mes "Are you sure you want to trade your ^0055FF"+getitemname(@sold_nameid)+"^000000 for a ^0055FF"+getitemname(@bought_nameid)+"^000000?"; next; if(select("Yes, I'm sure.:Wait a second...") == 2) { mes "[item Trader]"; mes "Okay, take your time."; close; } mes "[item Trader]"; mes "Here you go."; mes "Enjoy!"; delitem @sold_nameid,1; getitem @bought_nameid,1; close; OnInit: // Write the lower and upper bounds of item IDs to trade in. setarray .Bounds[0],500,550; // List the items available to purchase. setarray .@Items[0],501,502,503,504,505,506,507,508,509,510,511; freeloop(1); npcshopdelitem "item_trader",512; for(set .@i,0; .@i<getarraysize(.@Items); set .@i,.@i+1) npcshopadditem "item_trader",.@Items[.@i],0; freeloop(0); end; } - shop item_trader -1,512:-1 upaste: http://upaste.me/raw/e99b962ab10812a
  20. That's official behavior, all castles without an owner will remain open.
  21. @wakoko321: Actually... I have no idea how Toasty managed to do that, o.o. You could add a session, reload settings, and delete the session after it's over -- not as convenient, but it gets the same results.
  22. Duplicate: bugreport:6526 A post will be made there when it's fixed.
  23. @RaGERO: I've scripted the controller to use as few variables as possible (well, within reason), so I'm only storing "hour" variables and checking status on :00. It's certainly possible to script around it if you're only adding one extra check (i.e. :30), but it'd be too resource-unfriendly to allow an input. If you don't want to use :00 at all, you could just change this: OnMinute00: To: OnMinute30: And add this as necessary for the display: ...+":30"+...
  24. You should fix the indentation, ex: if(@equip != -1 && @view > 0) { //note: yes...i'm using atcommand here cause for some reason // 'setlook' has permanent effects...last time i checked at least if(@equip & 1) atcommand "@changelook 3 " + @view; if(@equip & 256) atcommand "@changelook 1 " + @view; if(@equip & 512) atcommand "@changelook 2 " + @view; } In all honesty, I don't see why someone would opt to use this instead of an easily-configurable dynamic script, but I guess that's not my call to make.
  25. Iirc this should be very easy to do via source. Moving to source requests~
×
×
  • Create New...