Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-08-2011, 12:48 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Post Improved Gralats

This is an improved gralats class, some may like. Some may not.

-----------------------------------------------
PHP Code:
gralat.admins = {
                  
"Graal749201"
                
};
function 
onCreated() {
  
showcharacter();
  
updategani();
}
function 
onUpdategani() {
  
updategani();
}

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

  
setcharani("gralats"temp.type);
}

function 
onPlayerTouchsMe() {
  if (
player.account == this.owner || this.owner == NULL) {
    
player.rupees += rupees;
    
dontblock();
    
rupees 0;
    
destroy();
  }
  if (
player.account != this.owner) {
    
player.chat "I don't own this!";
  }
}
function 
onActionLeftMouse() {
  
this.chat rupees;
  
sleep(3);
  
this.chat "";
}
function 
onActionRightMouse() {
  if (
this.owner != NULL) {
    
this.chat this.owner;
    
sleep(3);
    
this.chat "";
  }
  if (
this.owner == NULL) {
    
this.owner player.account;
    
player.chat "I now own the gralat!";
  }
}
function 
onPlayerChats() {
  if (
player.account in gralat.admins) {
    if (
player.chat == "/killgralats") {
      
destroy();
      
rupees 0;
    }
  }
  if (
player.chat == "/viewowners") {
    
this.chat this.owner;
    
sleep(3);
    
this.chat "";
  }

----------------------------------------------------

Q: What does it do?

A: It lets people own gralats so one person can keep the gralat while nobody steals it, and it lets people view the gralat amount the gralat is worth!

Q: How does it work?

A: Clicking on the gralat lets the player view the amount it is worth. Right clicking on it, lets you own the gralat if it isn't currently occupied

Q: Are there other mini features?

A: Yes, chatting "/viewowners" shows all gralat owners nearby. And if your account is in the array at the top you can remove the levels gralats by saying "/killgralats"!


Hopefully this will be useful to people who like Gralats and want improvements on how the system works!

Updates will appear later in this thread.
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!



Last edited by Tigairius; 02-08-2011 at 01:25 AM.. Reason: Read the rules. Please use [PHP] tags around your code. Also, style. I also don't want to have to fix your scripts.
Reply With Quote
  #2  
Old 02-08-2011, 12:53 AM
codecub codecub is offline
Banned
Join Date: Feb 2011
Location: psych ward
Posts: 37
codecub is an unknown quantity at this point
Reply With Quote
  #3  
Old 02-08-2011, 01:13 AM
Astram Astram is offline
Era iPhone PR
Astram's Avatar
Join Date: Aug 2010
Posts: 324
Astram can only hope to improve
Send a message via AIM to Astram
Quote:
Originally Posted by codecub View Post
Don't like it? Well, its not for everyone.
__________________
-Toad
The worlds biggest Toad fan...
Era iPhone FTW!


Reply With Quote
  #4  
Old 02-08-2011, 01:16 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Place your code in [PHP] tags.
__________________
Quote:
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:38 PM.


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