Jump to content
  • 0
Sign in to follow this  
Hatake Kakashi

Race to 99 with announcer

Question

Posted (edited)

Hello im BACK~ pioneer of rathena but i can't remember all because im old now hahaha,

can you please give me script that has a Race to 99 npc when the player reach max lvl 99 he/she needs to talk to the npc and npc will give his/her reward

and npc announce his/her name to congratulate him/her to reach lvl 99 and per account only and take note please put for 30 players only then after 30 players who reached max level then the npc will automatically gone.

 

thank you in advance.

Edited by Hatake Kakashi

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0
Posted (edited)
MAP,X,Y,POS	script	Reward Npc::99PrizeNpc	SPRITE_ID,{
	if (BaseLevel == 99 && !(char99reward)){
		// Get prize here
		$99rewards += 1;		// Permanent global server var. Counter
		set char99reward,1;			// Permanent char var.
		announce strcharindo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left".
	}
OnInit:
	if ($99rewards > 29)
		disablenpc(strnpcinfo(3));
	end;
}

Its a very simple way of doing that. 
Even so, the best way of doing that is creating a SQL table for that purpose. 
see: 

 

Edited by buraquera

Share this post


Link to post
Share on other sites
  • 0
11 hours ago, buraquera said:
MAP,X,Y,POS	script	Reward Npc::99PrizeNpc	SPRITE_ID,{
	if (BaseLevel == 99 && !(char99reward)){
		// Get prize here
		$99rewards += 1;		// Permanent global server var. Counter
		set char99reward,1;			// Permanent char var.
		announce strcharindo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left".
	}
OnInit:
	if ($99rewards > 29)
		disablenpc(strnpcinfo(3));
	end;
}

Its a very simple way of doing that. 
Even so, the best way of doing that is creating a SQL table for that purpose. 
see: 

 

i got error sir. 

error.png

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
Quote

prontera,139,174,4    script    Reward Npc::99PrizeNpc    430,{
    if (BaseLevel == 99 && !(char99reward)){
        // Get prize here
        $99rewards += 1;        // Permanent global server var. Counter
        set char99reward,1;            // Permanent char var.
        announce strcharindo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left".
    }
OnInit:
    if ($99rewards > 29)
        disablenpc(strnpcinfo(3));
    end;
}

here's the script i edit. please help ty

Edited by Hatake Kakashi
nothing

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

image.png.038171029c1bfd301ce6c7e50cdb3ffc.png
 

Purple: Whats wrong and line.
Red: Error description

This mean a syntax error. Often is a "typing error".

There are no "strcharindo" function but "strcharINFO". Also should be a ";" in the end. So:

from
 announce strcharindo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left".
to
 announce strcharinfo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left.";

Edited by buraquera

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

same error.

 

error2.png

Edited by Hatake Kakashi

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Hatake Kakashi said:

same error.

 

error2.png

announce strcharindo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left".
to
 announce strcharinfo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left.",bc_all;

 

Share this post


Link to post
Share on other sites
  • 0

when i click the npc it says prontera? why prontera? please i want a announce his/her name thank you.

error.png

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, Hatake Kakashi said:

when i click the npc it says prontera? why prontera? please i want a announce his/her name thank you.

error.png

on
 announce strcharinfo(3) + "has won LvL 99 reward." + (30-$99rewards) + " prizes left.",bc_all;

change: strcharinfo(3) to -> strcharinfo(0)


 

*strcharinfo(<type>{,<char_id>})
   
  This function will return either the name, party name or guild name for the
  invoking character. Whatever it returns is determined by type.
   
  0 - Character's name.
  1 - The name of the party they're in if any.
  2 - The name of the guild they're in if any.
  3 - The name of the map the character is in.
   
  If a character is not a member of any party or guild, an empty string will be
  returned when requesting that information.


You better have a read on this entire file before adding new scripts. Will help you a lot.
https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
Quote

prontera,139,174,4    script    Race to 99 NPC    430,{
    if (BaseLevel == 99 && !(char99reward)){
        // Get prize here
        $99rewards += 1;        // Permanent global server var. Counter
        set char99reward,1;            // Permanent char var.
         announce strcharinfo(0) + " has won LvL 99 reward." + (30-$99rewards) + " prizes left.",bc_all;
    }
OnInit:
    if ($99rewards > 29)
        disablenpc(strnpcinfo(3));
    end;
}

it's now working, but please tell me where can i put the prize? thank you,.

Edited by Hatake Kakashi

Share this post


Link to post
Share on other sites
  • 0
22 hours ago, Hatake Kakashi said:

it's now working, but please tell me where can i put the prize? thank you,.

where can i put the prize on it? thank you.

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Hatake Kakashi said:

where can i put the prize on it? thank you.

above   // Get prize here lol

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, buraquera said:

above   // Get prize here lol

thank you master 🙂

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.