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
  #10  
Old 02-04-2011, 11:18 PM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
I decided to help further by making you a GUI shopping system in which you can purchase bombs and arrows:

PHP Code:
function onActionServerSide(action) {
  switch (
action) {
    case 
"DecRup":
      
player.rupees -= params[1];
    break;
  }
}

//#CLIENTSIDE
function onCreated() {
 new 
GuiWindowCtrl("Bomb_Window") {
   
clientextent "300,200";
   
profile GuiBlueWindowProfile;
   
screenwidth/2-150;
   
screenheight/2-100;
   
visible true;

   
text "Get your bombs and arrows!";
   
canmove true;
   
canresize false;
   
canmaximize false;
 
   new 
GuiShowImgCtrl("Bomb_Img") {
     
55;
     
80;
     
width 32;
     
height 32;
     
this.image "bomb.png";
    }
   new 
GuiShowImgCtrl("Bomb_Img2") {
     
210;
     
80;
     
width 32;
     
height 32;
     
this.image "arrow.png";
    }
 
   new 
GuiMLTextCtrl("Bomb_Text") {
     
profile GuiBlueMLTextProfile;
     
30;
     
35;
     
width 430;     
     
height 50;
     
text "<font size=28><font color=white><b>Bombs:</b></font></font>";
    }
   new 
GuiMLTextCtrl("Bomb_Text2") {
     
profile GuiBlueMLTextProfile;
     
10;
     
130;
     
width 430;
     
height 50;
     
text "<font size=13.5><font color=white><b>10 Bombs for 10 Gralats.</b></font></font>";
    }
   new 
GuiMLTextCtrl("Bomb_Text3") {
     
profile GuiBlueMLTextProfile;
     
170;
     
35;
     
width 430;
     
height 50;
     
text "<font size=28><font color=white><b>Arrows:</b></font></font>";
    }
   new 
GuiMLTextCtrl("Bomb_Text4") {
     
profile GuiBlueMLTextProfile;
     
160;
     
130;
     
width 430;
     
height 50;
     
text "<font size=13.5><font color=white><b>20 Arrows for 10 Gralats.</b></font></font>";
    }
   new 
GuiButtonCtrl("Bomb_Button1") {
     
profile GuiBlueButtonProfile;
     
20;
     
155;
     
width 100;
     
height 30;
     
text "Purchase";
    }
   new 
GuiButtonCtrl("Bomb_Button2") {
     
profile GuiBlueButtonProfile;
     
170;
     
155;
     
width 100;
     
height 30;
     
text "Purchase";
    }
  }
}

function 
Bomb_Button1.onAction() {
  
//Button "Purchase"
 
if (player.rupees >= 9) {
   
triggerserver("gui",this.name,"DecRup",10);
   
player.bombs += 10;
  }else
    
player.chat "Insufficient Funds";
}

function 
Bomb_Button2.onAction() {
  
//Button "Purchase"
 
if (player.rupees >= 9) {
   
triggerserver("gui",this.name,"DecRup",10);
   
player.darts += 20;
  }else
    
player.chat "Insufficient Funds";

I've also included a .txt file.
Attached Files
File Type: txt BombPurchasing.txt (2.3 KB, 181 views)
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.
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 09:11 PM.


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