CEP weapons

Go down

CEP weapons

Post by Taswombat on Sat Apr 14, 2012 10:05 pm

Just a simple query.

Is there an easy way to allow the use of CEP weapons with feats, focus and specialization etc

Taswombat

Posts : 2
Join date : 2012-03-24

View user profile

Back to top Go down

Re: CEP weapons

Post by The Amethyst Dragon on Sun Apr 15, 2012 2:46 pm

The simple answer: no

Weapon Focus and Weapon Specialization (and Weapon of Choice for the weapon master prestige class) are basically hardcoded in the game engine. New weapon item types do not get the benefit of those feats applying to them.

With quite a bit of work, you can add such feat choices, but they wouldn't really have any effect in-game. Additional custom scripting and workarounds would be needed (such as adding temporary attack/damage bonuses via scripting when such an item is equipped, and removing said bonuses when removed).
avatar
The Amethyst Dragon
Custom Content Wyrm: CEP 2.60+

Posts : 103
Join date : 2012-01-21
Age : 42
Location : lLoc = GetLocation(oDragon);

View user profile http://www.amethyst-dragon.com/nwn

Back to top Go down

Re: CEP weapons

Post by Taswombat on Sun Apr 15, 2012 5:46 pm

Thank you for the prompt reply ... sigh another dream shattered Twisted Evil


P.S your Pod casts have been extremely funny, my Wife who is the scripter. has been cackling away.


Taswombat

Taswombat

Posts : 2
Join date : 2012-03-24

View user profile

Back to top Go down

Re: CEP weapons

Post by Tyndrel on Mon Apr 16, 2012 2:13 am

There are these on the NWVault but I have not used them myself.

CEP weapon script

CEP new weapons feats workaround

The down side of this is that these will count towards the +20 ceiling.


The other option that I've seen used is to modify the 2da to include them as the nearest existing weapon types.

jocolor
avatar
Tyndrel

Posts : 67
Join date : 2012-01-28

View user profile

Back to top Go down

Re: CEP weapons

Post by kalbaern on Mon Apr 16, 2012 11:31 am

The other option that I've seen used is to modify the 2da to include them as the nearest existing weapon types.

How is this done? Is it just the Base Item 2da needing changed and would players require the change or is it just serverside?

kalbaern

Posts : 25
Join date : 2012-01-28

View user profile

Back to top Go down

Re: CEP weapons

Post by The Amethyst Dragon on Sun Dec 01, 2013 7:55 pm

Updated information. Smile

I've been using a NWNX2 plugin called nwnx_weapons, created by Terra_777 to allow CEP weapons to use the closest standard weapon feats (for Weapon Focus, Specialization, etc.).  It works very well on my Windows XP server.

Forum/download link: http://www.nwnx.org/phpBB2/viewtopic.php?t=2116
avatar
The Amethyst Dragon
Custom Content Wyrm: CEP 2.60+

Posts : 103
Join date : 2012-01-21
Age : 42
Location : lLoc = GetLocation(oDragon);

View user profile http://www.amethyst-dragon.com/nwn

Back to top Go down

Re: CEP weapons

Post by Quilistan on Thu Jan 04, 2018 5:29 pm

What is needed to get the weapon enchantment spells to work with the CEP Custom weapons.

I have set the #include zep_inc_main in the spell scripts x2_i0_spells and x0_i0_spells

and added them to the lists in x2_i0_spells and compiled.

Quilistan

Posts : 1
Join date : 2018-01-03

View user profile

Back to top Go down

Re: CEP weapons

Post by The Amethyst Dragon on Fri Jan 05, 2018 1:22 am

If you are already including zep_inc_main into your spells scripting, that really just adds constants that reference baseitems.2da.

You would need to edit your weapon enchantment spell scripts to add the weapon types into the checks the spell scripts do. Use either those constants (if they show up in your list by including that script), or the line numbers from the 2da file for those item types.

As an example, let's check the x2_s0_flmeweap script (for flame weapon). Line 69 is:
object oMyWeapon   =  IPGetTargetedOrEquippedMeleeWeapon();

Looks like that function gets the targeted weapon, or if you didn't target one it checks if you have one equipped. It then checks to see if it's a melee weapon. But that check is currently done with a function that's defined in another script.

You'd need to add another check to that script to get the targeted item, get its base item type, check to see if the type is a normal or CEP melee weapon, and if so, apply the spell's effects to the weapon.

It's not the simplest of tasks, but not particularly difficult to script either.

You'd probably just want to swap out the built-in checking function and do one of your own right in the script so you can include the CEP weapon types in the list to get checked.

Since GetBaseItemType() returns an integer value (the line number from baseitems.2da), you can use a switch to check through all the possible values.

int nItemType = GetBaseItemType(oWeapon);
int nIsMelee;
switch (nItemType)
{
case BASE_ITEM_BASTARDSWORD:
case BASE_ITEM_BATTLEAXE:
case BASE_ITEM_DOUBLEAXE:
...
case 318:                                   // maul
case 323: nIsMelee = TRUE;
}
if (nIsMelee == TRUE)
   {
   DoTheThingToTheWeapon...
   }

Or, if you don't like switch checks, you can do an "if/else if" check...

if (nItemType == BASE_ITEM_BASTARDSWORD) { nIsMelee = TRUE; }
else if (nItemType == BASE_ITEM_BATTLEAXE) { nIsMelee = TRUE; }
...
else if (nItemType == 318) { nIsMelee = TRUE; }

Or you can do an "or" check in an if line...

if (nItemType == BASE_ITEM_BASTARDSWORD || nItemType == BASE_ITEM_BATTLEAXE || nItemType == 318)
{
nIsMelee = TRUE;
}
avatar
The Amethyst Dragon
Custom Content Wyrm: CEP 2.60+

Posts : 103
Join date : 2012-01-21
Age : 42
Location : lLoc = GetLocation(oDragon);

View user profile http://www.amethyst-dragon.com/nwn

Back to top Go down

Re: CEP weapons

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum