CoPaP Forum Index CoPaP
 A community of linked Neverwinter Nights worlds. 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 RegisterRegister   Log inLog in 
The time now is Wed Nov 13, 2019 10:05 am
All times are UTC - 5
View posts since last visit
View unanswered posts
 Forum index » General Forums » Scripters and Coders' Forum
Magic Weapon Change for Gloves
Post new topic   Reply to topic View previous topicView next topic
Page 1 of 1 [5 Posts]  
Author Message
Fredegar
Noobie

Joined: 01 Nov 2005
Posts: 4
 Magic Weapon Change for Gloves

For Hades, I modified the Greater Magic Weapon and Magic Weapon spell script to allow BASE_ITEM_GLOVES to be enchanted by the spell. Gloves will not take an enhancement type Enhancement so my work around was to have it apply a seperate Attack bonus and Damage bonus to the enchanted glove. If any other worlds want to use it, I'm sure your monks will appreciate it.

A huge thanks for those who have worked and continue to work on the spellhooking code.

This is the version for Greater Magic Weapon. Magic Weapon would be the same but with the enhancement set to 1.




Quote:
case SPELL_GREATER_MAGIC_WEAPON :
//::///////////////////////////////////////////////
//:: Greater Magic Weapon
//:: V1.5
//:: Bioware: X2_S0_GrMagWeap
//:://////////////////////////////////////////////
{
effect eVis = EffectVisualEffect( VFX_IMP_SUPER_HEROISM );
effect eLink = EffectVisualEffect( VFX_DUR_CESSATE_POSITIVE );
int iDuration = iLevel;
int iBonus = iLevel / 4;

//Limit iLevel to 5, so it max out at +5 enhancement to the weapon.
if(iBonus > 5) iBonus = 5;

object oWeapon = SHS_GetTargetedOrEquippedMeleeWeapon(oTarget);
object oOwner = GetItemPossessor(oWeapon);

int iMilitantLevels;
if (MILITANT_LEVEL_BONUSES_ON)
{
iMilitantLevels = SHS_GetMilitantLevels(oOwner);
if (DEBUG) SendMessageToPC(oCaster, "avlis_spellhook:main():SPELL_GREATER_MAGIC_WEAPON: Militant Level: " + IntToString(iMilitantLevels));
}

if (GetWasMetamagicFeatUsed(iMeta, METAMAGIC_EXTEND)) iDuration = iDuration * 2; //Duration is +100%

// Militant Level Bonuses provide better buffs based on the number of
// militant levels a fighter style character has.
if (MILITANT_LEVEL_BONUSES_ON)
{
if (iMilitantLevels >= 6) iBonus++; //Enhancement bonus bump +1
if (iMilitantLevels >= 16) iDuration = iDuration + iDuration / 2; //Duration increased 50% - this stacks with Extend Spell
if (iMilitantLevels >= 26) iBonus++; //Enhancement bonus bump +1, total bump +2
if (iMilitantLevels >= 36) iBonus++; //Enhancement bonus bump +1, total bump +3
}
//Check to see if target is wearing gloves.
if((GetIsObjectValid(oWeapon)) && (GetBaseItemType(oWeapon)==BASE_ITEM_GLOVES))
{
SignalEvent(oOwner, EventSpellCastAt(oCaster, iSpell, FALSE));
if (iDuration>0)
{
//Code to keep people from enchanting weapons held by fighters then switching them.
if (MILITANT_LEVEL_BONUSES_ON && iMilitantLevels >= 6)
{
if (iMilitantLevels >= 6) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 1);
if (iMilitantLevels >= 16) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 2);
if (iMilitantLevels >= 26) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 3);
if (iMilitantLevels >= 36) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 4);
DelayCommand(TurnsToSeconds(iDuration), DeleteLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON"));
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, GetItemPossessor(oWeapon), TurnsToSeconds(iDuration));
IPSafeAddItemProperty(oWeapon,ItemPropertyAttackBonus(iBonus), (TurnsToSeconds(iDuration)), X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,FALSE,TRUE);
IPSafeAddItemProperty(oWeapon,ItemPropertyDamageBonus(IP_CONST_DAMAGETYPE_BLUDGEONING, iBonus), (TurnsToSeconds(iDuration)), X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,FALSE,TRUE);
}
}
else if(GetIsObjectValid(oWeapon) )
{
SignalEvent(oOwner, EventSpellCastAt(oCaster, iSpell, FALSE));
if (iDuration>0)
{
//Code to keep people from enchanting weapons held by fighters then switching them.
if (MILITANT_LEVEL_BONUSES_ON && iMilitantLevels >= 6)
{
if (iMilitantLevels >= 6) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 1);
if (iMilitantLevels >= 16) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 2);
if (iMilitantLevels >= 26) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 3);
if (iMilitantLevels >= 36) SetLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON", 4);
DelayCommand(TurnsToSeconds(iDuration), DeleteLocalInt(oWeapon, "SPELL_GREATER_MAGIC_WEAPON"));
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, GetItemPossessor(oWeapon));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, GetItemPossessor(oWeapon), TurnsToSeconds(iDuration));
IPSafeAddItemProperty(oWeapon,ItemPropertyEnhancementBonus(iBonus), (TurnsToSeconds(iDuration)), X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,FALSE,TRUE);
}

}
else
FloatingTextStrRefOnCreature(83615, oCaster);
}
break;


PostPosted: Fri Dec 30, 2005 1:39 am
 View user's profile Send private message
Reply with quote Back to top 
jaythespacehound
Groundling

Joined: 16 Feb 2005
Posts: 93
Location: Hobart Australia
Nice to see, thank you.
Jay
________________
Outlands Head Coder

PostPosted: Fri Dec 30, 2005 8:33 am
 View user's profile Send private message Send e-mail
Reply with quote Back to top 
Loki70
Planewalker

Joined: 26 Sep 2005
Posts: 27
Location: Seattle, WA
*pokes the Avlis coders*

PostPosted: Fri Dec 30, 2005 9:26 pm
 View user's profile Send private message MSN Messenger
Reply with quote Back to top 
PlasmaJohn
Planewalker

Joined: 10 Apr 2004
Posts: 27
A similar change was made in Spellhooking 1.7.3.1 which was released to the MC's recently. That or 1.7.3.2 (not yet out) will start showing up during the next few release cycles.

PostPosted: Thu Jan 05, 2006 12:01 pm
 View user's profile Send private message
Reply with quote Back to top 
Loki70
Planewalker

Joined: 26 Sep 2005
Posts: 27
Location: Seattle, WA
Tested it with my main, no effect. Tested with three types of gloves (custom plot, custom, and bioware). I will test it again (could be that the server was not updated)

PostPosted: Thu Jan 05, 2006 7:16 pm
 View user's profile Send private message MSN Messenger
Reply with quote Back to top 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topicView next topic
 Forum index » General Forums » Scripters and Coders' Forum
Jump to:  

You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1404s ][ Queries: 11 (0.1013s) ][ GZIP on - Debug on ]