Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-13-2001, 04:57 AM
SlayerOfDarkness SlayerOfDarkness is offline
Registered User
Join Date: Nov 2001
Location: I kinda forgot
Posts: 24
SlayerOfDarkness is on a distinguished road
Send a message via ICQ to SlayerOfDarkness Send a message via AIM to SlayerOfDarkness Send a message via Yahoo to SlayerOfDarkness
Question Bar Store Script

Hi I'm making a bar for my server. I made it so far except the part when the money goes in the chest. I'd greatly appreciate it if someone help me. Heres the system script of the bar:

// NPC made by heX (Owner)
if (playerenters) {

}
if (playertouchsme) {
say 0;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 1))) {
putnpc beer.gif,beer.txt,30,17;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 2))) {
putnpc beer.gif,beer.txt,30,21;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 3))) {
putnpc beer.gif,beer.txt,33,24;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 4))) {
putnpc beer.gif,beer.txt,41,24;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 5))) {
putnpc beer.gif,beer.txt,46,21;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 6))) {
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 1))) {
putnpc beer.gif,beer.txt,30,17;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 2))) {
putnpc beer.gif,beer.txt,30,21;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 3))) {
putnpc beer.gif,beer.txt,33,24;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 4))) {
putnpc beer.gif,beer.txt,41,24;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 5))) {
putnpc beer.gif,beer.txt,46,21;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 6))) {
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 1))) {
putnpc beer.gif,beer.txt,30,17;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 2))) {
putnpc beer.gif,beer.txt,30,21;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 3))) {
putnpc beer.gif,beer.txt,33,24;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 4))) {
putnpc beer.gif,beer.txt,41,24;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 5))) {
putnpc beer.gif,beer.txt,46,21;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 6))) {
putnpc beer.gif,beer.txt,46,17;
}

if (strequals(#g, Owner)&&(strequals(#c, Free Sell))) {
putnpc beer.gif,beerfree.txt,30,17;
putnpc beer.gif,beerfree.txt,30,21;
putnpc beer.gif,beerfree.txt,33,24;
putnpc beer.gif,beerfree.txt,41,24;
putnpc beer.gif,beerfree.txt,46,21;
putnpc beer.gif,beerfree.txt,46,17;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell All))) {
putnpc beer.gif,beer.txt,30,17;
putnpc beer.gif,beer.txt,30,21;
putnpc beer.gif,beer.txt,33,24;
putnpc beer.gif,beer.txt,41,24;
putnpc beer.gif,beer.txt,46,21;
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell All))) {
putnpc beer.gif,beer.txt,30,17;
putnpc beer.gif,beer.txt,30,21;
putnpc beer.gif,beer.txt,33,24;
putnpc beer.gif,beer.txt,41,24;
putnpc beer.gif,beer.txt,46,21;
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell All))) {
putnpc beer.gif,beer.txt,30,17;
putnpc beer.gif,beer.txt,30,21;
putnpc beer.gif,beer.txt,33,24;
putnpc beer.gif,beer.txt,41,24;
putnpc beer.gif,beer.txt,46,21;
putnpc beer.gif,beer.txt,46,17;
}
[B]
if (itemlayed) {
take greenrupee;take redrupee;take bluerupee;take goldrupee;
}
if(strequals(#g,Owner)&&strequals(#c,Take Donation)){playerrupees=playerrupees+rupees; rupees=0;}
if(strequals(#g,Owner)&&strequals(#c,See Donations)){message #v(rupees) Gralat; sleep2; message ;}

Im having a problem with the item layed part:

if (itemlayed) {
take greenrupee;take redrupee;take bluerupee;take goldrupee;
}

Here is the beer script (beer.txt):

if (playertouchsme&&(playerrupees>4))
{playerrupees-=5;
show;
setplayerprop #c, Ah! Fells good!;
lay2 bluerupee,0,0;
sleep .5;
putleaps 5,x+0.5,y+0;
hide;
playerhearts+=3;
}

Please someone I really need your help!

Email it to me if you wish at [email protected]
Reply With Quote
  #2  
Old 11-13-2001, 05:22 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
the event is "playerlaysitem" not "itemlayed"
Reply With Quote
  #3  
Old 11-13-2001, 05:23 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
also, the putnpc has no "destroy" command (BAD! BAD! BAD!)
Reply With Quote
  #4  
Old 11-13-2001, 05:25 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
just do like on the chest
if (actionadd) {
rupees+=strtofloat(#p(0));
}
then on the beer.txt thing you want to put
if (playertouchsme ) {
... whatever here like heal the palyer blabla..
triggeraction xOfTheChest,yOfTheChest,add,CostOfBeer;
}
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #5  
Old 11-13-2001, 05:26 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
hmm...wait, you might want to do it another way (since it's not the player that lays the item

if (playerenters) timeout=.05;
if (timeout) {
take greenrupee; take bluerupee; take redrupee; take goldrupee;
timeout=.05;
}
Reply With Quote
  #6  
Old 11-13-2001, 05:27 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
that script is annoyingly long ....
use tokenizing or something ...
Reply With Quote
  #7  
Old 11-13-2001, 05:36 AM
Mrmicro Mrmicro is offline
Registered User
Join Date: Mar 2001
Posts: 128
Mrmicro is on a distinguished road
Send a message via AIM to Mrmicro
Try this

Try doing this... Put a beer GFX at each spot where you want the beer to Appear. Add in there..

If (playerenters) hide;
if (strequals(#g, Owner)&&(strequals(#c, Sell 1))) {
show;
if (playertouchsme)
playerhearts+= 3;
hide;

And you can put these npcs in all the spots.
__________________
Reply With Quote
  #8  
Old 11-13-2001, 06:00 AM
SlayerOfDarkness SlayerOfDarkness is offline
Registered User
Join Date: Nov 2001
Location: I kinda forgot
Posts: 24
SlayerOfDarkness is on a distinguished road
Send a message via ICQ to SlayerOfDarkness Send a message via AIM to SlayerOfDarkness Send a message via Yahoo to SlayerOfDarkness
Unhappy ? HELp!

I used liquids way cuz he knowz alot of thingz =)
but it didnt quite work maby i did something wrong
heres the system script:
// NPC made by heX
if (playerenters) {
x = 38;
y = 14;

}
if (playertouchsme) {
say 0;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 1))) {
putnpc beer.gif,beer.txt,30,17;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 2))) {
putnpc beer.gif,beer.txt,30,21;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 3))) {
putnpc beer.gif,beer.txt,33,24;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 4))) {
putnpc beer.gif,beer.txt,41,24;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 5))) {
putnpc beer.gif,beer.txt,46,21;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell 6))) {
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 1))) {
putnpc beer.gif,beer.txt,30,17;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 2))) {
putnpc beer.gif,beer.txt,30,21;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 3))) {
putnpc beer.gif,beer.txt,33,24;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 4))) {
putnpc beer.gif,beer.txt,41,24;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 5))) {
putnpc beer.gif,beer.txt,46,21;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell 6))) {
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 1))) {
putnpc beer.gif,beer.txt,30,17;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 2))) {
putnpc beer.gif,beer.txt,30,21;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 3))) {
putnpc beer.gif,beer.txt,33,24;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 4))) {
putnpc beer.gif,beer.txt,41,24;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 5))) {
putnpc beer.gif,beer.txt,46,21;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell 6))) {
putnpc beer.gif,beer.txt,46,17;
}

if (strequals(#g, Owner)&&(strequals(#c, Free Sell))) {
putnpc beer.gif,beerfree.txt,30,17;
putnpc beer.gif,beerfree.txt,30,21;
putnpc beer.gif,beerfree.txt,33,24;
putnpc beer.gif,beerfree.txt,41,24;
putnpc beer.gif,beerfree.txt,46,21;
putnpc beer.gif,beerfree.txt,46,17;
}
if (strequals(#g, Owner)&&(strequals(#c, Sell All))) {
putnpc beer.gif,beer.txt,30,17;
putnpc beer.gif,beer.txt,30,21;
putnpc beer.gif,beer.txt,33,24;
putnpc beer.gif,beer.txt,41,24;
putnpc beer.gif,beer.txt,46,21;
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTManager)&&(strequals(#c, Sell All))) {
putnpc beer.gif,beer.txt,30,17;
putnpc beer.gif,beer.txt,30,21;
putnpc beer.gif,beer.txt,33,24;
putnpc beer.gif,beer.txt,41,24;
putnpc beer.gif,beer.txt,46,21;
putnpc beer.gif,beer.txt,46,17;
}
if (strequals(#g, GTStaff)&&(strequals(#c, Sell All))) {
putnpc beer.gif,beer.txt,30,17;
putnpc beer.gif,beer.txt,30,21;
putnpc beer.gif,beer.txt,33,24;
putnpc beer.gif,beer.txt,41,24;
putnpc beer.gif,beer.txt,46,21;
putnpc beer.gif,beer.txt,46,17;
}
if (actionadd) {
rupees+=strtofloat(#p(0));
}
if(strequals(#g,Owner)&&strequals(#c,Take Donation)){playerrupees=playerrupees+rupees; rupees=0;}
if(strequals(#g,Owner)&&strequals(#c,See Donations)){message #v(rupees) Gralat; sleep2; message ;}


heres the beer script :
if (playertouchsme&&(playerrupees>4))
{playerrupees-=5;
show;
setplayerprop #c, Ah! Fells good!;
sleep .5;
putleaps 5,x+0.5,y+0;
hide;
playerhearts+=3;
triggeraction 38,14,add,5;
}
Reply With Quote
  #9  
Old 11-13-2001, 06:50 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
the triggeraction x,y should be of the cash register chest.. and it should work
try doing this
rupees+=strtofloat(#s(#p(0)));
that might work
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #10  
Old 11-13-2001, 08:13 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Re: ? HELp!

Quote:
Originally posted by SlayerOfDarkness
cuz he knowz alot of thingz =)
Do you mean "cause he knows alot of things"? I know the s key is right next to the z, but try not to get them messed up..It's really annoying...To me, at least
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #11  
Old 11-14-2001, 03:59 AM
SlayerOfDarkness SlayerOfDarkness is offline
Registered User
Join Date: Nov 2001
Location: I kinda forgot
Posts: 24
SlayerOfDarkness is on a distinguished road
Send a message via ICQ to SlayerOfDarkness Send a message via AIM to SlayerOfDarkness Send a message via Yahoo to SlayerOfDarkness
Red face im confused now...

I am extramly confused will someone help me out by liquids way?
Reply With Quote
  #12  
Old 11-15-2001, 10:55 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

I can't lower myself to Liquid's level, but here's some help... I'm not 100% sure it'll work since I'm not using the graal editor to check everything, but it should.

//The Main NPC
1- set an array of the x's you want
2- set an array of the y's you want
3- check the position based on the number said
4- put an npc there
5- add donation acceptances
6- add money withdrawal

//The Beer.txt NPC
1- check if the player touchs
2- Take some money from the player
3- Add it to a string


Finished script:

//The Main NPC
if (playerenters){
this.x={30,30,33,41,46,46};
this.y={17,21,24,24,21,17};
}
if (playerchats){
if (strequals(#g,Owner) || strequals(#g,GTManager) || strequals(#g,GTStaff)){
if (strequals(#g,Owner)){
if (strequals(#c,take donations)){
playerrupees+=strtofloat(#s(server.barrupees));
setstring server.barrupees,;
}
if (strequals(#c,see donations)){
message strtofloat(#s(server.barrupees)) rupees;
}
}
tokenize #c;
if (strequals(#t(0),Sell)){
this.put=strtofloat(#t(1))-1;
putnpc beer.gif,,this.x[this.put],this.y[this.put]
}
if (strequals(#t(0),Free)){
for (this.put=-1;this.put<arraylen(this.x);this.put++){
putnpc beer.gif,,this.x[this.put],this.y[this.put];
}
}
}
}
if (playerchats && startswith(donate,#c)){
tokenize #c;
if (playerrupees>=strtofloat(#t(1))){
setstring server.barrupees,#v(strtofloat(#s(server.barrupees ))+strtofloat(#t(1)));
}
}

//The Beer.txt
if (playertouchsme && playerrupees>=5){
playerhearts+=2;
playerrupees-=5;
setplayerprop #c,Ahhh... feels good!;
setstring server.barrupees,#v(strtofloat(#s(server.barrupees ))+5);
sleep .5;
putleaps 5,x+0.5,y+0;
destroy;
}
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #13  
Old 11-15-2001, 08:16 PM
SlayerOfDarkness SlayerOfDarkness is offline
Registered User
Join Date: Nov 2001
Location: I kinda forgot
Posts: 24
SlayerOfDarkness is on a distinguished road
Send a message via ICQ to SlayerOfDarkness Send a message via AIM to SlayerOfDarkness Send a message via Yahoo to SlayerOfDarkness
Talking thxs

thxs man
__________________

bya? -my ary take and die!
Reply With Quote
  #14  
Old 11-16-2001, 07:15 AM
SlayerOfDarkness SlayerOfDarkness is offline
Registered User
Join Date: Nov 2001
Location: I kinda forgot
Posts: 24
SlayerOfDarkness is on a distinguished road
Send a message via ICQ to SlayerOfDarkness Send a message via AIM to SlayerOfDarkness Send a message via Yahoo to SlayerOfDarkness
Unhappy doesnt work

doesnt work
__________________

bya? -my ary take and die!
Reply With Quote
  #15  
Old 11-16-2001, 09:24 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

Like I said, I didn't use Graal Editor for that script... so what's wrong with it? I think my computer can actually open a graal window now without crashing and burning >.<;

*checks* Yup.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
Reply


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 06:22 AM.


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