Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gmap/Gralats problem (https://forums.graalonline.com/forums/showthread.php?t=71716)

Devenio 01-26-2007 03:46 AM

Gmap/Gralats problem
 
Ok we got gmaps on a server i work for. The gralats can be dropped by s+a in inside levels but on gmaps they just dont work... How can i fix this problem so you can drop gralats in any level/gmap???

Tolnaftate2004 01-26-2007 04:06 AM

This happened on Zenkou a while back. I'm not too sure how it was fixed, but eventually it worked again. In the meantime though, we used a stand-in script.

A gift from me to you.
PHP Code:

function onActionserverside() {
  if (
params[0] == "placemoney"){
    if (
player.rupees params[3]) return false;
    
thiso.tnpc = -1;
    
intNPCscount npcs.size();
    for (
this.i=0;this.i<intNPCscount;this.i++){
      
this.= ((params[1] - npcs[this.i].x)^+ (params[2] - npcs[this.i].y)^2)^.5;
      if (
this.3){
        
with(npcs[this.i]){
          for (
this.i=0;this.i<intNPCscount;this.i++){
            if (
npcs[this.i].id == id){
              
thiso.tnpc this.i;
              break;
            }
          }
        }
        if (
thiso.tnpc != -1) break;
      }
    }
    
with(npcs[thiso.tnpc]){
      if (
this.ani == "gralat"){ /* I recall this not working, you may need to use a variable that will recognize it as a gralat */
        
rupees += params[3];
        
this.updategani();
      }else{
        
temp.npc putnpc2(params[1],params[2]-1,{"join(\"gralats;\");"});
        
with(temp.npc){
          
this.owner playero.account;
          
rupees params[3];
          
this.updategani();
        }
      }
    }
    
thiso.tnpc NULL;
  }
}
//#CLIENTSIDE
function onCreated() onTimeout();
function 
onTimeout() {
  
this.rupeesn player.rupees;
  
intItemscount items.size();
  for (
this.i=0;this.i<intItemscount;this.i++){
    if (
items[this.i].type in {0,1,2,19}){
      
this.val = (items[this.i].type == 0) + (items[this.i].type == 1)*+ (items[this.i].type == 2)*30 + (items[this.i].type == 19)*100;
      
this.coords = {items[this.i].x-(playerx%64),items[this.i].y-(playery%64)};
      if (
this.rupeeso this.rupeesn this.val == 0){
        
triggeraction(0,0,"serverside",this.name,"placemoney",playerx+this.coords[0],playery+this.coords[1],this.val);
      }
      
take2(this.i);
      
temp.1;
    }
  }
  if (
temp.== 1sleep(.3);
  
this.rupeeso player.rupees;
  
timeout .05;


You will need to change the gralat class to make updategani a public function. And please take note that this is a pretty strict transliteration from GS1.

napo_p2p 01-26-2007 09:41 AM

Hmm, I never came across that.

Are you sure that the gmap is in serveroptions, as well as in the NPC Level List?

Devenio 01-27-2007 06:35 PM

ya i put 'gmaps=graallegacy,glmines,' in server options, while 'graallegacy.gmap,glmines.gmap' in npc levels list... but dont work :(

Riot 01-27-2007 06:58 PM

Is the gralats gani uploaded to your server? I believe this fixed it once for me awhile ago.

Devenio 01-27-2007 11:04 PM

ok it works on levels that ARENT gmaps. anyway i did upload it and still no.


All times are GMT +2. The time now is 09:22 AM.

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