Aller au contenu

Photo

Item Activated Unique power error


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

#1
Nebril2

Nebril2
  • Members
  • 59 messages

Hi all!!

 

 

 

I just want to make a item that when activated gives gold to the activator... simple but im getting one error. 

 

The item not only activates when used, also when picked up, dropped etc... and of course i dont want that.

 

I use to have that problem before but i solved it with an #include, but now months later cant remember which include is! i tried with many but none worked. 

 

This is the current code, trying with 2 more includes there none working.

 

 

 

#include "nw_i0_spells"

#include "x0_i0_spells"
 
void main()
{
 
  object oPC = GetItemActivator();
 
  GiveGoldToCreature(oPC, d8(5));
 
 
 
 
}

 



#2
WhiZard

WhiZard
  • Members
  • 1 204 messages

Try here.  The include is x2_inc_switches which will give you the constants for the user defined events.


  • henesua aime ceci

#3
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

Try this

 

#include "x2_inc_switches"
 
void main()
{
    int nEvent = GetUserDefinedItemEventNumber();    
    object oPC;     
 
    switch (nEvent)
    {
        case X2_ITEM_EVENT_ACTIVATE:
 
            oPC   = GetItemActivator();        
 
            GiveGoldToCreature(oPC, d8(5));
            break;
    }
}

  • henesua aime ceci

#4
henesua

henesua
  • Members
  • 3 882 messages

Good responses here.

 

Just want to suggest that rather than the old lexicon, Nebril be pointed to the wikified lexicon.

Here's the tutorial at the wiki.


  • Proleric aime ceci

#5
Nebril2

Nebril2
  • Members
  • 59 messages
Yes now I got it used the user defined events worked, you are so nice :)

Thanks