RydahMSテトリスNPC

Go down

RydahMSテトリスNPC

投稿 by 構築さん on 2014-05-29, 21:52

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 #rYourServer#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#b4 VotePoints\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.getPlayer().getVotePoints() > 4 && 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.EquipList(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(selected, cm.getP());
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.getPlayer().setVotePoints(cm.getPlayer().getVotePoints() -4 );
cm.reloadChar();
cm.dispose();
}
if (selection == 1) {
cm.sendOk("Alright see you next time.");
cm.dispose();
}
}
}[/code:1]

NPCConversationManager:
[code:1] 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();
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);
nItem.setHands(hand);
nItem.setLevel(level);
nItem.setRingId(-1);
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();
}
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可