Thread: Using an item on item to get another item..

Results 1 to 3 of 3
  1. #1 Using an item on item to get another item.. 
    Registered Member
    GwasDdos's Avatar
    Join Date
    Jul 2009
    Posts
    326
    Thanks given
    10
    Thanks received
    4
    Rep Power
    234
    Ok well im using iClarity, i tried adding the code myself and apparently it didnt work..

    Hers is the code i used;
    Code:
    if((itemUsed == 5001 || useWith == 5016)) {
    sendMessage("You have created a Divine Spirit Shield.");
    deleteItem(5001, getItemSlot(5001), 1);
    addItem(5014, 1);
    }
    Didnt work, it was my attempt on using a divine sigil on a spirit shield to get a divine spirit shield, i didnt use any tutorail for this couldnt really find one so i tried doing it myself .. as you can see it didnt work, if you could help please. Thanks.

    Once again, im using iClarity.
    Reply With Quote  
     

  2. #2  
    Uhm Kyle
    Guest
    Try this.

    Code:
    else if ((itemUsed == 5001) && (useWith == 5016)) {
    deleteItem(5001, getItemSlot(5001), 1);
    addItem(5014, 1);
    sendMessage("You have created a Divine Spirit Shield.");
    }
    Search for

    Code:
    else if ((itemUsed ==
    And add with

    Code:
    } else if ((itemUsed == 590) && (useWith == 1511)) {
    if (playerLevel[11] >= 0) {
    deleteItem(1511, getItemSlot(1511), 1);
    makeGlobalObject(absX,absY, 2732, 0, 10);
    addSkillXP(500, 11);
    sendMessage("You attempt to light the logs.");
    sendMessage("The fire catches and the logs begin to burn.");
    resetWC();
    }
    Or something.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jan 2008
    Posts
    639
    Thanks given
    4
    Thanks received
    5
    Rep Power
    0
    Kyle's code should work.

    Explanation:

    Your code is basically saying that:

    Example:
    Code:
    if itemUsed is 5001 OR useWith is 5016 {
    sendMessage("Blah");
    deleteItem(5001, getItemSlot(5001), 1);
    addItem(5014, 1);
    }

    Code:
    if((itemUsed == 5001 || useWith == 5016)) {
    sendMessage("You have created a Divine Spirit Shield.");
    deleteItem(5001, getItemSlot(5001), 1);
    addItem(5014, 1);
    }
    As Kyle's says the same thing except he has &&, which means AND in the Java Language.

    Code:
    else if ((itemUsed == 5001) && (useWith == 5016)) {
    deleteItem(5001, getItemSlot(5001), 1);
    addItem(5014, 1);
    sendMessage("You have created a Divine Spirit Shield.");
    }
    So, basically, remember that || is OR, and && is AND.
    That seems to be the only mistake you've made.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •