Advertisement
Emistry

[RO] Infinity Gauntlet - Finger Snap

Apr 28th, 2019
3,777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.26 KB | None | 0 0
  1. -   script  infinity_gauntlet_main  -1,{
  2.    
  3.     OnInit:
  4.         .item_id = 2604; // Glove itemID
  5.         bindatcmd("snap", strnpcinfo(3)+"::OnAtcommand", 99);
  6.         end;
  7.        
  8.     OnAtcommand:
  9.         if (.item_id) {
  10.             if (!isequipped(.item_id)) {
  11.                 dispbottom "You need to equip "+getitemname(.item_id)+" to use this feature.";
  12.                 end;
  13.             }
  14.         }
  15.         if (!.status) {
  16.             .status = 1;
  17.             if (.@atcmd_parameters$ == "thanos") {
  18.                 .@size = query_sql("SELECT `char_id`,`name`,`online` FROM `char` WHERE `account_id` IN (SELECT `account_id` FROM `login` WHERE `account_id` <> "+getcharid(3)+" AND `group_id` < "+getgroupid()+") ORDER BY RAND()", .@cid, .@name$, .@online);
  19.                 .@size = (.@size / 2);
  20.                 announce "<SYSTEM> '"+strcharinfo(0)+"' snapped his 'thanos' finger!! Half of the population from the server will be banned.", bc_all;
  21.                 for (.@i = 0; .@i < .@size; .@i++) {
  22.                     if (.@online[.@i]) {
  23.                         atcommand "@kick "+.@name$[.@i];
  24.                     }
  25.                     query_sql("UPDATE `char` SET `unban_time` = 2147483647 WHERE `char_id` = "+.@cid[.@i]+" LIMIT 1");
  26.                 }
  27.                 dispbottom "You snapped "+.@size+" player(s)";
  28.                 unittalk getcharid(3), "I...AM...INEVITABLE!!!";
  29.                 percentheal -50,-50;
  30.             }
  31.             else if (.@atcmd_parameters$ == "ironman") {
  32.                 announce "<SYSTEM> '"+strcharinfo(0)+"' snapped his 'ironman' finger!! All monsters in the map has been wiped.", bc_all;
  33.                 unittalk getcharid(3), "I...AM...IRON-MAN!!!";
  34.                 killmonsterall strcharinfo(3);
  35.                 unitkill getcharid(3);
  36.             }
  37.             else if (.@atcmd_parameters$ == "hulk") {
  38.                 announce "<SYSTEM> '"+strcharinfo(0)+"' snapped his 'hulk' finger!! The banned population has been saved.", bc_all;
  39.                 .@size = query_sql("SELECT `name` FROM `char` WHERE `unban_time` > 0", .@name$);
  40.                 // for (.@i = 0; .@i < .@size; .@i++)
  41.                 //  atcommand "@charunban "+.@name$[.@i];
  42.                 query_sql("UPDATE `char` SET `unban_time` = 0 WHERE `unban_time` > 0");
  43.                 dispbottom "You saved "+.@size+" player(s)";
  44.                 unittalk getcharid(3), "AARRRGGGHHHHHHH";
  45.                 percentheal -50,-50;
  46.             }
  47.             else {
  48.                 dispbottom "Usage: "+.@atcmd_command$+" <thanos/ironman/hulk>";
  49.                 dispbottom " - thanos - ban 50% of population";
  50.                 dispbottom " - ironman - wipe all monster in the map.";
  51.                 dispbottom " - hulk - unban everyone.";
  52.             }
  53.             .status = 0;
  54.         }
  55.         end;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement