Advertisement
Guest User

Untitled

a guest
May 20th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.58 KB | None | 0 0
  1. //Main module loading event script
  2.  
  3. //Note by MadRabbit on April 16, 2009 : Horses have been disabled in the other
  4. //modules, but I have left the settings in this one in case they are ever added again.
  5. //Uneeded horse code is commented out. Look for my comments to find starting and
  6. //ending points
  7.  
  8.  
  9. #include "inc_emotewand"
  10. #include "gs_inc_time"
  11. #include "x2_inc_switches"
  12. #include "nwnx_weapon"
  13.  
  14. void main()
  15. {
  16. //Set standard module switches
  17. SetModuleSwitch (MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, TRUE);
  18. SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
  19. SetLocalInt(GetModule(),"X2_L_NOTREASURE",TRUE);
  20. // SetModuleSwitch (MODULE_SWITCH_DISABLE_ITEM_CREATION_FEATS, TRUE);
  21.  
  22. //Load the spellhook
  23. SetModuleOverrideSpellscript("mr_spellhook");
  24.  
  25.  
  26. //////////////////////////////////////////////
  27. //Colour Tag custom Tokens for journal/Convos
  28. SetCustomToken(7100, "</c>"); // CLOSE tag
  29. SetCustomToken(7101, "<c? >"); // red
  30. SetCustomToken(7102, "<c ? >"); // green
  31. SetCustomToken(7103, "<c ?>"); // blue
  32. SetCustomToken(7104, "<c ??>"); // cyan
  33. SetCustomToken(7105, "<c? ?>"); // magenta
  34. SetCustomToken(7106, "<c?? >"); // yellow
  35. SetCustomToken(7107, "<c >"); // black
  36. SetCustomToken(7108, "<c? >"); // dark red
  37. SetCustomToken(7109, "<c ? >"); // dark green
  38. SetCustomToken(7110, "<c ?>"); // dark blue
  39. SetCustomToken(7111, "<c ??>"); // dark cyan
  40. SetCustomToken(7112, "<c? ?>"); // dark magenta
  41. SetCustomToken(7113, "<c?? >"); // dark yellow
  42. SetCustomToken(7114, "<c???>"); // grey
  43. SetCustomToken(7117, "<c???>"); // dark grey
  44. SetCustomToken(7115, "<c?? >"); // orange
  45. SetCustomToken(7116, "<c?? >"); // dark orange
  46. SetCustomToken(7117, "<c?#>"); // brown
  47. SetCustomToken(7118, "<c? >"); // dark brown
  48.  
  49. /////////////////////////////////////////////////
  50.  
  51. //Set the initial location of the resources
  52. SetLocalString(GetModule(), "TensFireStone", "Tens Resource House");
  53. SetLocalString(GetModule(), "AnamcharaFireStone", "Anamchara Resource House");
  54. SetLocalString(GetModule(), "ElzigardFireStone", "Elzigard Resource House");
  55.  
  56. object oAnamSpawnPoint=GetWaypointByTag("anamresourcept");
  57. object oTensSpawnPoint=GetWaypointByTag("tensresourcept");
  58. object oElziSpawnPoint=GetWaypointByTag("elziresourcept");
  59.  
  60. location lSpawnAnam=GetLocation(oAnamSpawnPoint);
  61. location lSpawnElzi=GetLocation(oElziSpawnPoint);
  62. location lSpawnTens=GetLocation(oTensSpawnPoint);
  63.  
  64. //Spawn the resources
  65. CreateObject(OBJECT_TYPE_PLACEABLE, "zep_crystal006", lSpawnAnam);
  66. CreateObject(OBJECT_TYPE_PLACEABLE, "elzigardfireston", lSpawnElzi);
  67. CreateObject(OBJECT_TYPE_PLACEABLE, "tens", lSpawnTens);
  68.  
  69. //Set up the portal ownership (note: this should be deleted at some point if we want to make capturing
  70. //forts work across server crashes and resets)
  71. string sCampaign = "Isleofstyss";
  72. //1 = Anam owns the portal 2 = Elzigard owns the portal 3 = Tens owns the portal
  73. SetCampaignInt (sCampaign,"iAnamPortals",1);
  74. SetCampaignInt (sCampaign,"iElzPortals",2);
  75. SetCampaignInt (sCampaign,"iTensPortals",3);
  76.  
  77. //More color token generation. Need to look at this sometime to find the unrecognized tokens in the
  78. //login messages
  79. CollorModLoad("Collorgeneration");
  80.  
  81. //Initialize game time (needed for the banking system)
  82. SetLocalInt(OBJECT_SELF, "GS_YEAR", GetCalendarYear());
  83. int nTimestamp = GetCampaignInt("GS_SYSTEM", "TIMESTAMP");
  84. if (nTimestamp) gsTISetTime(nTimestamp);
  85.  
  86. // Dev Crit change.
  87. WriteTimestampedLogEntry("Configuring devestating critical.");
  88. NWNX_Weapon_SetDevastatingCriticalEventScript("ft_devcrit");
  89.  
  90. ////////////////////////////////////////////////////////////////////////////////////////////
  91. /////////////////////// Horse Settings //////////////////////////////////////
  92. ////////////////////////////////////////////////////////////////////////////////////////////
  93.  
  94. //MR Code Modification Begins
  95.  
  96. //Prevent graphics glitch when mounting on a steep hill
  97. // SetLocalInt(GetModule(),"bX3_MOUNT_NO_ZAXIS",TRUE);
  98.  
  99. //Limit henchmen/horses
  100. // SetMaxHenchmen(1);
  101.  
  102. //No lootable horse corpses
  103. // SetLocalInt(GetModule(),"X3_HORSE_NO_CORPSES",TRUE);
  104.  
  105. //Enable/Disable mount database (currently disabled for performance reasons)
  106. // SetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB",FALSE);
  107.  
  108. //No Resting on Horse
  109. // SetLocalInt(GetModule(),"X3_MOUNT_NO_REST_DISMOUNT",FALSE);
  110.  
  111. //No Horse AC Boost (exploit fix as well)
  112. // SetLocalInt(GetModule(),"X3_HORSE_ENABLE_ACBOOST",FALSE);
  113.  
  114. //Horse HP Boost
  115. // SetLocalInt(GetModule(),"X3_HORSE_ENABLE_HPBOOST",TRUE);
  116.  
  117. /*List of Areas we're excluding horses from - easier than setting the area variables by hand
  118. Global Settings:
  119.  
  120. * Mounts are allowed in exterior areas only.*/
  121. // SetLocalInt(GetModule(),"X3_MOUNTS_EXTERNAL_ONLY",TRUE);
  122. // * No horses are allowed underground.
  123. // SetLocalInt(GetModule(),"X3_MOUNTS_NO_UNDERGROUND",TRUE);
  124. /*
  125. Specific Maps (use area tag):
  126. Notes: We're excluding horses from indoor and underground areas globally, so those don't need to be here.
  127. The only areas listed are areas marked as 'outdoors' we don't want horses in.
  128. This mostly covers the warzone, the 'special' inn rooms, Blackwaters Rock, and the other cities.*/
  129.  
  130. // SetLocalInt(GetObjectByTag("Anamchara"), "X3_NO_HORSES", TRUE);
  131. // SetLocalInt(GetObjectByTag("AnamcharaHousing"), "X3_NO_HORSES", TRUE);
  132. // SetLocalInt(GetObjectByTag("Elzigard"), "X3_NO_HORSES", TRUE);
  133. // SetLocalInt(GetObjectByTag("ElzigardHousing"), "X3_NO_HORSES", TRUE);
  134. // SetLocalInt(GetObjectByTag("TensCity"), "X3_NO_HORSES", TRUE);
  135. // SetLocalInt(GetObjectByTag("NewTensHousing"), "X3_NO_HORSES", TRUE);
  136. // SetLocalInt(GetObjectByTag("NewOOCarea"), "X3_NO_HORSES", TRUE);
  137. // SetLocalInt(GetObjectByTag("TheMercenaryCamp"), "X3_NO_HORSES", TRUE);
  138. // SetLocalInt(GetObjectByTag("TheMercenaryCampSouth"), "X3_NO_HORSES", TRUE);
  139. // SetLocalInt(GetObjectByTag("TheMercenaryCampWest"), "X3_NO_HORSES", TRUE);
  140. // SetLocalInt(GetObjectByTag("TheJaggedCrossroadsInnWesternLak"), "X3_NO_HORSES", TRUE);
  141. // SetLocalInt(GetObjectByTag("MephsPark"), "X3_NO_HORSES", TRUE);
  142. // SetLocalInt(GetObjectByTag("pirateship"), "X3_NO_HORSES", TRUE);
  143. // SetLocalInt(GetObjectByTag("trb_garden_paradice"), "X3_NO_HORSES", TRUE);
  144. // SetLocalInt(GetObjectByTag("SandyOasis"), "X3_NO_HORSES", TRUE);
  145. // SetLocalInt(GetObjectByTag("ArcaneTower"), "X3_NO_HORSES", TRUE);
  146. // SetLocalInt(GetObjectByTag("OPH_Room03"), "X3_NO_HORSES", TRUE);
  147. // SetLocalInt(GetObjectByTag("PeelMeaFig"), "X3_NO_HORSES", TRUE);
  148. // SetLocalInt(GetObjectByTag("Desafinado"), "X3_NO_HORSES", TRUE);
  149. // SetLocalInt(GetObjectByTag("OPH_Room07"), "X3_NO_HORSES", TRUE);
  150. // SetLocalInt(GetObjectByTag("DayattheBeach"), "X3_NO_HORSES", TRUE);
  151. // SetLocalInt(GetObjectByTag("DesertDesires"), "X3_NO_HORSES", TRUE);
  152. // SetLocalInt(GetObjectByTag("NaughtyNymph"), "X3_NO_HORSES", TRUE);
  153. // SetLocalInt(GetObjectByTag("PolarOpposites"), "X3_NO_HORSES", TRUE);
  154. // SetLocalInt(GetObjectByTag("RomanticRuins"), "X3_NO_HORSES", TRUE);
  155. // SetLocalInt(GetObjectByTag("Frozenanam"), "X3_NO_HORSES", TRUE);
  156. // SetLocalInt(GetObjectByTag("Crossroads"), "X3_NO_HORSES", TRUE);
  157. // SetLocalInt(GetObjectByTag("ElzigardFortress"), "X3_NO_HORSES", TRUE);
  158. // SetLocalInt(GetObjectByTag("Eid_StyssNorthHill"), "X3_NO_HORSES", TRUE);
  159. // SetLocalInt(GetObjectByTag("Eid_StyssPondShores"), "X3_NO_HORSES", TRUE);
  160. // SetLocalInt(GetObjectByTag("Eid_StyssSouthHill"), "X3_NO_HORSES", TRUE);
  161. // SetLocalInt(GetObjectByTag("TensFortress"), "X3_NO_HORSES", TRUE);
  162.  
  163. /* This is a list of areas that we -allow- horses in, even if the area is marked as underground or indoors.
  164. Mostly here to show how to do this if we add a stable or something, (using the DM room as an example.)*/
  165.  
  166. // SetLocalInt(GetObjectByTag("OOC"), "X3_MOUNT_OK_EXCEPTION", TRUE);
  167.  
  168. // MR Code Modfication Ends
  169.  
  170. //Unused settings, for reference/possible changes:
  171.  
  172. // * This tells how long you have left in seconds before you will be force-mounted
  173. // * if you got stuck while moving to horse in mounting procedure, unless you
  174. // * are using X3_HORSE_ACT_VS_DELAY method, where you can interrupt your movement
  175. // * before reaching the mounting spot.
  176. //SetLocalFloat(GetModule(),"fX3_TIMEOUT_TO_MOUNT",12.0f);
  177.  
  178. // * Once per fX3_FREQUENCY (default = 1.0s) seconds character will retry to
  179. // * get on the right path when moving to horse in case he gets stuck or
  180. // * something makes him temporarily stuck, if he doesnt get to horse in
  181. // * fX3_TIMEOUT_TO_MOUNT seconds, he is forced to mount.
  182. //SetLocalFloat(GetModule(),"fX3_FREQUENCY",2.0);
  183.  
  184. // * Use this if you want characters to be able to interrupt the mounting
  185. // * procedure before they get to the horse (ie. by clicking on the ground).
  186. //SetLocalInt(GetModule(),"X3_HORSE_ACT_VS_DELAY",TRUE);
  187.  
  188. // * Use horse's inventory as a storage for saddlebag content.
  189. //SetLocalInt(GetModule(),"X3_HORSE_ENABLE_SADDLEBAGS",TRUE);
  190.  
  191. // * Dont forget to place the storage waypoint for this to work!
  192. //SetLocalString(GetModule(),"X3_SADDLEBAG_DATABASE","NAME");
  193.  
  194. // * Doesnt apply speed bonus when mounted.
  195. //SetLocalInt(GetModule(),"X3_HORSE_DISABLE_SPEED",TRUE);
  196.  
  197. // * Possible trouble-shoot for situation when players would be left in an
  198. // * uncommandable state (it should never happen however)
  199. //SetLocalInt(GetModule(),"X3_NO_MOUNT_COMMANDABLE",TRUE);
  200. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement