• 0

# race to 99 rewards

## Question

can someone direct me to a script that does the following

1. if a character reaches 99 it will give a reward

2. total of 100 rewards only on 1st 99 characters

3. if a character leveled to 99 but the count is 101 99 characters, the script will not give reward

## Recommended Posts

• 0
49 minutes ago, Leic said:

some problem with the announce line and if lv98 is taking the reward, it's telling all items has been taken.

Here, forgot to add check if player is lower than lvl 99.

Tick solve and upvote if I helped you, Thanks.

```// by pajodex
// Optimized by AnnieRuru
prontera,150,150,0	script	Race-To-99	100,{
if (BaseLevel < 99) {
npctalk "Sorry, Only Lvl 99 can claim the reward!";
end;
}
if (\$ItemGive == 100) {
npctalk "Sorry, all rewards has been taken!";
end;
}
if (getreward) {
npctalk "Sorry, Nothing for you!";
end;
}
announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event", bc_all;
getitem 501, 100;
++\$ItemGive;
getreward = 1;
sleep 2000;
announce "There are "+(100 - \$ItemGive)+" rewards left to give!", bc_all;
end;
}```
Edited by pajodex
Optimized

##### Share on other sites
• 0
1 hour ago, Leic said:

can someone direct me to a script that does the following

1. if a character reaches 99 it will give a reward

2. total of 100 rewards only on 1st 99 characters

3. if a character leveled to 99 but the count is 101 99 characters, the script will not give reward

```// by pajodex
prontera,150,150,0	script	Race-To-99	100,{
[email protected] = 501; // Item ID
[email protected] = 100; // Amount
if(\$ItemGive != 100 && BaseLevel == 99) {
if(getreward != 1) {
Announce "Congratulations! "+strcharinfo{0}+" has claimed his reward for Race to 99 Event", 0;
getitem [email protected], [email protected];
\$ItemGive++;
getreward++;
sleep 2000;
announce "There are "+100 - \$ItemGive+" rewards left to give!";
end;
} else
npctalk "Sorry, Nothing for you!";
end;

}
else {
npctalk "Sorry, all rewards has been taken!";
end;
}
}```

Not yet tested, but it should work.

Edited by pajodex

##### Share on other sites
• 0

sorry my bad. it should be globe reg value i think.

Once they reach 99. the script checks on how many \$maxlevel already took the reward. something like that. if less or equal  to 100 value = give reward. Else just a message that he's not eligable to get the rewards.

something like onlevelup?

##### Share on other sites
• 0
1 hour ago, Leic said:

sorry my bad. it should be globe reg value i think.

Once they reach 99. the script checks on how many \$maxlevel already took the reward. something like that. if less or equal  to 100 value = give reward. Else just a message that he's not eligable to get the rewards.

something like onlevelup?

exactly what I did. Test it.

##### Share on other sites
• 0

some problem with the announce line and if lv98 is taking the reward, it's telling all items has been taken.

`strcharinfo{0}`

was in bracket still the problem is when im lvl 98, still saying all items has been redeemed

added <=99 if to fix it. thanks

##### Share on other sites
• 0

I read some of your scripts, and I think your script still has some room for improvements

maybe you should learn how to streamline your conditions, so others can also read your script easily

example in this script

```poring_w01,100,100,5    script    Race-To-99    100,{
if (BaseLevel < 99) {
npctalk "Sorry, Only Lvl 99 can claim the reward!";
end;
}
if (\$ItemGive == 100) {
npctalk "Sorry, all rewards has been taken!";
end;
}
if (getreward) {
npctalk "Sorry, Nothing for you!";
end;
}
announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event", bc_all;
getitem 501, 100;
++\$ItemGive;
getreward = 1;
sleep 2000;
announce "There are "+(100 - \$ItemGive)+" rewards left to give!", bc_all;
end;
}```

put all the false condition before executing the true condition

##### Share on other sites
• 0
7 minutes ago, AnnieRuru said:

I read some of your scripts, and I think your script still has some room for improvements

maybe you should learn how to streamline your conditions, so others can also read your script easily

example in this script

```poring_w01,100,100,5    script    Race-To-99    100,{
if (BaseLevel < 99) {
npctalk "Sorry, Only Lvl 99 can claim the reward!";
end;
}
if (\$ItemGive == 100) {
npctalk "Sorry, all rewards has been taken!";
end;
}
if (getreward) {
npctalk "Sorry, Nothing for you!";
end;
}
announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event", bc_all;
getitem 501, 100;
++\$ItemGive;
getreward = 1;
sleep 2000;
announce "There are "+(100 - \$ItemGive)+" rewards left to give!", bc_all;
end;
}```

put all the false condition before executing the true condition

Yeah, I guess I have long way to go! Thanks for the tip @AnnieRuru. I will edit my first post.

##### Share on other sites
• 0

another question. i cannot find the

`\$ItemGive`

where can i find it?

##### Share on other sites
• 0
```	mes "[Race-to-99]";
mes "Ohh ! A level 99 !!";
next;
mes "[Race-to-175]";
mes "Let me check if your qualified to get the reward..";
next;
getitem 4047,1;
getitem 4054,1;
getitem 4174,1;
++\$ItemGive;
getreward = 1;
close;
announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event !", bc_all;
sleep 2000;
announce "There are "+(100 - \$ItemGive)+" rewards left to give!", bc_all;
end;```

problem now is this. when i use close; it doesn't run the announce. then if i remove the close, the message box is just stuck.

##### Share on other sites
• 0
```	mes "[Race-to-99]";
mes "Ohh ! A level 99 !!";
next;
mes "[Race-to-175]";
mes "Let me check if your qualified to get the reward..";
next;
getitem 4047,1;
getitem 4054,1;
getitem 4174,1;
++\$ItemGive;
getreward = 1;
close;
announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event !", bc_all;
sleep 2000;
announce "There are "+(100 - \$ItemGive)+" rewards left to give!", bc_all;
end;```

problem now is this. when i use close; it doesn't run the announce. then if i remove the close, the message box is just stuck.

##### Share on other sites
• 0
On 4/6/2018 at 10:44 PM, pajodex said:

Here, forgot to add check if player is lower than lvl 99.

Tick solve and upvote if I helped you, Thanks.

```// by pajodex
// Optimized by AnnieRuru
prontera,150,150,0	script	Race-To-99	100,{
if (BaseLevel < 99) {
npctalk "Sorry, Only Lvl 99 can claim the reward!";
end;
}
if (\$ItemGive == 100) {
npctalk "Sorry, all rewards has been taken!";
end;
}
if (getreward) {
npctalk "Sorry, Nothing for you!";
end;
}
announce "Congratulations! "+strcharinfo(0)+" has claimed his reward for Race to 99 Event", bc_all;
getitem 501, 100;
++\$ItemGive;
getreward = 1;
sleep 2000;
announce "There are "+(100 - \$ItemGive)+" rewards left to give!", bc_all;
end;
}```

How to set the reward with random item?

Rare item: costume 1,costume 2,costume 3, etc.... with a 30% chance

Normal item: costume 1,costume 2,costume 3, etc.... with a 70% chance

## Join the conversation

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

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

• ### Recently Browsing   0 members

×
• Forums

• #### My Account

×
• Create New...