Jump to content

Help with Scripting


samisam

Recommended Posts

This code will add an item to the players inventory when the cowl is equipped:

 

short doOnce

 

begin OnEquip

if(doOnce==0) ; if it has not been done yet

player.addItem WHATEVERITEMYOUWANT, 1 ; add one of the specified item to the players inventory.

set doOnce to 1 ; so it does not go next time it is equipped

endif

end

 

and this code will place the item in the worldspace:

 

short doOnce

 

begin OnEquip

if(doOnce==0) ; if it has not been done yet

player.placeAtMe WHATEVERITEMYOUWANT, 1, 100 , 1 ; place one of the specified item 100 units in front of player

set doOnce to 1 ; so it does not go next time it is equipped

endif

end

 

(see http://cs.elderscrolls.com/constwiki/index.php/PlaceAtMe for documentation)

 

Hope that helps!

Link to comment
Share on other sites

This code will add an item to the players inventory when the cowl is equipped:

 

short doOnce

 

begin OnEquip

if(doOnce==0) ; if it has not been done yet

player.addItem WHATEVERITEMYOUWANT, 1 ; add one of the specified item to the players inventory.

set doOnce to 1 ; so it does not go next time it is equipped

endif

end

 

and this code will place the item in the worldspace:

 

short doOnce

 

begin OnEquip

if(doOnce==0) ; if it has not been done yet

player.placeAtMe WHATEVERITEMYOUWANT, 1, 100 , 1 ; place one of the specified item 100 units in front of player

set doOnce to 1 ; so it does not go next time it is equipped

endif

end

 

(see http://cs.elderscrolls.com/constwiki/index.php/PlaceAtMe for documentation)

 

Hope that helps!

 

for the item name do i do my chosen custon name or the hex code?

Link to comment
Share on other sites

Since both examples create a new item you would use the items editor ID.

Could you tell me how to write that into this code? Sorry for all the questions.

 

ScriptName TGGrayCowlScript

Float GFCrimeGold
Float GFInfamy
Float GFFame

Float PCCrimeGold
Float PlayerInfamy
Float PlayerFame

Float TempCrime

Begin OnEquip Player
If GetPlayerInSEWorld == 0
	Set TempCrime to GetGameSetting iCrimeGoldAttackMin
	If GFCrimeGold < TempCrime
 		Set GFCrimeGold to TempCrime
	EndIf
	Set PCCrimeGold to Player.GetCrimeGold
	Player.SetCrimeGold GFCrimeGold	
EndIf
Set PlayerFame to GetPCFame
SetPCFame GFFame

If GFInfamy < 100
	Set GFInfamy to 100
EndIf
Set PlayerInfamy to GetPCInfamy
SetPCInfamy GFInfamy
End

Begin OnUnequip Player
If GetPlayerInSEWorld == 0
	Set GFCrimeGold to Player.GetCrimeGold
	Player.SetCrimeGold PCCrimeGold
EndIf
Set GFFame to GetPCFame
SetPCFame PlayerFame

Set GFInfamy to GetPCInfamy
SetPCInfamy PlayerInfamy
End

Begin GameMode
If GetPlayerInSEWorld == 0
	If SECrime.LeftSECowlOn == 1
		If SECrime.EnteredSECowlOn == 0
		; duplicate equipping the cowl if the player didn't have it on when he entered SE, but has it on when he leaves
			Set TempCrime to GetGameSetting iCrimeGoldAttackMin
			If GFCrimeGold < TempCrime
 				Set GFCrimeGold to TempCrime
			EndIf
			Set PCCrimeGold to Player.GetCrimeGold
			Player.SetCrimeGold GFCrimeGold	

			Set SECrime.LeftSECowlOn to 0
		EndIf
	EndIf

	If SECrime.LeftSECowlOn == 0
		If SECrime.EnteredSECowlOn == 1
		; duplicate unequipping the cowl if the player had it on when he entered SE, but not on when he leaves
			Set GFCrimeGold to Player.GetCrimeGold
			Player.SetCrimeGold PCCrimeGold
			Set SECrime.EnteredSECowlOn to 0
		EndIf
	EndIf
EndIf
End

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...