Jump to content
  • 0

contribute + rates


GM Takumirai

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

i requested this to Emistry but its not working

prontera.gat,146,171,6 script Gigler 402,{
mes "Welcome :";
mes "Would you like to contribute for double drop rate and experience?";
mes "I need [Zeny] to modify the rates and share it to all players here.";
next;
mes "Total Zeny Gained :";
mes "^FF0000"+.TotalZeny+"^000000 Zeny.";
mes "Need "+.TargetZeny+" Zeny. To Activate the modified rates, would you like to share?";
next;
if( select("Donate Zeny:Cancel") == 1 ){
mes "How many will be Donated ?";
input .@Amount,0,Zeny;
mes "Done,.. you have Donated "+.@Amount+" Zeny.";
set Zeny,Zeny - .@Amount;
if( .TotalZeny >= .TargetZeny ){
 set .TotalZeny,0;
 set .Duration,gettimetick(2) + ( 24 * 60 );
 announce "Rates already modified..[x2] drop rate[x2] exp. rate. for 1 day, Please Re-Log to enjoy the double rates.";
}
}
close;
OnInit:
set .TargetZeny,50000000;
set .Rate,2;
end;
OnPCLoginEvent:
if( .Duration > gettimetick(2) ){
sc_start SC_EXPBOOST,( .Duration - gettimetick(2) ),( .Rate * 100 );
sc_start SC_ITEMBOOST,( .Duration - gettimetick(2) ),( .Rate * 100 );
}
end;
}

Edited by GM Takumirai
Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

owh...some mistake..

find this

input .@Amount,0,Zeny;

add below

set .TotalZeny,.TotalZeny + .@Amount;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

- thanks @Emistry.. you always answer problem of players.. how i wish to rate you a 5 star. thank you

- sadly i still can't open the script npc ingame..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   52
  • Joined:  11/15/11
  • Last Seen:  

This should fix it:

http://upaste.me/index.php?show=63464

Forgot ",0; on announce was only "text";

Also removed 2 curly's

Edited by Nameless2you
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

it works, but the problem is when i click the NPC and input the donate it say i already Done Contributing and freeze [the npc stop] and the npc less the zeny, but still 0 contribution..

it works, but the problem is when i click the NPC and input the donate it say i already Done Contributing and freeze [the npc stop] and the npc less the zeny, but still 0 contribution..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   52
  • Joined:  11/15/11
  • Last Seen:  

Try this:

http://upaste.me/index.php?show=63465

I accidentally removed 1 close; without reading the entire script, I however added another check to prevent players from inputting more money than they actually have which I doubt would've worked anyways but it errors the server and can lead to nasty situations.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   17
  • Joined:  02/06/12
  • Last Seen:  

Will it work without setting .TotalZeny to 0 on init?

http://upaste.me/index.php?show=63466

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   52
  • Joined:  11/15/11
  • Last Seen:  

Problem with the variables used is that it'll change back to 0 after a server restart anyways.. since npc variables tend to do that.. =/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  49
  • Reputation:   17
  • Joined:  02/06/12
  • Last Seen:  

Oh I see. So we dont have to define variables with set, its just assumed that any variable is equal to 0 unless set to something else?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   52
  • Joined:  11/15/11
  • Last Seen:  

That's what I expect but looking at the script it's missing a huge part..

it's not setting the TargetZeny or total zeny at all after doing the donation.. o_o

This would be a version that should work:

http://upaste.me/index.php?show=63472

Edited by Nameless2you
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

- Thanks Nameless,

- Thanks Emistry

- still got error.. the npc gone and i have this error

[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/rAthena/floating-rate-pay.txt', line '1'. Stopping...
* w1=prontera.gat,146,171,6 script Gigler 402,{
* w2=
* w3=
* w4=

i used your modified script @Emistry

the problem with nameless script is that

- if i input any amount it gives the double rates..

- and still 0 ammount..

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

1st line error........:)

all this is the TAB problem

maybe i forget change to TAB when paste to pastebin.....

the 1 nameless post...

he do wrong variable checking

this

if( .TotalZeny <= 0 ){

should be

if( .TotalZeny >= .TargetZeny ){

this

set .TotalZeny,.TotalZeny - .@Amount;

should be

set .TotalZeny,.TotalZeny + .@Amount;

and my script i have updated the Status Buff Time..anyway cant confirm it correctly due to unable to test the script

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

@Emistry its working great thanks [solved]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

@ Emistry - how can i make it.. if the npc is over for 1 day.. also the player status double exp. will also remove.. because my previous npc is when 1 day is over still my char. have the double rates. because im not online for 1 day...

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...