Spells for items
#1
Posté 21 mai 2011 - 09:43
Any clues would be much ap[preciated.
ET
#2
Posté 21 mai 2011 - 02:55
#3
Posté 21 mai 2011 - 06:54
//essence of cure ffbj
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
if (!nEvent == X2_ITEM_EVENT_ACTIVATE)
return;
object oPC = GetItemActivator();
object oItem = GetItemActivated();
object oCaster = oPC;
int iHeal = GetSkillRank(SKILL_HEAL, oCaster, TRUE);
AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_CURE_MODERATE_WOUNDS, oPC, 10 +iHeal, TRUE, TRUE));
DelayCommand (1.0, AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_REGENERATE, oPC, 10 +iHeal, TRUE, TRUE)));
DelayCommand (2.0, AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_REMOVE_DISEASE, oPC, 10 +iHeal, TRUE, TRUE)));
}
Modifié par ffbj, 21 mai 2011 - 07:06 .
#4
Posté 21 mai 2011 - 10:55
You can also make one script that also checks the name of the item as well instead of a few hundred smaller scripts.ffbj wrote...
You can just make the potion a unique item and have the PC cast the spell when they drink the potion. For instance and essence of cure from my campaign:
//essence of cure ffbj
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
if (!nEvent == X2_ITEM_EVENT_ACTIVATE)
return;
object oPC = GetItemActivator();
object oItem = GetItemActivated();
object oCaster = oPC;
int iHeal = GetSkillRank(SKILL_HEAL, oCaster, TRUE);
AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_CURE_MODERATE_WOUNDS, oPC, 10 +iHeal, TRUE, TRUE));
DelayCommand (1.0, AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_REGENERATE, oPC, 10 +iHeal, TRUE, TRUE)));
DelayCommand (2.0, AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_REMOVE_DISEASE, oPC, 10 +iHeal, TRUE, TRUE)));
}
#5
Posté 24 mai 2011 - 11:22
#6
Posté 25 mai 2011 - 11:37
Then named the scripts tsm_wep, tsm_pot, tsm_worn, tsm_misc so to adjust any of them is very simple.
#7
Posté 25 mai 2011 - 10:40





Retour en haut






