Jump to content

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

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
  • 0
Posted
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

  • 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
  • 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
  • 0
Posted
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;

 

  • 0
Posted
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

  • 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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...