Re: Sac de déménagement dimensionnel - WIP
Posté : 31 mars 2012, 20:35
				
				Bon le script semble ne pas vouloir fonctionner.
Avec l'aide de Sagittarius voici que ça donne:
Fenêtre QuestData:

Fenêtre QuestStages:

Fenêtre Script

Et le script (source) en question:
Quelqu'un a une idée pourquoi le script ne marche pas? En gros quand je suis en jeu et que je suis équipé avec l'objet, le script est bien en marche mais les effets recherchés (armes et magies rengainées) ne s'appliquent pas.
			Avec l'aide de Sagittarius voici que ça donne:
Fenêtre QuestData:

Fenêtre QuestStages:

Fenêtre Script

Et le script (source) en question:
Code : Tout sélectionner
Scriptname CoraxBagScript   
{scn CoraxBagScript extends Quest Auto
Import Game
ObjectReference Property Player Auto
Armor Property CoraxBag Auto
Int Property LeftHand = 0 Auto
Int Property RightHand = 1 Auto
Weapon Property RightWeapon Auto
Weapon Property LeftWeapon Auto
Spell Property LeftSpell Auto
Spell Property RightSpell Auto
Function SomeFunct()
	registerforupdate(3) ; script vérifié toutes les 3 secondes
EndFunction
Event OnUpdate()
	Player = GetPlayer()
	LeftWeapon = Player.GetEquippedWeapon(true)
	RightWeapon = Player.GetEquippedWeapon(false)
	LeftSpell = Player.GetEquippedSpell(0)
	RightSpell = Player.GetEquippedSpell(1)
	Int LeftHandObject = GetPlayer().GetEquippedItemType(LeftHand)
	Int RightHandObject = GetPlayer().GetEquippedItemType(RightHand)
	
		if LeftHandObject > 0 && LeftHandObject < 10 && Player.IsEquipped(CoraxBag)
			Player.UnequipItem(LeftSpell)
			Player.UnequipItem(RightSpell)
			Player.UnequipItem(LeftWeapon)
			Player.UnequipItem(RightWeapon)
		endif
		
		if RightHandObject > 0 && RightHandObject < 10 && Player.IsEquipped(CoraxBag)
			Player.UnequipItem(LeftSpell)
			Player.UnequipItem(RightSpell)
			Player.UnequipItem(LeftWeapon)
			Player.UnequipItem(RightWeapon)
		endif
EndEvent}
Armor Property CoraxBag  Auto  

