Jump to content
  • 0

restrict use to only once.


Tassadar

Question


  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

Good afternoon. How to prevent this NPC from giving the boxes twice? The first time the character arrives at level 10 and the second time after being reborn?

I know it is possible to create a variable for each level .. but I have seen somewhere that it is ideal not to load the personages of variables. That this could overload the server.

Note. I wish it was once per character.

// ============== Credit =====================
// Scripted by WhiteEagle
// =============== For =======================
// Delphin Project
// ===========================================

-	script	Levelupbox	-1,{

OnPCBaseLvUpEvent:
set .@item$,501;	// Level 1 with Item "Red Potion";
set .@item2$,501;	// Level 2 with Item "Red Potion";
set .@item3$,501;	// Level 3 with Item "Red Potion";
set .@item4$,501;	// Level 4 with Item "Red Potion";
set .@item5$,501;	// Level 5 with Item "Red Potion";
set .@item6$,501;	// Level 6 with Item "Red Potion";
set .@item7$,501;	// Level 7 with Item "Red Potion";
set .@item8$,501;	// Level 8 with Item "Red Potion";
set .@item9$,501;	// Level 9 with Item "Red Potion";
set .@item10$,501;	// Level 10 with Item "Red Potion";
set .@item11$,501;	// Level 11 with Item "Red Potion";
set .@item12$,501;	// Level 12 with Item "Red Potion";
set .@item13$,501;	// Level 13 with Item "Red Potion";
set .@item14$,501;	// Level 14 with Item "Red Potion";
set .@item15$,501;	// Level 15 with Item "Red Potion";
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 == 10) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 10!";
end;
}
if(BaseLevel == 20) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item2$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 20!";
end;
}
if(BaseLevel == 30) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item3$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 30!";
end;
}
if(BaseLevel == 40) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item4$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 40!";
end;
}
if(BaseLevel == 50) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item5$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 50!";
end;
}
if(BaseLevel == 60) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item6$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 60!";
end;
}
if(BaseLevel == 70) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item7$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 70!";
end;
}
if(BaseLevel == 80) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item8$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 80!";
end;
}
if(BaseLevel == 90) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item9$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 90!";
end;
}
if(BaseLevel == 100) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item10$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 100!";
end;
}
if(BaseLevel == 110) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item11$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 110!";
end;
}
if(BaseLevel == 120) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item12$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 120!";
end;
}
if(BaseLevel == 130) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item13$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 130!";
end;
}
if(BaseLevel == 140) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item14$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 140!";
end;
}
if(BaseLevel == 150) {
specialeffect2 .@effect$;
specialeffect2 .@effect2$;
specialeffect2 .@effect3;
getitem .@item15$,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 150!";
end;
}
}

Thanks in advance;

Edited by Tassadar
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

// ============== Credit =====================
// Scripted by WhiteEagle
// =============== For =======================
// Delphin Project
// ===========================================

-	script	Levelupbox	-1,{

OnPCBaseLvUpEvent:
if(eaclass()&EAJL_UPPER) end;
set .@item,501;	// Level 1 with Item "Red Potion";
set .@item2,501;	// Level 2 with Item "Red Potion";
set .@item3,501;	// Level 3 with Item "Red Potion";
set .@item4,501;	// Level 4 with Item "Red Potion";
set .@item5,501;	// Level 5 with Item "Red Potion";
set .@item6,501;	// Level 6 with Item "Red Potion";
set .@item7,501;	// Level 7 with Item "Red Potion";
set .@item8,501;	// Level 8 with Item "Red Potion";
set .@item9,501;	// Level 9 with Item "Red Potion";
set .@item10,501;	// Level 10 with Item "Red Potion";
set .@item11,501;	// Level 11 with Item "Red Potion";
set .@item12,501;	// Level 12 with Item "Red Potion";
set .@item13,501;	// Level 13 with Item "Red Potion";
set .@item14,501;	// Level 14 with Item "Red Potion";
set .@item15,501;	// Level 15 with Item "Red Potion";
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 == 10) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 10!";
end;
}
if(BaseLevel == 20) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item2,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 20!";
end;
}
if(BaseLevel == 30) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item3,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 30!";
end;
}
if(BaseLevel == 40) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item4,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 40!";
end;
}
if(BaseLevel == 50) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item5,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 50!";
end;
}
if(BaseLevel == 60) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item6,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 60!";
end;
}
if(BaseLevel == 70) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item7,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 70!";
end;
}
if(BaseLevel == 80) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item8,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 80!";
end;
}
if(BaseLevel == 90) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item9,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 90!";
end;
}
if(BaseLevel == 100) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item10,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 100!";
end;
}
if(BaseLevel == 110) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item11,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 110!";
end;
}
if(BaseLevel == 120) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item12,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 120!";
end;
}
if(BaseLevel == 130) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item13,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 130!";
end;
}
if(BaseLevel == 140) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item14,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 140!";
end;
}
if(BaseLevel == 150) {
specialeffect2 .@effect;
specialeffect2 .@effect2;
specialeffect2 .@effect3;
getitem .@item15,1;
dispbottom "Congratulation "+strcharinfo(0)+" to level 150!";
end;
}
}

Like this?

Edited by n0tttt
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

Thank you very much. It helped a lot.

It has like this  dispbottom

to appear of another color for the character. But still in the chat??

 

 


 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

dispbottom does support color.

Quote

*dispbottom "<message>"{,<color>{,<char_id>}};

This command will send the given message with color into the invoking character's chat
window. The color format is in RGB (0xRRGGBB). The color is
by default green

For example:

dispbottom "Example",0xff0000;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

Which is correct?

dispbottom "Congratulation "+strcharinfo(0)+" to level 10!,0xff0000";
dispbottom "Congratulation "+strcharinfo(0)+" to level 10!",0xff0000;

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Last one.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

Kinda liked it, so i revised it to a simple script.

-	script	Levelupbox	-1,{

OnInit:
	setarray .@reward[0],10,501,1,20,502,2; // Level, Item ID, Amount
end;

OnPCBaseLvUpEvent:
if(eaclass()&EAJL_UPPER) end;
for(.@i=0;.@i<getarraysize(.@reward);.@i+=3)
	if(BaseLevel==.@reward[.@i]){
		specialeffect2 71;
		specialeffect2 72;
		specialeffect2 73;
		getitem .@reward[.@i+1],.@reward[.@i+2];
		dispbottom "Congratulation! "+strcharinfo(0)+" reached level "+.@reward[.@i]+"!";
	}
end;
}

 

Edited by Haruka Mayumi
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...