Jump to content
  • 0

How to add this


Milky Holmes

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   0
  • Joined:  11/06/12
  • Last Seen:  

I'm wondering how to add items(usable/misc.) on this is it something like start_armor: 569 100? so 100 novice potion maybe..

// Starting weapon for new characters
start_weapon: 13041

// Starting armor for new characters
start_armor: 5055
start_armor: 2393
start_armor: 2112
start_armor: 2510
start_armor: 2414

// Starting zeny for new characters
start_zeny: 50000

Edited by Milky Holmes
Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   26
  • Joined:  11/19/11
  • Last Seen:  

OnPCLoginEvent:
if(#starterkit == 1) goto L_Done;
getitem 5055,1;
getitem 2393,1;
getitem 2112,1;
getitem 2510,1;
getitem 2414,1;
set #starterkit,1;

L_Done:
end;

Edited by Mavis
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   0
  • Joined:  11/06/12
  • Last Seen:  

So put it on a script ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   26
  • Joined:  11/19/11
  • Last Seen:  

yeah like this:


- script StarterKit -1,{
OnPCLoginEvent:
if(#starterkit == 1) goto L_Done;
getitem 5055,1;
getitem 2393,1;
getitem 2112,1;
getitem 2510,1;
getitem 2414,1;
set #starterkit,1;

L_Done:
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   0
  • Joined:  11/06/12
  • Last Seen:  

do u know how to add it to the char_athena.conf? so doesn't use script because when I'm afraid when I wipe out the server some player couldn't get it.. # is for char id right?

Edited by Euphy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   26
  • Joined:  11/19/11
  • Last Seen:  

"#" - A permanent local account variable.

They are stored with all the account data in "save\accreg.txt" in

TXT versions and in the SQL versions in the 'global_reg_value'

table using type 2.

"##" - A permanent global account variable stored by the login server.

They are stored in "save\account.txt" and in the SQL versions in the

'global_reg_value' table, using type 1. The only difference you will

note from normal # variables is when you have multiple char-servers

connected to the same login server. The # variables are unique to

each char-server, while the ## variables are shared by all these

char-servers.

#name - permanent local account integer variable

#name$ - permanent local account string variable

##name - permanent global account integer variable

##name$ - permanent global account string variable

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   0
  • Joined:  11/06/12
  • Last Seen:  

sry.. it got lag here and unaccidentally posted 3x

x_x

so its saved along with the character ?

if the character is deleted then the # also deleted ?

i mean reseted for that characters name?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  147
  • Reputation:   26
  • Joined:  11/19/11
  • Last Seen:  

oh you're right.

just for the character, it should be starterkit not #starterkit unless you want to make it as an account

- script starterkit -1,{
OnPCLoginEvent:
if(starterkit == 1) goto L_Done;
getitem 5055,1;
getitem 2393,1;
getitem 2112,1;
getitem 2510,1;
getitem 2414,1;
set starterkit,1;

L_Done:
end;
}

this is just for each character XD

so what this does is if your starterkit is 0, then you will be given those 5 items and sets them that you already got them for that character

Edited by Mavis
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   0
  • Joined:  11/06/12
  • Last Seen:  

lol.. thanks, but it does like what i said? when the character is deleted, then ppl make the same character id or name they will still get it again right?

cause i dont really get things like that ~~

Edited by Milky Holmes
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:  

@Milky Holmes

depend on what kind of variable you use...

if you save the variable as Account variable....then 1 account only can get 1 time..

if player variable....then each player within the account also can get it 1 time..

and player based variable will only removed if you delete the character ..or u delete through administration...

account variable only will get deleted when the account is deleted...or through administration.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   0
  • Joined:  11/06/12
  • Last Seen:  

@Milky Holmes

depend on what kind of variable you use...

if you save the variable as Account variable....then 1 account only can get 1 time..

if player variable....then each player within the account also can get it 1 time..

and player based variable will only removed if you delete the character ..or u delete through administration...

account variable only will get deleted when the account is deleted...or through administration.

Thanks.. sorry I just looked at this.. I just had some vacation :D

It really helped.. :)

btw Emistry, do you have the sites that teaches variables?

I can't seem to find it on the rathena wiki...

ah and a question.. whats the difference between the global and local variable?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

@Milky Holmes

All the details about the variables can be located in the doc folder.

It's taken from the file "Script_commands.txt"

view soft copy

from : https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/doc/script_commands.txt

Variables

---------

The meat of every programming language is variables - places where you store

data.

In the rAthena scripting language, variable names are not case sensitive.

Variables are divided into and uniquely identified by the combination of:

prefix - determines the scope and extent (or lifetime) of the variable

name - an identifier consisting of '_' and alphanumeric characters

postfix - determines the type of the variable: integer or string

Scope can be:

global - global to all servers

local - local to the server

account - attached to the account of the character identified by RID

character - attached to the character identified by RID

npc - attached to the NPC

scope - attached to the scope of the instance

Extent can be:

permanent - They still exist when the server resets.

temporary - They cease to exist when the server resets.

Prefix: scope and extent

nothing - A permanent variable attached to the character, the default variable

type. They are stored with all the account data in "save\athena.txt"

in TXT versions and in the SQL versions in the `global_reg_value`

table using type 3.

"@" - A temporary variable attached to the character.

SVN versions before 2094 revision and RC5 version will also treat

'l' as a temporary variable prefix, so beware of having variable

names starting with 'l' if you want full backward compatibility.

"$" - A global permanent variable.

They are stored in "save\mapreg.txt" or database table `mapreg`,

depending on server type.

"$@" - A global temporary variable.

This is important for scripts which are called with no RID

attached, that is, not triggered by a specific character object.

"." - A NPC variable.

They exist in the NPC and disappear when the server restarts or the

NPC is reloaded. Can be accessed from inside the NPC or by calling

'getvariableofnpc'. Function objects can also have .variables which

are accessible from inside the function, however 'getvariableofnpc'

does NOT work on function objects.

".@" - A scope variable.

They are unique to the instance and scope. Each instance has it's

own scope that ends when the script ends. Calling a function with

callsub/callfunc starts a new scope, returning from the function

ends it. When a scope ends, it's variables are converted to values

('return .@var;' returns a value, not a reference).

"'" - An instance variable

These are used with the instancing system, and are unique to each

party's instance.

"#" - A permanent local account variable.

They are stored with all the account data in "save\accreg.txt" in

TXT versions and in the SQL versions in the 'global_reg_value'

table using type 2.

"##" - A permanent global account variable stored by the login server.

They are stored in "save\account.txt" and in the SQL versions in the

'global_reg_value' table, using type 1. The only difference you will

note from normal # variables is when you have multiple char-servers

connected to the same login server. The # variables are unique to

each char-server, while the ## variables are shared by all these

char-servers.

Postfix: integer or string

nothing - integer variable, can store positive and negative numbers, but only

whole numbers (so don't expect to do any fractional math)

'$' - string variable, can store text

Examples:

name - permanent character integer variable

name$ - permanent character string variable

@name - temporary character integer variable

@name$ - temporary character string variable

$name - permanent global integer variable

$name$ - permanent global string variable

$@name - temporary global integer variable

$@name$ - temporary global string variable

.name - NPC integer variable

.name$ - NPC string variable

.@name - scope integer variable

.@name$ - scope string variable

#name - permanent local account integer variable

#name$ - permanent local account string variable

##name - permanent global account integer variable

##name$ - permanent global account string variable

If a variable was never set, it is considered to equal zero for integer

variables or an empty string ("", nothing between the quotes) for string

variables. Once you set it to that, the variable is as good as forgotten

forever, and no trace remains of it even if it was stored with character or

account data.

Some variables are special, that is, they are already defined for you by the

scripting engine. You can see the full list somewhere in 'db/const.txt', which

is a file you should read, since it also allows you to replace lots of numbered

arguments for many commands with easier to read text. The special variables most

commonly used are all permanent character-based variables:

  • Upvote 1
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...