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 08-21-2004, 12:04 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Mold from EK

Ok i'm sorry i have been trying to avoid posting here because i have the feeling i am becoming annoying, but no one i talk to can figure this out!


NPC Code:
 

if (created) {
initialize();
}
if (timeout) {
message #v(this.hearts/2);
if (this.found==0) {
setcharani mold_idle,;
for (i=0;i<playerscount;i++) {
if (abs(players[i].x-x)<=20&&abs(players[i].y-y)<=20) {

this.found=1;
break;
}
}
}

if (this.found==1) {
if (abs(players[i].x-x)<=20&&abs(players[i].y-y)<=20) {
setcharani ekmold-move,;
tx=players[i].x - x;
ty=players[i].y - y;
dist= (tx*tx+ty*ty)^0.5;
nx= (tx/dist)*1.2;
ny= (ty/dist)*1.2;
move nx,ny,1.2,;

if (players[i].x in |x-3,x+3|&&players[i].y in |y-3,y+3|) {
setcharani ekmold-attack,;
with(players[i]) {
setani hurt,;
setstring client.hp,#v(strtofloat(#s(client.hp))-1);
};
timeout=1;
}
} else {
setcharani ekmold-idle,;
this.found=0;
timeout=.1
}


timeout=.4;
}
timeout=.4;
}


function initialize() {

this.hearts=6;
setcharani ekmold-idle,;
timeout=.4;
}

function checkdead() {

if (this.hearts<=0) {
with(getplayer(#p(2))) {
insertstring client.messages,0,You gained EXP;
setstring client.playerexp,#v(strtofloat(#s(client.playerexp ))+3);
if (strlen(#g)>1) {
setstring server.account,#a;
setstring server.guild,#g
}
}
for(i=0;i<allplayerscount;i++) {
with (allplayers[i]) {
if (strequals(#g,#s(server.guild))&&!strequals(#a,#s( server.account))) {
insertstring client.messages,0,You guild/party got you EXP;
setstring client.playerexp,#v(strtofloat(#s(client.playerexp ))+3);
}

}

}


timeout=0;
putexplosion 1,x,y;
hide;
sleep 30;
show;
initialize();

}


else {
setcharani mold_idle,;
timeout=.65
}


}

//PROBLEM AREA
if (actionprojectile) {
this.hearts-=strtofloat(#p(1))+1;
setcharani mold_idle,;
message #v(this.hearts/2);
checkdead();
sleep .5;
}
//








ok i have looked over it as have several NATs. See the if (actionprojectile)?
well it doesnt respond to that. it ignores it. Acts like i never added that flag. It is very weird. I have actually replaced it with simple things like playerchats and they work. So why doesnt this? It should work by all standards. It used to work before EK was hacked. but now it doesnt. Any help would be appreciated
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!

Last edited by falco10291029; 08-21-2004 at 02:54 AM..
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 11:32 AM.


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