Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.31 KB | None | 0 0
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // ip_ini
  3. // written by: eyesolated
  4. // written at: April 2, 2015
  5. //
  6. // Notes: IP Initialization w/o NWNX
  7.  
  8. ///////////
  9. // Includes
  10. //
  11. #include "eas_inc"
  12. #include "color_inc"
  13. #include "egs_inc"
  14. #include "ip_inc"
  15. #include "eas_inc"
  16.  
  17. const int ITERATION = 50;
  18. void main()
  19. {
  20.     object oModule = OBJECT_SELF;
  21.     object oStorePreload = GetLocalObject(oModule, CS_IP_DB_PRELOAD_STORE_OBJ);
  22.  
  23.     int iCurrentPropertyID = GetLocalInt(oModule, CS_IP_ARRAY_INIT);
  24.     int iTotalProperties = eas_Array_GetSize(oStorePreload, CS_IP_DB_PRELOAD_ARRAY);
  25.  
  26.     if (iCurrentPropertyID >= iTotalProperties)
  27.     {
  28.         object oLog = GetObjectByTag("LOG");
  29.         SetDescription(oLog, GetDescription(oLog) + "\nIP INI B - Item properties store preload finished.");
  30.         WriteTimestampedLogEntry("IP INI B - Item properties store preload finished");
  31.         return;
  32.     }
  33.  
  34.     string sID;
  35.     int iProperty;
  36.     int iType;
  37.     string sCategoriesMain;
  38.     string sCategoriesSub;
  39.     string sBaseItems;
  40.     int iCount;
  41.     int iVarOne;
  42.     int iVarTwo;
  43.     int iVarThree;
  44.     int iMonsterOnly;
  45.  
  46.     int n = iCurrentPropertyID;
  47.     while (n < iTotalProperties &&
  48.            n < iCurrentPropertyID + ITERATION)
  49.     {
  50.         sID = IntToString(n);
  51.         iProperty = GetLocalInt(oStorePreload, CS_IP_ID + sID);
  52.         iType = GetLocalInt(oStorePreload, CS_IP_TYPE + sID);
  53.         sCategoriesMain = GetLocalString(oStorePreload, CS_IP_CATEGORIES_MAIN + sID);
  54.         sCategoriesSub = GetLocalString(oStorePreload, CS_IP_CATEGORIES_SUB + sID);
  55.         sBaseItems = GetLocalString(oStorePreload, CS_IP_BASEITEMS + sID);
  56.         iCount = GetLocalInt(oStorePreload, CS_IP_LEVEL + sID);
  57.         iVarOne = GetLocalInt(oStorePreload, CS_IP_VARONE + sID);
  58.         iVarTwo = GetLocalInt(oStorePreload, CS_IP_VARTWO + sID);
  59.         iVarThree = GetLocalInt(oStorePreload, CS_IP_VARTHREE + sID);
  60.         iMonsterOnly = GetLocalInt(oStorePreload, CS_IP_MONSTERONLY + sID);
  61.         ip_AddProperty(iProperty, iType, sCategoriesMain, sCategoriesSub, sBaseItems, iCount, iVarOne, iVarTwo, iVarThree, iMonsterOnly);
  62.  
  63.         n++;
  64.     }
  65.  
  66.     SetLocalInt(oModule, CS_IP_ARRAY_INIT, n);
  67.     DelayCommand(0.1f, ExecuteScript("ip_ini_b", OBJECT_SELF));
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement