Excellzone

Forum and disscussions since 2010


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

#1


NPC Script:
Code:


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();
         }
      }
   }

NPCConversationManager:
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();
                                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();
    }


Pictures Of It Running:









Enjoy:D
Thanks to MaxCloud for Equiplist function<3 and foodpro for the other
2 functions!

View user profile

#2
brdxl28

avatar
Level 0
Level 0
What would I do with the conversation manager? :3

View user profile

View previous topic View next topic Back to top Message [Page 1 of 1]


Permissions in this forum:
You cannot reply to topics in this forum