
Originally Posted by
rebuilt
Any ideas how to make a buffer npc? I saw it in other servers and its kinda good...
use search... I post that in post :ranting:
Post By DarXyde
PHP Code:
[config.java]
/** Config for max newbie level **/
public static int NEWBIE_MAX;
/** Config for min newbie level **/
public static int NEWBIE_MIN;
======
======
NEWBIE_MAX = Integer.parseInt(customSettings.getProperty("NewbieMax", "0"));
NEWBIE_MIN = Integer.parseInt(customSettings.getProperty("NewbieMin", "0"));
======
======
else if (pName.equalsIgnoreCase("NewbieMax")) NEWBIE_MAX = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("NewbieMin")) NEWBIE_MIN = Integer.parseInt(pValue);
[/config.java]
PHP Code:
[L2NpcInstance.java]
public void makeSupportMagic(L2PcInstance player)
{
int lvl = player.getLevel();
L2Skill skill;
this.setTarget(player);
if (lvl < Config.NEWBIE_MIN){
String content = "<html><body>Come back here when you grow up a little. I will give you support magic then.</body></html>";
insertObjectIdAndShowChatWindow(player, content);
return;
**
if (lvl > Config.NEWBIE_MAX){
String content = "<html><body>Newbie Guide:<br>Your level is to high now and i wont give you my magic support.</body></html>";
insertObjectIdAndShowChatWindow(player, content);
return;
**
//windwalk
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4322,1);
this.doCast(skill);
**
//shield
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4323,1);
this.doCast(skill);
**
if (!player.isMageClass()){
//blessofbody
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4324,1);
this.doCast(skill);
**
//vampirerage
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4325,1);
this.doCast(skill);
**
//regeneration
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4326,1);
this.doCast(skill);
**
//haste
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4327,1);
this.doCast(skill);
**
//lifecubic
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4338,1);
this.doCast(skill);
**
** else {
//blessthesoul
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4328,1);
this.doCast(skill);
**
//acumen
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4329,1);
this.doCast(skill);
**
//concentration
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4330,1);
this.doCast(skill);
**
//empower
if (lvl >= Config.NEWBIE_MIN && lvl <= Config.NEWBIE_MAX){
skill = SkillTable.getInstance().getInfo(4331,1);
this.doCast(skill);
**
**
[/L2NpcInstance.java]
PHP Code:
[custom.properties]
#Min-Max Lvl required for newbie buffer
NewbieMax = 50
NewbieMin = 5
[/custom.properties]
:ranting: :ranting:
Later i make a npc buffer and i upload here,but now i go to school :/