Graal Forums

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

happyme 03-25-2002 01:59 AM

Fishing?
 
I have a problem with this script... I would really appreciate it if someone would help me.... when im done fishing, the fishing rod is still there....
NPC Code:

// Fishing Rod made by dfex
if(created) {
Rodstock=30;
}
if (playerenters) {
message (#v(Rodstock) In Stock);
}
if (playerchats && strequals(#c,buy fishing rod)) {
if (playerrupees<100) {
say2 Not Enough Money.;
}
}
if (playerchats && strequals(#c,buy fishing rod)) {
if (Rodstock==0) {
say2 No Rods In Stock.;
}
}
if (playerchats && strequals(#c,buy fishing rod) && !hasweapon(Fishing Rod)) {
if (playerrupees>=100) {
if (Rodstock>0) {
setplayerprop #c,*Bought Fishing Rod*;
toweapons Fishing Rod;
Rodstock=Rodstock-1;
playerrupees=playerrupees-100;
message (#v(Rodstock) In Stock);
}
}
}
if (weaponfired && hasweapon(Fishing Bucket) && onwater(players[0].x,players[0].y)){
playersprite=33;
this.x=playerx;
this.y=playery;
if (playerdir=0) { this.x+=1; this.y-=1.4; }
if (playerdir=1) { this.x+=0; }
if (playerdir=2) { this.x+=.7; this.y+=1.2 }
if (playerdir=3) { this.x+=2; }
showimg 100,od-fishingrod.gif,this.x,this.y;
changeimgpart 100,playerdir*20,0,20,35;
freezeplayer 1;
fishweight = int(random(1,5));
fishcatch = int(random(1,10));
if(fishcatch<=7) {
}
else {
fishedweight = strtofloat(#s(fishedweight))+fishweight;
if (fishedweight>100) fishedweight = 150;
setstring fishedweight,#v(fishedweight);
setstring fishedsize,#v(strtofloat(#s(fishedsize))+this.size );
setstring client.fishedweight,#s(fishedweight);
say2 You got a #v(fishweight) pounder!;
setstring this.fisher,#a;
}}
if (weaponfired && !onwater(players[0].x,players[0].y)){
setplayerprop #c,I cant fish here;
}


Python523 03-25-2002 03:13 AM

Use ganis or showimg to show the rod and hideimg to hide it
Also dont use just players[0].x/y, playerx/y isnt centered and it really means the top left corner of the player, instead use vecx/vecy to get the spot in front of the player

happyme 03-25-2002 04:01 AM

i tried it with hideimg
but it didnt work
and i cant use ganis cause its non p2p

screen_name 03-25-2002 11:34 PM

first off

the onwater check is screwed, it will only work if they have fired the weapon if they are in water and the flag weaponfired isnt called when in water, so you need to fix that

BARGAD 03-26-2002 12:18 AM

Quote:

Originally posted by screen_name
first off

the onwater check is screwed, it will only work if they have fired the weapon if they are in water and the flag weaponfired isnt called when in water, so you need to fix that


He could use keydown :p

/CaRnIe

screen_name 03-26-2002 01:09 AM

Quote:

Originally posted by BARGAD



He could use keydown :p

/CaRnIe

He could, but he didn't.

BARGAD 03-26-2002 05:48 AM

Just makin a point :)

/CaRnIe

neomaximus2k 03-26-2002 04:26 PM

Quote:

Originally posted by happyme
i tried it with hideimg
but it didnt work
and i cant use ganis cause its non p2p

LMAO yes you can use a GANI
but there are certain limits.

for your script i guess you would have to have one for each direction, you cant just use one gani :'(

so youd have a gani for facing up, down, left and right.
a lot of gani's but still easier and more better looking

as for the script i aint looked at it yet

Ok just looked at it, and it is long winded, i shall compress it for you later cause you got certain things you dont really need in. cant do it now i'm off to work

nyghtGT 03-26-2002 04:29 PM

Re: Fishing?
 
NPC Code:

// Fishing Rod made by dfex
if(created) {
Rodstock=30;
}
if (playerenters) {
message (#v(Rodstock) In Stock);
}
if (playerchats && strequals(#c,buy fishing rod)) {
if (playerrupees<100) {
say2 Not Enough Money.;
}
}
if (playerchats && strequals(#c,buy fishing rod)) {
if (Rodstock==0) {
say2 No Rods In Stock.;
}
}
if (playerchats && strequals(#c,buy fishing rod) && !hasweapon(Fishing Rod)) {
if (playerrupees>=100) {
if (Rodstock>0) {
setplayerprop #c,*Bought Fishing Rod*;
toweapons Fishing Rod;
Rodstock=Rodstock-1;
playerrupees=playerrupees-100;
message (#v(Rodstock) In Stock);
}
}
}
if (weaponfired && hasweapon(Fishing Bucket) && onwater(players[0].x,players[0].y)){
playersprite=33;
this.x=playerx;
this.y=playery;
if (playerdir=0) { this.x+=1; this.y-=1.4; }
if (playerdir=1) { this.x+=0; }
if (playerdir=2) { this.x+=.7; this.y+=1.2 }
if (playerdir=3) { this.x+=2; }
showimg 100,od-fishingrod.gif,this.x,this.y;
changeimgpart 100,playerdir*20,0,20,35;
freezeplayer 1;
fishweight = int(random(1,5));
fishcatch = int(random(1,10));
if(fishcatch<=7) {
}
else {
fishedweight = strtofloat(#s(fishedweight))+fishweight;
if (fishedweight>100) fishedweight = 150;
setstring fishedweight,#v(fishedweight);
setstring fishedsize,#v(strtofloat(#s(fishedsize))+this.size );
setstring client.fishedweight,#s(fishedweight);
hideimg 100;
say2 You got a #v(fishweight) pounder!;
setstring this.fisher,#a;
}}
if (weaponfired && !onwater(players[0].x,players[0].y)){
setplayerprop #c,I cant fish here;
}


neomaximus2k 03-27-2002 05:03 AM

Re: Re: Fishing?
 
Quote:

Originally posted by nyghtGT
NPC Code:

// Fishing Rod made by dfex
if(created) {
Rodstock=30;
}
if (playerenters) {
message (#v(Rodstock) In Stock);
}
if (playerchats && strequals(#c,buy fishing rod)) {
if (playerrupees<100) {
say2 Not Enough Money.;
}
}
if (playerchats && strequals(#c,buy fishing rod)) {
if (Rodstock==0) {
say2 No Rods In Stock.;
}
}
if (playerchats && strequals(#c,buy fishing rod) && !hasweapon(Fishing Rod)) {
if (playerrupees>=100) {
if (Rodstock>0) {
setplayerprop #c,*Bought Fishing Rod*;
toweapons Fishing Rod;
Rodstock=Rodstock-1;
playerrupees=playerrupees-100;
message (#v(Rodstock) In Stock);
}
}
}
if (weaponfired && hasweapon(Fishing Bucket) && onwater(players[0].x,players[0].y)){
playersprite=33;
this.x=playerx;
this.y=playery;
if (playerdir=0) { this.x+=1; this.y-=1.4; }
if (playerdir=1) { this.x+=0; }
if (playerdir=2) { this.x+=.7; this.y+=1.2 }
if (playerdir=3) { this.x+=2; }
showimg 100,od-fishingrod.gif,this.x,this.y;
changeimgpart 100,playerdir*20,0,20,35;
freezeplayer 1;
fishweight = int(random(1,5));
fishcatch = int(random(1,10));
if(fishcatch<=7) {
}
else {
fishedweight = strtofloat(#s(fishedweight))+fishweight;
if (fishedweight>100) fishedweight = 150;
setstring fishedweight,#v(fishedweight);
setstring fishedsize,#v(strtofloat(#s(fishedsize))+this.size );
setstring client.fishedweight,#s(fishedweight);
hideimg 100;
say2 You got a #v(fishweight) pounder!;
setstring this.fisher,#a;
}}
if (weaponfired && !onwater(players[0].x,players[0].y)){
setplayerprop #c,I cant fish here;
}


bah i just got back and damn i am drubnk so u got no chance of me scripting soz bout that

neomaximus2k 03-28-2002 03:58 PM

ok well first of all, looked like you leeched the script from somewhere

and this script works but you got to figure out the rest yourself
NPC Code:

// Fishing Rod made by dfex
if(created) { Rodstock=30; }
if (playerenters) {message (#v(Rodstock) In Stock); }
if (playerchats && strequals(#c,buy fishing rod) && playerrupees<100) {say2 Not Enough Money.; }
if (playerchats && strequals(#c,buy fishing rod)) {
if (Rodstock==0) { say2 No Rods In Stock.; } }
if (playerchats && strequals(#c,buy fishing rod) && !hasweapon(Fishing Rod)) {
if (playerrupees>=100 && Rodstock>0) {setplayerprop #c,*Bought Fishing Rod*;
toweapons Fishing Rod; Rodstock=Rodstock-1; playerrupees=playerrupees-100;
message (#v(Rodstock) In Stock); } }
if (weaponfired && hasweapon(Fishing Rod) && onwater(playerx+10,playery)){
playersprite=33; this.x=playerx; this.y=playery; if (playerdir=0) { this.x+=1; this.y-=1.4; }
if (playerdir=1) { this.x+=0; }
if (playerdir=2) { this.x+=.7; this.y+=1.2 }
if (playerdir=3) { this.x+=2; }
showimg 100,od-fishingrod.gif,this.x,this.y;
changeimgpart 100,playerdir*20,0,20,35;
freezeplayer 1; fishweight = int(random(1,5)); fishcatch = int(random(1,10));
if(fishcatch<=7) { } else {
fishedweight = strtofloat(#s(fishedweight))+fishweight;
if (fishedweight>100) fishedweight = 150; setstring fishedweight,#v(fishedweight);
setstring fishedsize,#v(strtofloat(#s(fishedsize))+this.size );
setstring client.fishedweight,#s(fishedweight); say2 You got a #v(fishweight) pounder!;
setstring this.fisher,#a; }}
if (weaponfired && !onwater(players[0].x,players[0].y)){setplayerprop #c,I cant fish here; }


nyghtGT 03-28-2002 09:11 PM

Re: Re: Re: Fishing?
 
Quote:

Originally posted by neomaximus2k


bah i just got back and damn i am drubnk so u got no chance of me scripting soz bout that

your dumb ...

screen_name 03-28-2002 10:52 PM

Re: Re: Re: Re: Fishing?
 
Quote:

Originally posted by nyghtGT

your dumb ...

lol, i agree, drinking is just stupid

neomaximus2k 03-29-2002 04:19 AM

ok those that say drinking is dumb how old are you??

i am a teenager, 19 if i dont do this stuff now i cant when i am older, just cause i dont sit infront of a pc all day like most people here

haunter 03-29-2002 04:44 AM

Quote:

Originally posted by neomaximus2k
ok those that say drinking is dumb how old are you??

i am a teenager, 19 if i dont do this stuff now i cant when i am older, just cause i dont sit infront of a pc all day like most people here

... Drinking isn't dumb, getting drunk is though... Then you do stupid things, and people get hurt... We want peace and love...

darkriders_p2p 03-29-2002 05:14 AM

Quote:

Originally posted by haunter

... Drinking isn't dumb, getting drunk is though... Then you do stupid things, and people get hurt... We want peace and love...

i'm only 16 and I drink, and yes I know its wrong, and yes its horrible getting drunk because of hangovers, but my motto is keep drinking and hangovers never come :O

neomaximus2k 03-29-2002 05:43 AM

Quote:

Originally posted by darkriders_p2p


i'm only 16 and I drink, and yes I know its wrong, and yes its horrible getting drunk because of hangovers, but my motto is keep drinking and hangovers never come :O

i am lucky i dont have hang overs, can drink and drink and drink and muwhahahaha

so your 16 lol i started at 13 going to clubs :P

one night with me and you would all love it i am well known and always pull loads :P

darkriders_p2p 03-29-2002 07:54 AM

Quote:

Originally posted by neomaximus2k


i am lucky i dont have hang overs, can drink and drink and drink and muwhahahaha

so your 16 lol i started at 13 going to clubs :P

one night with me and you would all love it i am well known and always pull loads :P

#1 I wouldn't want to have a night with u x.x;;
and #2 being drunx rux0r :P

happyme 03-29-2002 10:00 AM

i ask for help lol and this turns into a beer debate

screen_name 03-29-2002 11:30 AM

Quote:

Originally posted by happyme
i ask for help lol and this turns into a beer debate
always happens :D

lol

darkriders_p2p 03-29-2002 12:37 PM

Quote:

Originally posted by happyme
i ask for help lol and this turns into a beer debate
he asked for help?

neomaximus2k 03-29-2002 07:18 PM

Quote:

Originally posted by happyme
i ask for help lol and this turns into a beer debate
i gave you help didn't i? or didn't i post it???

muwhahaha i got 2 lined up tongiht.... :D

happyme 03-30-2002 05:06 AM

Quote:

Originally posted by neomaximus2k
ok well first of all, looked like you leeched the script from somewhere

and this script works but you got to figure out the rest yourself
NPC Code:

// Fishing Rod made by dfex
if(created) { Rodstock=30; }
if (playerenters) {message (#v(Rodstock) In Stock); }
if (playerchats && strequals(#c,buy fishing rod) && playerrupees<100) {say2 Not Enough Money.; }
if (playerchats && strequals(#c,buy fishing rod)) {
if (Rodstock==0) { say2 No Rods In Stock.; } }
if (playerchats && strequals(#c,buy fishing rod) && !hasweapon(Fishing Rod)) {
if (playerrupees>=100 && Rodstock>0) {setplayerprop #c,*Bought Fishing Rod*;
toweapons Fishing Rod; Rodstock=Rodstock-1; playerrupees=playerrupees-100;
message (#v(Rodstock) In Stock); } }
if (weaponfired && hasweapon(Fishing Rod) && onwater(playerx+10,playery)){
playersprite=33; this.x=playerx; this.y=playery; if (playerdir=0) { this.x+=1; this.y-=1.4; }
if (playerdir=1) { this.x+=0; }
if (playerdir=2) { this.x+=.7; this.y+=1.2 }
if (playerdir=3) { this.x+=2; }
showimg 100,od-fishingrod.gif,this.x,this.y;
changeimgpart 100,playerdir*20,0,20,35;
freezeplayer 1; fishweight = int(random(1,5)); fishcatch = int(random(1,10));
if(fishcatch<=7) { } else {
fishedweight = strtofloat(#s(fishedweight))+fishweight;
if (fishedweight>100) fishedweight = 150; setstring fishedweight,#v(fishedweight);
setstring fishedsize,#v(strtofloat(#s(fishedsize))+this.size );
setstring client.fishedweight,#s(fishedweight); say2 You got a #v(fishweight) pounder!;
setstring this.fisher,#a; }}
if (weaponfired && !onwater(players[0].x,players[0].y)){setplayerprop #c,I cant fish here; }


now it doesnt show img x.x
sorry for making the margins go over

neomaximus2k 03-30-2002 04:34 PM

Quote:

Originally posted by happyme

now it doesnt show img x.x
sorry for making the margins go over

It never showed it for me in the first place!


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

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