pastebin - collaborative debugging tool
kpaste.net RSS


Untitled
Posted by Anonymous on Fri 1st Jun 2012 05:24
raw | new post
view followups (newest first): Untitled by Anonymous

  1. //=========================================
  2. //By : goddameit
  3. //Ver : 3
  4. //=========================================
  5. prontera,157,185,4      script  Warp Battle Ground Vg   100,{
  6.         warp "pvp_room",80,43;
  7.         end;
  8. }
  9.  
  10. //=======================================================================//
  11. //===============================Register================================//
  12. //=======================================================================//
  13. pvp_room,87,38,4        script  Battleground Vg#1       100,{
  14.         end;
  15. OnInitC:
  16.         if(!.k){end;}
  17.         enablenpc strnpcinfo(0);
  18.         waitingroom "Battle Ground",getvariableofnpc(.gameplayeramount,"batleVg"),"Battleground Vg#1::OnJoin",getvariableofnpc(.gameplayeramount,"batleVg");
  19.         end;
  20. OnJoin:
  21.         if(getvariableofnpc(.game,"batleVg")==3){
  22.                 mapannounce "pvp_room","[Battle Ground System] Wait for game over completely.",0;
  23.                 end;
  24.         }
  25.         set .k,0;
  26.         set $bgvgbid1,waitingroom2bg("bat_b01",87,75,"","batleVg::OnGu1Die");
  27.         warpwaitingpc "bat_b01",87,75;
  28.         delwaitingroom;
  29.         disablenpc strnpcinfo(0);
  30.         set getvariableofnpc(.game,"batleVg"),getvariableofnpc(.game,"batleVg")+1;
  31.         if(getvariableofnpc(.game,"batleVg")==1){
  32.                 donpcevent "batleVg::OnGameStart";
  33.         }
  34.         end;
  35. OnPCLoadMapEvent:
  36.         if(getcharid(4)){
  37.                 bg_leave;
  38.                 dispbottom "=======================================";
  39.                 dispbottom "================[Leave]================";
  40.                 dispbottom "=======================================";
  41.         }
  42.         end;
  43. }
  44.  
  45. pvp_room,72,38,4        script  Battleground Vg#2       100,{
  46.         end;
  47. OnInitC:
  48.         if(!.k){end;}
  49.         enablenpc strnpcinfo(0);
  50.         waitingroom "Battle Ground",getvariableofnpc(.gameplayeramount,"batleVg"),"Battleground Vg#2::OnJoin",getvariableofnpc(.gameplayeramount,"batleVg");
  51.         end;
  52. OnJoin:
  53.         if(getvariableofnpc(.game,"batleVg")==3){
  54.                 mapannounce "pvp_room","[Battle Ground System] Wait for game over completely.",0;
  55.                 end;
  56.         }
  57.         set .k,0;
  58.         set $bgvgbid2,waitingroom2bg("bat_b01",311,224,"","batleVg::OnGu2Die");
  59.         warpwaitingpc "bat_b01",311,224;
  60.         delwaitingroom;
  61.         disablenpc strnpcinfo(0);
  62.         set getvariableofnpc(.game,"batleVg"),getvariableofnpc(.game,"batleVg")+1;
  63.         if(getvariableofnpc(.game,"batleVg")==1){
  64.                 donpcevent "batleVg::OnGameStart";
  65.         }
  66.         end;
  67. }
  68.  
  69. //=======================================================================//
  70. //================================Set====================================//
  71. //=======================================================================//
  72. -       script  batleVg -1,{
  73. ii:
  74.         setarray .hpto,50,50,10000,90000,10000; //HP of Ground 1 , HP of Ground 2 , time 1(Register) , time 2(During) , time 3(Respwan)
  75.         if(!getvariableofnpc(.k,"Battleground Vg#2")){
  76.                 set getvariableofnpc(.k,"Battleground Vg#2"),1;
  77.                 donpcevent "Battleground Vg#2::OnInitC";
  78.         }
  79.         if(!getvariableofnpc(.k,"Battleground Vg#1")){
  80.                 set getvariableofnpc(.k,"Battleground Vg#1"),1;
  81.                 donpcevent "Battleground Vg#1::OnInitC";
  82.         }
  83.         set .game,0;
  84.         killmonsterall "bat_b01";
  85.         mapwarp "bat_b01","prontera",150,180;
  86.         return;
  87. OnInit:
  88.         set .gameplayeramount,1;
  89.         callsub ii;
  90.         //=======================================================================//
  91.         //===============================SetWall=================================//
  92.         //=======================================================================//
  93.         setwall "bat_b01",327,173,5,6,1,"battleground Vg wall 1";
  94.         setwall "bat_b01",332,172,2,6,1,"battleground Vg wall 2";
  95.         setwall "bat_b01",244,185,3,4,1,"battleground Vg wall 3";
  96.         setwall "bat_b01",244,182,4,6,1,"battleground Vg wall 4";
  97.         setwall "bat_b01",67,128,10,1,1,"battleground Vg wall 5";
  98.         setwall "bat_b01",152,118,4,6,1,"battleground Vg wall 6";
  99.         setwall "bat_b01",156,118,5,4,1,"battleground Vg wall 7";
  100.         disablenpc "battleground Vg warp 1";
  101.         disablenpc "battleground Vg warp 2";
  102.         disablenpc "battleground Vg warp 3";
  103.         disablenpc "battleground Vg warp 4";
  104.         end;
  105.         //=======================================================================//
  106.         //================================Control================================//
  107.         //=======================================================================//
  108. OnGameStart:
  109.         bg_updatescore "bat_b01",.hpto[0],.hpto[1];
  110.         mapwarp "bat_b01","prontera",150,180;
  111.         setarray .@k,gettime(3),gettime(2),gettime(1)+.hpto[2]/1000;
  112.         while(.@k[2]>=60){
  113.                 if(.@k[2]>=60){
  114.                         setarray .@k[1],.@k[1]+1,.@k[2]-60;
  115.                 }
  116.                 if(.@k[1]>=60){
  117.                         setarray .@k[0],.@k[0]+1,.@k[1]-60;
  118.                 }
  119.                 if(.@k[0]>=24){
  120.                         set .@k[0],.@k[0]-24;
  121.                 }
  122.         }
  123.         announce "[Battle Ground System] Will Start at "+.@k[0]+":"+.@k[1]+":"+.@k[2]+" !",0;
  124.         sleep(.hpto[2]);
  125. OnTimerC:
  126.         if(.game!=2){
  127.                 sleep(2000);
  128.                 if(.game){
  129.                         announce "[Battle Ground System] Game Over.",0;
  130.                 }
  131.                 callsub ii;
  132.                 end;
  133.         }
  134.         announce "[Battle Ground System] Go !",0;
  135.         set .ib2,bg_monster($bgvgbid2,"bat_b01",326,149," ",1956,"batleVg::OnKiillT2");
  136.         set .ib1,bg_monster($bgvgbid1,"bat_b01",61,149," ",1916,"batleVg::OnKiillT1");
  137.         enablenpc "battleground Vg warp 1";
  138.         enablenpc "battleground Vg warp 2";
  139.         enablenpc "battleground Vg warp 3";
  140.         enablenpc "battleground Vg warp 4";
  141.         initnpctimer "#bgvg_heal1";
  142.         //=======================================================================//
  143.         //=================================OnEnd=================================//
  144.         //=======================================================================//
  145. OnTimerB:
  146.         sleep(.hpto[3]);
  147.         if(.hpto[0]>.hpto[1]){
  148.                 set .@c4,1;
  149.         }else if(.hpto[0]<.hpto[1]){
  150.                 set .@c4,2;
  151.         }
  152.         announce "[Battle Ground System] Ground "+(.@c4?.@c4+" Win":"Tie")+" !",0;
  153.         callsub ii;
  154.         end;
  155.         //=======================================================================//
  156.         //================================OnBreak================================//
  157.         //=======================================================================//
  158. OnKiillT2:
  159.         bg_warp $bgvgbid1,"bat_b01",87,75;
  160.         bg_warp $bgvgbid2,"bat_b01",311,224;
  161.         bg_updatescore "bat_b01",set(.hpto[0],.hpto[0]+3),set(.hpto[1],.hpto[1]-5);
  162.         if(.hpto[0]>99){
  163.                 bg_updatescore "bat_b01",99,.hpto[1];
  164.         }
  165.         sleep(.hpto[4]);
  166.         set .ib2,bg_monster($bgvgbid2,"bat_b01",326,149," ",1956,"batleVg::OnKiillT2");
  167.         end;
  168. OnKiillT1:
  169.         bg_warp $bgvgbid1,"bat_b01",87,75;
  170.         bg_warp $bgvgbid2,"bat_b01",311,224;
  171.         bg_updatescore "bat_b01",set(.hpto[0],.hpto[0]-5),set(.hpto[1],.hpto[1]+3);
  172.         if(.hpto[1]>99){
  173.                 bg_updatescore "bat_b01",.hpto[0],99;
  174.         }
  175.         sleep(.hpto[4]);
  176.         set .ib1,bg_monster($bgvgbid1,"bat_b01",61,149," ",1916,"batleVg::OnKiillT1");
  177.         end;
  178.         //=======================================================================//
  179.         //=================================OnDie=================================//
  180.         //=======================================================================//
  181. OnGu1Die:
  182. OnGu2Die:
  183.         getmapxy(@n$,@n,@b,0);
  184.         if((getcharid(4)!=$bgvgbid2&&getcharid(4)!=$bgvgbid1)||@n$!="bat_b01"){        
  185.                 set @n$,"";set @n,0; set @b,0;
  186.                 end;
  187.         }
  188.         if(getcharid(4)==$bgvgbid2){
  189.                 set .hpto[1],.hpto[1]-1;
  190.         }else{
  191.                 set .hpto[0],.hpto[0]-1;
  192.         }
  193.         if(.hpto[1]>99){
  194.                 set .hpto[1],99;
  195.         }
  196.         if(.hpto[1]<0){
  197.                 set .winn,1;
  198.                 set .hpto[1],0;
  199.         }
  200.         if(.hpto[0]>99){
  201.                 set .hpto[0],99;
  202.         }
  203.         if(.hpto[0]<0){
  204.                 set .winn,2;
  205.                 set .hpto[0],0;
  206.         }
  207.         bg_updatescore "bat_b01",.hpto[0],.hpto[1];
  208.         if(.winn){
  209.                 announce "[Battle Ground System] Ground "+.winn+" Win !",0;
  210.                 sleep 1000;
  211.                 callsub ii;
  212.                 mapwarp "bat_b01","prontera",150,180;
  213.                 set .game,3;
  214.         }
  215.         end;
  216. }
  217.  
  218. //=======================================================================//
  219. //==================================Heal=================================//
  220. //=======================================================================//
  221. bat_b01,311,224,4       script  #bgvg_heal1     139,{
  222. OnTimer2000:
  223.         unitwarp .ib2,"bat_b01",326,149;
  224.         unitwarp .ib1,"bat_b01",61,149;
  225.         if(getvariableofnpc(.game,"batleVg")==2){
  226.                 unitwarp .ib1,"bat_b01",61,149;
  227.                 unitwarp .ib2,"bat_b01",326,149;
  228.                 specialeffect 573;
  229.                 donpcevent "#bgvg_heal2::OnDo";
  230.                 areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
  231.                 areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
  232.                 sleep(1000);
  233.                 areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
  234.                 areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
  235.                 sleep(1000);
  236.                 areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
  237.                 areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
  238.                 sleep(1000);
  239.                 areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
  240.                 areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
  241.                 sleep(1000);
  242.                 areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
  243.                 areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
  244.                 sleep(1000);
  245.                 areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
  246.                 areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
  247.                 sleep(1000);
  248.                 initnpctimer;
  249.         }else{
  250.                 stopnpctimer;
  251.         }
  252.         end;
  253. }
  254.  
  255. bat_b01,87,75,4 script  #bgvg_heal2     139,{
  256. OnDo:
  257.         specialeffect 573;
  258.         end;
  259. }
  260.  
  261. //=======================================================================//
  262. //==================================Warp=================================//
  263. //=======================================================================//
  264. bat_b01,338,226,0       warp    battleground Vg warp 1  2,2,bat_b01,331,170
  265. bat_b01,286,228,0       warp    battleground Vg warp 2  2,2,bat_b01,242,179
  266. bat_b01,61,73,0 warp    battleground Vg warp 3  2,2,bat_b01,65,133
  267. bat_b01,114,72,0        warp    battleground Vg warp 4  2,2,bat_b01,154,122
  268. bat_b01,199,119,0       script  #battleground Vg warp 5 45,2,2,{
  269.         if(getcharid(4)!=$bgvgbid1){end;}
  270.         warp "bat_b01",87,75;
  271.         end;
  272. }
  273. bat_b01,199,181,0       script  #battleground Vg warp 6 45,2,2,{
  274.         if(getcharid(4)!=$bgvgbid2){end;}
  275.         warp "bat_b01",311,224;
  276.         end;
  277. }
  278.  
  279. //=======================================================================//
  280. //================================Mapflag================================//
  281. //=======================================================================//
  282. bat_b01 mapflag battleground    2
  283. bat_b01 mapflag nomemo
  284. bat_b01 mapflag nosave  SavePoint
  285. bat_b01 mapflag noteleport
  286. bat_b01 mapflag nowarp
  287. bat_b01 mapflag nowarpto
  288. bat_b01 mapflag noreturn
  289. bat_b01 mapflag nobranch
  290. bat_b01 mapflag nopenalty
  291. bat_b01 mapflag monster_noteleport
  292. pvp_room        mapflag loadevent
  293.  
  294. //=======================================================================//
  295. //===============================Function================================//
  296. //=======================================================================//
  297. function        script  BattleGroundVgFunction  {
  298.         getmapxy(@m$,@x,@y,0);
  299.         if(getcharid(4)!=$bgvgbid1&&getcharid(4)!=$bgvgbid2&&@m$!="bat_b01"){
  300.                 dispbottom "[You can't use this item]";
  301.                 end;
  302.         }
  303.         bg_warp getcharid(4),@m$,@x,@y;
  304.         end;
  305. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at