[Release] Buff NPC! :D

Junior Spellweaver
Joined
Apr 21, 2007
Messages
158
Reaction score
1
Alright heres the buff NPC after editing a bit. :)

What it does:
It will let you choose what type of buff you want like...
Bless, Holy Symbol, Hyper Body, etc. :P
You can choose the amount of mesos you want your players to pay. :)

How to install:
1. Go to this thread and add the NPC command. :)
2. Copy this code into one of your NPC .js file. :D
You can use like Mia, duey, etc. Any NPC is good. :X

Credits to RMZero213 for the better script. :D
PHP:
// Credits to RMZero213 for the loop, www.untitledms.com

importPackage(net.sf.odinms.client); // leave this alone

var status = 0; // leave this alone
var price = 10000000; // define your price
var skills = new Array(2311003, 4101004, 2301004, 2301002, 2301003, 2321000, 1005, 3221002, 4001003, 2201001, 2001003, 1301006, 3001003, 1301007); // place your skills here

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0) {
            cm.dispose();
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            var seleskill = "Hello #h #, would you like to be buffed? \r\nSelect which buff you want. \r\n#r#eNote#n: You will be using your own MP.#k\r\n#b" + price + " mesos per buff.#b";
            for (var i = 0; i < skills.length; i++) {
                seleskill += "\r\n#L" + i + "##s" + skills[i] + "#     #q" + skills[i] + "##l";
            }
            seleskill += "#k";
            cm.sendSimple(seleskill);
        } else if (status == 1) {
            if (cm.getMeso() < price) {
                cm.sendOk("You dont have enough mesos #h #.");
                cm.dispose();
            } else {
                var buff = SkillFactory.getSkill(skills[selection]);
                cm.sendOk("Enjoy your buff.");
                cm.gainMeso(-price);
                cm.giveBuff(skills[selection], buff.getMaxLevel()); //gets the max level and the selection and applies it
                cm.dispose();
            }
        }
    }
}
3. Then just edit the price you want and you can add more buffs with the array.

Screenshot:
(Old screenshots but look 80% alike) :D
kakashirock - [Release] Buff NPC! :D - RaGEZONE Forums

kakashirock - [Release] Buff NPC! :D - RaGEZONE Forums

kakashirock - [Release] Buff NPC! :D - RaGEZONE Forums



For those who wanna re-release the NPC script that is better and more advanced, please leave my copyright there and you may put yours there too. :)
 
Last edited:
hh nice idea to make it even better im gonna add this with a quest like in gms
and attach this to the admin
 
@RMZero213
Well, im nub in javascript. :D
I guess I'll learn how to.. o.o

@Gmanpoinjay
Try relog. o.o
I tried that script in the post and it works so it should work for you. :)
 
Code:
/*
Buff NPC made by kakashirock from RaGEZONE. :)
mapless.servegame.com
*/

// Credits to RMZero213 for the loop, www.untitledms.com

importPackage(net.sf.odinms.client); // leave this alone

var status = 0; // leave this alone
var price = 10000000; // define your price
var skills = new Array(2311003, 4101004); // place your skills here

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.dispose();
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			var seleskill = "Hello #h #, would you like to be buffed? Select which buff you want. \r\n#r#eNote#n: You will be using your own MP.#k\r\n#b" + price + " mesos per buff.#r";
			for (var i = 0; i < skills.length; i++) {
				seleskill += "\r\n#L" + i + "##s" + skills[i] + "##q" + skills[i] + "##l";
			}
			seleskill += "#k";
			cm.sendSimple(seleskill);
		} else if (status == 1) {
			if (cm.getMeso() < price) {
				cm.sendOk("You dont have enough mesos #h #.");
				cm.dispose();
			} else {
				var buff = SkillFactory.getSkill(skills[selection]);
				cm.sendOk("Enjoy your buff.");
				cm.gainMeso(-price);
				cm.giveBuff(skills[selection], buff.getMaxLevel()); //gets the max level and the selection and applies it
				cm.dispose();
			}
		}
	}
}
Try that, put the skills you want in the array though
 
Back