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;
}