Author Topic: [OnEnter] Give (standard) torch and equip  (Read 514 times)

Legacy_Okto

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
[OnEnter] Give (standard) torch and equip
« on: February 22, 2011, 03:29:09 am »


               I'm not at home right now, so no toolset for me. Can anyone provide me with the lines to give the PC a torch and equip it?
Thanks.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
[OnEnter] Give (standard) torch and equip
« Reply #1 on: February 22, 2011, 04:39:28 am »


               Something kinda like so:

void main()
{
    object oPC = GetEnteringObject();
    object oTorch = CreateItemOnObject("nw_it_torch001", oPC);
    AssignCommand(oPC, ClearAllActions(TRUE));
    AssignCommand(oPC, ActionEquipItem(oTorch, INVENTORY_SLOT_LEFTHAND));
}


Good luck.
               
               

               
            

Legacy_Okto

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
[OnEnter] Give (standard) torch and equip
« Reply #2 on: February 22, 2011, 10:26:57 am »


               Thanks!
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
[OnEnter] Give (standard) torch and equip
« Reply #3 on: February 22, 2011, 10:14:04 pm »


               You do understand if that is used on cliententer the pc will get a new torch and it will be equipped every time?
               
               

               
            

Legacy_Okto

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
[OnEnter] Give (standard) torch and equip
« Reply #4 on: February 23, 2011, 10:54:12 am »


               @Baragg,

Yes I know. This is just for a little LevelUp module for myself. I check the entering PC for <1 XP, strip them clean, give the torch and set XP to 10.

I recently got a new laptop after my old desktop died. Decided to install NWN on it. (Been out of it for awhile). So a LevelUp module is a nice place to start and get a bit of my scripting knowledge back.

It's a small labyrinth with a trainer, a banker and a custom shop.

Area is pitch black so you can't navigate without light.
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
[OnEnter] Give (standard) torch and equip
« Reply #5 on: February 23, 2011, 12:39:14 pm »


               Cool, welcome back.