script went on a diet

Post » Tue Dec 29, 2009 6:59 pm

gonna post it here, someone see where I went wrong?

the function, each metal type has its own function, this is just a sample one.

fucntionCountDaedric
fucntionCountDwarven
fucntionCountEbony
fucntionCountElven
fucntionCountGlass
fucntionCountIron
fucntionCountSilver
fucntionCountSteel

Spoiler

scn fucntionCountEbony

ref CNTRef
short cNewEbony

begin Function {}

;this is your code you copypasted here

;Added by OOO
set cNewEbony to cNewEbony + (CNTRef.GetItemCount EbonyCuirassQV * 20)


;Vanilla
set cNewEbony to cNewEbony + (CNTRef.GetItemCount EbonyHelmet * 6)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount EbonyGauntlets * 6)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount EbonyBoots * 9)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount EbonyGreaves * 18)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount EbonyCuirass * 30)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount EbonyShield * 12)

;weapons added by OOO
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyScimitarOOO * 20)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyCutlassOOO * 20)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount AAAGleveEbenOOO * 22)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount rdeb2hmaceOOO * 30)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapAyleidEbonyBowOOO * 8)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapAyleidEbonyWarBowOOO * 12)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapAyleidEbonyLongBowOOO * 10)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyClaymoreVolmyrep * 22)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount AAAGleveEbenOOO * 22)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount AAAHeleEbenOOO * 12)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount AAASenseEbenOOO * 10)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount AAAStockEbenOOO * 7)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount AAAStockEbenDornenOOO * 10)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapSeverianEbonyKatana * 22)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapSeverianEbonyDaikatana * 25)

;vanilla
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyDagger * 3)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyShortsword * 8)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyLongsword * 20)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyClaymore * 22)

set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyWarAxe * 12)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyMace * 15)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyBattleAxe * 27)
set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyWarhammer * 30)

set cNewEbony to cNewEbony + (CNTRef.GetItemCount WeapEbonyBow * 8)




;then you return the result to the "mother script"
setfunctionvalue cNewEbony

end



the one that calls the function
Spoiler

scn HaroKArrowForgeQSTScript

float fQuestDelayTime

ref CNTRef

short Armorer

short cNewIron
short cNewSteel
short cNewSilver
short cNewDwarven
short cNewElven
short cNewGlass
short cNewEbony
short cNewDaedric
short cNew

short DoOnce
short Crafting

begin GameMode

set fQuestDelayTime to 0.001

if (DoOnce == 0)
StopQuest HaroKArrowForgeQST
return
endif
set DoOnce to 0

;Message "Start Fletching..."

set Crafting to 1
set CNTRef to HaroKArrowForgeCNT

SetQuestObject HaroKArrowForge 1

Set Armorer to Player.GetActorValue Armorer

;--------------------Count Arrows--------------------

set HaroKArrowForgeQST2.cIron to CNTRef.GetItemCount Arrow1Iron
set HaroKArrowForgeQST2.cIronLight to CNTRef.GetItemCount EncArrow1IronLight
set HaroKArrowForgeQST2.cIronFire to CNTRef.GetItemCount EncArrow1IronFireDamage
set HaroKArrowForgeQST2.cIronFrost to CNTRef.GetItemCount EncArrow1IronFrostDamage
set HaroKArrowForgeQST2.cIronShock to CNTRef.GetItemCount EncArrow1IronShockDamage
set HaroKArrowForgeQST2.cIronDemCrt to CNTRef.GetItemCount EncArrow1IronDemCreature
set HaroKArrowForgeQST2.cIronDemHum to CNTRef.GetItemCount EncArrow1IronDemHuman

set HaroKArrowForgeQST2.cSteel to CNTRef.GetItemCount Arrow2Steel
set HaroKArrowForgeQST2.cSteelFire to CNTRef.GetItemCount EncArrow2SteelFireDamage
set HaroKArrowForgeQST2.cSteelFrost to CNTRef.GetItemCount EncArrow2SteelFrostDamage
set HaroKArrowForgeQST2.cSteelShock to CNTRef.GetItemCount EncArrow2SteelShockDamage
set HaroKArrowForgeQST2.cSteelFireLight to CNTRef.GetItemCount EncArrow2SteelFireDamageLight
set HaroKArrowForgeQST2.cSteelDamFtg to CNTRef.GetItemCount EncArrow2SteelDamFatigue
set HaroKArrowForgeQST2.cSteelDemCrt to CNTRef.GetItemCount EncArrow2SteelDemCreature
set HaroKArrowForgeQST2.cSteelDemHum to CNTRef.GetItemCount EncArrow2SteelDemHuman
set HaroKArrowForgeQST2.cSteelFrenzyArea to CNTRef.GetItemCount EncArrow2SteelFrenzyArea

set HaroKArrowForgeQST2.cSilver to CNTRef.GetItemCount Arrow3Silver
set HaroKArrowForgeQST2.cSilverDamMag to CNTRef.GetItemCount EncArrow3SilverDamageMagic
set HaroKArrowForgeQST2.cSilverDispel to CNTRef.GetItemCount EncArrow3SilverDispel
set HaroKArrowForgeQST2.cSilverDrainMag to CNTRef.GetItemCount EncArrow3SilverDrainMagic
set HaroKArrowForgeQST2.cSilverWithering to CNTRef.GetItemCount EncArrow3SilverWithering
set HaroKArrowForgeQST2.cSilverFireArea to CNTRef.GetItemCount EncArrow3SilverFireArea

set HaroKArrowForgeQST2.cDwarven to CNTRef.GetItemCount Arrow4Dwarven
set HaroKArrowForgeQST2.cDwarvenFire to CNTRef.GetItemCount EncArrow4DwarvenFireDamage
set HaroKArrowForgeQST2.cDwarvenFrost to CNTRef.GetItemCount EncArrow4DwarvenFrostDamage
set HaroKArrowForgeQST2.cDwarvenShock to CNTRef.GetItemCount EncArrow4DwarvenShockDamage
set HaroKArrowForgeQST2.cDwarvenFireLight to CNTRef.GetItemCount EncArrow4DwarvenFireDamageLight
set HaroKArrowForgeQST2.cDwarvenSilence to CNTRef.GetItemCount EncArrow4DwarvenSilence
set HaroKArrowForgeQST2.cDwarvenFrostArea to CNTRef.GetItemCount EncArrow4DwarvenFrostArea

set HaroKArrowForgeQST2.cElven to CNTRef.GetItemCount Arrow5Elven
set HaroKArrowForgeQST2.cElvenFire to CNTRef.GetItemCount EncArrow5ElvenFireDamage
set HaroKArrowForgeQST2.cElvenFrost to CNTRef.GetItemCount EncArrow5ElvenFrostDamage
set HaroKArrowForgeQST2.cElvenShock to CNTRef.GetItemCount EncArrow5ElvenShockDamage
set HaroKArrowForgeQST2.cElvenFireLight to CNTRef.GetItemCount EncArrow5ElvenFireDamageLight
set HaroKArrowForgeQST2.cElvenSilence to CNTRef.GetItemCount EncArrow5ElvenSilence
set HaroKArrowForgeQST2.cElvenShockArea to CNTRef.GetItemCount EncArrow5ElvenShockArea
set HaroKArrowForgeQST2.cElvenFrostArea to CNTRef.GetItemCount EncArrow5ElvenFrostArea
set HaroKArrowForgeQST2.cElvenDamHeal to CNTRef.GetItemCount EncArrow5ElvenDamHealth

set HaroKArrowForgeQST2.cGlass to CNTRef.GetItemCount Arrow6Glass
set HaroKArrowForgeQST2.cGlassFire to CNTRef.GetItemCount EncArrow6GlassFireDamage
set HaroKArrowForgeQST2.cGlassFrost to CNTRef.GetItemCount EncArrow6GlassFrostDamage
set HaroKArrowForgeQST2.cGlassShock to CNTRef.GetItemCount EncArrow6GlassShockDamage
set HaroKArrowForgeQST2.cGlassFireLight to CNTRef.GetItemCount EncArrow6GlassFireDamageLight
set HaroKArrowForgeQST2.cGlassFireArea to CNTRef.GetItemCount EncArrow6GlassFireArea
set HaroKArrowForgeQST2.cGlassDamMag to CNTRef.GetItemCount EncArrow6GlassDamageMagicka

set HaroKArrowForgeQST2.cEbony to CNTRef.GetItemCount Arrow7Ebony
set HaroKArrowForgeQST2.cEbonyFire to CNTRef.GetItemCount EncArrow7EbonyFireDamage
set HaroKArrowForgeQST2.cEbonyFrost to CNTRef.GetItemCount EncArrow7EbonyFrostDamage
set HaroKArrowForgeQST2.cEbonyShock to CNTRef.GetItemCount EncArrow7EbonyShockDamage
set HaroKArrowForgeQST2.cEbonyShockArea to CNTRef.GetItemCount EncArrow7EbonyShockArea

set HaroKArrowForgeQST2.cDaedric to CNTRef.GetItemCount Arrow8Daedric
set HaroKArrowForgeQST2.cDaedricFire to CNTRef.GetItemCount EncArrow8DaedricFireDamage
set HaroKArrowForgeQST2.cDaedricFrost to CNTRef.GetItemCount EncArrow8DaedricFrostDamage
set HaroKArrowForgeQST2.cDaedricShock to CNTRef.GetItemCount EncArrow8DaedricShockDamage
set HaroKArrowForgeQST2.cDaedricSilenceArea to CNTRef.GetItemCount EncArrow8DaedricSilenceArea
set HaroKArrowForgeQST2.cDaedricSoulTrap to CNTRef.GetItemCount EncArrowHatredsSoulTrap

;-----Upgrade Dremora Arrows
set HaroKArrowForgeQST2.cDaedric to HaroKArrowForgeQST2.cDaedric + CNTRef.GetItemCount DremoraArrow1Field
set HaroKArrowForgeQST2.cDaedric to HaroKArrowForgeQST2.cDaedric + CNTRef.GetItemCount DremoraArrow2Broadhead
set HaroKArrowForgeQST2.cDaedric to HaroKArrowForgeQST2.cDaedric + CNTRef.GetItemCount DremoraArrow3Barbed




;--------------------Iron Arrows--------------------

set cNewIron to CNTRef.call fucntionCountIron

;--------------------Steel Arrows--------------------

set cNewSteel to CNTRef.call fucntionCountSteel

;--------------------Silver Arrows--------------------

set cNewSilver to CNTRef.call fucntionCountSilver

;--------------------Dwarven Arrows--------------------

set cNewDwarven to CNTRef.call fucntionCountDwarven

;--------------------Elven Arrows--------------------

set cNewElven to CNTRef.call fucntionCountElven


;--------------------Glass Arrows--------------------

set cNewGlass to fucntionCountGlass

;--------------------Ebony Arrows--------------------

set cNewEbony to fucntionCountEbony

;--------------------Daedric Arrows--------------------

set cNewDaedric to fucntionCountDaedric

;--------------------Armorer Skill Modify--------------------

if (Armorer < 25)

;-----Novice-----
set cNewIron to cNewIron * 1
set cNewSteel to cNewSteel * 1
set cNewSilver to cNewSilver * 0.75
set cNewDwarven to cNewDwarven * 0.75
set cNewElven to cNewElven * 0.5
set cNewGlass to cNewGlass * 0.25
set cNewEbony to cNewEbony * 0.25
set cNewDaedric to cNewDaedric * 0

elseif (Armorer < 50)

;-----Apprentice-----
set cNewIron to cNewIron * 1.25
set cNewSteel to cNewSteel * 1.25
set cNewSilver to cNewSilver * 1
set cNewDwarven to cNewDwarven * 1
set cNewElven to cNewElven * 0.75
set cNewGlass to cNewGlass * 0.5
set cNewEbony to cNewEbony * 0.5
set cNewDaedric to cNewDaedric * 0.25

elseif (Armorer < 75)

;-----Journeyman-----
set cNewIron to cNewIron * 1.5
set cNewSteel to cNewSteel * 1.5
set cNewSilver to cNewSilver * 1.25
set cNewDwarven to cNewDwarven * 1.25
set cNewElven to cNewElven * 1
set cNewGlass to cNewGlass * 0.75
set cNewEbony to cNewEbony * 0.75
set cNewDaedric to cNewDaedric * 0.5

elseif (Armorer < 100)

;-----Expert-----
set cNewIron to cNewIron * 1.75
set cNewSteel to cNewSteel * 1.75
set cNewSilver to cNewSilver * 1.5
set cNewDwarven to cNewDwarven * 1.5
set cNewElven to cNewElven * 1.5
set cNewGlass to cNewGlass * 1.25
set cNewEbony to cNewEbony * 1.25
set cNewDaedric to cNewDaedric * 1

else

;-----Master-----
set cNewIron to cNewIron * 2
set cNewSteel to cNewSteel * 2
set cNewSilver to cNewSilver * 2
set cNewDwarven to cNewDwarven * 2
set cNewElven to cNewElven * 2
set cNewGlass to cNewGlass * 2
set cNewEbony to cNewEbony * 2
set cNewDaedric to cNewDaedric * 2

endif

;------------------------------------------------------------

set HaroKArrowForgeQST2.cIron to HaroKArrowForgeQST2.cIron + cNewIron
set HaroKArrowForgeQST2.cSteel to HaroKArrowForgeQST2.cSteel + cNewSteel
set HaroKArrowForgeQST2.cSilver to HaroKArrowForgeQST2.cSilver + cNewSilver
set HaroKArrowForgeQST2.cDwarven to HaroKArrowForgeQST2.cDwarven + cNewDwarven
set HaroKArrowForgeQST2.cElven to HaroKArrowForgeQST2.cElven + cNewElven
set HaroKArrowForgeQST2.cGlass to HaroKArrowForgeQST2.cGlass + cNewGlass
set HaroKArrowForgeQST2.cEbony to HaroKArrowForgeQST2.cEbony + cNewEbony
set HaroKArrowForgeQST2.cDaedric to HaroKArrowForgeQST2.cDaedric + cNewDaedric
set cNew to (cNewIron + cNewSteel + cNewSilver + cNewDwarven + cNewElven + cNewGlass + cNewEbony + cNewDaedric)

Set HaroKArrowForgeQST2.DoOnce to 1
StartQuest HaroKArrowForgeQST2
StopQuest HaroKArrowForgeQST
end


which is called by

Spoiler


scn HaroKArrowForgeScript

short Selected

short num

begin OnAdd
if (HaroKArrowForgeGot == 0)
Set HaroKArrowForgeGot to 1
MessageBox "You've got the Arrow Forge. You can now recycle most any non-magical equipments and reforge them into arrows. Remember that nothing but arrows will left when the reaction stoped! Don't put anything important in the Forge! To enchant arrows, put ingredients with proper Effect in Forge with them. Make sure the Effect is powerful enough to meet the requirement. You can increase the Effect by drop multiple ingredients. Get your Armorer and Alchemy skills higher to help you out."
endif
end

begin OnEquip
if (HaroKArrowForgeQST.Crafting == 0)
SetQuestObject HaroKArrowForge 1
HaroKArrowForgeCNT.Activate player 1
set Selected to 1
;Message "The forging will start as soon as you close the inventory. EVERYTHING in the Forge will be lost when the work is finished."
set HaroKArrowForgeQST.DoOnce to 1
StartQuest HaroKArrowForgeQST
else
Message "The Forge is too hot. You can barely touch it."
endif
end

begin MenuMode 1002
if (Selected == 1)
set Selected to 0
SetQuestObject HaroKArrowForge 0
endif
end



third part

Spoiler

scn HaroKArrowForgeQST2Script

float fQuestDelayTime

ref CNTRef

short Alchemy

short cIron
short cSteel
short cSilver
short cDwarven
short cElven
short cGlass
short cEbony
short cDaedric

short cIronLight
short cIronFire
short cIronFrost
short cIronShock
short cIronDemCrt
short cIronDemHum

short cSteelFire
short cSteelFrost
short cSteelShock
short cSteelFireLight
short cSteelDamFtg
short cSteelDemCrt
short cSteelDemHum
short cSteelFrenzyArea

short cSilverDamMag
short cSilverDispel
short cSilverDrainMag
short cSilverWithering
short cSilverFireArea

short cDwarvenFire
short cDwarvenFrost
short cDwarvenShock
short cDwarvenFireLight
short cDwarvenSilence
short cDwarvenFrostArea

short cElvenFire
short cElvenFrost
short cElvenShock
short cElvenFireLight
short cElvenSilence
short cElvenShockArea
short cElvenFrostArea
short cElvenDamHeal

short cGlassFire
short cGlassFrost
short cGlassShock
short cGlassFireLight
short cGlassFireArea
short cGlassDamMag

short cEbonyFire
short cEbonyFrost
short cEbonyShock
short cEbonyShockArea

short cDaedricFire
short cDaedricFrost
short cDaedricShock
short cDaedricSilenceArea
short cDaedricSoulTrap

short cEnchant

short Fire
short Frost
short Shock
short FireArea
short FrostArea
short ShockArea
short Light
short DamHeal
short DamMag
short DamFtg
short DamAtt
short DrainMag
short Dispel
short Silence

short TotalFire
short TotalFrost
short TotalShock
short TotalFireArea
short TotalFrostArea
short TotalShockArea
short TotalLight
short TotalDamHeal
short TotalDamMag
short TotalDamFtg
short TotalDamAtt
short TotalDrainMag
short TotalDispel
short TotalSilence

short num
short num2

short multi1
short multi2
short multi3
short multi4

short DoOnce

begin GameMode

set fQuestDelayTime to 0.001

if (DoOnce == 0)
StopQuest HaroKArrowForgeQST2
return
endif
set DoOnce to 0

;Message "Start Enchanting..."

set CNTRef to HaroKArrowForgeCNT

SetQuestObject HaroKArrowForge 1

Set Alchemy to Player.GetActorValue Alchemy

if (Alchemy < 25)
set multi1 to 15
set multi2 to 0
set multi3 to 0
set multi4 to 0
elseif (Alchemy < 50)
set multi1 to 20
set multi2 to 30
set multi3 to 0
set multi4 to 0
elseif (Alchemy < 75)
set multi1 to 25
set multi2 to 40
set multi3 to 60
set multi4 to 0
elseif (Alchemy < 100)
set multi1 to 30
set multi2 to 50
set multi3 to 70
set multi4 to 90
else
set multi1 to 45
set multi2 to 75
set multi3 to 105
set multi4 to 135
endif

set TotalFire to 0
set TotalFrost to 0
set TotalShock to 0
set TotalFireArea to 0
set TotalFrostArea to 0
set TotalShockArea to 0
set TotalLight to 0
set TotalDamHeal to 0
set TotalDamMag to 0
set TotalDamFtg to 0
set TotalDamAtt to 0
set TotalDrainMag to 0
set TotalDispel to 0
set TotalSilence to 0

;--------------------Level 1 Effect--------------------

if (Alchemy >= 1)

set Fire to 0
set Frost to 0
set Shock to 0
set FireArea to 0
set FrostArea to 0
set ShockArea to 0
set Light to 0
set DamHeal to 0
set DamMag to 0
set DamFtg to 0
set DamAtt to 0
set DrainMag to 0
set Dispel to 0
set Silence to 0

;-----Damage Attribute (damage at least 2 attributes)

;-----Damage Fatigue
set DamFtg to DamFtg + CNTRef.GetItemCount MortFlesh
set DamFtg to DamFtg + CNTRef.GetItemCount Ratmeat
set DamFtg to DamFtg + CNTRef.GetItemCount Bonemeal
set DamFtg to DamFtg + CNTRef.GetItemCount MG01Bonemeal
set DamFtg to DamFtg + CNTRef.GetItemCount DreughWax

;-----Damage Health
set DamHeal to DamHeal + CNTRef.GetItemCount Nightshade
set DamHeal to DamHeal + CNTRef.GetItemCount WispStalkCaps
set DamHeal to DamHeal + CNTRef.GetItemCount Harrada
set DamHeal to DamHeal + CNTRef.GetItemCount SpiddalStick
set DamHeal to DamHeal + CNTRef.GetItemCount StinkhornCap
set DamHeal to DamHeal + CNTRef.GetItemCount FG0xxxImpFluid

;-----Damage Magicka
set DamMag to DamMag + CNTRef.GetItemCount DarkHumanSkin
set DamMag to DamMag + CNTRef.GetItemCount ScampSkin

;-----Dispel

;-----Fire Damage
set Fire to Fire + CNTRef.GetItemCount FireSalts

;-----Frost Damage
set Frost to Frost + CNTRef.GetItemCount FrostSalts

;-----Shock Damage
set Shock to Shock + CNTRef.GetItemCount Ectoplasm

;-----Fire Area (Fire Shield)

;-----Frost Area (Frost Shield)

;-----Shock Area (Shock Shield)

;-----Drain Magicka (Damage Intelligence)
set DrainMag to DrainMag + CNTRef.GetItemCount OgresTeeth

;-----Light
set Light to Light + CNTRef.GetItemCount MilkThistleSeeds

;-----Silence
set Silence to Silence + CNTRef.GetItemCount MG13VampireDust
set Silence to Silence + CNTRef.GetItemCount VampireDust

;---------------

set TotalFire to TotalFire + Fire * multi1
set TotalFrost to TotalFrost + Frost * multi1
set TotalShock to TotalShock + Shock * multi1
set TotalFireArea to TotalFireArea + FireArea * multi1
set TotalFrostArea to TotalFrostArea + FrostArea * multi1
set TotalShockArea to TotalShockArea + ShockArea * multi1
set TotalLight to TotalLight + Light * multi1
set TotalDamHeal to TotalDamHeal + DamHeal * multi1
set TotalDamMag to TotalDamMag + DamMag * multi1
set TotalDamFtg to TotalDamFtg + DamFtg * multi1
set TotalDamAtt to TotalDamAtt + DamAtt * multi1
set TotalDrainMag to TotalDrainMag + DrainMag * multi1
set TotalDispel to TotalDispel + Dispel * multi1
set TotalSilence to TotalSilence + Silence * multi1

endif

;--------------------Level 2 Effect--------------------

if (Alchemy >= 25)

set Fire to 0
set Frost to 0
set Shock to 0
set FireArea to 0
set FrostArea to 0
set ShockArea to 0
set Light to 0
set DamHeal to 0
set DamMag to 0
set DamFtg to 0
set DamAtt to 0
set DrainMag to 0
set Dispel to 0
set Silence to 0

;-----Damage Attribute

;-----Damage Fatigue
set DamFtg to DamFtg + CNTRef.GetItemCount WaterHyacinthNectar
set DamFtg to DamFtg + CNTRef.GetItemCount Mutton
set DamFtg to DamFtg + CNTRef.GetItemCount MotherwortSprig

;-----Damage Health
set DamHeal to DamHeal + CNTRef.GetItemCount DragonsTongue
set DamHeal to DamHeal + CNTRef.GetItemCount SacredLotusSeeds
set DamHeal to DamHeal + CNTRef.GetItemCount StJohnsWortNectar
set DamHeal to DamHeal + CNTRef.GetItemCount PeonySeeds
set DamHeal to DamHeal + CNTRef.GetItemCount VoidSalts

;-----Damage Magicka
set DamMag to DamMag + CNTRef.GetItemCount Harrada
set DamMag to DamMag + CNTRef.GetItemCount SpiddalStick
set DamMag to DamMag + CNTRef.GetItemCount WheatGrain

;-----Dispel
set Dispel to Dispel + CNTRef.GetItemCount BergamotSeeds
set Dispel to Dispel + CNTRef.GetItemCount Ectoplasm

;-----Fire Damage
set Fire to Fire + CNTRef.GetItemCount SteelBlueEntolomaCap

;-----Frost Damage
set Frost to Frost + CNTRef.GetItemCount MilkThistleSeeds

;-----Shock Damage

;-----Fire Area

;-----Frost Area
set FrostArea to FrostArea + CNTRef.GetItemCount DaedrothTeeth

;-----Shock Area
set ShockArea to ShockArea + CNTRef.GetItemCount DaedraHeart
set ShockArea to ShockArea + CNTRef.GetItemCount DarkHumanheart
set ShockArea to ShockArea + CNTRef.GetItemCount HumanHeart

;-----Drain Magicka (Damage Intelligence)
set DrainMag to DrainMag + CNTRef.GetItemCount CairnBoleteCap
set DrainMag to DrainMag + CNTRef.GetItemCount FennelSeeds
set DrainMag to DrainMag + CNTRef.GetItemCount MonkshoodRootPulp

;-----Light
set Light to Light + CNTRef.GetItemCount GlowDust

;-----Silence
set Silence to Silence + CNTRef.GetItemCount Rice

;---------------

set TotalFire to TotalFire + Fire * multi2
set TotalFrost to TotalFrost + Frost * multi2
set TotalShock to TotalShock + Shock * multi2
set TotalFireArea to TotalFireArea + FireArea * multi2
set TotalFrostArea to TotalFrostArea + FrostArea * multi2
set TotalShockArea to TotalShockArea + ShockArea * multi2
set TotalLight to TotalLight + Light * multi2
set TotalDamHeal to TotalDamHeal + DamHeal * multi2
set TotalDamMag to TotalDamMag + DamMag * multi2
set TotalDamFtg to TotalDamFtg + DamFtg * multi2
set TotalDamAtt to TotalDamAtt + DamAtt * multi2
set TotalDrainMag to TotalDrainMag + DrainMag * multi2
set TotalDispel to TotalDispel + Dispel * multi2
set TotalSilence to TotalSilence + Silence * multi2

endif

;--------------------Level 3 Effect--------------------

if (Alchemy >= 50)

set Fire to 0
set Frost to 0
set Shock to 0
set FireArea to 0
set FrostArea to 0
set ShockArea to 0
set Light to 0
set DamHeal to 0
set DamMag to 0
set DamFtg to 0
set DamAtt to 0
set DrainMag to 0
set Dispel to 0
set Silence to 0

;-----Damage Attribute
set DamAtt to DamAtt + CNTRef.GetItemCount WispStalkCaps
set DamAtt to DamAtt + CNTRef.GetItemCount Pumpkin
set DamAtt to DamAtt + CNTRef.GetItemCount TrollFat

;-----Damage Fatigue
set DamFtg to DamFtg + CNTRef.GetItemCount GreenStainShelfCap
set DamFtg to DamFtg + CNTRef.GetItemCount IronwoodNut
set DamFtg to DamFtg + CNTRef.GetItemCount LadysSmockLeaves
set DamFtg to DamFtg + CNTRef.GetItemCount CrabMeat

;-----Damage Health
set DamHeal to DamHeal + CNTRef.GetItemCount ImpGall
set DamHeal to DamHeal + CNTRef.GetItemCount RedwortFlower
set DamHeal to DamHeal + CNTRef.GetItemCount Strawberry
set DamHeal to DamHeal + CNTRef.GetItemCount Venison
set DamHeal to DamHeal + CNTRef.GetItemCount WormwoodLeaves
set DamHeal to DamHeal + CNTRef.GetItemCount DaedraVenin
set DamHeal to DamHeal + CNTRef.GetItemCount Scales

;-----Damage Magicka
set DamMag to DamMag + CNTRef.GetItemCount FennelSeeds
set DamMag to DamMag + CNTRef.GetItemCount Ratmeat
set DamMag to DamMag + CNTRef.GetItemCount BergamotSeeds
set DamMag to DamMag + CNTRef.GetItemCount Tobacco
set DamMag to DamMag + CNTRef.GetItemCount AloeVeraLeaves
set DamMag to DamMag + CNTRef.GetItemCount Ham
set DamMag to DamMag + CNTRef.GetItemCount DaedraHeart
set DamMag to DamMag + CNTRef.GetItemCount DarkHumanheart
set DamMag to DamMag + CNTRef.GetItemCount HumanHeart

;-----Dispel
set Dispel to Dispel + CNTRef.GetItemCount Mutton
set Dispel to Dispel + CNTRef.GetItemCount Graqes

;-----Fire Damage
set Fire to Fire + CNTRef.GetItemCount SpiddalStick

;-----Frost Damage
set Frost to Frost + CNTRef.GetItemCount MG13VampireDust
set Frost to Frost + CNTRef.GetItemCount VampireDust

;-----Shock Damage
set Shock to Shock + CNTRef.GetItemCount OgresTeeth

;-----Fire Area
set FireArea to FireArea + CNTRef.GetItemCount CheeseWedge
set FireArea to FireArea + CNTRef.GetItemCount Lettuce

;-----Frost Area
set FrostArea to FrostArea + CNTRef.GetItemCount MorningGloryRootPulp
set FrostArea to FrostArea + CNTRef.GetItemCount Garlic

;-----Shock Area
set ShockArea to ShockArea + CNTRef.GetItemCount Rice

;-----Drain Magicka (Damage Intelligence)
set DrainMag to DrainMag + CNTRef.GetItemCount WispStalkCaps

;-----Light
set Light to Light + CNTRef.GetItemCount AlkanetFlower

;-----Silence
set Silence to Silence + CNTRef.GetItemCount FrostSalts
set Silence to Silence + CNTRef.GetItemCount GoldenRodSeedPod
set Silence to Silence + CNTRef.GetItemCount Harrada
set Silence to Silence + CNTRef.GetItemCount MotherwortSprig

;---------------

set TotalFire to TotalFire + Fire * multi3
set TotalFrost to TotalFrost + Frost * multi3
set TotalShock to TotalShock + Shock * multi3
set TotalFireArea to TotalFireArea + FireArea * multi3
set TotalFrostArea to TotalFrostArea + FrostArea * multi3
set TotalShockArea to TotalShockArea + ShockArea * multi3
set TotalLight to TotalLight + Light * multi3
set TotalDamHeal to TotalDamHeal + DamHeal * multi3
set TotalDamMag to TotalDamMag + DamMag * multi3
set TotalDamFtg to TotalDamFtg + DamFtg * multi3
set TotalDamAtt to TotalDamAtt + DamAtt * multi3
set TotalDrainMag to TotalDrainMag + DrainMag * multi3
set TotalDispel to TotalDispel + Dispel * multi3
set TotalSilence to TotalSilence + Silence * multi3

endif

;--------------------Level 4 Effect--------------------

if (Alchemy >= 75)

set Fire to 0
set Frost to 0
set Shock to 0
set FireArea to 0
set FrostArea to 0
set ShockArea to 0
set Light to 0
set DamHeal to 0
set DamMag to 0
set DamFtg to 0
set DamAtt to 0
set DrainMag to 0
set Dispel to 0
set Silence to 0

;-----Damage Attribute
set DamAtt to DamAtt + CNTRef.GetItemCount Breadloaf
set DamAtt to DamAtt + CNTRef.GetItemCount Leek
set DamAtt to DamAtt + CNTRef.GetItemCount SQ01PotatoBreadLoaf
set DamAtt to DamAtt + CNTRef.GetItemCount SummerBoleteCap
set DamAtt to DamAtt + CNTRef.GetItemCount CinnabarPolyporeCap02
set DamAtt to DamAtt + CNTRef.GetItemCount EmeticRussulaCap
set DamAtt to DamAtt + CNTRef.GetItemCount BogBeaconAscoCap01
set DamAtt to DamAtt + CNTRef.GetItemCount ElfCupCap
set DamAtt to DamAtt + CNTRef.GetItemCount RootPulp
set DamAtt to DamAtt + CNTRef.GetItemCount TigerLilyNectar

;-----Damage Fatigue
set DamFtg to DamFtg + CNTRef.GetItemCount AlkanetFlower

;-----Damage Health
set DamHeal to DamHeal + CNTRef.GetItemCount Watermelon
set DamHeal to DamHeal + CNTRef.GetItemCount TrollFat
set DamHeal to DamHeal + CNTRef.GetItemCount Onion
set DamHeal to DamHeal + CNTRef.GetItemCount Graqes
set DamHeal to DamHeal + CNTRef.GetItemCount Apple
set DamHeal to DamHeal + CNTRef.GetItemCount Pear
set DamHeal to DamHeal + CNTRef.GetItemCount Ectoplasm
set DamHeal to DamHeal + CNTRef.GetItemCount ClannfearClaws
set DamHeal to DamHeal + CNTRef.GetItemCount DarkHumanSkin
set DamHeal to DamHeal + CNTRef.GetItemCount GreenStainCupCap
set DamHeal to DamHeal + CNTRef.GetItemCount ScampSkin
set DamHeal to DamHeal + CNTRef.GetItemCount GlowDust
set DamHeal to DamHeal + CNTRef.GetItemCount FlaxSeeds
set DamHeal to DamHeal + CNTRef.GetItemCount DreughWax

;-----Damage Magicka
set DamMag to DamMag + CNTRef.GetItemCount CloudedFunnelCap
set DamMag to DamMag + CNTRef.GetItemCount WormwoodLeaves
set DamMag to DamMag + CNTRef.GetItemCount Mutton
set DamMag to DamMag + CNTRef.GetItemCount MorningGloryRootPulp
set DamMag to DamMag + CNTRef.GetItemCount TinderPolyporeCap

;-----Dispel
set Dispel to Dispel + CNTRef.GetItemCount Tobacco
set Dispel to Dispel + CNTRef.GetItemCount SacredLotusSeeds
set Dispel to Dispel + CNTRef.GetItemCount Beef
set Dispel to Dispel + CNTRef.GetItemCount HouseServantPie
set Dispel to Dispel + CNTRef.GetItemCount VoidSalts

;-----Fire Damage
set Fire to Fire + CNTRef.GetItemCount ImpGall

;-----Frost Damage
set Frost to Frost + CNTRef.GetItemCount DryadSaddlePolyporeCap

;-----Shock Damage
set Shock to Shock + CNTRef.GetItemCount GinkgoLeaf
set Shock to Shock + CNTRef.GetItemCount CairnBoleteCap
set Shock to Shock + CNTRef.GetItemCount FlyAmanitaCap

;-----Fire Area
set FireArea to FireArea + CNTRef.GetItemCount CrabMeat
set FireArea to FireArea + CNTRef.GetItemCount DragonsTongue
set FireArea to FireArea + CNTRef.GetItemCount FireSalts

;-----Frost Area
set FrostArea to FrostArea + CNTRef.GetItemCount Potato
set FrostArea to FrostArea + CNTRef.GetItemCount FrostSalts

;-----Shock Area
set ShockArea to ShockArea + CNTRef.GetItemCount Corn
set ShockArea to ShockArea + CNTRef.GetItemCount Taproot

;-----Drain Magicka (Damage Intelligence)
set DrainMag to DrainMag + CNTRef.GetItemCount ElfCupCap

;-----Light
set Light to Light + CNTRef.GetItemCount DaedrothTeeth
set Light to Light + CNTRef.GetItemCount GoldenRodSeedPod

