Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-05-2003, 12:06 AM
TheStivi TheStivi is offline
Registered User
Join Date: Sep 2002
Location: Germany - NRW
Posts: 78
TheStivi is on a distinguished road
Send a message via ICQ to TheStivi Send a message via AIM to TheStivi
a Present for you :)

Yeah a little after Graaloween present for the kids rofl

My Bomy Script

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
__________________
Old Staff Jobs :
Graal 2002 : Gani Maker || Doomsday : Developer || Terra : Developer || Zenkou : NAT || Anystria : Manager || Galeon : Co Manager || Kabruriki : NAT Chief || Archaic : NAT || Age of Legends : Manager
Reply With Quote
 


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


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