[SOLVED]Upgraded to v83, MSI NPC already in it
Hi guys i am using this script http://forum.ragezone.com/f427/rydahms-msi-npc-659625/
but when im about to add the code to NPCConversationManager i am missing a few functions:
Code:
MapleJob job = eu.getJob();
nItem.setJob(job);
nItem.setRingId(-1);
getJob, setJob and setRingId is the ones that it doesn't recognise.
NetBeans wants me to add those methods to client.Equip
Help Please
Re: Max Stat Item NPC error....
Why would you see those code for a MSI NPC o.o
Posted via Mobile Device
Re: Max Stat Item NPC error....
ask the guy who made it... idk
would be good if someone got a fix for this... Players are waiting
Re: Max Stat Item NPC error....
Why not make your own, instead of taking one? o-o
Re: Max Stat Item NPC error....
Don't be stupid. Just remove those functions from the "msi method". The rydahms morons don't know anything, as TiredGuy said it's not necessary at all.
Edit: If you're going to bitch to us (forum) about your players waiting do it yourself, you think anyone really cares? We aren't your assistants.
Re: Max Stat Item NPC error....
Quote:
Originally Posted by
Soulfist
Don't be stupid. Just remove those functions from the "msi method". The rydahms morons don't know anything, as TiredGuy said it's not necessary at all.
Edit: If you're going to bitch to us (forum) about your players waiting do it yourself, you think anyone really cares? We aren't your assistants.
well sorry for that.. i just want to get it running again :/
so you basiclly mean that i should do this:
PHP Code:
public MapleCharacter getP() {
return getPlayer();
}
public void MakeGMItem (byte slot, MapleCharacter player) {
MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP);
Equip eu = (Equip) equip.getItem(slot);
int item = equip.getItem(slot).getItemId();
short hand = eu.getHands();
byte level = eu.getLevel();
Equip nItem = new Equip(item, equip.getNextFreeSlot());
nItem.setStr((short) 30000); // STR
nItem.setDex((short) 30000); // DEX
nItem.setInt((short) 30000); // INT
nItem.setLuk((short) 30000); //LUK
nItem.setUpgradeSlots((byte) 0);
nItem.setHands(hand);
nItem.setLevel(level);
player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem);
}
public String EquipList(MapleClient c) {
StringBuilder str = new StringBuilder();
MapleInventory equip = c.getPlayer().getInventory(MapleInventoryType.EQUIP);
List<String> stra = new LinkedList<String>();
for (IItem item : equip.list()) {
stra.add("#L"+item.getPosition()+"##v"+item.getItemId()+"##l");
}
for (String strb : stra) {
str.append(strb);
}
return str.toString();
}
ORIGINAL:
PHP Code:
public MapleCharacter getP() {
return getPlayer();
}
public void MakeGMItem (byte slot, MapleCharacter player) {
MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP);
Equip eu = (Equip) equip.getItem(slot);
int item = equip.getItem(slot).getItemId();
MapleJob job = eu.getJob(); - REMOVED
short hand = eu.getHands();
byte level = eu.getLevel();
Equip nItem = new Equip(item, equip.getNextFreeSlot());
nItem.setStr((short) 30000); // STR
nItem.setDex((short) 30000); // DEX
nItem.setInt((short) 30000); // INT
nItem.setLuk((short) 30000); //LUK
nItem.setUpgradeSlots((byte) 0);
nItem.setJob(job); - REMOVED
nItem.setHands(hand);
nItem.setLevel(level);
nItem.setRingId(-1); - REMOVED
player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem);
}
public String EquipList(MapleClient c) {
StringBuilder str = new StringBuilder();
MapleInventory equip = c.getPlayer().getInventory(MapleInventoryType.EQUIP);
List<String> stra = new LinkedList<String>();
for (IItem item : equip.list()) {
stra.add("#L"+item.getPosition()+"##v"+item.getItemId()+"##l");
}
for (String strb : stra) {
str.append(strb);
}
return str.toString();
}
Re: Max Stat Item NPC error....
Wrote this, its easier.
PHP Code:
public String inventoryList(byte type) {
StringBuilder str = new StringBuilder();
for (IItem item : getPlayer().getInventory(MapleInventoryType.getByType(type)).list())
str.append("#L").append(item.getPosition()).append("##v").append(item.getItemId()).append("##l");
return str.toString();
}
Replace all equiplist() calls and the method with this. Replace the calls with inventoryList(1);
and...
Just use getPlayer() (cm.getPlayer()), delete getP(), its pointless
and...
PHP Code:
public void makeGMItem (byte slot) {
Equip nItem = (Equip) getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot);
nItem.setStr((short) 30000); // STR
nItem.setDex((short) 30000); // DEX
nItem.setInt((short) 30000); // INT
nItem.setLuk((short) 30000); //LUK
nItem.setUpgradeSlots((byte) 0);
c.announce(MaplePacketCreator.updateEquipSlot(nItem));
}
In the npc change it from
MakeGMItem(slot, cm.getP());
to
makeGMItem(slot);
That just adds 30,000 all stats (str,int,dex,luk) and removes the slots. The other method was done horribly. It's pointless to make a new Equip (and it was messy), since they are selecting an item from their inventory.
Re: Max Stat Item NPC error....
Quote:
Originally Posted by
Soulfist
Wrote this, its easier.
PHP Code:
public String inventoryList(byte type) {
StringBuilder str = new StringBuilder();
for (IItem item : getPlayer().getInventory(MapleInventoryType.getByType(type)).list())
str.append("#L").append(item.getPosition()).append("##v").append(item.getItemId()).append("##l");
return str.toString();
}
Replace all equiplist() calls and the method with this. Replace the calls with inventoryList(1);
and...
Just use getPlayer() (cm.getPlayer()), delete getP(), its pointless
and...
PHP Code:
public void makeGMItem (byte slot) {
Equip nItem = (Equip) getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot);
nItem.setStr((short) 30000); // STR
nItem.setDex((short) 30000); // DEX
nItem.setInt((short) 30000); // INT
nItem.setLuk((short) 30000); //LUK
nItem.setUpgradeSlots((byte) 0);
c.announce(MaplePacketCreator.updateEquipSlot(nItem));
}
In the npc change it from
MakeGMItem(slot, cm.getP());
to
makeGMItem(slot);
That just adds 30,000 all stats (str,int,dex,luk) and removes the slots. The other method was done horribly. It's pointless to make a new Equip (and it was messy), since they are selecting an item from their inventory.
thanks, but just one problem with the MakeGMItem thingy... it can't find the c.announce symbol...
Re: Max Stat Item NPC error....
Use c.getSession().write
Posted via Mobile Device
Re: Max Stat Item NPC error....
Quote:
Originally Posted by
TiredGuy
Use c.getSession().write
Posted via Mobile Device
Like this?
PHP Code:
public void makeGMItem (byte slot) {
Equip nItem = (Equip) getPlayer().getInventory(MapleInventoryType.EQUIP).getItem(slot);
nItem.setStr((short) 30000); // STR
nItem.setDex((short) 30000); // DEX
nItem.setInt((short) 30000); // INT
nItem.setLuk((short) 30000); //LUK
nItem.setUpgradeSlots((byte) 0);
c.getSession().write (MaplePacketCreator.updateEquipSlot(nItem));
}
Re: Max Stat Item NPC error....
Yes.
Posted via Mobile Device
Re: Max Stat Item NPC error....
It says this npc dosen't work properly.... :(
Re: Max Stat Item NPC error....
What source are you using?
Re: Max Stat Item NPC error....
Mapleworld... not much longer xD
Btw just so i'll know until' next time
PHP Code:
/*
By Mac
Max Stat Item NPC
AIM:darkriuxd MSN:darkriuxd@hotmail.com
*/
importPackage(net.sf.odinms.client);
var status = 0;
var selected = 1;
var wui = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
selected = selection;
if (mode == -1) {
cm.dispose();
} else {
if (status >= 0 && mode == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendAcceptDecline("Hey, Welcome to #rMapleTaste#k Max Stat Item NPC!#k\r\n#rPlease Meet these Requirements: \r\n\r\n#b30,000 Stats in all#k\r\n#b250 Tetris Pieces\r\n#b3 White Scrolls");
} else if (status == 1) {
if (cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999 && cm.getPlayer().getLuk() > 29999 && cm.haveItem(4030002, 250) && cm.haveItem(2340000, 3)){
var String = "Please Choose your desire item or nx you want as your new MSI. Please check your Inventory to make sure u have enough room because, we don't give back refunds.Enjoy!\r\n\r\n";
cm.sendSimple(String+cm.inventoryList(cm.getC()));
} else {
cm.sendOk ("Sorry but you don't meet the requirements to do this procedure");
cm.dispose();
}
} else if (status == 2) {
cm.makeGMItem(slot);
cm.getPlayer().setStr(4); cm.getPlayer().setDex(4); cm.getPlayer().setLuk(4); cm.getPlayer().setInt(4);
cm.gainItem(4030002, -250)
cm.gainItem(2340000, -3);
cm.reloadChar();
cm.dispose();
}
if (selection == 1) {
cm.sendOk("Alright see you next time.");
cm.dispose();
}
}
}
Is this correct?
Re: [SOLVED]Upgraded to v83, MSI NPC already in it
your missing ; after cm.gainItem(4030002, -250)
then test the npc yourself i guess?