Jump to content
  • 0

Freebies reward problem


mrlongshen

Question


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

prontera,160,187,4	script	Freebies	123,{
	mes "[Hello]";
	mes "[I can give you a free gift based on your future job.]";
	mes "[Please choose the correct item for the future job]";

	if(!#Freebie) {
		mes "Select one:";
		next;
		switch(select("Swordsman:Magician:Archer:Acolyte:Merchant:Thief")) {
			case 1:
				getitem 13758,1,969,20,1408,1,2104,1,4043,4; //Item for Swordsman
				break;

			case 2:
				getitem 13758,1,969,20,1602,1,2102,1,4043,4; //Item for Magician
				break;

			case 3:
				getitem 13758,1,969,20,1705,1,12009,10,4043,4; //Item for Archer
				break;
				
			case 4:
				getitem 13758,1,969,20,1602,1,2102,1,4043,4; //Item for Acolyte
				break;
			
			case 5:
				getitem 13758,1,969,20,1302,1,2104,1,4043,4; //Item for Merchant
				break;
			
			case 6:
				getitem 13758,1,969,20,1108,1,2104,1,4043,4; //Item for Thief
				break;
				
			}
			set #Freebie, 1;
			close;
	}
	OnInit:
	waitingroom "Get your freebies here ! ",0;
	end;
}

hello all, i set my script like this. but its not works. what is the problem  ?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  254
  • Reputation:   72
  • Joined:  07/10/13
  • Last Seen:  

You're not using the getitem( ) function properly.

*getitem <item id>,<amount>{,<account ID>};

*getitem "<item name>",<amount>{,<account ID>};

This command will give an amount of specified items to the invoking character.

If an optional account ID is specified, and the target character is currently

online, items will be created in their inventory instead. If they are not

online, nothing will happen.

In the first and most commonly used version of this command, items are

referred to by their database ID number found inside 'db/(pre-)re/item_db.txt'.

getitem 502,10 // The person will receive 10 apples

getitem 617,1 // The person will receive 1 Old Violet Box

Giving an item ID of -1 will give a specified number of random items from the

list of those that fall out of Old Blue Box. Unlike in all other cases, these

will be unidentified, if they turn out to be equipment. This is exactly what's

written in the Old Blue Box's item script.

Other negative IDs also correspond to other random item generating item tables:

Giving an item ID of -2 will produce the effects of Old Violet Box.

Giving an item ID of -3 will produce the effects of Old Card Album.

Giving an item ID of -4 will produce the effects of Gift Box.

Giving an item ID of -5 will produce the effects of Worn Out Scroll, which, in

current SVN, drops only Jellopies anyway.

This transaction is logged if the log script generated transactions option is

enabled.

You may also create an item by its name in the 'english name' field in the

item database:

getitem "RED_POTION",10;

Which will do what you'd expect. If it can't find that name in the database,

apples will be created anyway. It is often a VERY GOOD IDEA to use it like this.

This is used in pretty much all NPC scripts that have to do with items and

quite a few item scripts. For more examples check just about any official script.

For example, change
getitem 13758,1,969,20,1108,1,2104,1,4043,4;
to
getitem 13758,1;
getitem 969,20;
getitem 1108,1;
getitem 2104,1;
getitem 4043,4;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

You're not using the getitem( ) function properly.

*getitem <item id>,<amount>{,<account ID>};

*getitem "<item name>",<amount>{,<account ID>};

This command will give an amount of specified items to the invoking character.

If an optional account ID is specified, and the target character is currently

online, items will be created in their inventory instead. If they are not

online, nothing will happen.

In the first and most commonly used version of this command, items are

referred to by their database ID number found inside 'db/(pre-)re/item_db.txt'.

getitem 502,10 // The person will receive 10 apples

getitem 617,1 // The person will receive 1 Old Violet Box

Giving an item ID of -1 will give a specified number of random items from the

list of those that fall out of Old Blue Box. Unlike in all other cases, these

will be unidentified, if they turn out to be equipment. This is exactly what's

written in the Old Blue Box's item script.

Other negative IDs also correspond to other random item generating item tables:

Giving an item ID of -2 will produce the effects of Old Violet Box.

Giving an item ID of -3 will produce the effects of Old Card Album.

Giving an item ID of -4 will produce the effects of Gift Box.

Giving an item ID of -5 will produce the effects of Worn Out Scroll, which, in

current SVN, drops only Jellopies anyway.

This transaction is logged if the log script generated transactions option is

enabled.

You may also create an item by its name in the 'english name' field in the

item database:

getitem "RED_POTION",10;

Which will do what you'd expect. If it can't find that name in the database,

apples will be created anyway. It is often a VERY GOOD IDEA to use it like this.

This is used in pretty much all NPC scripts that have to do with items and

quite a few item scripts. For more examples check just about any official script.

For example, change
getitem 13758,1,969,20,1108,1,2104,1,4043,4;
to
getitem 13758,1;
getitem 969,20;
getitem 1108,1;
getitem 2104,1;
getitem 4043,4;

 

thx alot bro. its work perfectly!!!

+1 for u xD

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