Skip to content

Opcodes

Named constants for opcode numbers.

Opcode

Source: misc/opcode.tph

NameValueDescription
OPCODE_ac_vs_damage_type_mod0Stat: AC vs. Damage Type Modifier
OPCODE_attacks_per_round_mod1Stat: Attacks Per Round Modifier
OPCODE_cure_sleep2Cure: Sleep
OPCODE_berserking3State: Berserking
OPCODE_cure_berserking4Cure: Berserking
OPCODE_charm_charm_specific_creature5Charm: Charm Specific Creature
OPCODE_charisma_mod6Stat: Charisma Modifier
OPCODE_colour_set_character_colours_by_palette7Colour: Set Character colours by Palette
OPCODE_colour_change_by_rgb8Colour: Change by RGB
OPCODE_colour_glow_pulse9Colour: Glow Pulse
OPCODE_constitution_mod10Stat: Constitution Modifier
OPCODE_cure_poison11Cure: Poison
OPCODE_hp_damage12HP: Damage
OPCODE_death_instant_death13Death: Instant Death
OPCODE_defrost14Graphics: Defrost
OPCODE_dexterity_mod15Stat: Dexterity Modifier
OPCODE_haste16State: Haste
OPCODE_hp_current_hp_mod17HP: Current HP Modifier
OPCODE_hp_maximum_hp_mod18HP: Maximum HP Modifier
OPCODE_intelligence_mod19Stat: Intelligence Modifier
OPCODE_invisibility20State: Invisibility
OPCODE_lore_mod21Stat: Lore Modifier
OPCODE_cumulative_luck_bonus22Stat: Cumulative Luck Bonus
OPCODE_morale_mod23Stat: Morale Modifier
OPCODE_horror24State: Horror
OPCODE_poison25State: Poison
OPCODE_remove_curse26Item: Remove Curse
OPCODE_acid_resist_mod27Stat: Acid Resistance Modifier
OPCODE_cold_resist_mod28Stat: Cold Resistance Modifier
OPCODE_electricity_resist_mod29Stat: Electricity Resistance Modifier
OPCODE_fire_resist_mod30Stat: Fire Resistance Modifier
OPCODE_magic_damage_resist_mod31Stat: Magic Damage Resistance Modifier
OPCODE_cure_death_raise_dead32Cure: Death (Raise Dead)
OPCODE_save_vs_death_mod33Stat: Save vs. Death Modifier
OPCODE_save_vs_wands_mod34Stat: Save vs. Wands Modifier
OPCODE_save_vs_petrification_polymorph_mod35Stat: Save vs. Petrification/Polymorph Modifier
OPCODE_save_vs_breath_weapons_mod36Stat: Save vs. Breath Weapons Modifier
OPCODE_save_vs_spells_mod37Stat: Save vs. Spells Modifier
OPCODE_silence38State: Silence
OPCODE_unconsciousness39State: Unconsciousness
OPCODE_slow40State: Slow
OPCODE_sparkle41Graphics: Sparkle
OPCODE_wizard_spell_slots_mod42Spell: Wizard Spell Slots Modifier
OPCODE_cure_stone_to_flesh43Cure: Stone to Flesh
OPCODE_strength_mod44Stat: Strength Modifier
OPCODE_stun45State: Stun
OPCODE_cure_stun_unstun46Cure: Stun (Unstun)
OPCODE_cure_invisibility47Cure: Invisibility
OPCODE_cure_silence_vocalize48Cure: Silence (Vocalize)
OPCODE_wisdom_mod49Stat: Wisdom Modifier
OPCODE_colour_glow_by_rgb_brief50Colour: Glow by RGB (Brief)
OPCODE_colour_strong_dark_by_rgb51Colour: Strong/Dark by RGB
OPCODE_colour_very_bright_by_rgb52Colour: Very Bright by RGB
OPCODE_animation_change53Graphics: Animation Change
OPCODE_thac0_mod54Stat: THAC0 Modifier
OPCODE_death_kill_creature_type55Death: Kill Creature Type
OPCODE_alignment_invert56Alignment: Invert
OPCODE_alignment_change57Alignment: Change
OPCODE_cure_dispellable_effects_dispel_magic58Cure: Dispellable Effects (Dispel Magic)
OPCODE_stealth_mod59Stat: Stealth Modifier
OPCODE_miscast_magic60Stat: Miscast Magic
OPCODE_priest_spell_slots_mod62Spell: Priest Spell Slots Modifier
OPCODE_infravision63State: Infravision
OPCODE_remove_infravision64State: Remove Infravision
OPCODE_overlay_blur65Overlay: Blur
OPCODE_transparency_fade66Graphics: Transparency Fade
OPCODE_creature_summoning67Summon: Creature Summoning
OPCODE_unsummon_creature68Summon: Unsummon Creature
OPCODE_protection_from_detection_non_detection69Protection: From Detection (Non-Detection)
OPCODE_cure_non_detection70Cure: Non-Detection
OPCODE_ids_sex_change71IDS: Sex Change
OPCODE_ids_set_ids_state72IDS: Set IDS State
OPCODE_extra_damage_mod73Stat: Extra Damage Modifier
OPCODE_blindness74State: Blindness
OPCODE_cure_blindness75Cure: Blindness
OPCODE_feeblemindedness76State: Feeblemindedness
OPCODE_cure_feeblemindedness77Cure: Feeblemindedness
OPCODE_disease78State: Disease
OPCODE_cure_disease79Cure: Disease
OPCODE_deafness80State: Deafness
OPCODE_cure_deafness81Cure: Deafness
OPCODE_set_ai_script82Set AI Script
OPCODE_protection_from_projectile83Protection: From Projectile
OPCODE_magical_fire_resist_mod84Stat: Magical Fire Resistance Modifier
OPCODE_magical_cold_resist_mod85Stat: Magical Cold Resistance Modifier
OPCODE_slashing_resist_mod86Stat: Slashing Resistance Modifier
OPCODE_crushing_resist_mod87Stat: Crushing Resistance Modifier
OPCODE_piercing_resist_mod88Stat: Piercing Resistance Modifier
OPCODE_missiles_resist_mod89Stat: Missiles Resistance Modifier
OPCODE_open_locks_mod90Stat: Open Locks Modifier
OPCODE_find_traps_mod91Stat: Find Traps Modifier
OPCODE_pick_pockets_mod92Stat: Pick Pockets Modifier
OPCODE_fatigue_mod93Stat: Fatigue Modifier
OPCODE_drunkenness_mod94Stat: Drunkenness Modifier
OPCODE_tracking_skill_mod95Stat: Tracking Skill Modifier
OPCODE_level_change96Stat: Level Change
OPCODE_exceptional_strength_mod97Stat: Exceptional Strength Modifier
OPCODE_hp_regeneration98HP: Regeneration
OPCODE_duration_mod99Spell Effect: Duration Modifier
OPCODE_protection_from_creature_type100Protection: from Creature Type
OPCODE_protection_from_opcode101Protection: from Opcode
OPCODE_immunity_by_power_level102Spell: Immunity (by Power Level)
OPCODE_text_change_name103Text: Change Name
OPCODE_experience_points104Stat: Experience Points
OPCODE_gold105Stat: Gold
OPCODE_morale_break_mod106Stat: Morale Break Modifier
OPCODE_portrait_change107Portrait Change
OPCODE_reputation108Stat: Reputation
OPCODE_hold109State: Hold
OPCODE_create_magical_weapon111Item: Create Magical Weapon
OPCODE_remove_item112Item: Remove Item
OPCODE_dither114Graphics: Dither
OPCODE_detect_alignment115Detect: Alignment
OPCODE_cure_invisibility_2116State: Cure Invisibility
OPCODE_reveal_area117Spell Effect: Reveal Area
OPCODE_mirror_image119Spell Effect: Mirror Image
OPCODE_protection_from_weapons120Protection: from Weapons
OPCODE_create_inventory_item122Item: Create Inventory Item
OPCODE_remove_inventory_item123Item: Remove Inventory Item
OPCODE_teleport_dimension_door124Spell Effect: Teleport (Dimension Door)
OPCODE_unlock_knock125Spell Effect: Unlock (Knock)
OPCODE_movement_mod126Stat: Movement Modifier
OPCODE_monster_summoning127Summon: Monster Summoning
OPCODE_confusion128State: Confusion
OPCODE_aid129State: Aid
OPCODE_bless130State: Bless
OPCODE_positive_chant131State: Positive Chant
OPCODE_raise_strength_constitution_dexterity_non_cumulative132State: Raise Strength, Constitution, & Dexterity Non-Cumulative
OPCODE_luck_non_cumulative133Spell Effect: Luck Non-Cumulative
OPCODE_petrification134State: Petrification
OPCODE_polymorph_into_specific135Graphics: Polymorph into Specific
OPCODE_force_visible136State: Force Visible
OPCODE_negative_chant137State: Negative Chant
OPCODE_character_animation_change138Graphics: Character Animation Change
OPCODE_text_display_string139Text: Display String
OPCODE_casting_glow140Graphics: Casting Glow
OPCODE_lighting_effects141Graphics: Lighting Effects
OPCODE_display_special_effect_icon142Graphics: Display Special Effect Icon
OPCODE_create_item_in_slot143Item: Create Item in Slot
OPCODE_button_disable_button144Button: Disable Button
OPCODE_disable_spell_casting_abilities145Spell: Disable Spell Casting Abilities
OPCODE_cast_spell_at_creature146Spell: Cast Spell (at Creature)
OPCODE_learn_spell147Spell: Learn Spell
OPCODE_cast_spell_at_point148Spell: Cast Spell (at Point)
OPCODE_identify149(Identify)
OPCODE_find_traps150Spell Effect: Find Traps
OPCODE_replace_creature151Summon: Replace Creature
OPCODE_play_movie152Spell Effect: Play Movie
OPCODE_overlay_sanctuary153Overlay: Sanctuary
OPCODE_overlay_entangle154Overlay: Entangle
OPCODE_overlay_minor_globe155Overlay: Minor Globe
OPCODE_overlay_protection_from_normal_missiles_cylinder156Overlay: Protection from Normal Missiles Cylinder
OPCODE_web_effect157State: Web Effect
OPCODE_overlay_grease158Overlay: Grease
OPCODE_mirror_image_exact_number159Spell Effect: Mirror Image (Exact Number)
OPCODE_remove_sanctuary160Remove Sanctuary
OPCODE_cure_horror161Cure: Horror
OPCODE_cure_hold162Cure: Hold
OPCODE_protection_free_action163Protection: Free Action
OPCODE_cure_drunkeness164Cure: Drunkeness
OPCODE_pause_target165Spell Effect: Pause Target
OPCODE_magic_resist_mod166Stat: Magic Resistance Modifier
OPCODE_thac0_mod_with_missile_weapons167Stat: THAC0 Modifier with Missile Weapons
OPCODE_remove_creature168Summon: Remove Creature
OPCODE_prevent_special_effect_icon169Graphics: Prevent Special Effect Icon
OPCODE_play_damage_animation170Graphics: Play Damage Animation
OPCODE_give_ability171Spell: Give Ability
OPCODE_remove_spell172Spell: Remove Spell
OPCODE_poison_resist_mod173Stat: Poison Resistance Modifier
OPCODE_play_sound_effect174Spell Effect: Play Sound Effect
OPCODE_hold_graphic175State: Hold
OPCODE_movement_mod_ii176Stat: Movement Modifier (II)
OPCODE_use_eff_file177Use EFF File
OPCODE_thac0_vs_creature_type_mod178Spell Effect: THAC0 vs. Creature Type Modifier
OPCODE_damage_vs_creature_type_mod179Spell Effect: Damage vs. Creature Type Modifier
OPCODE_cant_use_item180Item: Can't Use Item
OPCODE_cant_use_itemtype181Item: Can't Use Itemtype
OPCODE_apply_effect_item182Item: Apply Effect Item
OPCODE_apply_effect_itemtype183Item: Apply Effect Itemtype
OPCODE_passwall_dont_jump184Graphics: Passwall (Don't Jump)
OPCODE_hold_ii185State: Hold (II)
OPCODE_script_movetoarea186Script: MoveToArea
OPCODE_script_store_local_variable187Script: Store Local Variable
OPCODE_aura_cleansing188Spell Effect: Aura Cleansing
OPCODE_casting_time_mod189Stat: Casting Time Modifier
OPCODE_attack_speed_factor190Stat: Attack Speed Factor
OPCODE_casting_level_mod191Spell: Casting Level Modifier
OPCODE_find_familiar192Spell Effect: Find Familiar
OPCODE_invisible_detection_by_script193Spell Effect: Invisible Detection by Script
OPCODE_ignore_dialog_pause194Ignore Dialog Pause
OPCODE_death_dependent_constitution_loss_familiar_bond195Spell Effect: Death Dependent Constitution Loss (Familiar Bond)
OPCODE_familiar_block196Spell Effect: Familiar Block
OPCODE_bounce_by_impact_projectile197Spell: Bounce (by Impact Projectile)
OPCODE_bounce_by_opcode198Spell: Bounce (by Opcode)
OPCODE_bounce_by_power_level199Spell: Bounce (by Power Level)
OPCODE_bounce_by_power_level_decrementing200Spell: Bounce (by Power level, decrementing)
OPCODE_immunity_by_power_level_decrementing201Spell: Immunity (by Power Level, decrementing)
OPCODE_bounce_by_school202Spell: Bounce (by School)
OPCODE_bounce_by_secondary_type203Spell: Bounce (by Secondary Type)
OPCODE_protection_by_school204Spell: Protection (by School)
OPCODE_protection_by_secondary_type205Spell: Protection (by Secondary Type)
OPCODE_protection_from_spell206Spell: Protection from Spell
OPCODE_bounce_by_resource207Spell: Bounce (by Resource)
OPCODE_hp_minimum_limit208HP: Minimum Limit
OPCODE_death_kill_60hp209Death: Kill 60HP
OPCODE_stun_90hp210Spell Effect: Stun 90HP
OPCODE_imprisonment211Spell Effect: Imprisonment
OPCODE_protection_freedom212Protection: Freedom
OPCODE_maze213Spell Effect: Maze
OPCODE_select_spell214Spell Effect: Select Spell
OPCODE_play_3d_effect215Graphics: Play 3D Effect
OPCODE_level_drain216Spell Effect: Level Drain
OPCODE_unconsciousness_20hp217Spell Effect: Unconsciousness 20HP
OPCODE_protection_stoneskin218Protection: Stoneskin
OPCODE_ac_vs_creature_type_mod219Stat: AC vs. Creature Type Modifier
OPCODE_remove_school220Removal: Remove School
OPCODE_remove_secondary_type221Removal: Remove Secondary Type
OPCODE_teleport_field222Spell Effect: Teleport Field
OPCODE_immunity_by_school_decrementing223Spell: Immunity (by School, decrementing)
OPCODE_cure_level_drain_restoration224Cure: Level Drain (Restoration)
OPCODE_reveal_magic225Spell: Reveal Magic
OPCODE_immunity_by_secondary_type_decrementing226Spell: Immunity (by Secondary Type, decrementing)
OPCODE_bounce_by_school_decrementing227Spell: Bounce (by School, decrementing)
OPCODE_bounce_by_secondary_type_decrementing228Spell: Bounce (by Secondary Type, decrementing)
OPCODE_remove_one_school229Removal: Remove One School
OPCODE_remove_one_secondary_type230Removal: Remove One Secondary Type
OPCODE_time_stop231Spell Effect: Time Stop
OPCODE_cast_spell_on_condition232Spell Effect: Cast Spell on Condition
OPCODE_proficiency_mod233Stat: Proficiency Modifier
OPCODE_contingency_creation234Spell Effect: Contingency Creation
OPCODE_wing_buffet235Spell Effect: Wing Buffet
OPCODE_image_projection236Spell Effect: Image Projection
OPCODE_puppet_id237Spell Effect: Puppet ID
OPCODE_death_disintegrate238Death: Disintegrate
OPCODE_farsight239Spell Effect: Farsight
OPCODE_remove_special_effect_icon240Graphics: Remove Special Effect Icon
OPCODE_charm_control_creature241Charm: Control Creature
OPCODE_cure_confusion242Cure: Confusion
OPCODE_drain_item_charges243Item: Drain Item Charges
OPCODE_drain_wizard_spell244Spell: Drain Wizard Spell
OPCODE_check_for_berserk245Check For Berserk
OPCODE_berserking_2246Spell Effect: Berserking
OPCODE_attack_nearest_creature247Spell Effect: Attack Nearest Creature
OPCODE_set_melee_effect248Item: Set Melee Effect
OPCODE_set_ranged_effect249Item: Set Ranged Effect
OPCODE_damage_mod250Spell Effect: Damage Modifier
OPCODE_change_bard_song_effect251Spell Effect: Change Bard Song Effect
OPCODE_set_trap252Spell Effect: Set Trap
OPCODE_add_map_marker253Spell Effect: Add Map Marker
OPCODE_remove_map_marker254Spell Effect: Remove Map Marker
OPCODE_create_inventory_item_days255Item: Create Inventory Item (days)
OPCODE_spell_sequencer_active256Spell: Spell Sequencer Active
OPCODE_spell_sequencer_creation257Spell: Spell Sequencer Creation
OPCODE_spell_sequencer_activation258Spell: Spell Sequencer Activation
OPCODE_protection_spell_trap_by_power_level_decrementing259Protection: Spell Trap (by Power Level, decrementing)
OPCODE_restore_lost_spells261Spell: Restore Lost Spells
OPCODE_visual_range262Stat: Visual Range
OPCODE_backstab263Stat: Backstab
OPCODE_drop_weapons_in_panic264Spell Effect: Drop Weapons in Panic
OPCODE_script_modify_global_variable265Script: Modify Global Variable
OPCODE_remove_protection_from_spell266Spell: Remove Protection from Spell
OPCODE_text_protection_from_display_specific_string267Text: Protection from Display Specific String
OPCODE_clear_fog_of_war_wizard_eye268Spell Effect: Clear Fog of War (Wizard Eye)
OPCODE_shake_window269Spell Effect: Shake Window
OPCODE_cure_unpause_target270Cure: Unpause Target
OPCODE_avatar_removal271Graphics: Avatar Removal
OPCODE_apply_repeating_eff272Spell: Apply Repeating EFF
OPCODE_remove_specific_area_effect_zone_of_sweet_air273Remove: Specific Area Effect(Zone of Sweet Air)
OPCODE_teleport_to_target274Spell Effect: Teleport to Target
OPCODE_hide_in_shadows_mod275Stat: Hide in Shadows Modifier
OPCODE_detect_illusion_mod276Stat: Detect Illusion Modifier
OPCODE_set_traps_mod277Stat: Set Traps Modifier
OPCODE_to_hit_mod278Stat: To Hit Modifier
OPCODE_button_enable_button279Button: Enable Button
OPCODE_wild_magic280Spell Effect: Wild Magic
OPCODE_wild_magic_2281Stat: Wild Magic
OPCODE_script_scripting_state_mod282Script: Scripting State Modifier
OPCODE_use_eff_file_cursed283Use EFF File (Cursed)
OPCODE_melee_thac0_mod284Stat: Melee THAC0 Modifier
OPCODE_melee_weapon_damage_mod285Stat: Melee Weapon Damage Modifier
OPCODE_missile_weapon_damage_mod286Stat: Missile Weapon Damage Modifier
OPCODE_selection_circle_removal287Graphics: Selection Circle Removal
OPCODE_fist_thac0_mod288Stat: Fist THAC0 Modifier
OPCODE_fist_damage_mod289Stat: Fist Damage Modifier
OPCODE_text_change_title290Text: Change Title
OPCODE_disable_visual_effect291Graphics: Disable Visual Effect
OPCODE_protection_backstab292Protection: Backstab
OPCODE_script_enable_offscreen_ai293Script: Enable Offscreen AI
OPCODE_existance_delay_override294Spell Effect: Existance Delay Override
OPCODE_disable_permanent_death295Graphics: Disable Permanent Death
OPCODE_protection_from_specific_animation296Graphics: Protection from Specific Animation
OPCODE_immunity_to_turn_undead297Spell Effect: Immunity to Turn Undead
OPCODE_execute_script_cut250a298Spell Effect: Execute Script cut250a
OPCODE_chaos_shield299Spell Effect: Chaos Shield
OPCODE_npcbump300Spell Effect: NPCBump
OPCODE_critical_hit_mod301Stat: Critical Hit Modifier
OPCODE_can_use_any_item302Item: Can Use Any Item
OPCODE_backstab_every_hit303Spell Effect: Backstab Every Hit
OPCODE_mass_raise_dead304Mass Raise Dead
OPCODE_thac0_mod_off_hand305Stat: THAC0 Modifier (Off-Hand)
OPCODE_thac0_mod_on_hand306Stat: THAC0 Modifier (On-Hand)
OPCODE_ranger_tracking_ability307Ranger Tracking Ability
OPCODE_protection_from_tracking308Protection: From Tracking
OPCODE_script_modify_local_variable309Script: Modify Local Variable
OPCODE_protection_from_timestop310Protection: from Timestop
OPCODE_random_wish_spell311Spell: Random Wish Spell
OPCODE_HLA_denotation313High-Level Ability Denotation
OPCODE_golem_stoneskin314Spell: Golem Stoneskin
OPCODE_animation_removal315Graphics: Animation Removal
OPCODE_magical_rest316Spell: Magical Rest
OPCODE_haste_2317State: Haste 2
OPCODE_set_stat_tobex318Stat: Set Stat (TobEx)

Opcode Ee

Source: misc/opcode_ee.tph

NameValue
OPCODE_immunity_to_spell_or_item_no_feedback318
OPCODE_restrict_item319
OPCODE_change_weather320
OPCODE_remove_effects_by_resource321
OPCODE_turn_undead_level323
OPCODE_immunity_to_spell_or_item_and_message324
OPCODE_all_saving_throws_bonus325
OPCODE_apply_effects_list326
OPCODE_show_visual_effect327
OPCODE_set_spell_state328
OPCODE_slow_poison329
OPCODE_floating_text330
OPCODE_summon_creatures_2331
OPCODE_attack_damage_type_bonus332
OPCODE_static_charge333
OPCODE_turn_undead334
OPCODE_seven_eyes335
OPCODE_seven_eyes_overlay336
OPCODE_remove_effects_by_opcode337
OPCODE_disable_rest_or_save338
OPCODE_alter_visual_animation_effect339
OPCODE_backstab_hit_effect340
OPCODE_critical_hit_effect341
OPCODE_override_creature_data342
OPCODE_hp_swap343
OPCODE_enchantment_vs_creature_type344
OPCODE_enchantment_bonus345
OPCODE_save_vs_school_bonus346
OPCODE_move_view_to_target347
OPCODE_change_background352 // PST:EE
OPCODE_tint_screen353 // PST:EE
OPCODE_flash_screen354 // PST:EE
OPCODE_soul_exodus355 // PST:EE
OPCODE_stop_all_actions356 // PST:EE
OPCODE_set_state357 // PST:EE
OPCODE_set_AI_script358 // PST:EE
OPCODE_Ignore_reputation_breaking_point360
OPCODE_cast_spell_on_critical_miss361
OPCODE_critical_miss_bonus362
OPCODE_modal_state_check363
OPCODE_make_unselectable365
OPCODE_apply_spell_on_movement366
OPCODE_minimum_base_stats367
OPCODE_play_BAM_file_single_or_dual369 // PST:EE
OPCODE_play_BAM_file370 // PST:EE
OPCODE_play_BAM_file_2371 // PST:EE
OPCODE_play_BAM_file_3372 // PST:EE
OPCODE_play_BAM_file_4373 // PST:EE
OPCODE_special_spell_hit374 // PST:EE
OPCODE_play_BAM_with_effects375 // PST:EE
OPCODE_detect_evil376 // PST:EE
OPCODE_prayer378 // PST:EE
OPCODE_curse379 // PST:EE
OPCODE_embalm380 // PST:EE
OPCODE_induce_hiccups381 // PST:EE
OPCODE_fist_of_iron382 // PST:EE
OPCODE_hit_point_transfer383 // PST:EE