Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-28-2011, 03:36 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Custom Gralat Class

I liked Classic iPhones gralat locking system so much that I made my own.
Anyway here is mine.
It allows you to lock gralats if you're in a level that starts with house_account, you may want to restrict it to a level, if so leave that in.
The only difference is that even if you're the owner they WON'T pick up if they're locked, that was the only thing I hate about Classic iPhone in that regards.
PHP Code:
function onCreated() {
  
this.setshape(0,32,32);
  
dontblock();
  
showcharacter();
  
updategani();
}
function 
onUpdategani() {
  
updategani();
}

function 
updategani() {
  
temp.type 1;
  if (
rupees>=100temp.type 4;
  else if (
rupees>=30temp.type 3;
  else if (
rupees>=5temp.type 2;

  
setcharani("gralats"temp.type);
}

function 
onPlayerTouchsMe() {
  if(
this.locked == 0){
    
player.rupees += rupees;
    
rupees 0;
    
destroy();
  }else{
  
this.chat "(Locked)";
  
sleep(2);
  
this.chat "";
  }
}
function 
onActionLeftMouse(){
  if(
this.locked == 1){
  
this.chat rupees@" (Locked)";
  
sleep(2);
  
this.chat "";
  }else{
  
this.chat rupees;
  
sleep(2);
  
this.chat "";
  }
}
function 
onActionDoubleMouse(){
  
temp.lname player.level.name.substring(6);
  
temp.lname lname.substring(0lname.pos(".nw").trim());
  
//had to use it twice, I tried  player.level.name.substring(6,  lname.pos(".nw").trim());  with no luck.
  
if(player.account == lname){
    
this.locked = !this.locked;
    if(
this.locked == 1){
      
this.chat "Locked!";
      
sleep(2);
      
this.chat "";
    }
    if(
this.locked == 0){
      
this.chat "Unlocked!";
      
sleep(2);
      
this.chat "";
    }
  }

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion

Last edited by Gunderak; 12-29-2011 at 03:35 PM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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