1
Help / Re: Easy Question about disable teleport
« on: March 06, 2018, 04:51:07 AM »
Solved with a script made to go around the problem
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
void main()
{
object oTarget;
int nSpell=GetSpellId();
int nSpellDC=GetSpellSaveDC();
int nCastLevel=GetCasterLevel(OBJECT_SELF);
object oCaster = OBJECT_SELF;
if (GetCasterLevel(OBJECT_SELF) > 20)
{
nCastLevel = (GetCasterLevel(OBJECT_SELF) + (GetLevelByXP(OBJECT_SELF)-40));
}
switch (nSpell)
{
//*Arcane Sfera 1
//* Evoca I
case SPELL_SUMMON_CREATURE_I:
{int nMetaMagic = GetMetaMagicFeat();
int nDuration = nCastLevel;
//------------------------------------------------------------------------------
// Execute a user overridden spell script.
//------------------------------------------------------------------------------
int X2RunUserDefinedSpellScript()
{
// See x2_inc_switches for details on this code
string sScript = GetModuleOverrideSpellscript();
if (sScript != "")
{
ExecuteScript(sScript,OBJECT_SELF);
if (GetModuleOverrideSpellScriptFinished() == TRUE)
{
return FALSE;
}
}
return TRUE;
}
//------------------------------------------------------------------------------
// Set the user-specific spell script
//------------------------------------------------------------------------------
void PRCSetUserSpecificSpellScript(string sScript)
{
SetLocalString(OBJECT_SELF, "PRC_OVERRIDE_SPELLSCRIPT", sScript);
}
//------------------------------------------------------------------------------
// Get the user-specific spell script
//------------------------------------------------------------------------------
string PRCGetUserSpecificSpellScript()
{
return GetLocalString(OBJECT_SELF, "PRC_OVERRIDE_SPELLSCRIPT");
}
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//------------------------------------------------------------------------------
// S P E L L S C R I P T S
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Allows the module creator to specify a script that will be run before any spellscript is run
// You can call SetModuleOverrideSpellscript() at the end of the script specified by
// sScriptName. If you call this function this will prevent the original spellscript
// (and all craft item code) from being executed.
// If you do not add this line, the original spellscript and/or crafting code will
// run in addition to your script
//------------------------------------------------------------------------------
void SetModuleOverrideSpellscript(string sScriptName);