Advertisement
Skorm

Mob Spawner (Update: Blacklist / No drops)

Aug 28th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.84 KB | None | 0 0
  1. prontera,119,168,6  script  Skormy  904,{
  2.     if(getgmlevel()<.gmlevel) end;
  3.     set .@MVPID,-3;
  4.    
  5. L_Menu:
  6.     mes .NPC$;
  7.     mes "Select an option from the menu below and click [ ^0000FFSummon!^000000 ] when you're done.";
  8.     next;
  9.    
  10.     if(.@MVPID==-3){ set .@tmp$,"Random MVP"; } else { set .@tmp$,getmonsterinfo(.@MVPID,0); }
  11.  
  12.     Switch(select("Monster ID ( ^0000FF"+.@tmp$+"^000000 ) :Map Name ( ^0000FF"+.@MAPNAME$+"^000000 ) :Amount ( ^0000FF"+.@AMOUNT+"^000000 ):[ ^0000FFSummon!^000000 ]")) {
  13.         case 1:
  14.             mes .NPC$;
  15.             mes "Input the id of the monster you'd like to spawn.";
  16.             next;
  17.             input(.@MVPID);
  18.             while(!query_sql("(SELECT `ID` from `mob_db` where `ID` = "+.@MVPID+") UNION ALL (SELECT `ID` from `mob_db2` where `ID` = "+.@MVPID+" LIMIT 1);",.@a))
  19.                 input(.@MVPID);
  20.                
  21.             if( compare(.blacklist$,"|"+.@MVPID+"|" ) ) {
  22.                 message strcharinfo(0),"I'm sorry but "+getmonsterinfo(.@MVPID,0)+" was blacklisted!";
  23.                 message strcharinfo(0),"Please use a different id.";
  24.                 set(.@MVPID,0);
  25.             }
  26.            
  27.             goto L_Menu;
  28.            
  29.         case 2:
  30.             mes .NPC$;
  31.             mes "Input the name of the map you'd like to spawn the monster on.";
  32.             next;
  33.             input(.@MAPNAME$);
  34.             while(mobcount(.@MAPNAME$,"all")==-1){
  35.                 input(.@MAPNAME$);
  36.                 if(mobcount(.@MAPNAME$,"all")!=-1){
  37.                     mes "Would you like to spawn "+(.@MVPID==-3?"Random MVPs":getmonsterinfo(.@MVPID,0))+" on the map "+.@MAPNAME$+"?";
  38.                     next;
  39.                     if(select("Yes:No")-1) { set .@MAPNAME$,""; continue; } else { break; }
  40.                 }
  41.             }
  42.             goto L_Menu;
  43.            
  44.         case 3:
  45.             mes .NPC$;
  46.             mes "Input the amount you'd like to spawn.";
  47.             mes "( Maximum "+.Lamount+" )";
  48.             next;
  49.             input(.@AMOUNT);
  50.             while(.@AMOUNT<=0||.@AMOUNT>.Lamount) {
  51.                 input(.@AMOUNT);
  52.                 if(.@AMOUNT>0&&.@AMOUNT<=.Lamount) {
  53.                     mes "Would you like to spawn "+.@AMOUNT+" monsters?";
  54.                     next;
  55.                     if(select("Yes:No")-1) { set .@AMOUNT,0; continue; } else { break; }
  56.                 }
  57.             }
  58.             goto L_Menu;
  59.            
  60.         case 4:
  61.             if( mobcount(.@MAPNAME$,"all")==-1 || .@AMOUNT<=0 ) {
  62.                 if(!.fiesta) {
  63.                     mes .NPC$;
  64.                     mes "I'm sorry you need to fill-out all the fields before summoning a monster!";
  65.                     next;
  66.                     goto L_Menu;
  67.                 } else {
  68.                     if(mobcount(.@MAPNAME$,"all")==-1) set .@MAPNAME$,"this";
  69.                     if(.@AMOUNT<=0) set .@AMOUNT,.fiesta;
  70.                 }
  71.             }
  72.            
  73.             if(.Mamount){
  74.                 if(mobcount(.@MAPNAME$,"MVP Spawner::OnMVPDeath")+.@AMOUNT>.Mamount&&.Mamount>0) {
  75.                     mes .NPC$;
  76.                     mes "I'm sorry but there can only be "+.Mamount+" MVPs in one map.";
  77.                     set .@tmp,.Mamount-mobcount(.@MAPNAME$,"MVP Spawner::OnMVPDeath");
  78.                     if(.@tmp>0) {
  79.                         mes "Would you like to spawn "+.@tmp+" instead?";
  80.                         if(select("Yes:No")-1) { mes "Ok!"; close; }
  81.                         announce ""+strcharinfo(0)+" : Summoned "+.@AMOUNT+" "+.@tmp$+"(s) in "+(.@MAPNAME$=="this"?strcharinfo(3):.@MAPNAME$)+".",bc_all,"0x"+.fontcolor$;
  82.                         monster .@MAPNAME$,0,0,"--ja--",.@MVPID,.@tmp,"MVP Spawner::OnMVPDeath";
  83.                         close;
  84.                     }
  85.                     next;
  86.                     goto L_Menu;
  87.                 }
  88.             }
  89.        
  90.             announce ""+strcharinfo(0)+" : Summoned "+.@AMOUNT+" "+.@tmp$+"(s) in "+(.@MAPNAME$=="this"?strcharinfo(3):.@MAPNAME$)+".",bc_all,"0x"+.fontcolor$;
  91.             monster .@MAPNAME$,0,0,"--ja--",.@MVPID,.@AMOUNT,"MVP Spawner::OnMVPDeath";
  92.             close;
  93.     }
  94.     end;
  95.    
  96. OnMVPDeath:
  97.     end;
  98.            
  99. OnInit:
  100.     //=-=-=-=-=-=Configuration=-=-=-=-=-=
  101.     set .NPC$,"[ ^D2691ESkormy^000000 ]"; // Npc Name
  102.     set .gmlevel,99; //Minimum Gm level allowed to spawn MVPS.
  103.     set .fiesta,0; // If enabled will spawn that many random MVPs on the players map if no other information is provided! (Off=0) Will bypass Maximum amount!
  104.     set .fontcolor$,"FFFF00"; // Hexi color text is announced in.
  105.     set .Lamount,150; // Maximum amount of mvps that can be spawned at once.
  106.     set .Mamount,0; // Maximum amount of mvps on one map at a time. (Off=0)
  107.     set .blacklist$,"|1002|1003|1004|1005|";
  108.     //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement