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 04-11-2004, 02:00 AM
internetexplorer internetexplorer is offline
Cookies Enabled
internetexplorer's Avatar
Join Date: Feb 2004
Location: Flordia; The Sunshine State
Posts: 11
internetexplorer is on a distinguished road
Healing Players

I'm making some type of healing NPC,
and it's suppose to heal the player no matter
what AP they might have.
Hopefully someone will find this and help me. :grin:

NPC Code:
if (actionserverside) {
if (strequals(#p(0),heal)) {
with (getplayer(#p(1))) {
if (playerap <= 39) {
playerap += 40;
playerhearts = playerfullhearts;
playerap -= 40;
} else {
playerhearts = playerfullhearts;
}
}
}
}
//#CLIENTSIDE
if (playerchats) {
if (startswith(/heal,#c)) {
triggeraction 0,0,serverside,Tools,heal,#T(#e(5,-1,#c));
}
}

Reply With Quote
  #2  
Old 04-11-2004, 02:53 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
You would want to set a variable to the current AP, raise their AP to 40 or higher, raise their hearts, then change their AP back to the temporary variable.
__________________
Kat

Last edited by -Ramirez-; 04-11-2004 at 04:14 AM..
Reply With Quote
  #3  
Old 04-11-2004, 06:09 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Re: Healing Players

Quote:
Originally posted by internetexplorer
NPC Code:
CODE

Problem: #T(#e(5,-1,#c))

You don't need to use #T since you're using #e. Also it's #e(6,-1,#c), because #e counts white spaces.

Quote:
I'm making some type of healing NPC,
and it's suppose to heal the player no matter
what AP they might have.
Why is it checking if player's AP are <= 39 then?
Also you're adding 40 and taking 40 of AP.. lol
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /

Last edited by osrs; 04-11-2004 at 06:25 AM..
Reply With Quote
  #4  
Old 04-11-2004, 06:35 AM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
I'm pretty sure that if the player ap is <= 39 graal will not allow players to increase their heart amount. apystem=false serveroption will allow players to heal no matter what ap they have.
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

Reply With Quote
  #5  
Old 04-11-2004, 06:41 AM
internetexplorer internetexplorer is offline
Cookies Enabled
internetexplorer's Avatar
Join Date: Feb 2004
Location: Flordia; The Sunshine State
Posts: 11
internetexplorer is on a distinguished road
Re: Re: Healing Players

Quote:
Originally posted by osrs


Problem: #T(#e(5,-1,#c))

You don't need to use #T since you're using #e. Also it's #e(6,-1,#c), because #e counts white spaces.



Why is it checking if player's AP are <= 39 then?
Also you're adding 40 and taking 40 of AP.. lol
It would check to see if the player has 39 ap or lower to do the actions, and if they don't (else), the other commands will heal them with 40 ap or over w/o messing with their ap... Mind helping me a bit more? I'm just a little confused.
Reply With Quote
  #6  
Old 04-11-2004, 06:53 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Re: Re: Re: Healing Players

Quote:
Originally posted by internetexplorer


It would check to see if the player has 39 ap or lower to do the actions, and if they don't (else), the other commands will heal them with 40 ap or over w/o messing with their ap... Mind helping me a bit more? I'm just a little confused.
Read Maniaman's post, he explained your problem.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #7  
Old 04-11-2004, 07:01 AM
internetexplorer internetexplorer is offline
Cookies Enabled
internetexplorer's Avatar
Join Date: Feb 2004
Location: Flordia; The Sunshine State
Posts: 11
internetexplorer is on a distinguished road
Re: Re: Re: Re: Healing Players

Quote:
Originally posted by osrs


Read Maniaman's post, he explained your problem.
That would just destroy the whole point of making the NPC. lol
Thanks anyways. <3
Reply With Quote
  #8  
Old 04-11-2004, 10:14 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Re: Re: Healing Players

Quote:
Originally posted by osrs


Problem: #T(#e(5,-1,#c))

You don't need to use #T since you're using #e. Also it's #e(6,-1,#c), because #e counts white spaces.
Erm, no.

#T() is perfectly fine where it is. #T = trim whitespace.

Doing it this way means he could do /healaccount or /heal account.
Reply With Quote
  #9  
Old 04-11-2004, 11:34 AM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Well, It should work no matter what AP it is..
here's an example..

if (actionserverside) {
if(strequals(#p(0),heal)){
with (getplayer(#t(1))) {
playerhearts = playerfullhearts;
}
}
}
//#CLIENTSIDE
if (playerchats) {
tokenize #c;
if (startswith(/heal,#c)) {
triggeraction 0,0,serverside,tool,heal;
}
}
__________________
V$:CONFL16T
Reply With Quote
  #10  
Old 04-11-2004, 03:49 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Re: Re: Re: Healing Players

NPC Code:

with (getplayer(#t(1))) {



Your code won't work that way, Wan.

Quote:
Originally posted by Riot


Erm, no.

#T() is perfectly fine where it is. #T = trim whitespace.

Doing it this way means he could do /healaccount or /heal account.
Hmm yea, i was wrong. x-x
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #11  
Old 04-11-2004, 08:59 PM
internetexplorer internetexplorer is offline
Cookies Enabled
internetexplorer's Avatar
Join Date: Feb 2004
Location: Flordia; The Sunshine State
Posts: 11
internetexplorer is on a distinguished road
Well... will there be any type of way of doing this w/o messing with server options?
Reply With Quote
  #12  
Old 04-11-2004, 10:08 PM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
increasing their ap, healing, and then decreasing their ap again
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

Reply With Quote
  #13  
Old 04-11-2004, 10:08 PM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by internetexplorer
Well... will there be any type of way of doing this w/o messing with server options?
Quote:
Originally posted by -Ramirez-
You would want to set a variable to the current AP, raise their AP to 40 or higher, raise their hearts, then change their AP back to the temporary variable.
*****, Maniaman said it again before I could.
__________________
Kat
Reply With Quote
  #14  
Old 04-11-2004, 11:29 PM
internetexplorer internetexplorer is offline
Cookies Enabled
internetexplorer's Avatar
Join Date: Feb 2004
Location: Flordia; The Sunshine State
Posts: 11
internetexplorer is on a distinguished road
Well... I'm using:
NPC Code:
if (playerap <= 39) {
playerap += 40;
playerhearts = playerfullhearts;
playerap -= 40;
} else {
playerhearts = playerfullhearts;
}



Shouldn't that work? o_o;;
Reply With Quote
  #15  
Old 04-12-2004, 12:53 AM
DIABLO2099 DIABLO2099 is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 290
DIABLO2099 is on a distinguished road
Can't you just increase their hearts serverside? If you want to heal clientside then you can raise their ap I suppose. IE, throw a sleep in there and see what it does.
__________________
-Former UnholyNation Server Manager.

Call me Xecutor.
Reply With Quote
  #16  
Old 04-12-2004, 01:01 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by internetexplorer
Shouldn't that work? o_o;;
Yeah... it should. Xecutor's suggestion is probably what I'd try too. Although it shouldn't have to wait...

--Edit--
I just did some testing and discovered that it DOES raise the hearts without needing to raise the AP at all. The problem is that the client won't raise the hearts due to still having low AP. (Oh the wonders of still having clientside-only support!)

You'd just need to do something to make the client see that the hearts have gone up.
__________________
Kat

Last edited by -Ramirez-; 04-12-2004 at 01:13 AM..
Reply With Quote
  #17  
Old 04-12-2004, 03:36 AM
internetexplorer internetexplorer is offline
Cookies Enabled
internetexplorer's Avatar
Join Date: Feb 2004
Location: Flordia; The Sunshine State
Posts: 11
internetexplorer is on a distinguished road
This is all so very confusing... mind giving me an example?
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 03:50 PM.


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