Jump to content
  • 0

Level box problem.


stydianx

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  


-	script	Levelupbox	-1,{

OnPCBaseLvUpEvent:
set .@item$,13711;	// Level 1 with Item "Small life potion box 10";
set .@item2$,2741;	// Level 2 with Item "All in one ring [0]";
set .@item3$,13746;	// Level 1.5 with Item "small defense potion box 10";
set .@item4$,5189;	// Level 3 with Item "Autumn Leaves [0] headgear";
set .@item5$,13714;	// Level 4 with Item "Medium Life potion box 10";
set .@item6$,13749;	// Level 5 with Item "small defense potion box 10";
set .@item7$,15052;	// Level 6 with Item "Bayani bakunawa scale armor [0]";
set .@item8$,14533;	// Level 7 with Item "Field manual 100%";
set .@item9$,14592;	// Level 8 with Item "JOB manual 50%";
set .@item10$,4799;	// Level 9 with Item "HP stone +500";
set .@item11$,14533;	// Level 9.5 with Item "Field manual 100%";
set .@item12$,12623;	// Level 10 with Item "Advanced weapon box";
set .@item13$,4133;	// Level 11 with Item "Raydric Card";
set .@item14$,14533;	// Level 11.5 with Item "Field manual 100%";
set .@item15$,13755;	// Level 12 with Item "Big magic defense potion box";
set .@item16$,14592;	// Level 12.5 with Item "JOB manual 50%";
set .@item17$,13813;	// Level 13 with Item "Lvl 3 food box";
set .@item18$,14545;	// Level 13.5 with Item "Field manual 300%";
set .@item19$,14607;	// Level 14 with Item "Luxurious food";
set .@item20$,9042;	// Level 15 with Item "Loli Ruri pet egg";
set .@item21$,25001;	// Level 16 with Item "Emperium Crystals";
set .@item22$,12623;	// Level 17 with Item "Advanced weapon box";
set .@effect$,71;	// Specialeffect Spiral White balls
set .@effect2$,72;	// Specialeffect Bigger Spiral White balls
set .@effect3$,73;	// Specialeffect Blue/White Small Aura

if(BaseLevel == 5) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 5!";
end;
}
if(BaseLevel == 10) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item2$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 20!";
end;
}
if(BaseLevel == 20) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item3$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 10!";
end;
}
if(BaseLevel == 30) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item4$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 30!";
end;
}
if(BaseLevel == 40) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item5$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 40!";
end;
}
if(BaseLevel == 50) {
specialeffect2 .@effect$;
specialeffect2 .@effect3;
getitem .@item6$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 50!";
end;
}
if(BaseLevel == 60) {
specialeffect2 .@effect$;
specialeffect2 .@effect3;
getitem .@item7$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 60!";
end;
}
if(BaseLevel == 70) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item8$,2;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 70!";
end;
}
if(BaseLevel == 80) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item9$,8;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 80!";
end;
}
if(BaseLevel == 90) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item10$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 90!";
end;
}
if(BaseLevel == 95) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item11$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 95!";
end;
}
if(BaseLevel == 100) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item12$,3;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 100!";
end;
}
if(BaseLevel == 110) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item13$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 110!";
end;
}
if(BaseLevel == 115) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item14$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 115!";
end;
}
if(BaseLevel == 120) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item15$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 120!";
end;
}
if(BaseLevel == 125) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item16$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 120!";
end;
}
if(BaseLevel == 130) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item17$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 130!";
end;
}
if(BaseLevel == 135) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item18$,2;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 135!";
end;
}
if(BaseLevel == 140) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item19$,5;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 140!";
end;
}
if(BaseLevel == 150) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item20$,1;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 150!";
end;
}
if(BaseLevel == 160) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item21$,20;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 160!";
end;
}if(BaseLevel == 170) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item22$,5;
dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 170!";
end;
}
}

 

Sup guys, i have this script ----^^^

but it wont give the items. can plus it send a message in the server window.. saying:

 

 

[Warning]: Unexpected type for argument 1. Expected number.
[Debug]: Data: variable name='.@effect$' index=0
[Debug]: Function: specialeffect2
[Debug]: Source (NPC): Levelupbox (invisible/not on a map)
[Warning]: Unexpected type for argument 1. Expected number.
[Debug]: Data: variable name='.@effect2$' index=0
[Debug]: Function: specialeffect2
[Debug]: Source (NPC): Levelupbox (invisible/not on a map)
[Error]: buildin_getitem: Nonexistant item 5189 requested.
[Debug]: Source (NPC): Levelupbox (invisible/not on a map)
 

 

in-game it only sayas "Congratulations <character name> for reaching lvl --"

can someone help me? :D i'll give cookies.

 
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

Remove the $ sign at the end of the effects. You are making it take a string instead of a int.

 

String = Text

Int = Numbers.

 

.@effect1$

.@effect2$

 

 to

 

.@effect1

