Hi I'm trying to override spells, it's near to be OK but there is something strange
Here is my script :
#include "x2_inc_switches"
#include "mod_inc_cym_system"
void main()
{
object oPC = OBJECT_SELF;
int iSpellID = GetSpellId();
SendMessageToPC(oPC, "iSpellID : " + IntToString(iSpellID));
int iSpellLevel = GetSpellLevel(iSpellID);
SendMessageToPC(oPC, "iSpellLevel : " + IntToString(iSpellLevel));
int iCasterLevel = GetCasterLevel(oPC);
SendMessageToPC(oPC, "iCasterLevel : " + IntToString(iCasterLevel));
int iSpellCymCost = iSpellLevel * 100;
SendMessageToPC(oPC, "iSpellCymCost : " + IntToString(iSpellCymCost));
if (!GetIsPC(oPC) || GetIsDM(oPC) || GetIsDMPossessed(oPC))
{
return;
}
if (CS_CheckCym(oPC, iSpellCymCost) != 1)
{
SendMessageToPC(oPC, "Vous ne possédez pas assez de Cym pour lancer ce sort.");
SetNoticeText(oPC, "SORT INTERROMPU (Pas assez de Cym)");
SetModuleOverrideSpellScriptFinished();
return;
}
else
{
CS_TakeCym(oPC, iSpellCymCost);
}
}
It alsmot worked but it take the spell casted before the current cast
If I cast 2 times the Resistance spell, at first it didnt detect the ID (-1) but then It detect it (151).
Cf screen :

So the problem is that it detects each time the spell cast before the one I want to control
Thanks for helping!





Retour en haut







