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 07-10-2003, 02:02 AM
Shroomed Shroomed is offline
Gone..
Shroomed's Avatar
Join Date: Jun 2003
Location: middleton, MA
Posts: 111
Shroomed is on a distinguished road
Send a message via ICQ to Shroomed Send a message via AIM to Shroomed
My servers leveling system

Can you tell me whats wrong with this level up system for my new server?

// NPC made by nervNAT
if (playerenters) {
if (!hasweapon(*System)) {
toweapons *System;
setstring client.maxmp,#v(int(strtofloat(#s(client.level))*1 .5));
setstring client.maxhp,#v(int(strtofloat(#s(client.level))*1 .8));
setstring client.hp,#s(client.maxhp);
setstring client.mp,#s(client.maxmp);
setstring client.maxexp,1000000;
setstring client.level,1;
}
this.baddiecount=compuscount;
timeout=.05;
}
if (timeout) {
if (playerhearts<playerfullhearts) setstring client.hp,#v(strtofloat(#s(client.hp))-1);
setstring client.exptonext,#v(strtofloat(#s(client.level))*5 );
baddycheck();
playerhearts=playerfullhearts;
if (strtofloat(#s(client.hp))>strtofloat(#s(client.ma xhp))) setstring client.hp,#s(client.maxhp);
if (strtofloat(#s(client.mp))>strtofloat(#s(client.ma xmp))) setstring client.mp,#s(client.maxmp);
exp();
if (strtofloat(#s(client.hp))<=0) dead();
showimg 0,@HP:#s(client.hp)/#s(client.maxhp),570,10;
changeimgvis 0,4;
showimg 1,@MP:#s(client.mp)/#s(client.maxmp),570,25;
changeimgvis 1,4;
showimg 2,@EXP:#s(client.exp)/#s(client.exptonext),570,40;
changeimgvis 2,4;
showimg 3,@Level:#s(client.level),570,55;
changeimgvis 3,4;
timeout=.05;
}
function baddycheck() {
for (this.i=0;this.i<compuscount;this.i++) {
if (compus[this.i].mode==3) {
if (compus[this.i].type==0) this.exp=1;
if (compus[this.i].type==1) this.exp=2;
if (compus[this.i].type==2) this.exp=3;
if (compus[this.i].type==3) this.exp=3;
if (compus[this.i].type==4) this.exp=3;
if (compus[this.i].type==5) this.exp=1;
if (compus[this.i].type==6) this.exp=1;
if (compus[this.i].type==7) this.exp=4;
if (compus[this.i].type==8) this.exp=5;
if (compus[this.i].type==9) this.exp=6;
}}
if (this.baddiecount!=compuscount) {
setstring client.exp,#v(strtofloat(#s(client.exp))+this.exp) ;
this.baddiecount=compuscount;
}}
function dead() {
freezeplayer 3;
setani dead,dead;
setstring client.hp,#s(client.maxhp);
setstring client.deaths,#v(strtofloat(#s(client.deaths))+1);
}
function exp() {
setstring client.maxmp,#v(int(strtofloat(#s(client.level))*1 .5));
setstring client.maxhp,#v(int(strtofloat(#s(client.level))*1 .8));
if (strtofloat(#s(client.exp))>strtofloat(#s(client.m axexp))) setstring client.exp,#s(client.maxexp);
if (strtofloat(#s(client.exp))>=strtofloat(#s(client. exptonext))) {
setstring client.level,#v(strtofloat(#s(client.level))+1);
setstring client.exp,#v(strtofloat(#s(client.exp))-strtofloat(#s(client.exptonext)));
setstring client.hp,#s(client.maxhp);
setstring client.mp,#s(client.maxmp);
setplayerprop #c,Level Up!;
}
}


BTW i didnt make this another staf on my server did...he just dont have gold days left on his acc
__________________
Gone......
 


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 07:01 PM.


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