Jump to content

meko

Core Developers
  • Content Count

    363
  • Joined

  • Days Won

    46

Everything posted by meko

  1. You spawn your monster like this: .@mobGID = monster("prontera", 150, 150, "Poring", PORING, 1); And you manipulate like this: // to prevent from moving: setunitdata(.@mobGID, UDT_MODE, getunitdata(.@mobGID, UDT_MODE) &~ 1); // to prevent from attacking: setunitdata(.@mobGID, UDT_MODE, getunitdata(.@mobGID, UDT_MODE) &~ 128); // to change stats: setunitdata(.@mobGID, UDT_STR, 11); // <= change those numbers setunitdata(.@mobGID, UDT_AGI, 95); setunitdata(.@mobGID, UDT_VIT, 2); setunitdata(.@mobGID, UDT_INT, 55); setunitdata(.@mobGID, UDT_DEX, 10); setunitdata(.@mobGID, UDT_LUK, 40);
  2. on line 22 just change "poring" to whatever name you want same goes for "INVASION BOSS" on line 34 see https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt#L6072
  3. the x1,y1,x2,y2 is the square area composed of the coordinates of the top-left tile and the bottom-right tile Let's imagine a grid of x,y coordinates: 0,0 0,1 0,2 0,3 0,4 1,0 1,1 1,2 1,3 1,4 2,0 2,1 2,2 2,3 2,4 3,0 3,1 3,2 3,3 3,4 4,0 4,1 4,2 4,3 4,4 Let's say you want the coordinates in red to be basilica; The top-left red tile is 1,1 in this case. This would be your x1,y1. The bottom-right tile is 3,3. This would be your x2,y2 so you'd write setcell("map", 1,1, 3,3, cell_basilica, true) If you do not know the coordinates you can simply walk to it with your character and use the @where command
  4. you could spawn a mob then manipulate it with setunitdata() as for where to get the data about the monster see getmonsterinfo()
  5. try bonus2(bAddRace2, RC_All, 50) or bonus2(bMagicAtkEle, Ele_All, 50)
  6. DropAnnounce is not enough, as it doesn't force pickup by the other player, and also it's only triggered on mob kill event, not pc
  7. here's a rough draft (not tested) - script PvP Ranking FAKE_NPC,{ OnPCKillEvent: pvp_rank[.this_week] += 3; // raise our own pvp rank dispbottom("You gain 3 points on PvP Rank"); attachrid(killedrid); pvp_rank[.this_week] = max(0, pvp_rank[.this_week] - 3); // decrease their pvp rank dispbottom("You received -3 points penalty on PvP Rank"); end; OnPCLoginEvent: OnClaimReward: .@char = getcharid(CHAR_ID_CHAR); if ($pending_badges[.@char] < 1) { end; } pvp_rank[$last_week] = 0; dispbottom(sprintf("PvP Rank: you obtained %i points this week, putting you at rank %i.", $pending_points[.@char], $pending_rank[.@char] + 1)); dispbottom(sprintf("Reward: %i badges.", $pending_badges[.@char])); getitem(Rok_Star_Badge, $pending_badges[.@char]); $pending_badges[.@char] = 0; $pending_points[.@char] = 0; $pending_rank[.@char] = 0; end; OnInit: .top_len = 10; // we want a top 10 // fallthrough OnSun0001: // every Sunday at 00:01 AM $last_week = .this_week; .this_week = atoi(gettimestr("%y%W", 4)); // YYWW if ($last_week < 1) { end; // this is our first week running this script } .@count = query_sql(sprintf("SELECT c.char_id, c.name, r.value" "FROM `char_reg_num_db` r " "JOIN `char` c ON r.char_id = c.char_id " "WHERE `key`='pvp_rank' AND `index`='%i' " "ORDER BY `value` DESC " "LIMIT " + .top_len + ";", $last_week), .top_char[0], .top_char$[0], .top_points[0]); // store that info so it can be reused throughout the week query_sql(sprintf("DELETE FROM `char_reg_num_db` WHERE `key`='pvp_rank' AND `index` <= %i", $last_week)); // janitor task for (.@i = 0; .@i < .@count; .@i++) { .@badges = (10 * .top_len) - (10 * .@i); // the badges this player won .@char = .top_char[.@i]; .@acc = charid2rid(.@char); $pending_badges[.@char] += .@badges; $pending_points[.@char] = .top_points[.@i]; $pending_rank[.@char] = (.@i + 1); if (.@acc > 0) { addtimer(rand(5000), "PvP Ranking::OnClaimReward", .@acc); } } end; } You'll notice I did +3 and -3 for both killing and being killed; This is on purpose, else someone could just make 2 characters and kill each other to keep getting +1 every time (+3, -2) To display the top 10 from last week in a npc you'd do something like: mes("Here's the ranking for last week:"); next(); if (getvariableofnpc(.top_char[0], "PvP Ranking") < 1) { mes("(no ranking available for that week)"); next(); } .@max = getvariableofnpc(.top_len, "PvP Ranking"); for (.@i = 0; .@i < .@max; .@i++) { .@points = getvariableofnpc(.top_points[.@i], "PvP Ranking"); if (.@points < 1) { break; } mes(sprintf("%i. %s — %i points.", .@i + 1, getvariableofnpc(.top_char$[.@i], "PvP Ranking"), .@points)); next(); }
  8. working on it, I'll post here the script asap, free of charge
  9. not sure if related but someone did request a script for a variable called "brokeemp", see http://herc.ws/board/topic/14684-can-some-one-convert-this-script-to-hercules/
  10. add this mapflag: loadevent then do something like: OnPCLoadMapEvent: if (strcharinfo(PC_MAP) == "moc_fild22" && !@auth_moc_fild22) { warp("SavePoint", 0, 0); // player is not authorized to be on moc_fild22 } end; and in the npc that warps the player to that map you'd just set @auth_moc_fild22 to true and warp to moc_fild22
  11. .@count = query_sql("SELECT c.name, r.value AS points " "FROM `char_reg_num_db` r " "JOIN `char` c ON r.char_id = c.char_id " "WHERE `key`='brokeemp' AND `index`='0' " "ORDER BY `value` DESC " "LIMIT 10;", .@char$[0], .@points[0]); for (.@i = 0; .@i < .@count; .@i++) { mes(sprintf("%d. %s — %d points.", .@i + 1, .@char$[.@i], .@points[.@i])); }
  12. maybe something like this: map,x,y,dir script npc name sprite,{ if (gettime(GETTIME_HOUR) == 15 || gettime(GETTIME_HOUR) == 19) { mes("I will now teleport you to the map."); close2(); // check the hour again, because the player can wait before closing if (gettime(GETTIME_HOUR) == 15 || gettime(GETTIME_HOUR) == 19) { warp(.dest_map$, .dest_x, .dest_y); addtimer(600000, strnpcinfo(NPC_NAME) + "::OnComeBack"); // 10 minutes end; } } mes("Sorry, I cannot teleport you right now."); next(); mes("Come back at 15H or 19H."); close; OnComeBack: warp("SavePoint", 0, 0); end; OnInit: .dest_map$ = "destination map"; .dest_x = 0; .dest_y = 0; // fallthrough OnHour16: OnHour20: // force any remaining player to come back if for whatever reason they are still there .@count = getunits(BL_PC, .@players, false, .dest_map$); for (.@i = 0; .@i < .@count; .@i++) { deltimer(strnpcinfo(NPC_NAME) + "::OnComeBack", .@players[.@i]); addtimer(0, strnpcinfo(NPC_NAME) + "::OnComeBack", .@players[.@i]); } end; }
  13. maybe something like this: OnPCKillEvent: if (rand(10) != 1) end; // artificial drop rate (1 in X chances to drop) delitem(Baphomet_Card, 1, killedrid); // force "drop" getitem(Baphomet_Card, 1); // force "pick-up" announce(sprintf("%s killed %s and obtained their Baphomet Card.", strcharinfo(PC_NAME), strcharinfo(PC_NAME, "unknown", killedrid)), bc_all); end;
  14. Not sure I understand what you're asking for.. You want the player to be teleported to their savepoint when they pay some amount of zeny? If so you would do the following: if (Zeny >= .@cost) { Zeny -= .@cost; warp("SavePoint", 0, 0); } With .@cost being the amount of zeny to substract
  15. EDIT: this PR was merged I need someone to test a certain pull request on the official ragnarok client (is it called Gravity?). See https://github.com/HerculesWS/Hercules/pull/1717 What needs testing: manipulating the vault from script while the bank window is open and checking if it updates the window accordingly. Thanks for your time
  16. Yeah that's new: https://github.com/HerculesWS/Hercules/pull/1657
  17. Thankfully I added a new buildin for that: getvariableofpc() Try this: set(getvariableofpc(<variable>, <account id>), <value>); With your code it would give: getpartymember(getcharid(CHAR_ID_PARTY), 2); for (.@i = 0; .@i < $@partymembercount; ++.@i) { .@acc = $@partymemberaid[.@i]; if (isloggedin(.@acc) && strcharinfo(PC_MAP, .@acc) == "poring_w03") { set(getvariableofpc(Flower, .@acc), 1); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.