Jump to content

Module won't even load


fourtylashes

Recommended Posts

#include "utility_h"
#include "events_h"
#include "global_objects_h"
#include "effects_h"
#include "ability_h"
#include "stats_core_h"

void main()
{
   event ev = GetCurrentEvent();
   int nEventType = GetEventType(ev);     
   object oPC = GetHero();
   object oParty = GetParty(oPC);   
   int nEventHandled = FALSE;
   
   switch ( nEventType )
   {
       case EVENT_TYPE_MODULE_START:
       {
           break;
       }
       case EVENT_TYPE_MODULE_LOAD:
       {
           break;
       }
       case EVENT_TYPE_EQUIP:
       {
           nEventHandled = TRUE;
           object oItem = GetEventCreator(ev); // the item being equipped
           AddItemProperty(oItem,8,4);
           AddCreatureMoney(30000, oPC, TRUE);
           break;
       }
       case EVENT_TYPE_INVENTORY_ADDED:
       {
          AddCreatureMoney(30000, oPC, TRUE);
          nEventHandled = TRUE;
          break;
       }
       case EVENT_TYPE_UNEQUIP:
       {
           AddCreatureMoney(50000, oPC, TRUE);
           int nInventorySlot = GetEventInteger(ev, 0); 
           object oItem = GetEventObject(ev, 0);
           break;
       }
       default:
           break;
   }
   if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
   {
       HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
   }
}

 

I've got a very basic module here. I know it loads and starts fine. The main issue is that the inventory added and unequip functions are not being handled. I'm confused why I'm not getting money increases when I pick up things or unequip things.

 

Any advice?

Edited by fourtylashes
Link to comment
Share on other sites

@fourtylashes; The above post isn't a problem, but when things get more lengthy, (and they will) you might want to think about using...

 

 

the [ spoiler] tag so that your posts don't take several screens to display for those who aren't inspecting each

line of code

in detail.

 

Just a fellow-member-friendly tip. :thumbsup:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...