Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Jobs (https://forums.graalonline.com/forums/showthread.php?t=11978)

fireball_dolphonia 09-16-2001 04:16 AM

Jobs
 
how do u script the farming job

Shard_IceFire 09-16-2001 04:48 AM

What, do you think someone's just gonna post the farming script for you? Either learn how to yourself or at least give us a basic farming script and we can help you fix the errors.

fireball_dolphonia 09-16-2001 04:57 AM

all i need is the watering can

entravial 09-16-2001 05:07 AM

~AlphaFlame~

If you hafta use G2k1 scripts and can't make your own scripts that own g2k1 scripts... then you're just pathetic and shouldn't even be scripting.

*duck falls from the ceiling and explodes*

wetferret1 09-16-2001 08:50 AM

if (initialized) {
sprites = {-1,-1, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 4, 3, 3, 2, 1};
stepnext = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12, 13, 0, 0, 0, 0};
stepdienext = { 0, 0, 0,16,15,14,12,12,12,12, 0, 0, 0, 0, 0, 0, 0};
}
if (created) {
showcharacter;
set this.istree;

this.step = 0;
this.timer = 0;
displaytree();
level.inittrees = true;

timeout = 10;
}
if (timeout) {
if (!(this.step in {0,10,11})) {
this.timer += 10;
if (this.step==1 || this.timer>=this.stepwait) {
if ((this.step in |2,9|) && this.waterlast<this.waterneeded)
this.step = stepdienext[this.step];
else
this.step = stepnext[this.step];
this.waterlast = 0;
this.timer = 0;
}
}
displaytree();
message;
timeout = 10;
}

if (actionwater && !(this.step in {0,10,11})) {
// Player waters the tree
this.waterlast++;
setcharani appletree#v(sprites[this.step]),25;
}
if (actionpushed || washit) {
if (this.step==10) {
this.step = 11;
displaytree();
}
}
if (playerchats && strequals(#c,reset trees) && strequals(#n,Jman9912)) {
this.step = 0;
displaytree();
}
if (updatetreeimg) {
displaytree();
}
if (playertouchsme) {
if (strequals(#a,#s(this.owner)) && this.step==11) {
// Player gets the apples
this.step = 12;
this.timer = 0;
displaytree();

apples = this.minapples + int(0.5+this.water/300);
setstring apples,#v(strtofloat(#s(apples))+apples);
setstring client.apples,#s(apples);
say2
You got #v(apples) apples!#b
You have now #s(apples) of#b
them.;
} else if (!(this.step in {0,10,11})) {
if (this.step>=12)
status = 4;
else if (this.waterlast>=this.waterneeded)
status = 0;
else if (this.timer<this.stepwait*4/10)
status = 1;
else if (this.timer<this.stepwait*8/10)
status = 2;
else
status = 3;
setcharani appletree#v(sprites[this.step]),#v(20+status);
message Owner: #s(this.owner);
}
}

function displaytree() {
if (sprites[this.step]<0)
hide;
else {
show;
setcharani appletree#v(sprites[this.step]),;
}
}

ownerofbabylon 09-16-2001 02:19 PM

the whole point was not to give him a script

wetferret1 09-16-2001 04:27 PM

I am going to make a job! Hehe

SkooL 09-16-2001 04:33 PM

I would think the watering can would just be...
PHP Code:

if (onwater(x,y)&&weaponfired)
{
  
setani ganifill,;
  
this.waterfill=4;
}
if (
weaponfired&&!onwater(x,y)) 
{
  
setani gani water,;
  
this.waterfill-=1;
}
if (
weaponfired&&!onwater(x,y)&&this.water=0)
{
  
setani gani canempty,;


With the tree, there would be a couple lines similar to...
PHP Code:

if (playertouchsme&&strequals(#m,water))
{
  
this.watered++;



SkooL 09-16-2001 04:36 PM

Quote:

Originally posted by wetferret1
NPC Code:
if (initialized) {
sprites = {-1,-1, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 4, 3, 3, 2, 1};
stepnext = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12, 13, 0, 0, 0, 0};
stepdienext = { 0, 0, 0,16,15,14,12,12,12,12, 0, 0, 0, 0, 0, 0, 0};
}
if (created) {
showcharacter;
set this.istree;

this.step = 0;
this.timer = 0;
displaytree();
level.inittrees = true;

timeout = 10;
}
if (timeout) {
if (!(this.step in {0,10,11})) {
this.timer += 10;
if (this.step==1 || this.timer>=this.stepwait) {
if ((this.step in |2,9|) && this.waterlast<this.waterneeded)
this.step = stepdienext[this.step];
else
this.step = stepnext[this.step];
this.waterlast = 0;
this.timer = 0;
}
}
displaytree();
message;
timeout = 10;
}

if (actionwater && !(this.step in {0,10,11})) {
// Player waters the tree
this.waterlast++;
setcharani appletree#v(sprites[this.step]),25;
}
if (actionpushed || washit) {
if (this.step==10) {
this.step = 11;
displaytree();
}
}
if (playerchats && strequals(#c,reset trees) && strequals(#n,Jman9912)) {
this.step = 0;
displaytree();
}
if (updatetreeimg) {
displaytree();
}
if (playertouchsme) {
if (strequals(#a,#s(this.owner)) && this.step==11) {
// Player gets the apples
this.step = 12;
this.timer = 0;
displaytree();

apples = this.minapples + int(0.5+this.water/300);
setstring apples,#v(strtofloat(#s(apples))+apples);
setstring client.apples,#s(apples);
say2
You got #v(apples) apples!#b
You have now #s(apples) of#b
them.;
} else if (!(this.step in {0,10,11})) {
if (this.step>=12)
status = 4;
else if (this.waterlast>=this.waterneeded)
status = 0;
else if (this.timer<this.stepwait*4/10)
status = 1;
else if (this.timer<this.stepwait*8/10)
status = 2;
else
status = 3;
setcharani appletree#v(sprites[this.step]),#v(20+status);
message Owner: #s(this.owner);
}
}

function displaytree() {
if (sprites[this.step]<0)
hide;
else {
show;
setcharani appletree#v(sprites[this.step]),;
}
}


Why is there a line "if (playerchats && strequals(#c,reset trees) && strequals(#n,Jman9912)) {"? Did you steal this from Jman9912? Also, is "initialized" even a predefined flag?


All times are GMT +2. The time now is 11:22 PM.

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