Jump to content

Z3R0

Members
  • Posts

    618
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Z3R0

  1. I still hate you sometimes *much love*
  2. What are u confused about it looks pretty straight forward // Untested - script PartyExp -1,{ OnPartyExpKilled: // Clear the Server Party Variables set($ @ partymembercount, 0); deletearray($ @ partymemberaid, getarraysize( $ @partymemberaid)); // Get the Corresponding Party Information getpartymember(getcharid(1)); // Loop Through Party Members for(.@i = 0; .@i < $ @ partymembercount; .@i++) { // Attach the player id attachrid($ @ partymemberaid[.@i]); set(BaseExp, BaseExp + 1000); // Give Base Exp set(JobExp, JobExp + 1000); // Give Job Exp getitem(501,1); // Give Item // Unattach Player from the Script detachrid; } announce("Wootzers! You Done It!", bc_map, C_YELLOW); end; }
  3. Ok, I can look into it tonight, sorry, I am at work, just thought I would whip something up, I can test it out tonight late though if you don't have anyone to debunk it by then... Sorry for it not working right off the bat
  4. Crude and Highly Untested prontera,158,173,4 script CoinExchanger 88,{ mes("Welcome"); mes("Please give me your coins..."); // Check Inventory for Coins getinventorylist; freeloop(true); for(.@coin_index = 0; .@coin_index < getarraysize(.exchange_ids); .@coin_index++) { for(.@i = 0; .@i < @inventorylist_count, .@i++) { if (@inventorylist_id[.@i] == .exchange_ids[.@coin_index]) { if (@inventorylist_amount[.@i] >= .exchange_amount[.@coin_index]) { set(.@menu_coin_index[getarraysize(.@menu_coin_index)], .@coin_index); set(.@menu$, ( .@menu$ = "" ? "" : ":" ) + getitemname(.exchange_ids[.@coin_index]) + "(" + @inventorylist_amount[.@i] + ")"); } } } } freeloop(false); // Display Option to Show them choices and how many coins they have... set .@choice, select(.@menu$) - 1; // Subtract 1 to get Array Index set .@index, .@menu_coin_index[.@choice]; dispbottom("You have chosen to use " + getitemname(.exchange_ids[.@index]) ); progressbar("00FF00", .exchange_duration[.@index]); // Start the Progressbar // On Progress Bar Completion... let's see what we do here... delitem(.exchange_ids[.@index], .exchange_amount[.@index]; freeloop(true); for(.@i = 0; .@i < getarraysize(.available_items); .@i++) { .@random = rand(1, 100); if (.@random <= .available_chance[.@i]) { // GET THE ITEM mes "Here you go"; getitem(.available_items[.@i], .available_amount[.@i]); if (.available_chance[.@i] <= .announce_level_chance) { announce(strcharinfo(0) + " just scored " + getitemname(.exchange_ids[.@index]), bc_all, C_YELLOW); } close; } } freeloop(false); mes("You got the default prize..."); getitem(.default_item, .default_amount); close; OnInit: setarray(.exchange_ids, 673, 675, 671, 677); setarray(.exchange_amount, 1, 1, 1, 1); setarray(.exchange_duration, 10, 8, 5, 2); // # of seconds to progressbar... setarray(.available_items, 501, 502, 503, 504); setarray(.available_amount, 1, 1, 1, 1); setarray(.available_chance, 50, 40, 30, 10); // % of 100 set(.announce_level_chance, 10); // Will only display announce if they get item 504... since it's the only one with 10 chance or lower set(.default_item, 501); set(.default_amount, 1); end; }
  5. Crude and Untested (just figured i would whip something to get you started...) - script TestEvent -1,{ OnInit: initnpctimer; .event_started = 0; end; OnTimer300000: // 5 Minutes Check (When Event is on) if (.event_started == 1) { doevent("TestEvent::OnStopEvent"); } end; OnTimer1080000: // 18 Minutes .r = rand(5); if (.r == 0) { doevent("TestEvent::OnRunEvent"); } end; OnTimer1140000: // 19 Minutes if (.r == 1) { doevent("TestEvent::OnRunEvent"); } end; OnTimer1200000: // 20 Minutes if (.r == 2) { doevent("TestEvent::OnRunEvent"); } end; OnTimer1260000: // 21 Minutes if (.r == 3) { doevent("TestEvent::OnRunEvent"); } end; OnTimer1320000: // 22 Minutes if (.r == 4) { doevent("TestEvent::OnRunEvent"); } end; OnRunEvent: .event_started = 1; setnpctimer(0); announce("Event Running...", bc_all, C_YELLOW); // Do Other Event Things end; OnStopEvent: .event_started = 0; setnpctimer(0); announce("Event Stopped", bc_all, C_YELLOW); end; }
  6. .@generatedMenu$ = ""; setarray(.@pvp_maps$, "a", "b", "c", "d"); // Corresponds to the Menu Options // Generate the Menu from the Array for (.@i = 0; .@i < getarraysize(.@pvp_maps$); .@i++) { .@generatedMenu$ += ( .@i = 0 ? "" : ":" ) + "Enter PVP Room #" + (.@i + 1) + "[" + getmapusers(.@pvp_maps$[.@i]) + "]"; } // Append the last option .@generatedMenu$ += ":I'm out of potions for today"; .@selection = select(.@generatedMenu$) - 1; // Substract 1 because select gives 1-N and array starts 0-N if (.@selection = getarraysize(.@menu$) ) { // This is the actual array size because we added +1 due to last option // Chose Last Option mes "Sorry to see you go"; close; } // Else they chose to warp to a pvp place... warp .@pvp_maps$[.@selection], 0, 0; end;
  7. Sorry I botched the code a bit... this is what happens when I can't test haha... Getmapxy you need to include the charname... I think u can use charid... don't know..m to access char id... it will be... getelementofarray ( getvariableofnpc (".mine_players", npc name), .@i) within the for loop... When u initnpctimer you need to include char id... to replace getcharid (0) with the above code as well... or you can simply male that it's own var... .@charid = getelementofarray ( getvariableofnpc (".mine_players", npc name), .@i); from within the for loop
  8. Right if you don't want to use a name.. then u can change .@mvp_names $[.@i] to a string to something like... "Special MVP" and they will all have that name
  9. Oh sorry one small glitch you have to specify the npc name to retrieve the variable from in getvariableofnpc... not something I have used in a while... look up the syntax in rathena script commands.. and put the npc name that has that variable of the players... so that you retrieve that variable from that npc
  10. - script MVPSummoner -1,{ // There is no reason to kill them if you summon them... so I didn't add that command... // This will simply spawn the mob id's you list, on the maps you choose at random coordinates on the maps.. // and display them with the name you chose... // I would have gone through the DB, but they don't list the maps that the MVP's spawn on... OnSpawnMVP: setarray(.@mvp_ids, 1086, 1087); // Continue to list MVP ID's here... setarray(.@maps$, "prt_fild08", "prontera"); // List the correct map that corresponds with the MVP ID serarray(.@mvp_names$, "Golden Thief Bug", "Other"); // MVP Names to Display can customize // Summon the MVPs for(.@i = 0; .@i < getarraysize(.@mvp_ids); .@i++) { monster .@maps$[.@i], 0, 0, .@mvp_names$[.@i], .@mvp_ids[.@i], 1; } end; OnInit: // Load the script commands bindatcmd("spawnmvp", strnpcinfo(0) + "::OnSpawnMVP"); end; }
  11. Well the only time the players interact with those NPC's are 2 instances... A ) When they warp to the map B ) When they kill something... What I would suggest doing is storing the players that are warped to the map into an array right before the warp... set(.mine_players[getarraysize(.@mine_players)], getcharid(0)); This will give you a useable array of character id's that have joined the event... On your crystaltimer npc... where you start the timer... instead of starting it with initnpctimer()... loop through each character that should still be in the mine map... for(.@i = 0; .@i < getarraysize(getvariableofnpc(".mine_players")); .@i++) { // Make sure the users are still on the map... getmapxy(.@map$, .@x, .@y, UNITTYPE_PC); if (.@map$ == "mine_evt") { // Still on the map... initnpctimer(getcharid(0)); // This will attach the NPC Timer to the character so you can run multiple rather than 1... } } I haven't tested this so I can't be 100% sure, but that's something for what you are looking for...
  12. that is what his script does... one command... Then it gathers the id's from an sql query... and loops through the results and spawns them... One command to control them all
  13. You are not attaching any players to the npctimers... attachnpctimer (getcharid (0));.... You can't read char info if a character never started the timer or event... Might need to re work this script
  14. Npc won't trigger on touch... but after the npc move you could add a donpcevent... and call that npc OnTouch label... Calculate how long it takes to move from point a to point b... Start a timer and OnTimerXXXX: dpnpcevent("ontouchnpc::OnTouch");
  15. It should pull the mvp I'd list from query_sql if you want to add custom ones not in that table... after the query_sql... add: set(.@idList [getarraysize [.@idList], 1234); Where 1234 is a new id not listed in the db... you can add multiples of those if you want...
  16. Could write a custom bindatcmd... that would check each mvp for the presence of the mvp if not there spawn him.
  17. Setarray (.@maps $, "prontera", "morrocc"); Setarray (.@x,158,0); Setarray (.@y, 173,0); .@index = rand (0, getarraysize (.@maps $ -1); Warp .@maps $[.@index], .@x [.@index], .@y [.@index];
  18. Is it any npc or only a particular? You could set a var to be read when they click the npc they are talking to. I don't believe there is a way to see if they are "busy" talking though
  19. You need to include a check for getmapxy () and see if the char is still within the area... if not set char var fire to 0
  20. Nice. If u don't get an answer by the time I get home I will check it out. I am mobile atm and it's hard to see anything.
  21. You could just adjust the menu order if it's wrong... change the location of the strings...
  22. Where is the rest of the code? That information is just variables being set...
  23. The set .@menu $, .@menu $ + ":"; Are irrelevant... remove those else's... that would just create empty spacers in the menu and there is no reason for that... although I am assuming you have that because the menu is not setup to be dynamic... Wish people would take more approaches with dynamics than just making "extra" room hehe... I can help look when I get to my pc on Monday if it is not resolved by then.
×
×
  • Create New...