Re: [Need-Help] Npc Script
Nothing is wrong. If it's not working you're probably missing either the getGiftLog or setBossLog method.
Re: [Need-Help] Npc Script
i don't know if your method cm.getGiftLog parameter is a String but if so, you need to put quote around instead. like so:
PHP Code:
cm.getGiftLog("1337")
edit: or what sharky just said
Re: [Need-Help] Npc Script
Quote:
Originally Posted by
oxysoft
edit: or what shary just said
Sharky* :closedeyes:
Re: [Need-Help] Npc Script
Haha alright thanks you ill try that too... what about this one
Code:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
importPackage(Packages.tools);
function start() {
cm.gainItem(4001042, 1);
cm.gainItem(4031344, 1);
cm.gainItem(4000100, 2);
cm.warp(910000000, 0);
cm.gainExp(2100000000);
cm.gainExp(2100000000);
cm.gainExp(2100000000);
cm.gainExp(2100000000);
cm.gainExp(500000000);
cm.worldMessage(5, "[Vikan] Congraxt to " + cm.getPlayer().getName() + " on completing a Rebirth Level Quest!");
cm.sendOk("Hey you did well! This is some rewards for you.");
cm.getPlayer().getMap().broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear"));
cm.getPlayer().getMap().broadcastMessage(MaplePacketCreator.playSound("Party1/Clear"));
cm.getGuild().gainGP(2);
cm.dispose();
}
When you double click he doesnt open or he gives you "NPC not working properly"
Re: [Need-Help] Npc Script
add function action(m,t,s) {} at the end and tell me if it works now.
Re: [Need-Help] Npc Script
If it works with action added, I suggest replacing the intefaces with invokeFunction
Posted via Mobile Device
Re: [Need-Help] Npc Script
Quote:
Originally Posted by
StripedCow
add function action(m,t,s) {} at the end and tell me if it works now.
What do you mean?
Re: [Need-Help] Npc Script
PHP Code:
var status = 0;
function start() {
if (cm.getGiftLog('1337') < 1) {
cm.setBossLog('1337');
cm.gainItem(4000100); // Plastic Crown
cm.gainItem(5077000, 5); // Triple Smega
cm.gainItem(4001042, 1); // Eraser
cm.gainItem(4000038, 2); // Trophy
cm.gainItem(4031284); // Golden Egg
cm.sendOk("Here you go! Come back tomorrow!\r\n\r\n#eGolden Egg Information - #nYou can trade golden eggs for attractive prizes from #bTeen Mia#k once you have gained enough golden eggs for the prizes.");
cm.dispose();
} else {
cm.sendOk("You've already taken your gifts today. \r\n#ePlease come back tommrow!#n");
cm.dispose();
}
}
PHP Code:
if (cm.getGiftLog('1337') < 1) {
why using '1337'? if it's a string use "1337", ' .. ' is for chars.
If it's supposed to be an int remove all quotation marks.
Same for the setBossLog.
Re: [Need-Help] Npc Script
alright ill try this :D thank you ill come back with results
Edit: None of those worked
Re: [Need-Help] Npc Script
Fixed the npc jump quest sorry if i bumped this but im doing it just in case anyone else is having problems like i was...
Code:
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 0 && status == 0)
cm.dispose();
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.gainItem(4001042, 5);
cm.gainItem(4000100, 2);
cm.warp(100000000, 0);
cm.worldMessage(5, "[Jump4Joy] Congratulations to " + cm.getPlayer().getName() + " on completing a Jumping Quest");
cm.sendOk("Hey, you did well! Here are some rewards for you.");
cm.dispose();
} else {
cm.dispose();
}
}
}
Just rewrote it ;)
Re: [Need-Help] Npc Script
All you did was remove a few lines.
PHP Code:
cm.getPlayer().getMap().broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear"));
cm.getPlayer().getMap().broadcastMessage(MaplePacketCreator.playSound("Party1/Clear"));
cm.getGuild().gainGP(2);
The issue was probably there.
Re: [Need-Help] Npc Script
I know :P lol i believe it was the gainGP