private static void RegisterDMEvents() { NWNXEvents.SubscribeEvent(NWNXEventType.DMAppearBefore, "dm_appear"); NWNXEvents.SubscribeEvent(NWNXEventType.DMChangeDifficultyBefore, "dm_change_diff"); NWNXEvents.SubscribeEvent(NWNXEventType.DMDisableTrapBefore, "dm_disab_trap"); NWNXEvents.SubscribeEvent(NWNXEventType.DMDisappearBefore, "dm_disappear"); NWNXEvents.SubscribeEvent(NWNXEventType.DMForceRestBefore, "dm_force_rest"); NWNXEvents.SubscribeEvent(NWNXEventType.DMGetVariableBefore, "dm_get_var"); NWNXEvents.SubscribeEvent(NWNXEventType.DMGiveGoldBefore, "dm_give_gold"); NWNXEvents.SubscribeEvent(NWNXEventType.DMGiveItemAfter, "dm_give_item"); NWNXEvents.SubscribeEvent(NWNXEventType.DMGiveLevelBefore, "dm_give_level"); NWNXEvents.SubscribeEvent(NWNXEventType.DMGiveXPBefore, "dm_give_xp"); NWNXEvents.SubscribeEvent(NWNXEventType.DMHealBefore, "dm_heal"); NWNXEvents.SubscribeEvent(NWNXEventType.DMJumpBefore, "dm_jump"); NWNXEvents.SubscribeEvent(NWNXEventType.DMJumpAllPlayersToPointBefore, "dm_jump_all"); NWNXEvents.SubscribeEvent(NWNXEventType.DMJumpTargetToPointBefore, "dm_jump_target"); NWNXEvents.SubscribeEvent(NWNXEventType.DMKillBefore, "dm_kill"); NWNXEvents.SubscribeEvent(NWNXEventType.DMLimboBefore, "dm_limbo"); NWNXEvents.SubscribeEvent(NWNXEventType.DMPossessBefore, "dm_possess"); NWNXEvents.SubscribeEvent(NWNXEventType.DMSetDateBefore, "dm_set_date"); NWNXEvents.SubscribeEvent(NWNXEventType.DMSetStatBefore, "dm_set_stat"); NWNXEvents.SubscribeEvent(NWNXEventType.DMSetTimeBefore, "dm_set_time"); NWNXEvents.SubscribeEvent(NWNXEventType.DMSetVariableBefore, "dm_set_var"); NWNXEvents.SubscribeEvent(NWNXEventType.DMSpawnObjectAfter, "dm_spawn"); NWNXEvents.SubscribeEvent(NWNXEventType.DMTakeItemBefore, "dm_take_item"); NWNXEvents.SubscribeEvent(NWNXEventType.DMToggleImmortalBefore, "dm_togg_immo"); NWNXEvents.SubscribeEvent(NWNXEventType.DMToggleInvulnerabilityBefore, "dm_togg_invuln"); NWNXEvents.SubscribeEvent(NWNXEventType.DMToggleAIBefore, "dm_toggle_ai"); NWNXEvents.SubscribeEvent(NWNXEventType.DMToggleLockBefore, "dm_toggle_lock"); }
/// <summary> /// Registers all of the NWNX event scripts. /// </summary> private static void RegisterNWNXEvents() { NWNXEvents.SubscribeEvent(NWNXEventType.StartCombatRoundBefore, "mod_on_attack"); NWNXEvents.SubscribeEvent(NWNXEventType.ExamineObjectBefore, "mod_on_examine"); NWNXEvents.SubscribeEvent(NWNXEventType.UseFeatBefore, "mod_on_usefeat"); NWNXEvents.SubscribeEvent(NWNXEventType.UseItemBefore, "mod_on_useitem"); NWNXEvents.SubscribeEvent(NWNXEventType.ItemEquipBefore, "mod_nwnx_equip"); NWNXEvents.SubscribeEvent(NWNXEventType.ItemUnequipBefore, "mod_nwnx_unequip"); NWNXChat.RegisterChatScript("mod_on_nwnxchat"); }
private static void SetModuleEventScripts() { // Vanilla NWN Event Hooks _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_ACQUIRE_ITEM, "mod_on_acquire"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_ACTIVATE_ITEM, "mod_on_activate"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_CLIENT_ENTER, "mod_on_enter"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_CLIENT_EXIT, "mod_on_leave"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_PLAYER_CANCEL_CUTSCENE, "mod_on_csabort"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_HEARTBEAT, "mod_on_heartbeat"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_PLAYER_CHAT, "mod_on_chat"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_PLAYER_DEATH, "mod_on_death"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_PLAYER_DYING, "mod_on_dying"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_EQUIP_ITEM, "mod_on_equip"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_PLAYER_LEVEL_UP, "mod_on_levelup"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_RESPAWN_BUTTON_PRESSED, "mod_on_respawn"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_PLAYER_REST, "mod_on_rest"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_UNEQUIP_ITEM, "mod_on_unequip"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_LOSE_ITEM, "mod_on_unacquire"); _.SetEventScript(_.GetModule(), _.EVENT_SCRIPT_MODULE_ON_USER_DEFINED_EVENT, "mod_on_user"); // NWNX Hooks NWNXEvents.SubscribeEvent(EventType.StartCombatRoundBefore, "mod_on_attack"); NWNXEvents.SubscribeEvent(EventType.ExamineObjectBefore, "mod_on_examine"); NWNXEvents.SubscribeEvent(EventType.UseFeatBefore, "mod_on_usefeat"); NWNXEvents.SubscribeEvent(EventType.EnterStealthAfter, "mod_on_entstlth"); NWNXDamage.SetDamageEventScript("mod_on_applydmg"); // DM Hooks NWNXEvents.SubscribeEvent(EventType.DMAppearBefore, "dm_appear"); NWNXEvents.SubscribeEvent(EventType.DMChangeDifficultyBefore, "dm_change_diff"); NWNXEvents.SubscribeEvent(EventType.DMDisableTrapBefore, "dm_disab_trap"); NWNXEvents.SubscribeEvent(EventType.DMDisappearBefore, "dm_disappear"); NWNXEvents.SubscribeEvent(EventType.DMForceRestBefore, "dm_force_rest"); NWNXEvents.SubscribeEvent(EventType.DMGetVariableBefore, "dm_get_var"); NWNXEvents.SubscribeEvent(EventType.DMGiveGoldBefore, "dm_give_gold"); NWNXEvents.SubscribeEvent(EventType.DMGiveItemBefore, "dm_give_item"); NWNXEvents.SubscribeEvent(EventType.DMGiveLevelBefore, "dm_give_level"); NWNXEvents.SubscribeEvent(EventType.DMGiveXPBefore, "dm_give_xp"); NWNXEvents.SubscribeEvent(EventType.DMHealBefore, "dm_heal"); NWNXEvents.SubscribeEvent(EventType.DMJumpBefore, "dm_jump"); NWNXEvents.SubscribeEvent(EventType.DMJumpAllPlayersToPointBefore, "dm_jump_all"); NWNXEvents.SubscribeEvent(EventType.DMJumpTargetToPointBefore, "dm_jump_target"); NWNXEvents.SubscribeEvent(EventType.DMKillBefore, "dm_kill"); NWNXEvents.SubscribeEvent(EventType.DMLimboBefore, "dm_limbo"); NWNXEvents.SubscribeEvent(EventType.DMPossessBefore, "dm_possess"); NWNXEvents.SubscribeEvent(EventType.DMSetDateBefore, "dm_set_date"); NWNXEvents.SubscribeEvent(EventType.DMSetStatBefore, "dm_set_stat"); NWNXEvents.SubscribeEvent(EventType.DMSetTimeBefore, "dm_set_time"); NWNXEvents.SubscribeEvent(EventType.DMSetVariableBefore, "dm_set_var"); NWNXEvents.SubscribeEvent(EventType.DMSpawnCreatureAfter, "dm_spawn_crea"); NWNXEvents.SubscribeEvent(EventType.DMSpawnEncounterAfter, "dm_spawn_enco"); NWNXEvents.SubscribeEvent(EventType.DMSpawnItemAfter, "dm_spawn_item"); NWNXEvents.SubscribeEvent(EventType.DMSpawnPlaceableAfter, "dm_spawn_plac"); NWNXEvents.SubscribeEvent(EventType.DMSpawnPortalAfter, "dm_spawn_port"); NWNXEvents.SubscribeEvent(EventType.DMSpawnTrapOnObjectAfter, "dm_spawn_trap"); NWNXEvents.SubscribeEvent(EventType.DMSpawnTriggerAfter, "dm_spawn_trigg"); NWNXEvents.SubscribeEvent(EventType.DMSpawnWaypointAfter, "dm_spawn_wayp"); NWNXEvents.SubscribeEvent(EventType.DMTakeItemBefore, "dm_take_item"); NWNXEvents.SubscribeEvent(EventType.DMToggleImmortalBefore, "dm_togg_immo"); NWNXEvents.SubscribeEvent(EventType.DMToggleAIBefore, "dm_toggle_ai"); NWNXEvents.SubscribeEvent(EventType.DMToggleLockBefore, "dm_toggle_lock"); }
private static void SetModuleEventScripts() { // Vanilla NWN Event Hooks _.SetEventScript(_.GetModule(), EventScript.Module_OnAcquireItem, "mod_on_acquire"); _.SetEventScript(_.GetModule(), EventScript.Module_OnActivateItem, "mod_on_activate"); _.SetEventScript(_.GetModule(), EventScript.Module_OnClientEnter, "mod_on_enter"); _.SetEventScript(_.GetModule(), EventScript.Module_OnClientExit, "mod_on_leave"); _.SetEventScript(_.GetModule(), EventScript.Module_OnPlayerCancelCutscene, "mod_on_csabort"); _.SetEventScript(_.GetModule(), EventScript.Module_OnHeartbeat, "mod_on_heartbeat"); _.SetEventScript(_.GetModule(), EventScript.Module_OnPlayerChat, "mod_on_chat"); _.SetEventScript(_.GetModule(), EventScript.Module_OnPlayerDeath, "mod_on_death"); _.SetEventScript(_.GetModule(), EventScript.Module_OnPlayerDying, "mod_on_dying"); _.SetEventScript(_.GetModule(), EventScript.Module_OnEquipItem, "mod_on_equip"); _.SetEventScript(_.GetModule(), EventScript.Module_OnPlayerLevelUp, "mod_on_levelup"); _.SetEventScript(_.GetModule(), EventScript.Module_OnRespawnButtonPressed, "mod_on_respawn"); _.SetEventScript(_.GetModule(), EventScript.Module_OnPlayerRest, "mod_on_rest"); _.SetEventScript(_.GetModule(), EventScript.Module_OnUnequipItem, "mod_on_unequip"); _.SetEventScript(_.GetModule(), EventScript.Module_OnLoseItem, "mod_on_unacquire"); _.SetEventScript(_.GetModule(), EventScript.Module_OnUserDefined, "mod_on_user"); // NWNX Hooks NWNXEvents.SubscribeEvent(EventType.StartCombatRoundBefore, "mod_on_attack"); NWNXEvents.SubscribeEvent(EventType.ExamineObjectBefore, "mod_on_examine"); NWNXEvents.SubscribeEvent(EventType.UseFeatBefore, "mod_on_usefeat"); NWNXEvents.SubscribeEvent(EventType.EnterStealthAfter, "mod_on_entstlth"); NWNXEvents.SubscribeEvent(EventType.DecrementItemStackSizeBefore, "item_dec_stack"); NWNXEvents.SubscribeEvent(EventType.UseItemBefore, "item_use_before"); NWNXEvents.SubscribeEvent(EventType.UseItemAfter, "item_use_after"); NWNXEvents.SubscribeEvent(EventType.ItemInventoryRemoveItemAfter, "item_inventory_disturb_after"); NWNXEvents.SubscribeEvent(EventType.ItemInventoryAddItemAfter, "item_inventory_disturb_after"); NWNXDamage.SetDamageEventScript("mod_on_applydmg"); // DM Hooks NWNXEvents.SubscribeEvent(EventType.DMAppearBefore, "dm_appear"); NWNXEvents.SubscribeEvent(EventType.DMChangeDifficultyBefore, "dm_change_diff"); NWNXEvents.SubscribeEvent(EventType.DMDisableTrapBefore, "dm_disab_trap"); NWNXEvents.SubscribeEvent(EventType.DMDisappearBefore, "dm_disappear"); NWNXEvents.SubscribeEvent(EventType.DMForceRestBefore, "dm_force_rest"); NWNXEvents.SubscribeEvent(EventType.DMGetVariableBefore, "dm_get_var"); NWNXEvents.SubscribeEvent(EventType.DMGiveGoldBefore, "dm_give_gold"); NWNXEvents.SubscribeEvent(EventType.DMGiveItemBefore, "dm_give_item"); NWNXEvents.SubscribeEvent(EventType.DMGiveLevelBefore, "dm_give_level"); NWNXEvents.SubscribeEvent(EventType.DMGiveXPBefore, "dm_give_xp"); NWNXEvents.SubscribeEvent(EventType.DMHealBefore, "dm_heal"); NWNXEvents.SubscribeEvent(EventType.DMJumpBefore, "dm_jump"); NWNXEvents.SubscribeEvent(EventType.DMJumpAllPlayersToPointBefore, "dm_jump_all"); NWNXEvents.SubscribeEvent(EventType.DMJumpTargetToPointBefore, "dm_jump_target"); NWNXEvents.SubscribeEvent(EventType.DMKillBefore, "dm_kill"); NWNXEvents.SubscribeEvent(EventType.DMLimboBefore, "dm_limbo"); NWNXEvents.SubscribeEvent(EventType.DMPossessBefore, "dm_possess"); NWNXEvents.SubscribeEvent(EventType.DMSetDateBefore, "dm_set_date"); NWNXEvents.SubscribeEvent(EventType.DMSetStatBefore, "dm_set_stat"); NWNXEvents.SubscribeEvent(EventType.DMSetTimeBefore, "dm_set_time"); NWNXEvents.SubscribeEvent(EventType.DMSetVariableBefore, "dm_set_var"); NWNXEvents.SubscribeEvent(EventType.DMSpawnCreatureAfter, "dm_spawn_crea"); NWNXEvents.SubscribeEvent(EventType.DMSpawnEncounterAfter, "dm_spawn_enco"); NWNXEvents.SubscribeEvent(EventType.DMSpawnItemAfter, "dm_spawn_item"); NWNXEvents.SubscribeEvent(EventType.DMSpawnPlaceableAfter, "dm_spawn_plac"); NWNXEvents.SubscribeEvent(EventType.DMSpawnPortalAfter, "dm_spawn_port"); NWNXEvents.SubscribeEvent(EventType.DMSpawnTrapOnObjectAfter, "dm_spawn_trap"); NWNXEvents.SubscribeEvent(EventType.DMSpawnTriggerAfter, "dm_spawn_trigg"); NWNXEvents.SubscribeEvent(EventType.DMSpawnWaypointAfter, "dm_spawn_wayp"); NWNXEvents.SubscribeEvent(EventType.DMTakeItemBefore, "dm_take_item"); NWNXEvents.SubscribeEvent(EventType.DMToggleImmortalBefore, "dm_togg_immo"); NWNXEvents.SubscribeEvent(EventType.DMToggleAIBefore, "dm_toggle_ai"); NWNXEvents.SubscribeEvent(EventType.DMToggleLockBefore, "dm_toggle_lock"); }
private static void RegisterInventoryEvents() { NWNXEvents.SubscribeEvent(NWNXEventType.ItemInventoryAddItemBefore, "inv_add_item"); NWNXEvents.SubscribeEvent(NWNXEventType.ItemInventoryRemoveItemBefore, "inv_rem_item"); }