Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   a Present for you :) (https://forums.graalonline.com/forums/showthread.php?t=48981)

TheStivi 11-05-2003 12:06 AM

a Present for you :)
 
Yeah a little after Graaloween present for the kids :D rofl :p

My Bomy Script
:D
but there are errors in onwall of waterfall "climbing" dont know how to say it XD

Its an weapon and works perfect online :
NPC Code:

//#CLIENTSIDE
if (timeout || playerenters){
hideimgs 100,400;
this.sittiles={0x2A9,0x2AA,0x2B9,0x2BA,0x467,0x468 ,0xD97,0xD98,0xDA7,0xDA8};
this.waterfall={0x464,0x463,0x464,0x463,0x467,0x46 8,0x471,0x472};
if (strtofloat(#s(client.isbomy))=1 && isweapon){
disabledefmovement;
if (this.hide=1){
setani bomy_hide,;
}
if (this.swim=1){
this.counter+=1;
if (this.counter=6){
putleaps 5,playerx+1.5,playery+2;
this.counter=0;
}
if (keydown(0)){
if (this.ymove>-0.8){this.ymove-=0.15;}
if (this.xmove<0){this.xmove+=0.05;}
if (this.xmove>0){this.xmove-=0.05;}
}
if (keydown(2)){
if (this.ymove<0.8){this.ymove+=0.15;}
if (this.xmove<0){this.xmove+=0.05;}
if (this.xmove>0){this.xmove-=0.05;}
}
if (keydown(1)){
if (this.xmove>-0.8){this.xmove-=0.15;}
if (this.ymove<0){this.ymove+=0.05;}
if (this.ymove>0){this.ymove-=0.05;}
}
if (keydown(3)){
if (this.xmove<0.8){this.xmove+=0.15;}
if (this.ymove<0){this.ymove+=0.05;}
if (this.ymove>0){this.ymove-=0.05;}
}
if (this.xmove<0){
if (this.xmove>-1){
this.xmove-=0.1;}
}
if (this.xmove>0){
if (this.xmove<1){
this.xmove+=0.1;}
}
if (this.ymove<0){
if (this.ymove>-1){
this.ymove-=0.1;}
}
if (this.ymove>0){
if (this.ymove<1){
this.ymove+=0.1;}
}
if (tiles[playerx+1,playery+2] in this.waterfall){
if (this.ymove<1.6){
this.ymove+=0.28;
}
}
else{
if (this.ymove>1){
this.ymove-=0.1;
}
}
this.newx=playerx+this.xmove;
this.newy=playery+this.ymove;
if ((onwall(this.newx+1.5,this.newy+1.5) || onwall(this.newx+1.5,this.newy+2.5) || onwall(this.newx+2.5,this.newy+1.5) || onwall(this.newx+2.5,this.newy+2.5)) && !(tiles[this.newx+1.5,this.newy+2] in this.waterfall || tiles[this.newx+1.5,this.newy+1] in this.waterfall || tiles[this.newx+2.5,this.newy+3] in this.waterfall)){
this.ymove=this.ymove*(-1);
this.xmove=this.xmove*(-1);
this.newx=playerx+this.xmove;
this.newy=playery+this.ymove;
}
if (onwater(this.newx+1,this.newy+2) || tiles[this.newx+1,this.newy] in this.waterfall || tiles[this.newx+2,this.newy] in this.waterfall || tiles[this.newx+1,this.newy+1] in this.waterfall || tiles[this.newx+2,this.newy+1] in this.waterfall || tiles[this.newx+1,this.newy+2] in this.waterfall || tiles[this.newx+2,this.newy+2] in this.waterfall || tiles[this.newx+1,this.newy+3] in this.waterfall || tiles[this.newx+2,this.newy+3] in this.waterfall){
if (tiles[this.newx+1,this.newy+1] in this.waterfall){}
else{
this.xmove=this.xmove*(-1);
this.newx=playerx+this.xmove;
}
if (tiles[this.newx+2,this.newy+1] in this.waterfall){}
else{
this.xmove=this.xmove*(-1);
this.newx=playerx+this.xmove;
}
this.swim=1;
}
else{
this.swim=0;}
playerx=this.newx;
playery=this.newy;
showimg 200,bomycompass.gif,screenwidth-60,20;
showimg 201,bomycompassdot.gif,screenwidth-39+this.xmove*5,41+this.ymove*5;
showimg 202,bomysom.gif,screenwidth-60,70;
this.speed=this.xmove*4+this.ymove*4;
showimg 203,bomycompassdot.gif,screenwidth-39+this.speed,75;
changeimgvis 200,4;
changeimgvis 201,4;
changeimgvis 202,4;
changeimgvis 203,4;
setani bomy_swim,;
}
if (this.swim=0){
if (this.xmove<>0 || this.ymove<>0){
this.outofwater=1;
setani bomy_swim,;
this.freeze=0.6;
if (this.xmove>0){
this.xmove-=0.15;
}
if (this.ymove<0){
this.ymove+=0.15;
}
if (this.xmove<0){
this.xmove+=0.15;
}
if (this.ymove>0){
this.ymove-=0.15;
}
if (this.xmove in |-0.15,0.15|){
this.xmove=0;
}
if (this.ymove in |-0.15,0.15|){
this.ymove=0;
}
this.newx=playerx+this.xmove;
this.newy=playery+this.ymove;
if ((onwall(this.newx+1.5,this.newy+1.5) || onwall(this.newx+1.5,this.newy+2.5) || onwall(this.newx+2.5,this.newy+1.5) || onwall(this.newx+2.5,this.newy+2.5))){
this.ymove=this.ymove*(-1);
this.xmove=this.xmove*(-1);
}
else{
playerx=this.newx;
playery=this.newy;
}
}
else{
if (this.outofwater=1){
this.x=playerx-int(playerx);
this.y=playery-int(playery);
if (this.x>0.5){this.x=0.5}
else{this.x=0};
if (this.y>0.5){this.x=0.5};
else{this.y=0};
playerx=int(playerx)+this.x;
playery=int(playery)+this.y;
this.outofwater=0;
}
}
if (this.xmove=0 && this.ymove=0 && this.freeze=0){
if (!keydown(1) && !keydown(2) && !keydown(0) && !keydown(3) && !keydown(6) && !keydown(5)){
this.hide=0;
if (this.idle=0){
setani bomy_idle,;
}
this.idle=1;
}
elseif (keydown(6)){
if (this.hide=0){
setani bomy_duck,;
}
this.freeze=0.1;
this.idle=0;
this.hide=1;
}
elseif (keydown(5)){
this.hide=0;
this.freeze=0.4;
this.idle=0;
setani bomy_attack,;
}
else{
this.hide=0;
this.idle=0;
setani bomy_walk,;
}
}
if (tiles[playerx+1,playery+2] in this.sittiles){
setani bomy_sit,;
}
if (onwater(playerx+1.5,playery+2)){
if (playerdir=1 || playerdir=3){
this.xmove=(playerdir-2)/10;
}
else{
this.ymove=(playerdir-1)/10;
}
this.swim=1;
}
if (!keydown(4) && this.freeze=0 && this.swim=0){
if (keydown(0)){
playerdir=0;
this.newx=playerx;
this.newy=playery-0.5;
if (!onwall(this.newx+2,this.newy+1) && !onwall(this.newx+0.5,this.newy+1) && !onwall(this.newx+1.5,this.newy+1)){
playery-=0.5;
}
}
if (keydown(1)){
playerdir=1;
this.newx=playerx-0.5;
this.newy=playery;
if (!onwall(this.newx+0.5,this.newy+1) && !onwall(this.newx+0.5,this.newy+2.5) && !onwall(this.newx+0.5,this.newy+1.5)){
playerx-=0.5;
}
}
if (keydown(2)){
playerdir=2;
this.newx=playerx;
this.newy=playery+0.5;
if (!onwall(this.newx+2,this.newy+2.5) && !onwall(this.newx+0.5,this.newy+2.5) && !onwall(this.newx+1.5,this.newy+2.5)){
playery+=0.5;
}
}
if (keydown(3)){
playerdir=3;
this.newx=playerx+0.5;
this.newy=playery;
if (!onwall(this.newx+2,this.newy+1) && !onwall(this.newx+2,this.newy+2.5) && !onwall(this.newx+2,this.newy+1.5)){
playerx+=0.5;
}
}
}
}
}
else{
enabledefmovement;
}
if (this.freeze>0){
this.freeze-=0.05;}
timeout=0.05;
}

if (playerchats){
if (startswith(setbomy,#c)){
tokenize #c;
if (!strequals(#t(2),)){
setplayerprop #3,bomy_#t(1)#t(2).png;
}
}
}
if (playerchats && strequals(#c,be human)){
if (strtofloat(#s(client.isbomy))=1){
setstring client.isbomy,;
setstring client.bomy,#3;
setplayerprop #3,#s(client.head);
setani idle,;
}
}
if (playerchats && strequals(#c,be bomy)){
if (!strtofloat(#s(client.isbomy))=1){
setstring client.isbomy,1;
playerx=int(playerx);
playery=int(playery);
setstring client.head,#3;
setplayerprop #3,#s(client.bomy);
}
}



Commands :
Be Bomy / Be Human - Change your race
Setbomy Name Number - Change your skin

Python523 11-05-2003 12:55 AM

If you're going to bother to post scripts at least follow the KSI-GS

Fogy 11-06-2003 12:00 AM

Quote:

Originally posted by Python523
If you're going to bother to post scripts at least follow the KSI-GS
Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.

Goboom 11-06-2003 12:15 AM

Quote:

Originally posted by Fogy


Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.

Not when there is a "Rules" thread and a "KSI-GS" standard thread.

Python523 11-06-2003 12:56 AM

Quote:

Originally posted by Fogy


Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.

Please don't try to interpret the rules better than me, I think I'm a mod for a reason, plus I didn't 'offend' him by telling him to follow a rule. Oh yes, and please do not be a hypocrite :) Post reviver.

Deek2 11-06-2003 03:03 AM

Pretty simple script. Looks a little messy though, possibly with a little bit of tweaking and maintainience here and there it could be better.

Gambet 11-07-2003 02:13 AM

Quote:

Originally posted by Fogy


Please do not offend the users of the board, this is suppose to be a nice community not a bad one, sure he violated the rule but he should be told nicely so he can learn, not like that.

bah...dude learn who your talking to before you say things, python is part of the global scripting team and there is a stickied thread in this forum which clearly states that you cannot post scripts....and any dunce wouldve seen that thread (unless they cant read)...and its true what python said "i am mod for a reason", its to control idiots who disobey the rules (i aint callin anyone in this thread an idiot so dont go all ****in "mommy!" on me :) ) anyways, whats done is done

tlf288 11-07-2003 02:14 AM

Wow! That looks really, really... messy and inefficient :\ . I guess it might work but if it does I wouldn't bet extremely well. But hey, atleast you are being nice and giving (me\us) a gift :D .


All times are GMT +2. The time now is 12:17 PM.

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