Author Topic: item scripting prob  (Read 610 times)

Legacy_delmetry

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
item scripting prob
« Reply #15 on: May 17, 2012, 01:47:49 am »


               No biggie i knew what it was right away
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
item scripting prob
« Reply #16 on: May 17, 2012, 02:26:39 am »


               Ok I just tested this, You will need to change the name of the convo to match yours. I also could not remember if books equipted in the right or left hand. You may have to change that to the other hand. The main question if it still does not work is if the PC is getting the "convo" message.

#include "x2_inc_switches"


void main()
{
    object oPC;
    object oItem;
    int nEvent = GetUserDefinedItemEventNumber();
    switch (nEvent)
    {


        case X2_ITEM_EVENT_EQUIP:
            oPC = GetPCItemLastEquippedBy();
            oItem = GetPCItemLastEquipped();
            SendMessageToPC(oPC,"convo");
            if(!GetLocalInt(oPC,"Already_Reading"))
               AssignCommand(oPC,ActionStartConversation(oPC,"book",TRUE));
            else
              SetLocalInt(oPC,"Already_Reading",FALSE);
            break;

        case X2_ITEM_EVENT_UNEQUIP:
            oPC = GetPCItemLastUnequippedBy();
            oItem = GetPCItemLastUnequipped();
             if (IsInConversation(oPC))
             {
                AssignCommand(oPC,ActionEquipItem(oItem,INVENTORY_SLOT_LEFTHAND));
                SendMessageToPC(oPC,"You Must Finish Reading First");
                SetLocalInt(oPC,"Already_Reading",TRUE);
            }
    }
}


EDIT: ooops, corrected a line.
               
               

               


                     Modifié par Lightfoot8, 17 mai 2012 - 02:14 .
                     
                  


            

Legacy_delmetry

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
item scripting prob
« Reply #17 on: May 17, 2012, 09:45:19 pm »


               light ty for the testing u did the scripting we did was fine.  i went with the equipable book.  it was my test conversation that was the problem.  i had two different options that had no responses under them so it wasnt working