Difference between revisions of "Weapon Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Dienes
(→‎SKSE Member Functions: GetCritMultiplier changed to return float instead of bool)
imported>CraftySentinel
(Reverted to List)
 
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]
'''Extends:''' [[Form Script]]
'''Extends:''' [[Form Script]]


Script for the manipulation of weapon base objects.
Script for the manipulation of weapon base objects.


== Definition ==
== Definition ==
Line 13: Line 8:
ScriptName Weapon extends Form
ScriptName Weapon extends Form
</source>
</source>


== Properties ==
== Properties ==
None
None


== Global Functions ==
== Global Functions ==
None
None


== Member Functions ==
== Member Functions ==


{|class="wikitable" width =100%
:'''[[Fire - Weapon|Fire]](ObjectReference ''akSource'')'''
!style="text-align:left;"|Function
:*Fires this weapon from the specified source object.
!style="text-align:left;"|Description
|-
|[[Fire - Weapon|'''Fire'''(ObjectReference ''akSource'')]]
|Fires this weapon from the specified source object.
|-


|}


== SKSE Member Functions ==
== SKSE Member Functions ==


{|class="wikitable" width =100%
:'''Int [[GetBaseDamage - Weapon|GetBaseDamage]]()'''
!style="text-align:left;"|Function
:*Returns the base damage of this weapon.
!style="text-align:left;"|Description
|-
|[[GetBaseDamage - Weapon|Int '''GetBaseDamage'''()]]
|Returns the base damage of this weapon.
|-


|[[SetBaseDamage - Weapon|'''SetBaseDamage'''(Int ''damage'')]]
:'''[[SetBaseDamage - Weapon|SetBaseDamage]](Int ''damage'')'''
|Changes the base damage of this weapon.
:*Changes the base damage of this weapon.
|-


|[[GetCritDamage - Weapon|Int '''GetCritDamage'''()]]
:'''Int [[GetCritDamage - Weapon|GetCritDamage]]()'''
|Returns the critical damage of this weapon.
:*Returns the critical damage of this weapon.
|-


|[[SetCritDamage - Weapon|'''SetCritDamage'''(Int ''damage'')]]
:'''[[SetCritDamage - Weapon|SetCritDamage]](Int ''damage'')'''
|Changes the critical damage of this weapon.
:*Changes the critical damage of this weapon.
|-


|[[GetReach - Weapon|Float '''GetReach'''()]]
:'''Float [[GetReach - Weapon|GetReach]]()'''
|Returns the reach of this weapon.
:*Returns the reach of this weapon.
|-


|[[SetReach - Weapon|'''SetReach'''(Float ''reach'')]]
:'''[[SetReach - Weapon|SetReach]](Float ''reach'')'''
|Changes the reach of this weapon.
:*Changes the reach of this weapon.
|-


|[[GetMinRange - Weapon|Float '''GetMinRange'''()]]
:'''Float [[GetMinRange - Weapon|GetMinRange]]()'''
|Returns the minimum range of this weapon.
:*Returns the minimum range of this weapon.
|-


|[[SetMinRange - Weapon|'''SetMinRange'''(Float ''minRange'')]]
:'''[[SetMinRange - Weapon|SetMinRange]](Float ''minRange'')'''
|Changes the minimum range of this weapon.
:*Changes the minimum range of this weapon.
|-


|[[GetMaxRange - Weapon|Float '''GetMaxRange'''()]]
:'''Float [[GetMaxRange - Weapon|GetMaxRange]]()'''
|Returns the maximum range of this weapon.
:*Returns the maximum range of this weapon.
|-


|[[SetMaxRange - Weapon|'''SetMaxRange'''(Float ''maxRange'')]]
:'''[[SetMaxRange - Weapon|SetMaxRange]](Float ''maxRange'')'''
|Changes the maximum range of this weapon.
:*Changes the maximum range of this weapon.
|-


|[[GetSpeed - Weapon|Float '''GetSpeed'''()]]
:'''Float [[GetSpeed - Weapon|GetSpeed]]()'''
|Returns the speed of this weapon.
:*Returns the speed of this weapon.
|-


|[[SetSpeed - Weapon|'''SetSpeed'''(Float ''speed'')]]
:'''[[SetSpeed - Weapon|SetSpeed]](Float ''speed'')'''
|Changes the speed of this weapon.
:*Changes the speed of this weapon.
|-


|[[GetStagger - Weapon|Float '''GetStagger'''()]]
:'''Float [[GetStagger - Weapon|GetStagger]]()'''
|Returns the stagger value of this weapon.
:*Returns the stagger value of this weapon.
|-


|[[SetStagger - Weapon|'''SetStagger'''(Float ''stagger'')]]
:'''[[SetStagger - Weapon|SetStagger]](Float ''stagger'')'''
|Changes the stagger value of this weapon.
:*Changes the stagger value of this weapon.
|-


|[[GetWeaponType - Weapon|Int '''GetWeaponType'''()]]
:'''Int [[GetWeaponType - Weapon|GetWeaponType]]()'''
|Returns the weapon type of this weapon.
:*Returns the weapon type of this weapon.
|-


|[[SetWeaponType - Weapon|'''SetWeaponType'''(Int ''type'')]]
:'''[[SetWeaponType - Weapon|SetWeaponType]](Int ''type'')'''
|Changes the weapon type of this weapon.
:*Changes the weapon type of this weapon.
|-


|[[GetModelPath - Weapon|String '''GetModelPath'''()]]
:'''String [[GetModelPath - Weapon|GetModelPath]]()'''
|Returns the path to the file representing the in-game model of this weapon.
:*Returns the path to the file representing the in-game model of this weapon.
|-


|[[SetModelPath - Weapon|'''SetModelPath'''(String ''path'')]]
:'''[[SetModelPath - Weapon|SetModelPath]](String ''path'')'''
|Changes the path to the file representing the in-game model of this weapon.
:*Changes the path to the file representing the in-game model of this weapon.
|-


|[[GetIconPath - Weapon|String '''GetIconPath'''()]]
:'''String [[GetIconPath - Weapon|GetIconPath]]()'''
|Returns the path to the file representing the icon of this weapon in the inventory.
:*Returns the path to the file representing the icon of this weapon in the inventory.
|-


|[[SetIconPath - Weapon|'''SetIconPath'''(String ''path'')]]
:'''[[SetIconPath - Weapon|SetIconPath]](String ''path'')'''
|Changes the path to the file representing the icon of this weapon in the inventory.
:*Changes the path to the file representing the icon of this weapon in the inventory.
|-


|[[GetMessageIconPath - Weapon|String '''GetMessageIconPath'''()]]
:'''String [[GetMessageIconPath - Weapon|GetMessageIconPath]]()'''
|Returns the path to the file representing the message icon for this weapon.
:*Returns the path to the file representing the message icon for this weapon.
|-


|[[SetMessageIconPath - Weapon|'''SetMessageIconPath'''(String ''path'')]]
:'''[[SetMessageIconPath - Weapon|SetMessageIconPath]](String ''path'')'''
|Changes the path to the file representing the message icon for this weapon.
:*Changes the path to the file representing the message icon for this weapon.
|-


|[[GetEnchantment - Weapon|Enchantment '''GetEnchantment'''()]]
:'''Enchantment [[GetEnchantment - Weapon|GetEnchantment]]()'''
|Returns the Enchantment associated with the weapon.
:*Returns the Enchantment associated with the weapon.
|-


|[[SetEnchantment - Weapon|'''SetEnchantment'''(Enchantment ''e'')]]
:'''[[SetEnchantment - Weapon|SetEnchantment]](Enchantment ''e'')'''
|Set the Enchantment associated with the weapon.
:*Set the Enchantment associated with the weapon.
|-


|[[GetEnchantmentValue - Weapon|Int '''GetEnchantmentValue'''()]]
:'''Int [[GetEnchantmentValue - Weapon|GetEnchantmentValue]]()'''
|Returns the Enchantment Value of the associated weapon
:*Returns the Enchantment Value of the associated weapon
|-


|[[SetEnchantmentValue - Weapon|'''SetEnchantmentValue'''(Int ''value'')]]
:'''[[SetEnchantmentValue - Weapon|SetEnchantmentValue]](Int ''value'')'''
|Set the Enchantment value associated with the weapon.
:*Set the Enchantment value associated with the weapon.
|-


|[[GetEquippedModel - Weapon|Static '''GetEquippedModel'''()]]
:'''Static [[GetEquippedModel - Weapon|GetEquippedModel]]()'''
|Returns the Equipped Model of the associated weapon.
:*Returns the Equipped Model of the associated weapon.
|-


|[[SetEquippedModel - Weapon|'''SetEquippedModel'''(Static ''model'')]]
:'''[[SetEquippedModel - Weapon|SetEquippedModel]](Static ''model'')'''
|Sets the Equipped Model of the associated weapon.
:*Sets the Equipped Model of the associated weapon.
|-


|[[GetEquipType - Weapon|EquipSlot '''GetEquipType'''()]]
:'''EquipSlot [[GetEquipType - Weapon|GetEquipType]]()'''
|Returns the EquipSlot type of the weapon.
:*Returns the EquipSlot type of the weapon.
|-


|[[SetEquipType - Weapon|'''SetEquipType'''(EquipSlot ''type'')]]
:'''[[SetEquipType - Weapon|SetEquipType]](EquipSlot ''type'')'''
|Sets the EquipSlot of the weapon.
:*Sets the EquipSlot of the weapon.
|-


|[[GetSkill - Weapon|String '''GetSkill'''()]]
:'''String [[GetSkill - Weapon|GetSkill]]()'''
|Returns the Skill associated with the weapon.
:*Returns the Skill associated with the weapon.
|-


|[[SetSkill - Weapon|'''SetSkill'''(String ''skill'')]]
:'''[[SetSkill - Weapon|SetSkill]](String ''skill'')'''
|Sets the Skill associated with the weapon.
:*Sets the Skill associated with the weapon.
|-


|[[GetResist - Weapon|String '''GetResist'''()]]
:'''String [[GetResist - Weapon|GetResist]]()'''
|Returns the Actor Value Name of the Resistance that affects the damage of the weapon.
:*Returns the Actor Value Name of the Resistance that affects the damage of the weapon.
|-


|[[SetResist - Weapon|'''SetResist'''(String ''resist'')]]
:'''[[SetResist - Weapon|SetResist]](String ''resist'')'''
|Sets the Resistance associated to the weapon.
:*Sets the Resistance associated to the weapon.
|-


|[[GetCritEffect - Weapon|Spell '''GetCritEffect'''()]]
:'''Spell [[GetCritEffect - Weapon|GetCritEffect]]()'''
|Returns the Crit Effect associated with the weapon.
:*Returns the Crit Effect associated with the weapon.
|-


|[[SetCritEffect - Weapon|'''SetCritEffect'''(Spell ''ce'')]]
:'''[[SetCritEffect - Weapon|SetCritEffect]](Spell ''ce'')'''
|Sets the Critical Effect of the weapon.
:*Sets the Critical Effect of the weapon.
|-


|[[GetCritEffectOnDeath - Weapon|Bool '''GetCritEffectOnDeath'''()]]
:'''Bool [[GetCritEffectOnDeath - Weapon|GetCritEffectOnDeath]]()'''
|Returns whether the Critical Effect associated with the weapon should only occur on death.
:*Returns whether the Critical Effect associated with the weapon should only occur on death.
|-


|[[SetCritEffectOnDeath - Weapon|'''SetCritEffectOnDeath'''(Bool ''ceod'')]]
:'''[[SetCritEffectOnDeath - Weapon|SetCritEffectOnDeath]](Bool ''ceod'')'''
|Sets or unsets, if the Critical Effect should only occur on death.
:*Sets or unsets, if the Critical Effect should only occur on death.
|-


|[[GetCritMultiplier - Weapon|Float '''GetCritMultiplier'''()]]
:'''Float [[GetCritMultiplier - Weapon|GetCritMultiplier]]()'''
|Returns the weapon's Crit Multiplier.
:*Returns the weapon's Crit Multiplier.
|-


|[[SetCritMultiplier - Weapon|'''SetCritMultiplier'''(Float ''crit'')]]
:'''[[SetCritMultiplier - Weapon|SetCritMultiplier]](Float ''crit'')'''
|Sets the Crit Multiplier of the weapon to the specified amount.
:*Sets the Crit Multiplier of the weapon to the specified amount.
|-


|[[IsBattleAxe - Weapon|Bool '''IsBattleAxe'''()]]
:'''Bool [[IsBattleAxe - Weapon|IsBattleAxe]]()'''
|Returns whether this weapon has the "WeapTypeBattleaxe" keyword.
:*Returns whether this weapon has the "WeapTypeBattleaxe" keyword.
|-


|[[IsBow - Weapon|Bool '''IsBow'''()]]
:'''Bool [[IsBow - Weapon|IsBow]]()'''
|Returns whether this weapon has the "WeapTypeBow" keyword.
:*Returns whether this weapon has the "WeapTypeBow" keyword.
|-


|[[IsDagger - Weapon|Bool '''IsDagger'''()]]
:'''Bool [[IsDagger - Weapon|IsDagger]]()'''
|Returns whether this weapon has the "WeapTypeDagger" keyword.
:*Returns whether this weapon has the "WeapTypeDagger" keyword.
|-


|[[IsGreatsword - Weapon|Bool '''IsGreatsword'''()]]
:'''Bool [[IsGreatsword - Weapon|IsGreatsword]]()'''
|Returns whether this weapon has the "WeapTypeGreatsword" keyword.
:*Returns whether this weapon has the "WeapTypeGreatsword" keyword.
|-


|[[IsMace - Weapon|Bool '''IsMace'''()]]
:'''Bool [[IsMace - Weapon|IsMace]]()'''
|Returns whether this weapon has the "WeapTypeMace" keyword.
:*Returns whether this weapon has the "WeapTypeMace" keyword.
|-


|[[IsStaff - Weapon|Bool '''IsStaff'''()]]
:'''Bool [[IsStaff - Weapon|IsStaff]]()'''
|Returns whether this weapon has the "WeapTypeStaff" keyword.
:*Returns whether this weapon has the "WeapTypeStaff" keyword.
|-


|[[IsSword - Weapon|Bool '''IsSword'''()]]
:'''Bool [[IsSword - Weapon|IsSword]]()'''
|Returns whether this weapon has the "WeapTypeSword" keyword.
:*Returns whether this weapon has the "WeapTypeSword" keyword.
|-


|[[IsWarhammer - Weapon|Bool '''IsWarhammer'''()]]
:'''Bool [[IsWarhammer - Weapon|IsWarhammer]]()'''
|Returns whether this weapon has the "WeapTypeWarhammer" keyword.
:*Returns whether this weapon has the "WeapTypeWarhammer" keyword.
|-


|[[IsWarAxe - Weapon|Bool '''IsWarAxe'''()]]
:'''Bool [[IsWarAxe - Weapon|IsWarAxe]]()'''
|Returns whether this weapon has the "WeapTypeWarAxe" keyword.
:*Returns whether this weapon has the "WeapTypeWarAxe" keyword.
|-


|}


