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 03-25-2002, 01:59 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
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;
}

__________________
Reply With Quote
  #2  
Old 03-25-2002, 03:13 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
Reply With Quote
  #3  
Old 03-25-2002, 04:01 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
i tried it with hideimg
but it didnt work
and i cant use ganis cause its non p2p
__________________
Reply With Quote
  #4  
Old 03-25-2002, 11:34 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to 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
__________________
[signature]insert here[/signature]
Reply With Quote
  #5  
Old 03-26-2002, 12:18 AM
BARGAD BARGAD is offline
Registered User
Join Date: Aug 2001
Location: Sweden
Posts: 345
BARGAD will become famous soon enough
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

/CaRnIe
__________________
Gori

Born To Kill
Death Silent Killers

Two little newbies, out in the sun.
Then came Gori and there was only one.

Reply With Quote
  #6  
Old 03-26-2002, 01:09 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by BARGAD



He could use keydown

/CaRnIe
He could, but he didn't.
__________________
[signature]insert here[/signature]
Reply With Quote
  #7  
Old 03-26-2002, 05:48 AM
BARGAD BARGAD is offline
Registered User
Join Date: Aug 2001
Location: Sweden
Posts: 345
BARGAD will become famous soon enough
Just makin a point

/CaRnIe
__________________
Gori

Born To Kill
Death Silent Killers

Two little newbies, out in the sun.
Then came Gori and there was only one.

Reply With Quote
  #8  
Old 03-26-2002, 04:26 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #9  
Old 03-26-2002, 04:29 PM
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
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;
}

Reply With Quote
  #10  
Old 03-27-2002, 05:03 AM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #11  
Old 03-28-2002, 03:58 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to 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; }

__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #12  
Old 03-28-2002, 09:11 PM
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
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 ...
Reply With Quote
  #13  
Old 03-28-2002, 10:52 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Re: Re: Re: Re: Fishing?

Quote:
Originally posted by nyghtGT

your dumb ...
lol, i agree, drinking is just stupid
__________________
[signature]insert here[/signature]
Reply With Quote
  #14  
Old 03-29-2002, 04:19 AM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to 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
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #15  
Old 03-29-2002, 04:44 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
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...
Reply With Quote
  #16  
Old 03-29-2002, 05:14 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
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
__________________
maximus_asinus
Reply With Quote
  #17  
Old 03-29-2002, 05:43 AM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #18  
Old 03-29-2002, 07:54 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
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
__________________
maximus_asinus
Reply With Quote
  #19  
Old 03-29-2002, 10:00 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
i ask for help lol and this turns into a beer debate
__________________
Reply With Quote
  #20  
Old 03-29-2002, 11:30 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by happyme
i ask for help lol and this turns into a beer debate
always happens

lol
__________________
[signature]insert here[/signature]
Reply With Quote
  #21  
Old 03-29-2002, 12:37 PM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Quote:
Originally posted by happyme
i ask for help lol and this turns into a beer debate
he asked for help?
__________________
maximus_asinus
Reply With Quote
  #22  
Old 03-29-2002, 07:18 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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....
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #23  
Old 03-30-2002, 05:06 AM
happyme happyme is offline
Registered User
Join Date: Mar 2002
Location: Toronto, Ontario, Canada
Posts: 142
happyme is on a distinguished road
Send a message via AIM to happyme
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
__________________
Reply With Quote
  #24  
Old 03-30-2002, 04:34 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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!
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

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 02:16 AM.


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