;-----Silence
set Silence to Silence + CNTRef.GetItemCount BergamotSeeds
set Silence to Silence + CNTRef.GetItemCount DaedraHeart
set Silence to Silence + CNTRef.GetItemCount DarkHumanheart
set Silence to Silence + CNTRef.GetItemCount HumanHeart
set Silence to Silence + CNTRef.GetItemCount Ratmeat
set Silence to Silence + CNTRef.GetItemCount MortFlesh

;---------------

set TotalFire to TotalFire + Fire * multi4
set TotalFrost to TotalFrost + Frost * multi4
set TotalShock to TotalShock + Shock * multi4
set TotalFireArea to TotalFireArea + FireArea * multi4
set TotalFrostArea to TotalFrostArea + FrostArea * multi4
set TotalShockArea to TotalShockArea + ShockArea * multi4
set TotalLight to TotalLight + Light * multi4
set TotalDamHeal to TotalDamHeal + DamHeal * multi4
set TotalDamMag to TotalDamMag + DamMag * multi4
set TotalDamFtg to TotalDamFtg + DamFtg * multi4
set TotalDamAtt to TotalDamAtt + DamAtt * multi4
set TotalDrainMag to TotalDrainMag + DrainMag * multi4
set TotalDispel to TotalDispel + Dispel * multi4
set TotalSilence to TotalSilence + Silence * multi4

endif

;--------------------------------------------------

set cEnchant to 0

;--------------------Enchant Daedric--------------------

;-----Magebane Arrow
set num to TotalSilence / 180
if (num > cDaedric)
set num to cDaedric
endif
set TotalSilence to TotalSilence - num * 180
set cDaedricSilenceArea to cDaedricSilenceArea + num
set cDaedric to cDaedric - num
set cEnchant to cEnchant + num

;-----Arrow of Storms
set num to TotalShock / 35
if (num > cDaedric)
set num to cDaedric
endif
set TotalShock to TotalShock - num * 35
set cDaedricShock to cDaedricShock + num
set cDaedric to cDaedric - num
set cEnchant to cEnchant + num

;-----Arrow of Winter
set num to TotalFrost / 35
if (num > cDaedric)
set num to cDaedric
endif
set TotalFrost to TotalFrost - num * 35
set cDaedricFrost to cDaedricFrost + num
set cDaedric to cDaedric - num
set cEnchant to cEnchant + num

;-----Arrow of the Inferno
set num to TotalFire / 35
if (num > cDaedric)
set num to cDaedric
endif
set TotalFire to TotalFire - num * 35
set cDaedricFire to cDaedricFire + num
set cDaedric to cDaedric - num
set cEnchant to cEnchant + num

;--------------------Enchant Ebony--------------------

;-----Arrow of Storm Strike
set num to TotalShock / 125
set num2 to TotalShockArea / 125
if (num > num2)
set num to num2
endif
if (num > cEbony)
set num to cEbony
endif
set TotalShock to TotalShock - num * 125
set TotalShockArea to TotalShockArea - num * 125
set cEbonyShockArea to cEbonyShockArea + num
set cEbony to cEbony - num
set cEnchant to cEnchant + num

;-----Arrow of Lightning
set num to TotalShock / 35
if (num > cEbony)
set num to cEbony
endif
set TotalShock to TotalShock - num * 35
set cEbonyShock to cEbonyShock + num
set cEbony to cEbony - num
set cEnchant to cEnchant + num

;-----Arrow of Blizzards
set num to TotalFrost / 35
if (num > cEbony)
set num to cEbony
endif
set TotalFrost to TotalFrost - num * 35
set cEbonyFrost to cEbonyFrost + num
set cEbony to cEbony - num
set cEnchant to cEnchant + num

;-----Arrow of the Blaze
set num to TotalFire / 35
if (num > cEbony)
set num to cEbony
endif
set TotalFire to TotalFire - num * 35
set cEbonyFire to cEbonyFire + num
set cEbony to cEbony - num
set cEnchant to cEnchant + num

;--------------------Enchant Glass--------------------

;-----Arrow of Hexing
set num to TotalDamMag / 15
if (num > cGlass)
set num to cGlass
endif
set TotalDamMag to TotalDamMag - num * 15
set cGlassDamMag to cGlassDamMag + num
set cGlass to cGlass - num
set cEnchant to cEnchant + num

;-----Arrow of Immolation
set num to TotalFire / 115
set num2 to TotalFireArea / 115
if (num > num2)
set num to num2
endif
if (num > cGlass)
set num to cGlass
endif
set TotalFire to TotalFire - num * 115
set TotalFireArea to TotalFireArea - num * 115
set cGlassFireArea to cGlassFireArea + num
set cGlass to cGlass - num
set cEnchant to cEnchant + num

;-----Arrow of Sunlight
set num to TotalFire / 25
set num2 to TotalLight / 5
if (num > num2)
set num to num2
endif
if (num > cGlass)
set num to cGlass
endif
set TotalFire to TotalFire - num * 25
set TotalLight to TotalLight - num * 5
set cGlassFireLight to cGlassFireLight + num
set cGlass to cGlass - num
set cEnchant to cEnchant + num

;-----Arrow of the Dynamo
set num to TotalShock / 25
if (num > cGlass)
set num to cGlass
endif
set TotalShock to TotalShock - num * 25
set cGlassShock to cGlassShock + num
set cGlass to cGlass - num
set cEnchant to cEnchant + num

;-----Arrow of the Glacier
set num to TotalFrost / 25
if (num > cGlass)
set num to cGlass
endif
set TotalFrost to TotalFrost - num * 25
set cGlassFrost to cGlassFrost + num
set cGlass to cGlass - num
set cEnchant to cEnchant + num

;-----Arrow of Fire
set num to TotalFire / 25
if (num > cGlass)
set num to cGlass
endif
set TotalFire to TotalFire - num * 25
set cGlassFire to cGlassFire + num
set cGlass to cGlass - num
set cEnchant to cEnchant + num

;--------------------Enchant Elven--------------------

;-----Arrow of Harm
set num to TotalDamHeal / 20
if (num > cElven)
set num to cElven
endif
set TotalDamHeal to TotalDamHeal - num * 20
set cElvenDamheal to cElvenDamheal + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;-----Arrow of the North Winds
set num to TotalFrost / 105
set num2 to TotalFrostArea / 105
if (num > num2)
set num to num2
endif
if (num > cElven)
set num to cElven
endif
set TotalFrost to TotalFrost - num * 105
set TotalFrostArea to TotalFrostArea - num * 105
set cElvenFrostArea to cElvenFrostArea + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;-----Stormcall Arrow
set num to TotalShock / 90
set num2 to TotalShockArea / 90
if (num > num2)
set num to num2
endif
if (num > cElven)
set num to cElven
endif
set TotalShock to TotalShock - num * 90
set TotalShockArea to TotalShockArea - num * 90
set cElvenShockArea to cElvenShockArea + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;-----Arrow of Stillness
set num to TotalSilence / 120
if (num > cElven)
set num to cElven
endif
set TotalSilence to TotalSilence - num * 120
set cElvenSilence to cElvenSilence + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;-----Arrow of Brilliance
set num to TotalFire / 20
set num2 to TotalLight / 3
if (num > num2)
set num to num2
endif
if (num > cElven)
set num to cElven
endif
set TotalFire to TotalFire - num * 20
set TotalLight to TotalLight - num * 3
set cElvenFireLight to cElvenFireLight + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;-----Arrow of Voltage
set num to TotalShock / 25
if (num > cElven)
set num to cElven
endif
set TotalShock to TotalShock - num * 25
set cElvenShock to cElvenShock + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;-----Arrow of Freezing
set num to TotalFrost / 25
if (num > cElven)
set num to cElven
endif
set TotalFrost to TotalFrost - num * 25
set cElvenFrost to cElvenFrost + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;-----Arrow of Flames
set num to TotalFire / 25
if (num > cElven)
set num to cElven
endif
set TotalFire to TotalFire - num * 25
set cElvenFire to cElvenFire + num
set cElven to cElven - num
set cEnchant to cEnchant + num

;--------------------Enchant Dwarven--------------------

;-----Arrow of Savage Frost
set num to TotalFrost / 125
set num to TotalFrostArea / 125
if (num > num2)
set num to num2
endif
if (num > cDwarven)
set num to cDwarven
endif
set TotalFrost to TotalFrost - num * 125
set TotalFrostArea to TotalFrostArea - num * 125
set cDwarvenFrostArea to cDwarvenFrostArea + num
set cDwarven to cDwarven - num
set cEnchant to cEnchant + num

;-----Arrow of Silence
set num to TotalSilence / 90
if (num > cDwarven)
set num to cDwarven
endif
set TotalSilence to TotalSilence - num * 90
set cDwarvenSilence to cDwarvenSilence + num
set cDwarven to cDwarven - num
set cEnchant to cEnchant + num

;-----Arrow of Illumination
set num to TotalFire / 10
set num2 to TotalLight / 2
if (num > num2)
set num to num2
endif
if (num > cDwarven)
set num to cDwarven
endif
set TotalFire to TotalFire - num * 10
set TotalLight to TotalLight - num * 2
set cDwarvenFireLight to cDwarvenFireLight + num
set cDwarven to cDwarven - num
set cEnchant to cEnchant + num

;-----Arrow of Shocking
set num to TotalShock / 15
if (num > cDwarven)
set num to cDwarven
endif
set TotalShock to TotalShock - num * 15
set cDwarvenShock to cDwarvenShock + num
set cDwarven to cDwarven - num
set cEnchant to cEnchant + num

;-----Arrow of Cold
set num to TotalFrost / 15
if (num > cDwarven)
set num to cDwarven
endif
set TotalFrost to TotalFrost - num * 15
set cDwarvenFrost to cDwarvenFrost + num
set cDwarven to cDwarven - num
set cEnchant to cEnchant + num

;-----Arrow of Scorching
set num to TotalFire / 15
if (num > cDwarven)
set num to cDwarven
endif
set TotalFire to TotalFire - num * 15
set cDwarvenFire to cDwarvenFire + num
set cDwarven to cDwarven - num
set cEnchant to cEnchant + num

;--------------------Enchant Silver--------------------

;-----Arrow of Cleansing
set num to TotalFire / 125
set num2 to TotalFireArea / 125
if (num > num2)
set num to num2
endif
if (num > cSilver)
set num to cSilver
endif
set TotalFire to TotalFire - num * 125
set TotalFireArea to TotalFireArea - num * 125
set cSilverFireArea to cSilverFireArea + num
set cSilver to cSilver - num
set cEnchant to cEnchant + num

;-----Arrow of Withering
set num to TotalDamMag / 180
if (num > cSilver)
set num to cSilver
endif
set TotalDamAtt to TotalDamAtt - num * 180
set cSilverWithering to cSilverWithering + num
set cSilver to cSilver - num
set cEnchant to cEnchant + num

;-----Arrow of Drain Magicka
set num to TotalDrainMag / 15
if (num > cSilver)
set num to cSilver
endif
set TotalDrainMag to TotalDrainMag - num * 15
set cSilverDrainMag to cSilverDrainMag + num
set cSilver to cSilver - num
set cEnchant to cEnchant + num

;-----Arrow of Dispel
set num to TotalDispel / 20
if (num > cSilver)
set num to cSilver
endif
set TotalDispel to TotalDispel - num * 20
set cSilverDispel to cSilverDispel + num
set cSilver to cSilver - num
set cEnchant to cEnchant + num

;-----Arrow of Jinxing
set num to TotalDamMag / 10
if (num > cSilver)
set num to cSilver
endif
set TotalDamMag to TotalDamMag - num * 10
set cSilverDamMag to cSilverDamMag + num
set cSilver to cSilver - num
set cEnchant to cEnchant + num

;--------------------Enchant Steel--------------------

;-----Arrow of Fatigue
set num to TotalDamFtg / 20
if (num > cSteel)
set num to cSteel
endif
set TotalDamFtg to TotalDamFtg - num * 20
set cSteelDamFtg to cSteelDamFtg + num
set cSteel to cSteel - num
set cEnchant to cEnchant + num

;-----Flare Arrow
set num to TotalFire / 5
set num2 to TotalLight / 1
if (num > num2)
set num to num2
endif
if (num > cSteel)
set num to cSteel
endif
set TotalFire to TotalFire - num * 5
set TotalLight to TotalLight - num * 1
set cSteelFireLight to cSteelFireLight + num
set cSteel to cSteel - num
set cEnchant to cEnchant + num

;-----Arrow of Jolts
set num to TotalShock / 5
if (num > cSteel)
set num to cSteel
endif
set TotalShock to TotalShock - num * 5
set cSteelShock to cSteelShock + num
set cSteel to cSteel - num
set cEnchant to cEnchant + num

;-----Arrow of Numbing
set num to TotalFrost / 5
if (num > cSteel)
set num to cSteel
endif
set TotalFrost to TotalFrost - num * 5
set cSteelFrost to cSteelFrost + num
set cSteel to cSteel - num
set cEnchant to cEnchant + num

;-----Arrow of Burning
set num to TotalFire / 5
if (num > cSteel)
set num to cSteel
endif
set TotalFire to TotalFire - num * 5
set cSteelFire to cSteelFire + num
set cSteel to cSteel - num
set cEnchant to cEnchant + num

;--------------------Enchant Iron--------------------

;-----Arrow of Sparks
set num to TotalShock / 5
if (num > cIron)
set num to cIron
endif
set TotalShock to TotalShock - num * 5
set cIronShock to cIronShock + num
set cIron to cIron - num
set cEnchant to cEnchant + num

;-----Arrow of Frost
set num to TotalFrost / 5
if (num > cIron)
set num to cIron
endif
set TotalFrost to TotalFrost - num * 5
set cIronFrost to cIronFrost + num
set cIron to cIron - num
set cEnchant to cEnchant + num

;-----Arrow of Embers
set num to TotalFire / 5
if (num > cIron)
set num to cIron
endif
set TotalFire to TotalFire - num * 5
set cIronFire to cIronFire + num
set cIron to cIron - num
set cEnchant to cEnchant + num

;-----Arrow of Light
set num to TotalLight / 1
if (num > cIron)
set num to cIron
endif
set TotalLight to TotalLight - num * 1
set cIronLight to cIronLight + num
set cIron to cIron - num
set cEnchant to cEnchant + num

;--------------------------------------------------

CNTRef.RemoveAllItems

CNTRef.AddItem Arrow1Iron cIron
CNTRef.AddItem Arrow2Steel cSteel
CNTRef.AddItem Arrow3Silver cSilver
CNTRef.AddItem Arrow4Dwarven cDwarven
CNTRef.AddItem Arrow5Elven cElven
CNTRef.AddItem Arrow6Glass cGlass
CNTRef.AddItem Arrow7Ebony cEbony
CNTRef.AddItem Arrow8Daedric cDaedric

CNTRef.AddItem EncArrow1IronLight cIronLight
CNTRef.AddItem EncArrow1IronFireDamage cIronFire
CNTRef.AddItem EncArrow1IronFrostDamage cIronFrost
CNTRef.AddItem EncArrow1IronShockDamage cIronShock
CNTRef.AddItem EncArrow1IronDemCreature cIronDemCrt
CNTRef.AddItem EncArrow1IronDemHuman cIronDemHum

CNTRef.AddItem EncArrow2SteelFireDamage cSteelFire
CNTRef.AddItem EncArrow2SteelFrostDamage cSteelFrost
CNTRef.AddItem EncArrow2SteelShockDamage cSteelShock
CNTRef.AddItem EncArrow2SteelFireDamageLight cSteelFireLight
CNTRef.AddItem EncArrow2SteelDamFatigue cSteelDamFtg
CNTRef.AddItem EncArrow2SteelDemCreature cSteelDemCrt
CNTRef.AddItem EncArrow2SteelDemHuman cSteelDemHum
CNTRef.AddItem EncArrow2SteelFrenzyArea cSteelFrenzyArea

CNTRef.AddItem EncArrow3SilverDamageMagic cSilverDamMag
CNTRef.AddItem EncArrow3SilverDispel cSilverDispel
CNTRef.AddItem EncArrow3SilverDrainMagic cSilverDrainMag
CNTRef.AddItem EncArrow3SilverWithering cSilverWithering
CNTRef.AddItem EncArrow3SilverFireArea cSilverFireArea

CNTRef.AddItem EncArrow4DwarvenFireDamage cDwarvenFire
CNTRef.AddItem EncArrow4DwarvenFrostDamage cDwarvenFrost
CNTRef.AddItem EncArrow4DwarvenShockDamage cDwarvenShock
CNTRef.AddItem EncArrow4DwarvenFireDamageLight cDwarvenFireLight
CNTRef.AddItem EncArrow4DwarvenSilence cDwarvenSilence
CNTRef.AddItem EncArrow4DwarvenFrostArea cDwarvenFrostArea

CNTRef.AddItem EncArrow5ElvenFireDamage cElvenFire
CNTRef.AddItem EncArrow5ElvenFrostDamage cElvenFrost
CNTRef.AddItem EncArrow5ElvenShockDamage cElvenShock
CNTRef.AddItem EncArrow5ElvenFireDamageLight cElvenFireLight
CNTRef.AddItem EncArrow5ElvenSilence cElvenSilence
CNTRef.AddItem EncArrow5ElvenShockArea cElvenShockArea
CNTRef.AddItem EncArrow5ElvenFrostArea cElvenFrostArea
CNTRef.AddItem EncArrow5ElvenDamHealth cElvenDamHeal

CNTRef.AddItem EncArrow6GlassFireDamage cGlassFire
CNTRef.AddItem EncArrow6GlassFrostDamage cGlassFrost
CNTRef.AddItem EncArrow6GlassShockDamage cGlassShock
CNTRef.AddItem EncArrow6GlassFireDamageLight cGlassFireLight
CNTRef.AddItem EncArrow6GlassFireArea cGlassFireArea
CNTRef.AddItem EncArrow6GlassDamageMagicka cGlassDamMag

CNTRef.AddItem EncArrow7EbonyFireDamage cEbonyFire
CNTRef.AddItem EncArrow7EbonyFrostDamage cEbonyFrost
CNTRef.AddItem EncArrow7EbonyShockDamage cEbonyShock
CNTRef.AddItem EncArrow7EbonyShockArea cEbonyShockArea

CNTRef.AddItem EncArrow8DaedricFireDamage cDaedricFire
CNTRef.AddItem EncArrow8DaedricFrostDamage cDaedricFrost
CNTRef.AddItem EncArrow8DaedricShockDamage cDaedricShock
CNTRef.AddItem EncArrow8DaedricSilenceArea cDaedricSilenceArea
CNTRef.AddItem EncArrowHatredsSoulTrap cDaedricSoulTrap

Message "Total %.0f new arrow(s) fletched, %.0f arrow(s) enchanted." HaroKArrowForgeQST.cNew cEnchant 5

SetQuestObject HaroKArrowForge 0
set HaroKArrowForgeQST.Crafting to 0

StopQuest HaroKArrowForgeQST2
end




but nothing is being returned!
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Tue Dec 29, 2009 8:57 pm

Did you also make all the scripts for the Iron counting, steel counting, etc.?

If you call a function without having made that function script first, the script might just choke and stop at the first bad line.
User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am

Post » Tue Dec 29, 2009 7:22 pm

Did you also make all the scripts for the Iron counting, steel counting, etc.?

If you call a function without having made that function script first, the script might just choke and stop at the first bad line.


I did a re edit, please go back to it. I forgot to mention them
User avatar
Carlitos Avila
 
Posts: 3438
Joined: Fri Sep 21, 2007 3:05 pm

Post » Wed Dec 30, 2009 8:27 am

gonna post it here, someone see where I went wrong?

Your fucntionCountEbony script has some major errors.

I see you followed my advice to call the script on the CNTRef object from HaroKArrowForgeQSTScript. But in fucntionCountEbony, you don't call GetItemCount on itself, but rather on a new CNTRef that you have not initiated. The CNTRef variable inside fucntionCountEbony is not the same as the one inside HaroKArrowForgeQSTScript.

So you must either pass the CNTRef variable from one script to the other, remove all references to CNTRef in the fucntionCountEbony script and call GetItemCount on the self object instead, e.g.
set cNewEbony to cNewEbony + (GetItemCount EbonyCuirassQV * 20)

User avatar
asako
 
Posts: 3296
Joined: Wed Oct 04, 2006 7:16 am

Post » Tue Dec 29, 2009 8:07 pm

please simplify the explanation


So you must either pass the CNTRef variable from one script to the other, remove all references to CNTRef in the fucntionCountEbony script and call GetItemCount on the self object instead, e.g.
set cNewEbony to cNewEbony + (GetItemCount EbonyCuirassQV * 20)



missing the or. I think, cause you said either and it sounds like you mean for me to do all 3


on a new CNTRef that you have not initiated.


example?
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Wed Dec 30, 2009 9:56 am

ok, got it done, works well, now to the next part which will get its own topic

please lock
User avatar
cosmo valerga
 
Posts: 3477
Joined: Sat Oct 13, 2007 10:21 am


Return to IV - Oblivion