NWScript :Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.
//:: Update Lylver 2005-09-16
//:: + spell hooking tnb : chgt RAISE_DEAD
//:/
//:////////////////////
//:: created Lylver 2005-06-10
//:: spell-hooking main
//:: 1st purpose : scrolls DC for thieves
//:////////////////////
/*
GetSpellId(); // returns the SPELL_* constant of the spell cast
GetSpellTargetObject(); // returns the targeted object of the spell, if valid
GetSpellTargetLocation(); // returns the targeted location of the spell, if valid
GetLastSpellCastClass(); // gets the class the PC cast the spell as
GetSpellCastItem(); // if an item cast the spell, this function gets that item
GetSpellSaveDC(); // gets the DC required to save against the effects of the spell
GetCasterLevel(OBJECT_SELF); // gets the level the PC cast the spell as
*/
#include "x2_inc_switches"
#include "ly_lib_spell"
#include "ly_nw_i0_spells"
#include "ly_x0_i0_spells"
#include "x2_inc_spellhook"
#include "ly_s0_firebrand"
#include "ly_s0_virtue"
#include "ly_s0_missstorm1"
#include "ly_s0_missstorm2"
#include "ly_s0_divpower"
void main()
{
struct spell_data stS ;
stS.nSpId = GetSpellId();
stS.oTgtObj = GetSpellTargetObject();
stS.lTgtLoc = GetSpellTargetLocation();
stS.nClass = GetLastSpellCastClass();
stS.oCItem = GetSpellCastItem();
stS.nSSDC = GetSpellSaveDC();
stS.nLevel = GetCasterLevel(OBJECT_SELF);
stS.nMeta = GetMetaMagicFeat();
// dump_spell( stS, "sow_mod_spells" ) ;
// Loop Lock
/* if( GetLocalInt(OBJECT_SELF," BUSY") ){
WriteTimestampedLogEntry(" ;Loop Lock");
return ;
} else {
SetLocalInt(OBJECT_SELF," BUSY",TRUE);
}*/
/* resoud un probleme de DC pour les sorts lances via parchemin pour les voleurs
et introduit DC pour les parchemins au dessus du niveau du caster
*/
if( GetIsObjectValid(stS.oCItem) &&
GetIsPC(OBJECT_SELF) &&
( GetBaseItemType(stS.oCItem) == BASE_ITEM_SPELLSCROLL ) &&
( GetLastSpellCastClass() == CLASS_TYPE_INVALID ) ){
int nProfane = GetLevelByClass(CLASS_TYPE_WIZARD)
+ GetLevelByClass(CLASS_TYPE_SORCERER)
+ GetLevelByClass(CLASS_TYPE_BARD)
+ GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE)
+ GetLevelByClass(CLASS_TYPE_PALEMASTER)
+ GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER)
+ GetLevelByClass(CLASS_TYPE_HARPER)
+ GetLevelByClass(CLASS_TYPE_SHADOWDANCER) ;
int nDivine = GetLevelByClass(CLASS_TYPE_CLERIC)
+ GetLevelByClass(CLASS_TYPE_DRUID)
+ GetLevelByClass(CLASS_TYPE_SHIFTER)
+ GetLevelByClass(CLASS_TYPE_PALADIN)
+ GetLevelByClass(CLASS_TYPE_HARPER)
+ GetLevelByClass(CLASS_TYPE_RANGER) ;
int nTypeMagie = (nDivine > nProfane) ? nDivine : nProfane ;
int nSkillUMD = d20() + GetSkillRank(SKILL_USE_MAGIC_DEVICE) + nTypeMagie ;
int nDC_UMD = stS.nSSDC-10 + GetCasterLevel(OBJECT_SELF) ;
if( stS.nSpId == SPELL_RAISE_DEAD ){ nDC_UMD = 2 ; }
if( nDC_UMD > nSkillUMD ){
SendMessageToPC(OBJECT_SELF,"Utilisation des Objets Magiques : Jet "
+IntToString(nSkillUMD)+", DC = "+IntToString(nDC_UMD)+"");
SetModuleOverrideSpellScriptFinished();
return ;
} else {
SendMessageToPC(OBJECT_SELF,"Utilisation des Objets Magiques : Jet "
+IntToString(nSkillUMD)+", DC = "+IntToString(nDC_UMD)+"");
}
}
/* classic spell-hooking */
/*
switch (stS.nSpId) {
case SPELL_FIREBRAND:
ly_s0_firebrand(stS) ;
SetModuleOverrideSpellScriptFi nished();
DeleteLocalInt(OBJECT_SELF,&qu ot;BUSY");
// DoMissileStorm(stS,1, 15, SPELL_FIREBRAND, VFX_IMP_MIRV_FLAME, VFX_IMP_FLAME_M, DAMAGE_TYPE_FIRE, FALSE, TRUE);
// SetModuleOverrideSpellScriptFi nished();
break ;
case SPELL_DIVINE_POWER: ly_s0_divpower(stS) ; break ;
case SPELL_ISAACS_LESSER_MISSILE_ST ORM: ly_s0_missstorm1(stS) ; break ;
case SPELL_ISAACS_GREATER_MISSILE_S TORM: ly_s0_missstorm2(stS) ; break ;
case SPELL_VIRTUE: ly_s0_virtue(stS) ; break ;
} // end switch statement */
}
//:: + spell hooking tnb : chgt RAISE_DEAD
//:/
//:////////////////////
//:: created Lylver 2005-06-10
//:: spell-hooking main
//:: 1st purpose : scrolls DC for thieves
//:////////////////////
/*
GetSpellId(); // returns the SPELL_* constant of the spell cast
GetSpellTargetObject(); // returns the targeted object of the spell, if valid
GetSpellTargetLocation(); // returns the targeted location of the spell, if valid
GetLastSpellCastClass(); // gets the class the PC cast the spell as
GetSpellCastItem(); // if an item cast the spell, this function gets that item
GetSpellSaveDC(); // gets the DC required to save against the effects of the spell
GetCasterLevel(OBJECT_SELF); // gets the level the PC cast the spell as
*/
#include "x2_inc_switches"
#include "ly_lib_spell"
#include "ly_nw_i0_spells"
#include "ly_x0_i0_spells"
#include "x2_inc_spellhook"
#include "ly_s0_firebrand"
#include "ly_s0_virtue"
#include "ly_s0_missstorm1"
#include "ly_s0_missstorm2"
#include "ly_s0_divpower"
void main()
{
struct spell_data stS ;
stS.nSpId = GetSpellId();
stS.oTgtObj = GetSpellTargetObject();
stS.lTgtLoc = GetSpellTargetLocation();
stS.nClass = GetLastSpellCastClass();
stS.oCItem = GetSpellCastItem();
stS.nSSDC = GetSpellSaveDC();
stS.nLevel = GetCasterLevel(OBJECT_SELF);
stS.nMeta = GetMetaMagicFeat();
// dump_spell( stS, "sow_mod_spells" ) ;
// Loop Lock
/* if( GetLocalInt(OBJECT_SELF," BUSY") ){
WriteTimestampedLogEntry(" ;Loop Lock");
return ;
} else {
SetLocalInt(OBJECT_SELF," BUSY",TRUE);
}*/
/* resoud un probleme de DC pour les sorts lances via parchemin pour les voleurs
et introduit DC pour les parchemins au dessus du niveau du caster
*/
if( GetIsObjectValid(stS.oCItem) &&
GetIsPC(OBJECT_SELF) &&
( GetBaseItemType(stS.oCItem) == BASE_ITEM_SPELLSCROLL ) &&
( GetLastSpellCastClass() == CLASS_TYPE_INVALID ) ){
int nProfane = GetLevelByClass(CLASS_TYPE_WIZARD)
+ GetLevelByClass(CLASS_TYPE_SORCERER)
+ GetLevelByClass(CLASS_TYPE_BARD)
+ GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE)
+ GetLevelByClass(CLASS_TYPE_PALEMASTER)
+ GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER)
+ GetLevelByClass(CLASS_TYPE_HARPER)
+ GetLevelByClass(CLASS_TYPE_SHADOWDANCER) ;
int nDivine = GetLevelByClass(CLASS_TYPE_CLERIC)
+ GetLevelByClass(CLASS_TYPE_DRUID)
+ GetLevelByClass(CLASS_TYPE_SHIFTER)
+ GetLevelByClass(CLASS_TYPE_PALADIN)
+ GetLevelByClass(CLASS_TYPE_HARPER)
+ GetLevelByClass(CLASS_TYPE_RANGER) ;
int nTypeMagie = (nDivine > nProfane) ? nDivine : nProfane ;
int nSkillUMD = d20() + GetSkillRank(SKILL_USE_MAGIC_DEVICE) + nTypeMagie ;
int nDC_UMD = stS.nSSDC-10 + GetCasterLevel(OBJECT_SELF) ;
if( stS.nSpId == SPELL_RAISE_DEAD ){ nDC_UMD = 2 ; }
if( nDC_UMD > nSkillUMD ){
SendMessageToPC(OBJECT_SELF,"Utilisation des Objets Magiques : Jet "
+IntToString(nSkillUMD)+", DC = "+IntToString(nDC_UMD)+"");
SetModuleOverrideSpellScriptFinished();
return ;
} else {
SendMessageToPC(OBJECT_SELF,"Utilisation des Objets Magiques : Jet "
+IntToString(nSkillUMD)+", DC = "+IntToString(nDC_UMD)+"");
}
}
/* classic spell-hooking */
/*
switch (stS.nSpId) {
case SPELL_FIREBRAND:
ly_s0_firebrand(stS) ;
SetModuleOverrideSpellScriptFi nished();
DeleteLocalInt(OBJECT_SELF,&qu ot;BUSY");
// DoMissileStorm(stS,1, 15, SPELL_FIREBRAND, VFX_IMP_MIRV_FLAME, VFX_IMP_FLAME_M, DAMAGE_TYPE_FIRE, FALSE, TRUE);
// SetModuleOverrideSpellScriptFi nished();
break ;
case SPELL_DIVINE_POWER: ly_s0_divpower(stS) ; break ;
case SPELL_ISAACS_LESSER_MISSILE_ST ORM: ly_s0_missstorm1(stS) ; break ;
case SPELL_ISAACS_GREATER_MISSILE_S TORM: ly_s0_missstorm2(stS) ; break ;
case SPELL_VIRTUE: ly_s0_virtue(stS) ; break ;
} // end switch statement */
}