Aller au contenu

Photo

[OnEnter] Give (standard) torch and equip


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Okto

Okto
  • Members
  • 5 messages
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.

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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.

#3
Okto

Okto
  • Members
  • 5 messages
Thanks!

#4
Baragg

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

#5
Okto

Okto
  • Members
  • 5 messages
@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.

#6
Baragg

Baragg
  • Members
  • 271 messages
Cool, welcome back.