Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Custom map (https://forums.graalonline.com/forums/showthread.php?t=69472)

contiga 10-17-2006 03:10 PM

Custom map
 
Not that others may use this, but I just wanted to show the script, and get some oppinions on it. Maybe tips to improve it?

- Contiga

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
map.offset_x map.offset_y 0;
  
map.movespeed 10;
  
map.status 0;
}

function 
onKeyPressednumkeyscan) {
  if ( 
key "m") {
    if ( 
isonmap) {
      
map.update true;
      
map.status map.status;
    }
    
setTimer0.05);
  }
}

function 
loadPos() {
  
setAni"bomyisland_map-unfold""");
  
map.offset_x = ( player.* ( map.i_width map.r_width)) - ( screenwidth 2) + 16;
  
map.offset_y = ( player.* ( map.i_height map.r_height)) - ( screenheight 2) + 32;
  
fixMapPos();
  
map.update false;
  
map.wait 1;
}

function 
onTimeout() {
  if ( 
map.status == 1) {
    if ( 
isonmapdrawMap();
    else 
hideMap();
  }
  else 
hideMap();
}

public function 
turnOff()
  
map.status 0;

function 
hideMap() {
  
setAni"bomyisland_map-fold""");
  
hideImgs200map.images_index);
  
disabledaynight false;
}

function 
drawMap() {
  
freezeplayer.1);
  if ( 
map.wait 0)
    
map.wait -= 0.1;
  
disabledaynight true;
  
hideImgs200map.images_index); 
  
map.images_index 200;
  
map.r_width map.r_height int64 25); 
  
map.background_poly = { 00screenwidth0screenwidthscreenheight0screenheight};
  
map.co_ordinates = { map.offset_xmap.offset_yscreenwidth 32screenheight 32};
  
map.i_width imgwidthnewmainmap.png); 
  
map.i_height imgheightnewmainmap.png);
  
fixMapPos();
  
drawImg"bomyisland_bigmap.png"16161710.81map.co_ordinates);
  
drawPolymap.background_poly160.71, { 000});
  
map.objects.clear(); 
  
map.objects.add( { "*" player.accountintplayer.x), intplayer.y), player.head, { 0643232}});
  
map.objects.add( { "Train"serverr.train_10], serverr.train_11], "trainicon.png", { 003232}});
  for ( 
plallplayers) {
    if ( 
pl.level.starts"world"))
      
map.objects.add( { "*" pl.accountintpl.x), intpl.y), pl.head, { 0643232}});
  }
  for ( 
omap.objects) {
    
obj_new_x = ( o1] * ( map.i_width map.r_width)) - map.offset_x;
    
obj_new_y = ( o2] * ( map.i_height map.r_height)) - map.offset_y;
    if ( 
obj_new_x in 0screenwidth| && obj_new_y in 0screenheight|) {
      
drawImgo3], obj_new_xobj_new_y190.511o4]);
      if ( 
mousescreenx in obj_new_x 8obj_new_x 24| && mousescreeny in obj_new_y 8obj_new_y 24|) {
        
drawTexto0], obj_new_x 26obj_new_y 4"Arial"0.8"bi", { 111}, 19);
        
obj_polygon_1 = { obj_new_x 26obj_new_y 4obj_new_x 30 getTextWidth0.8"Arial""bi"o0]), obj_new_y 4obj_new_x 30 getTextWidth0.8"Arial""bi"o0]), obj_new_y 24obj_new_x 26obj_new_y 24};
        
obj_polygon_2 = { obj_new_x 6obj_new_y 4obj_new_x 26obj_new_y 4obj_new_x 26obj_new_y 24obj_new_x 6obj_new_y 24};
        
drawPolyobj_polygon_1180.71, { 10.50}); drawPolyobj_polygon_2180.61, { 010});
      }
    }
  }
  if ( 
keydown0) || mousescreeny in 016|) map.offset_y max0map.offset_y map.movespeed);
  if ( 
keydown1) || mousescreenx in 016|) map.offset_x max0map.offset_x map.movespeed);
  if ( 
keydown2) || mousescreeny in screenheight 16screenheight|) map.offset_y minmap.i_height screenheight 32map.offset_y map.movespeed);
  if ( 
keydown3) || mousescreenx in screenwidth 16screenwidth|) map.offset_x minmap.i_width screenwidth 32map.offset_x map.movespeed);
  
findWeapon"*Inventory").invOff();
  if ( 
map.update == true)
    
loadPos();
  
setTimer0.05);
}

function 
fixMapPos() {
  
map.offset_y max0map.offset_y); 
  
map.offset_y minmap.i_height screenheight 32map.offset_y);
  
map.offset_x minmap.i_width screenwidth 32map.offset_x); 
  
map.offset_x max0map.offset_x);
}

function 
drawPolyipiliaimic) {
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
polygon iplayer ilalpha iamode im;
    
red ic0]; green ic1]; blue ic2];
  }
}

function 
drawImgimixiyiliziaimodeipart) {
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
image imixiylayer il;
    
zoom izalpha iamode imode;
  } 
changeImgPartmap.images_indexipart0], ipart1], ipart2], ipart3]);
}

function 
drawTexttmtxtytftztstctl) {
  if ( 
tc 0tc = { 111};
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
txtyfont tfzoom tztext tmstyle ts;
    
red tc0]; blue tc2]; green tc1]; layer tl 1;
  }
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
tx 1ty + ( - ( 16)); font tfzoom tz;
    
text tmstyle tsred blue green 0layer tl;
  }
}

function 
onMouseDownbutton) {
  switch ( 
button) {
    case 
"left":
      if ( 
map.status 0) return "";
      if ( 
keydown2162true)) {
        
map.warp_x = ( ( mousescreenx map.offset_x) - 16) * ( map.r_width map.i_width);
        
map.warp_y = ( ( mousescreeny map.offset_y) - 16) * ( map.r_height map.i_height);
        
player.chat "warpto " intmap.warp_x) @ " " intmap.warp_y) @ " newmain.gmap";
        
map.status 0;
      }
      break;
  }



Twinny 10-17-2006 03:47 PM

Quote:

Originally Posted by contiga (Post 1232048)
Not that others may use this

Did you somehow miss the point of the code gallery? Isn't this like a share the wealth sub forum?

contiga 10-17-2006 09:41 PM

Quote:

Originally Posted by Twinny (Post 1232077)
Did you somehow miss the point of the code gallery? Isn't this like a share the wealth sub forum?

What I ment, is not entirely copy, but get the base from it perhaps.. ^^ I don't want to see an exact copy of it on another server tho..

JkWhoSaysNi 10-31-2006 09:30 PM

How about a feature list?

I couldn't get it to work. The map never displays. Anyway, I released a custom map a while back how does it compare?

xXziroXx 11-11-2006 03:55 AM

Quote:

Originally Posted by JkWhoSaysNi (Post 1238110)
I released a custom map a while back

So did I :) . And Contiga, this forum is for sripts to be released for anyone to use it anywhere. Dont like it? Dont post.


All times are GMT +2. The time now is 08:30 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.