and one if oCreature is holding a light weapon. I could prob. make these myself, but it take awhile and I prob. miss something so I figured I ask the scripting gods
Need a couple functions
#1
Posté 08 décembre 2011 - 04:55
and one if oCreature is holding a light weapon. I could prob. make these myself, but it take awhile and I prob. miss something so I figured I ask the scripting gods
#2
Posté 08 décembre 2011 - 05:10
int GetIsTwoHandedWeapon(object oWeapon)
{
switch(GetBaseItemType(oWeapon))
{
case BASE_ITEM_GREATAXE:
case BASE_ITEM_SHORTSPEAR:
case BASE_ITEM_TRIDENT:
case BASE_ITEM_GREATSWORD:
case BASE_ITEM_HALBERD:
case BASE_ITEM_SCYTHE:
case BASE_ITEM_HEAVYFLAIL:
case BASE_ITEM_QUARTERSTAFF:
return TRUE;
case BASE_ITEM_SCIMITAR:
case BASE_ITEM_CLUB:
case BASE_ITEM_MORNINGSTAR:
case BASE_ITEM_LIGHTFLAIL:
case BASE_ITEM_WARHAMMER:
case BASE_ITEM_BATTLEAXE:
case BASE_ITEM_BASTARDSWORD:
case BASE_ITEM_LONGSWORD:
case BASE_ITEM_RAPIER:
case BASE_ITEM_DWARVENWARAXE:
switch(CORE_GetRacialType(GetItemPossessor(oWeapon)))
{
case RACIAL_TYPE_GNOME:
case RACIAL_TYPE_HALFLING:
return TRUE;
}
/*if(!GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,GetItemPossessor(oWeapon))))
{//SPECIAL: one handed weapon holded in two hands
return TRUE;
}*///guess this wont fit you
}
return FALSE;
}
int GetIsLightWeapon(object oWeapon)
{
object oPC = GetItemPossessor(oWeapon);
object oRightWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
if(oRightWeapon == oWeapon)
return FALSE;
if(StringToInt(Get2DAString("baseitems","WeaponSize",GetBaseItemType(oWeapon))) < GetCreatureSize(oPC))
return TRUE;
return FALSE;
}
#3
Posté 08 décembre 2011 - 06:46
int GetIsTwoHandedWeapon(object oWeapon)
{
if(oWeapon == OBJECT_INVALID)
return FALSE;
object oCreature = GetItemPossessor(oWeapon);
int nWeaponSize = StringToInt(Get2DAString("baseitems", "WeaponSize",GetBaseItemType(oWeapon)));
if(GetWeaponRanged(oWeapon))
return FALSE;
//Rules out base item type torch, and possible custom modifications to baseitems.2da
if(!StringToInt(Get2DAString("baseitems", "WeaponType", GetBaseItemType(oWeapon))))
return FALSE;
int nCreatureSize = GetCreatureSize(oCreature);
if(nCreatureSize + 1 == nWeaponSize)
return TRUE;
return FALSE;
}
For the second script torches could return as light weapons. A simple base item check should fix this easily.
#4
Posté 08 décembre 2011 - 06:48
[Edit] *Snip* Just realized both rely on NWNX, sorry.
Funky
Modifié par FunkySwerve, 08 décembre 2011 - 06:50 .
#5
Posté 08 décembre 2011 - 07:39
Does work.WhiZard wrote...
The first script looks good, though it doesn't consider epic minotaur shape and drider shape (large creature with large weapon)
yea right. Im using it after I find out its a weapon so I havent think of that so check whether baseitem matches shields/torch and if so return FALSEFor the second script torches could return as light weapons. A simple base item check should fix this easily.
Modifié par ShaDoOoW, 08 décembre 2011 - 07:42 .
#6
Posté 08 décembre 2011 - 07:25
ShaDoOoW wrote...
Does work.WhiZard wrote...
The first script looks good, though it doesn't consider epic minotaur shape and drider shape (large creature with large weapon)
What I meant is epic minotaur and drider don't get the 2 handed strength bonus, but your script acknowledges them as two-handing a weapon.
#7
Posté 08 décembre 2011 - 10:17
#8
Posté 10 décembre 2011 - 06:12
if (GetWeight(oItem) >12)
Or whatever the weight for the lightest 2-hander is. Of course if you have extremely light 2-handed weapons, by using weight reduction, this will not work, but if you do then what is the point of this script?
Simpler than listing all the weapons.
And the function to check if it's ranged:
if (GetWeaponRanged(oItem))
Unneeded if you are just interested in how much the thing weighs, which is what I'm guessing.
Modifié par ffbj, 10 décembre 2011 - 06:16 .
#9
Posté 10 décembre 2011 - 08:55





Retour en haut