== Events ==
== Events ==
None
None
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Script Objects]]
[[Category:SKSE]]
[[Category:SKSE Script Objects]]

Latest revision as of 22:43, 2 February 2014

Extends: Form Script

Script for the manipulation of weapon base objects.


Definition[edit | edit source]

ScriptName Weapon extends Form


Properties[edit | edit source]

None


Global Functions[edit | edit source]

None


Member Functions[edit | edit source]

Fire(ObjectReference akSource)
  • Fires this weapon from the specified source object.


SKSE Member Functions[edit | edit source]

Int GetBaseDamage()
  • Returns the base damage of this weapon.
SetBaseDamage(Int damage)
  • Changes the base damage of this weapon.
Int GetCritDamage()
  • Returns the critical damage of this weapon.
SetCritDamage(Int damage)
  • Changes the critical damage of this weapon.
Float GetReach()
  • Returns the reach of this weapon.
SetReach(Float reach)
  • Changes the reach of this weapon.
Float GetMinRange()
  • Returns the minimum range of this weapon.
SetMinRange(Float minRange)
  • Changes the minimum range of this weapon.
Float GetMaxRange()
  • Returns the maximum range of this weapon.
SetMaxRange(Float maxRange)
  • Changes the maximum range of this weapon.
Float GetSpeed()
  • Returns the speed of this weapon.
SetSpeed(Float speed)
  • Changes the speed of this weapon.
Float GetStagger()
  • Returns the stagger value of this weapon.
SetStagger(Float stagger)
  • Changes the stagger value of this weapon.
Int GetWeaponType()
  • Returns the weapon type of this weapon.
SetWeaponType(Int type)
  • Changes the weapon type of this weapon.
String GetModelPath()
  • Returns the path to the file representing the in-game model of this weapon.
SetModelPath(String path)
  • Changes the path to the file representing the in-game model of this weapon.
String GetIconPath()
  • Returns the path to the file representing the icon of this weapon in the inventory.
SetIconPath(String path)
  • Changes the path to the file representing the icon of this weapon in the inventory.
String GetMessageIconPath()
  • Returns the path to the file representing the message icon for this weapon.
SetMessageIconPath(String path)
  • Changes the path to the file representing the message icon for this weapon.
Enchantment GetEnchantment()
  • Returns the Enchantment associated with the weapon.
SetEnchantment(Enchantment e)
  • Set the Enchantment associated with the weapon.
Int GetEnchantmentValue()
  • Returns the Enchantment Value of the associated weapon
SetEnchantmentValue(Int value)
  • Set the Enchantment value associated with the weapon.
Static GetEquippedModel()
  • Returns the Equipped Model of the associated weapon.
