Jump to content

Ryokem

Members
  • Posts

    205
  • Joined

  • Last visited

Everything posted by Ryokem

  1. Heh, I do have it only when I'm not in a hurry, such as when I posted that script xD
  2. Yeh, I know imperative languages pretty well But that was not what I was aking for. function dispell(); //<-- Initialization on dispell function dispell(); //<-- function call What I mean is, can you really define the function script inside another one? <header>,{ function script <name> { //function features } } Does this work on rAthena? If you check on C, C++, Java or similar, each function must be declared not in another one, even if each function can call another one. That was what I was looking at, to learn if it's possible to or it is just a weird error.
  3. Yeah, I actually already corrected them all Had no time when I posted it, now that I came back from work I fixed them in a second Anyway, you still forget to correct an error I did: killmonsterall .Map$; //.Map$ as array needs an index
  4. Ryokem

    NPC BGM

    rAthena is something "bigger" than eAthena, so almost every eAthena script should work in rAthena, but not vice-versa. Although, this is only about scripting and not coding.
  5. Just to know, can you really script a function inside a switch case? O.o New feature of rA? xD
  6. oh, my bad, I noticed the error I did... I just forgot to specify the map in the mapannounce and mapflag command. Also, I optimized the script when deleting the mapflag. - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 2; set .NormalPorings, 2; setarray .Map$[0], "lighthalzen","louyang","comodo","xmas","aldebaran","izlude","payon","geffen","morocc","prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer360000: //1 hour delay stopnpctimer; killmonsterall .Map$[.loc]; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 0, 0, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 0, 0, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; mapannounce .Map$[.loc], strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) mapannounce .Map$[.loc], "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_blue; else { announce "The Poring Event has ended.", 0; removemapflag .Map$[.loc], mf_noskill; deletearray .Map$[0], getarraysize(.Map$); goto OnInit; } end; } This should fix my typo.
  7. I completely get your point, and maybe you are right, but I still believe you should ask in eA forum while you still have eA as emulator http://eathena.ws/forum/ <-- the active eA forum. Back to the main topic, did you manage to fix what you needed?
  8. "morroc" and "moroc" are not avaible maps. "morocc" is the current correct map name.
  9. getitem <item id>, <amount>; //Gold coins, poring coins or whatever you want to give out EDIT: By the way, shouldn't you use eAthena Forum if using that kind of emulator? o.O
  10. "anymapname" is not a map name, he meant to put there a random map location.. such as "prontera", "morocc", "moc_fild02"... whatever!
  11. Real. No need to open 2 topics with the same code and request. EDIT: Newer fixed version at Post #14 http://rathena.org/board/topic/73840-error-for-automated-events/#entry154225
  12. Untested. - script Poring Summoner -1,{ OnInit: //---- NPC Config ----- set .ItemID, 1000; set .SpecialPorings, 2; set .NormalPorings, 2; setarray .Map$[0], "lighthalzen","louyang","comodo","xmas","aldebaran","izlude","payon","geffen","morocc","prontera"; //--------------------- setnpctimer 0; initnpctimer; end; OnTimer360000: //1 hour delay stopnpctimer; killmonsterall .Map$; set .loc, rand(getarraysize(.Map$)); setmapflag .Map$[.loc], mf_noskill; monster .Map$[.loc], 0, 0, "Poring", 1002, .SpecialPorings, "Poring Summoner::OnSpecialKill"; monster .Map$[.loc], 0, 0, "Poring", 1002, .NormalPorings, "Poring Summoner::OnNormalKill"; announce "The Poring Event has begun!", 0; sleep 1000; announce "Location: " + .Map$[.loc], 0; sleep 1000; announce "Special Poring: " + .SpecialPorings, 0; sleep 1000; announce "Normal Poring: " + .NormalPorings, 0; end; OnSpecialKill: set .SpecialPorings, .SpecialPorings - 1; mapannounce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!", bc_map, bc_blue; getitem .ItemID,1; goto PoringCount; OnNormalKill: set .NormalPorings, .NormalPorings - 1; goto PoringCount; PoringCount: if( .SpecialPorings || .NormalPorings ) announce "Special Poring: " + .SpecialPorings + " || Normal Poring: " + .NormalPorings, bc_map, bc_blue; else { announce "The Poring Event has ended.", 0; deletearray .Map$[0], getarraysize(.Map$); removemapflag .Map$[.loc], mf_noskill; goto OnInit; } end; } Your script didn't start 'cause ou set a 60 hours wait time, actually almost 3 days. Also, you converted simple integer variables into array elements, don't know why.
  13. I totally agree, but I did find no real differences from reading a guide on a forum or on the wiki. For sure, direct tetaching will be the best option, but needs teachers, time to spare and something you can chat with.
  14. That is the wiki, or some references to it... O.o
  15. Nope I didn't test it, I just shot out what I remembered about @refresh, as I said above. Worth a try for sure, but I'm a bit hopeless about it.
  16. Mh? What tutorial are you looking for? http://rathena.org/wiki/Main_Page <--
  17. Better not. If i'm not wrong, @refresh resets the current look, chat and skill quickbars if I'm not wrong. Anyway, it has nothing to do with npc message box. Also, your code won't work as sleep 1000 will automatically detach the current read, and an error will popup when trying to use atcommand command.
  18. Don't forget to raise people before warping when they are dead, just not to fall into some weird bugs. OnPCDieEvent: atcommand "@raise"; if( <condition> ) warp "<map>", <x>, <y>; else if( <condition> ) warp "<map>", <x>, <y>; //[...]
  19. Unless you interact directly to the character, it's impossible to refresh a popul text window without source modifications. You can make it jump to the map at his currect position, to cancel the popup, but it's not really a great solution in my opinion, and also easily exploitable. mes "line 1"; getmapxy .@map$, .@x, .@y, 0; warp .@map$, .@x, .@y; sleep2 100; mes "line 2"; Oh god, this looks like really bad regardless from if it works or not... I shouldn't even post such trash xD
  20. EDIT: @Annie I just copy-paste your script, whithout worrying about what it does. Maybe try something like this to check if really works or not.. set .@s, select("1:2:3:4"); mes "You selected: " + ( (.@s == 1) ? "1" : ( ( .@s == 2 ) ? "2" : ( (.@s == 3 ) ? "3" : "4" ) ) );
  21. You just have to wonder about which and what to instance to get the scope you want. EDIT: I just did a typo, I wrote "34" instead of "3".
  22. Honestly, this is half-correct. eA and rA uses the pbs, so actually dynamic if statements must be put into a specific block of instance. //dispbottom ( (@menu == 4)? .@a$[@menu-4] : (@menu == 3)? .@a$[@menu-2] : .@a$[@menu] ); //Wrong 'cause 2 blocks of statements are running at the same time. dispbottom ( (@menu == 4) ? .@a$[@menu-4] : ( (@menu == 3)? .@a$[@menu-2] : .@a$[@menu]) ); I'm a bit out-of-dates about the primary ragnarok scripting engine, but many other imperiative languages work like this so I believe it works too.
  23. prt_fild08,40,54,5 script Long Run Event Manager 512,{ set @npcname$, "[ ^FFA500 Long Run Event Manager^000000 ]"; if ( getgmlevel() < 60 ) goto GM_Menu; GM_Menu: Obviously, if the IF doesn't meet conditions, it jumps to the next line, that actually is the GM_Menu label. You should create a label for no-GM users. prt_fild08,40,54,5 script Long Run Event Manager 512,{ set @npcname$, "[ ^FFA500 Long Run Event Manager^000000 ]"; if ( getgmlevel() < 60 ) goto Player_Menu; GM_Menu: // [...] end; Player_Menu: // [...] end; OnMonsterDied: killmonster "monk_test","Warg Racing::OnMonsterDied"; // [...] end; }
  24. The warp portal doesn't work or doesn't show up? If it doesn't appear on the map, check Valiente's solution bout tabbing the header, check the coordinates otherwise.
  25. { callfunc "Healings"; },{},{} function<tab>script<tab>Healings<tab>{ set @hp, Hp; while( Hp < MaxHp && Hp >= @hp ) { percentheal 3, 0; specialeffect2 7; set @hp, Hp; sleep2 1000; } return; } EDIT: Thanks Annie for testing it out ^^
×
×
  • Create New...