Jump to content
  • 0

race to 99 rewards


Leic

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  48
  • Reputation:   0
  • Joined:  02/27/18
  • Last Seen:  

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

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  431
  • Reputation:   164
  • Joined:  12/12/17
  • Last Seen:  

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
  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  431
  • Reputation:   164
  • Joined:  12/12/17
  • Last Seen:  

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,{
.@item = 501; // Item ID
.@amount = 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 .@item, .@amount;
		$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
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  48
  • Reputation:   0
  • Joined:  02/27/18
  • Last Seen:  

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?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  431
  • Reputation:   164
  • Joined:  12/12/17
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  48
  • Reputation:   0
  • Joined:  02/27/18
  • Last Seen:  

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 :D still the problem is when im lvl 98, still saying all items has been redeemed

added <=99 if to fix it. thanks

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@pajodex

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  431
  • Reputation:   164
  • Joined:  12/12/17
  • Last Seen:  

7 minutes ago, AnnieRuru said:

@pajodex

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.

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  48
  • Reputation:   0
  • Joined:  02/27/18
  • Last Seen:  

another question. i cannot find the

$ItemGive

 

where can i find it?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  48
  • Reputation:   0
  • Joined:  02/27/18
  • Last Seen:  

	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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  48
  • Reputation:   0
  • Joined:  02/27/18
  • Last Seen:  

	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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   4
  • Joined:  02/19/17
  • Last Seen:  

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

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