Jump to content
  • 0

[Paid] Whats wrong with my healer NPC?


c2greentea

Question


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  173
  • Reputation:   0
  • Joined:  06/07/14
  • Last Seen:  

What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d

 

It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Im sorry didn't read it correctly..

Edited by Ginji
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d

 

It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal

        if (.@Buffs) {
                specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10;
                specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
                set HEALDELAY,gettimetick(2)+.@Delay;
                close;
        }

You don't have anything that checks .@Buffs.

        if (.@Buffs == 1) {
                specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10;
                specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
                set HEALDELAY,gettimetick(2)+.@Delay;
                close;
        }
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  173
  • Reputation:   0
  • Joined:  06/07/14
  • Last Seen:  

Still doesnt work :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   13
  • Joined:  06/20/12
  • Last Seen:  

 

What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d

 

It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal

        if (.@Buffs) {
                specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10;
                specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
                set HEALDELAY,gettimetick(2)+.@Delay;
                close;
        }

You don't have anything that checks .@Buffs.

        if (.@Buffs == 1) {
                specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10;
                specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
                set HEALDELAY,gettimetick(2)+.@Delay;
                close;
        }

You clearly don't know how a If works..

@Topic

Try to remove this line 

 

mes "" + callfunc("Time2Str" ,HEALDELAY);

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

 

 

What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d

 

It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal

        if (.@Buffs) {
                specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10;
                specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
                set HEALDELAY,gettimetick(2)+.@Delay;
                close;
        }

You don't have anything that checks .@Buffs.

        if (.@Buffs == 1) {
                specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10;
                specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
                set HEALDELAY,gettimetick(2)+.@Delay;
                close;
        }

You clearly don't know how a If works..

@Topic

Try to remove this line 

 

mes "" + callfunc("Time2Str" ,HEALDELAY);

 

I know how it use to work. If they made a change to it to allow it to check without ==,</>=, !=, ||, &&; then that was done while I was away from rA between 2012 and 2014.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   47
  • Joined:  11/18/11
  • Last Seen:  

There are a few issues in the script you have @c2greentea.

 

The script below should work pretty well.

- script Healer -1,{
 
.@price = 0; // Zeny required for heal
.@buffs = 0; // Also buff players? (1: yes / 0: no)
.@delay = 10; // Heal delay, in seconds
 
if (@healDelay > gettimetick(2)) {
mes callfunc("Time2Str" ,@healDelay)+" seconds to heal again.";
close;
}
 
if(BaseLevel >= 95) {
mes "[Healer]";
mes "My free healing service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!";
mes " ";
mes "For players above lvl 95, my charge will be 780 z (w/o buffs). Thank you for your understanding.";
mes " ";
mes "^777777Delay: 1-3 minutes^000000";
set .@price,780; // Zeny required for heal
set .@delay,rand(60,180); // Heal delay, in seconds
} else if(BaseLevel < 50) {
mes "[Healer]";
mes "My free service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!";
mes " ";
mes "^777777Delay: 10 secs^000000";
set .@buffs,1; // Also buff players? (1: yes / 0: no)
set .@delay,10; // Heal delay, in seconds 
}
 
if (.@price) {
message strcharinfo(0),"Healing costs "+.@price+" Zeny.";
if (Zeny < .@price) {
mes "^ff0000You don't have enough Zeny^000000.";
message strcharinfo(0),"You don't have enough Zeny.";
close;
}
if(select("^0055FFHeal^000000:^777777Cancel^000000") == 2) close;
Zeny -= .@price;
}
 
specialeffect2 EF_HEAL2; percentheal 100,100;
 
if (.@buffs) {
specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10;
specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
}
if (.@delay) @healDelay = gettimetick(2)+.@delay;
close;
}

@Pneuma, just like @Moriarty said, you have no idea whatsoever of basic programming. Quite surprising how you even got that title.

 

Let's just say in athena's scripting when you compare a variable alone, example:

 

if(@variable)

 

it actually checks if it has a value, and if it does, it will execute whatever it is inside the if-statement.

 

if(@variable) //@variable has a value then...

{

     //doThis;

}

 

Hope it helps ^_^!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  173
  • Reputation:   0
  • Joined:  06/07/14
  • Last Seen:  

Thanks Imp, it finally buffed below lvl50 players but the script cursed the player? http://gyazo.com/16936925966938284497d15ccfc82cf3

 

How is that possible?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  55
  • Reputation:   2
  • Joined:  06/09/14
  • Last Seen:  

are you using he's fulls cript I don't see any SC with stone curse though.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

You are stone by default (a wrong const --> 0 = SC_STONE)

replace

SC_INC_AGI

by

SC_INCREASEAGI
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   13
  • Joined:  06/20/12
  • Last Seen:  

There are a few issues in the script you have @c2greentea.

 

The script below should work pretty well.

- script Healer -1,{
 
.@price = 0; // Zeny required for heal
.@buffs = 0; // Also buff players? (1: yes / 0: no)
.@delay = 10; // Heal delay, in seconds
 
if (@healDelay > gettimetick(2)) {
mes callfunc("Time2Str" ,@healDelay)+" seconds to heal again.";
close;
}
 
if(BaseLevel >= 95) {
mes "[Healer]";
mes "My free healing service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!";
mes " ";
mes "For players above lvl 95, my charge will be 780 z (w/o buffs). Thank you for your understanding.";
mes " ";
mes "^777777Delay: 1-3 minutes^000000";
set .@price,780; // Zeny required for heal
set .@delay,rand(60,180); // Heal delay, in seconds
} else if(BaseLevel < 50) {
mes "[Healer]";
mes "My free service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!";
mes " ";
mes "^777777Delay: 10 secs^000000";
set .@buffs,1; // Also buff players? (1: yes / 0: no)
set .@delay,10; // Heal delay, in seconds 
}
 
if (.@price) {
message strcharinfo(0),"Healing costs "+.@price+" Zeny.";
if (Zeny < .@price) {
mes "^ff0000You don't have enough Zeny^000000.";
message strcharinfo(0),"You don't have enough Zeny.";
close;
}
if(select("^0055FFHeal^000000:^777777Cancel^000000") == 2) close;
Zeny -= .@price;
}
 
specialeffect2 EF_HEAL2; percentheal 100,100;
 
if (.@buffs) {
specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10;
specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10;
}
if (.@delay) @healDelay = gettimetick(2)+.@delay;
close;
}

@Pneuma, just like @Moriarty said, you have no idea whatsoever of basic programming. Quite surprising how you even got that title.

 

Let's just say in athena's scripting when you compare a variable alone, example:

 

if(@variable)

 

it actually checks if it has a value, and if it does, it will execute whatever it is inside the if-statement.

 

if(@variable) //@variable has a value then...

{

     //doThis;

}

 

Hope it helps ^_^!

Actually, not entirely accurate.

@variable can have the value 0, returning false.

if(.@example).

.@example will be true if the value is 1 or higher, will be false if the value is 0. If the var does not exist, the emulator assume the value 0, that's why it return false.

In most programming languages, it would return a error if the var doesn't exist.

Edited by Moriarty
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   47
  • Joined:  11/18/11
  • Last Seen:  

@c2greentea, sorry for the curse thing, I used Euphy's script, didn't even read or browsed through the buffs lol. Should work with @capuche's solution (I guess).

 

@Moriarty, of course, in athena's scripting, 0 means false, to destroy variables you can just set them to 0, that's why I don't count 0 as a value. By any value I mean 1 or higher. Yet again I specified here in athena's scripting, because as you mentioned in most programming languages, it doesn't work that way ^_^!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...