SetEquippedModel(Static model)
  • Sets the Equipped Model of the associated weapon.
EquipSlot GetEquipType()
  • Returns the EquipSlot type of the weapon.
SetEquipType(EquipSlot type)
  • Sets the EquipSlot of the weapon.
String GetSkill()
  • Returns the Skill associated with the weapon.
SetSkill(String skill)
  • Sets the Skill associated with the weapon.
String GetResist()
  • Returns the Actor Value Name of the Resistance that affects the damage of the weapon.
SetResist(String resist)
  • Sets the Resistance associated to the weapon.
Spell GetCritEffect()
  • Returns the Crit Effect associated with the weapon.
SetCritEffect(Spell ce)
  • Sets the Critical Effect of the weapon.
Bool GetCritEffectOnDeath()
  • Returns whether the Critical Effect associated with the weapon should only occur on death.
SetCritEffectOnDeath(Bool ceod)
  • Sets or unsets, if the Critical Effect should only occur on death.
Float GetCritMultiplier()
  • Returns the weapon's Crit Multiplier.
SetCritMultiplier(Float crit)
  • Sets the Crit Multiplier of the weapon to the specified amount.
Bool IsBattleAxe()
  • Returns whether this weapon has the "WeapTypeBattleaxe" keyword.
Bool IsBow()
  • Returns whether this weapon has the "WeapTypeBow" keyword.
Bool IsDagger()
  • Returns whether this weapon has the "WeapTypeDagger" keyword.
Bool IsGreatsword()
  • Returns whether this weapon has the "WeapTypeGreatsword" keyword.
Bool IsMace()
  • Returns whether this weapon has the "WeapTypeMace" keyword.
Bool IsStaff()
  • Returns whether this weapon has the "WeapTypeStaff" keyword.
Bool IsSword()
  • Returns whether this weapon has the "WeapTypeSword" keyword.
Bool IsWarhammer()
  • Returns whether this weapon has the "WeapTypeWarhammer" keyword.
Bool IsWarAxe()
  • Returns whether this weapon has the "WeapTypeWarAxe" keyword.


Events[edit | edit source]

None