Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-31-2002, 05:12 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Class Equilization

OK, this is an NPC I am working on for Eternal Destiny so please dont steal it. I would like to know some things i could do to make it better plus any tips to get it to work right.
NPC Code:

NPC Code:

// NPC made by Nyght
// Class Equilization
if (playerenters&&!joined) {
set joined;
setstring server.people,#v(strtofloat(#s(server.people))+=1) ;
}
if (playerchats&&startswith(joinclass,#c)) {
this.warrior=strtofloat(#s(server.people))*.30;
tokenize #c;
if (strequals(#t(1),warrior)) {
if (this.warrior<strtofloat(#s(server.warrior))) {
message You can not choose this class because it allready has enough participants!;
sleep 1.25;
message ;
} else {
joinclasswarrior();
}
}
message If you are not transfered to class level, check spelling and try again!;
}
// Functions
function joinclasswarrior() {
set warriorclass;
setstring server.warrior,#v(strtofloat(#s(server.warrior))+= 1);
setlevel2 warrior.graal,32,32;
}




Its rougly suppose to work out like, if the warrior class is less then 30% of the servers total population then the person can join the class ...

Please, any help is appreciated ...
Reply With Quote
  #2  
Old 03-31-2002, 05:32 PM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
NPC Code:

// NPC made by Nyght
// Class Equilization
if (playerenters&&!joined) {
set joined;
setstring server.people,#v(strtofloat(#s(server.people))+1);
}

if (playerchats&&startswith(joinclass,#c)) {
this.warrior=strtofloat(#s(server.warrior))/strtofloat(#s(server.people));
tokenize #c;
if (strequals(#t(1),warrior)) {
if (this.warrior>0.3) {
message You can not choose this class because it allready has enough participants!;
sleep 1.25;
message ;
} else {
joinclasswarrior();
}
}
message If you are not transfered to class level, check spelling and try again!;
}
// Functions
function joinclasswarrior() {
set warriorclass;
setstring server.warrior,#v(strtofloat(#s(server.warrior))+1 );
setlevel2 warrior.graal,32,32;
}



This should work how you want it to.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
  #3  
Old 03-31-2002, 05:47 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Cybnext_Design

This should work how you want it to.
Thanx, i'll go check ...

Seems to work allright, thanx Cybnext ....
Reply With Quote
  #4  
Old 04-01-2002, 02:46 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
I thought join was for p2p only?
Reply With Quote
  #5  
Old 04-01-2002, 03:30 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
he's not using join lol
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #6  
Old 04-01-2002, 12:36 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by royce
I thought join was for p2p only?
rofl
rofl
rofl
hes setting the flag joined, not joining an npc...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #7  
Old 04-02-2002, 01:10 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
Quote:
Originally posted by Saga2001


rofl
rofl
rofl
hes setting the flag joined, not joining an npc...
It was 2 in the morning -_-
Reply With Quote
  #8  
Old 04-02-2002, 11:50 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by royce


It was 2 in the morning -_-
excuses, but, 'joinclasswarrior()' make the function of that occur ...
Reply With Quote
  #9  
Old 04-07-2002, 10:29 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
ok...

remember to find some way to unset joined
so that when the player logs out
and reconnect to the server, that "joined" is unset.

or otherwise detect - has this player chosen a class already?
if so, add him to the server.whatever-his-class-is count.

other than that, cool idea.
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #10  
Old 04-08-2002, 05:10 AM
Er1c Er1c is offline
Registered User
Er1c's Avatar
Join Date: Mar 2001
Location: Chicago, IL
Posts: 791
Er1c is on a distinguished road
if people's accounts get reset it will mess up the count... keep that in mind
__________________
Eric Kraft
Reply With Quote
  #11  
Old 04-08-2002, 04:25 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Er1c
if people's accounts get reset it will mess up the count... keep that in mind
sliced by the seer of er1c's cold blade of fate.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #12  
Old 04-08-2002, 06:00 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Er1c
if people's accounts get reset it will mess up the count... keep that in mind
i did think of that ...
and hopefully we wont ever have to reset an account ...
but subtracted one from the server total as well as from the class he joined could fix that, it'd be a hassel but it could work ...
Reply With Quote
  #13  
Old 04-09-2002, 03:20 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
Thumbs down

Quote:
Originally posted by nyghtGT

i did think of that ...
and hopefully we wont ever have to reset an account ...
but subtracted one from the server total as well as from the class he joined could fix that, it'd be a hassel but it could work ...
No reseting accounts waht-so-ever. Even if the players want a account reset we will not and should not reset it. If we have enough problems with players and other stuff we might request a server restart but thats it. Reseting account is just dumb for stuff that you have a class to stick to.
Reply With Quote
Reply


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:36 PM.


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