.@effect2

 

 

Also, you are trying to give your player an unknown item. It does not recognize the item ID 5189.

 

Same for your items though, you should change all the strings into integers consider you are only storing ID numbers.

Remove the $ from the variables that you are using.

 

Notice that you are using .@effect3 when the variable you've set up above is .@effect3$.

Make sure you  catch these small mistakes :P, especially when you are copy and pasting since you will end up having to fix all of them if they are based off the same code that has an error.

 

 

I have not tested this myself btw so I am not 100% sure that it will fix your problem.

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


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

Remove the $ sign at the end of the effects. You are making it take a string instead of a int.

 

String = Text

Int = Numbers.

 

.@effect1$

.@effect2$

 

 to

 

.@effect1

.@effect2

 

 

Also, you are trying to give your player an unknown item. It does not recognize the item ID 5189.

 

Same for your items though, you should change all the strings into integers consider you are only storing ID numbers.

Remove the $ from the variables that you are using.

 

Notice that you are using .@effect3 when the variable you've set up above is .@effect3$.

Make sure you  catch these small mistakes :P, especially when you are copy and pasting since you will end up having to fix all of them if they are based off the same code that has an error.

 

 

I have not tested this myself btw so I am not 100% sure that it will fix your problem.

i would kiss you right now! lol. thanks man!

 

uhmm.. what do i do if i want it to tell the player that he obtained the reward using dispbottom.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 160!";

 

I am unsure of the reason why it is showing up as "--" considering you are using hard text for it.

 

Try using "BaseLevel" instead of hard text... I am unsure if this will change anything but it's worth I try, it'll also save you time in the future if you want to read one's BaseLevel several times throughout the script instead of having to edit each individual line.

 

This will work because it will only  read their base level at a certain condition. Since the condition is being checked

When player has leveled to lvl 160. ( BaseLevel will equal 160 )

if(BaseLevel == 160 ) {...}

 

160 = 160 right? Since they've just reached that level, unless you have a multilvl up and somehow your player levels up more than one level...

 

So BaseLevel will take whatever level they are at that moment when the condition is met. ( Which should be the same since the npc event is running anyways... ) Using that to an advantage, you could just simply use BaseLevel in your npc text instead of having to change every single line to ___ level.

 

dispbottom "Congratulations "+strcharinfo(0)+" in making it to level ",BaseLevel;
 

 

You should also try temporarily commenting the rest of the copied script and just testing with one until it works, then continue after that. Just to make it easier on you since you would know that it works before you do any other additions/edits.

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

dispbottom "Congratulation "+strcharinfo(0)+" in making it to level 160!";

 

I am unsure of the reason why it is showing up as "--" considering you are using hard text for it.

 

Try using "BaseLevel" instead of hard text... I am unsure if this will change anything but it's worth I try, it'll also save you time in the future if you want to read one's BaseLevel several times throughout the script instead of having to edit each individual line.

 

This will work because it will only  read their base level at a certain condition. Since the condition is being checked

When player has leveled to lvl 160. ( BaseLevel will equal 160 )

if(BaseLevel == 160 ) {...}

 

160 = 160 right? Since they've just reached that level, unless you have a multilvl up and somehow your player levels up more than one level...

 

So BaseLevel will take whatever level they are at that moment when the condition is met. ( Which should be the same since the npc event is running anyways... ) Using that to an advantage, you could just simply use BaseLevel in your npc text instead of having to change every single line to ___ level.

 

dispbottom "Congratulations "+strcharinfo(0)+" in making it to level ",BaseLevel;
 

 

You should also try temporarily commenting the rest of the copied script and just testing with one until it works, then continue after that. Just to make it easier on you since you would know that it works before you do any other additions/edits.

 

no.. thats good, what i was asking for was, how do i make the script say that he got the item reward.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

dispbottom "You have received "+getitemname(.@item)+".";

 

getitemname will take in ID arguments and find out the item name. Is this what you wanted?

 

I used .@item since it is the first variable you used for the first prize.

 

Change it accordingly for each prize.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

dispbottom "You have received "+getitemname(.@item)+".";

 

getitemname will take in ID arguments and find out the item name. Is this what you wanted?

 

I used .@item since it is the first variable you used for the first prize.

 

Change it accordingly for each prize.

yes this is what i was looking for.. so... i do it like this?

 

dispbottom "You have received "+getitemname(.@item)+".";
dispbottom "You have received "+getitemname(.@item2)+".";
dispbottom "You have received "+getitemname(.@item3)+".";
dispbottom "You have received "+getitemname(.@item4)+".";
dispbottom "You have received "+getitemname(.@item5)+".";
dispbottom "You have received "+getitemname(.@item6)+".";

is this right? then i just, apply this to my script right?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

Yes this is correct, but you'd want to put them in each individual condition else it would spam your chat.

 

If anything, you should test it in-game since you will eventually reach your answer if you try it.

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