Xardex wrote...
Creating random properties to put into an item is incredibly simple and doesn't require nwnx by a long shot. I find nothing 'clunky' about the biowares functions.
If you read my post, you saw that I didn't say this required nwnx. I simply said that it helps, and it does - immensely. What I said would not confuse you in the least had you actually used the functionality I was talking about. It saves you having to write CLUNKY functions like this one, which is both rediculously long and forces you to check what each parameter is:
itemproperty ItemPropertyDynamic (int nType, int nParam1=0, int nParam2=0, int nParam3=0) {
switch (nType) {
case ITEM_PROPERTY_ABILITY_BONUS:
return ItemPropertyAbilityBonus(nParam1, nParam2);
case ITEM_PROPERTY_AC_BONUS:
return ItemPropertyACBonus(nParam1);
case ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP:
return ItemPropertyACBonusVsAlign(nParam1, nParam2);
case ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE:
return ItemPropertyACBonusVsDmgType(nParam1, nParam2);
case ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP:
return ItemPropertyACBonusVsRace(nParam1, nParam2);
case ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT:
return ItemPropertyACBonusVsSAlign(nParam1, nParam2);
case ITEM_PROPERTY_ADDITIONAL:
return ItemPropertyAdditional(nParam1);
case ITEM_PROPERTY_ENHANCEMENT_BONUS:
return ItemPropertyEnhancementBonus(nParam1);
case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP:
return ItemPropertyEnhancementBonusVsAlign(nParam1, nParam2);
case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_RACIAL_GROUP:
return ItemPropertyEnhancementBonusVsRace(nParam1, nParam2);
case ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_SPECIFIC_ALIGNEMENT:
return ItemPropertyEnhancementBonusVsSAlign(nParam1, nParam2);
case ITEM_PROPERTY_DECREASED_ENHANCEMENT_MODIFIER:
return ItemPropertyEnhancementPenalty(nParam1);
case ITEM_PROPERTY_BASE_ITEM_WEIGHT_REDUCTION:
return ItemPropertyWeightReduction(nParam1);
case ITEM_PROPERTY_BONUS_FEAT:
return ItemPropertyBonusFeat(nParam1);
case ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N:
return ItemPropertyBonusLevelSpell(nParam1, nParam2);
case ITEM_PROPERTY_CAST_SPELL:
return ItemPropertyCastSpell(nParam1, nParam2);
case ITEM_PROPERTY_DAMAGE_BONUS:
return ItemPropertyDamageBonus(nParam1, nParam2);
case ITEM_PROPERTY_DAMAGE_BONUS_VS_ALIGNMENT_GROUP:
return ItemPropertyDamageBonusVsAlign(nParam1, nParam2, nParam3);
case ITEM_PROPERTY_DAMAGE_BONUS_VS_RACIAL_GROUP:
return ItemPropertyDamageBonusVsRace(nParam1, nParam2, nParam3);
case ITEM_PROPERTY_DAMAGE_BONUS_VS_SPECIFIC_ALIGNMENT:
return ItemPropertyDamageBonusVsSAlign(nParam1, nParam2, nParam3);
case ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE:
return ItemPropertyDamageImmunity(nParam1, nParam2);
case ITEM_PROPERTY_DECREASED_DAMAGE:
return ItemPropertyDamagePenalty(nParam1);
case ITEM_PROPERTY_DAMAGE_REDUCTION:
return ItemPropertyDamageReduction(nParam1, nParam2);
case ITEM_PROPERTY_DAMAGE_RESISTANCE:
return ItemPropertyDamageResistance(nParam1, nParam2);
case ITEM_PROPERTY_DAMAGE_VULNERABILITY:
return ItemPropertyDamageVulnerability(nParam1, nParam2);
case ITEM_PROPERTY_DARKVISION:
return ItemPropertyDarkvision();
case ITEM_PROPERTY_DECREASED_ABILITY_SCORE:
return ItemPropertyDecreaseAbility(nParam1, nParam2);
case ITEM_PROPERTY_DECREASED_AC:
return ItemPropertyDecreaseAC(nParam1, nParam2);
case ITEM_PROPERTY_DECREASED_SKILL_MODIFIER:
return ItemPropertyDecreaseSkill(nParam1, nParam2);
case ITEM_PROPERTY_ENHANCED_CONTAINER_REDUCED_WEIGHT:
return ItemPropertyContainerReducedWeight(nParam1);
case ITEM_PROPERTY_EXTRA_MELEE_DAMAGE_TYPE:
return ItemPropertyExtraMeleeDamageType(nParam1);
case ITEM_PROPERTY_EXTRA_RANGED_DAMAGE_TYPE:
return ItemPropertyExtraMeleeDamageType(nParam1);
case ITEM_PROPERTY_HASTE:
return ItemPropertyHaste();
case ITEM_PROPERTY_HOLY_AVENGER:
return ItemPropertyHolyAvenger();
case ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS:
return ItemPropertyImmunityMisc(nParam1);
case ITEM_PROPERTY_IMPROVED_EVASION:
return ItemPropertyImprovedEvasion();
case ITEM_PROPERTY_SPELL_RESISTANCE:
return ItemPropertyBonusSpellResistance(nParam1);
case ITEM_PROPERTY_SAVING_THROW_BONUS:
return ItemPropertyBonusSavingThrowVsX(nParam1, nParam2);
case ITEM_PROPERTY_SAVING_THROW_BONUS_SPECIFIC:
return ItemPropertyBonusSavingThrow(nParam1, nParam2);
case ITEM_PROPERTY_KEEN:
return ItemPropertyKeen();
case ITEM_PROPERTY_LIGHT:
return ItemPropertyLight(nParam1, nParam2);
case ITEM_PROPERTY_MATERIAL:
return ItemPropertyMaterial(nParam1);
case ITEM_PROPERTY_MIGHTY:
return ItemPropertyMaxRangeStrengthMod(nParam1);
case ITEM_PROPERTY_MIND_BLANK:
break;
case ITEM_PROPERTY_NO_DAMAGE:
return ItemPropertyNoDamage();
case ITEM_PROPERTY_ON_HIT_PROPERTIES:
return ItemPropertyOnHitProps(nParam1, nParam2, nParam3);
case ITEM_PROPERTY_QUALITY:
return ItemPropertyQuality(nParam1);
case ITEM_PROPERTY_DECREASED_SAVING_THROWS:
return ItemPropertyReducedSavingThrowVsX(nParam1, nParam2);
case ITEM_PROPERTY_DECREASED_SAVING_THROWS_SPECIFIC:
return ItemPropertyReducedSavingThrow(nParam1, nParam2);
case ITEM_PROPERTY_REGENERATION:
return ItemPropertyRegeneration(nParam1);
case ITEM_PROPERTY_SKILL_BONUS:
return ItemPropertySkillBonus(nParam1, nParam2);
case ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL:
return ItemPropertySpellImmunitySpecific(nParam1);
case ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL:
return ItemPropertySpellImmunitySchool(nParam1);
case ITEM_PROPERTY_THIEVES_TOOLS:
return ItemPropertyThievesTools(nParam1);
case ITEM_PROPERTY_ATTACK_BONUS:
return ItemPropertyAttackBonus(nParam1);
case ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP:
return ItemPropertyAttackBonusVsAlign(nParam1, nParam2);
case ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP:
return ItemPropertyAttackBonusVsRace(nParam1, nParam2);
case ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT:
return ItemPropertyAttackBonusVsSAlign(nParam1, nParam2);
case ITEM_PROPERTY_DECREASED_ATTACK_MODIFIER:
return ItemPropertyAttackPenalty(nParam1);
case ITEM_PROPERTY_UNLIMITED_AMMUNITION:
return ItemPropertyUnlimitedAmmo(nParam1);
case ITEM_PROPERTY_USE_LIMITATION_ALIGNMENT_GROUP:
return ItemPropertyLimitUseByAlign(nParam1);
case ITEM_PROPERTY_USE_LIMITATION_class:
return ItemPropertyLimitUseByclass(nParam1);
case ITEM_PROPERTY_USE_LIMITATION_RACIAL_TYPE:
return ItemPropertyLimitUseByRace(nParam1);
case ITEM_PROPERTY_USE_LIMITATION_SPECIFIC_ALIGNMENT:
return ItemPropertyLimitUseBySAlign(nParam1);
case ITEM_PROPERTY_USE_LIMITATION_TILESET:
break;
case ITEM_PROPERTY_REGENERATION_VAMPIRIC:
return ItemPropertyVampiricRegeneration(nParam1);
case ITEM_PROPERTY_TRAP:
return ItemPropertyTrap(nParam1, nParam2);
case ITEM_PROPERTY_TRUE_SEEING:
return ItemPropertyTrueSeeing();
case ITEM_PROPERTY_ON_MONSTER_HIT:
return ItemPropertyOnMonsterHitProperties(nParam1, nParam2);
case ITEM_PROPERTY_TURN_RESISTANCE:
return ItemPropertyTurnResistance(nParam1);
case ITEM_PROPERTY_MASSIVE_CRITICALS:
return ItemPropertyMassiveCritical(nParam1);
case ITEM_PROPERTY_FREEDOM_OF_MOVEMENT:
return ItemPropertyFreeAction();
case ITEM_PROPERTY_POISON:
break;
case ITEM_PROPERTY_MONSTER_DAMAGE:
return ItemPropertyMonsterDamage(nParam1);
case ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL:
return ItemPropertyImmunityToSpellLevel(nParam1);
case ITEM_PROPERTY_SPECIAL_WALK:
return ItemPropertySpecialWalk(nParam1);
case ITEM_PROPERTY_HEALERS_KIT:
return ItemPropertyHealersKit(nParam1);
case ITEM_PROPERTY_WEIGHT_INCREASE:
return ItemPropertyWeightIncrease(nParam1);
case ITEM_PROPERTY_ONHITCASTSPELL:
return ItemPropertyOnHitCastSpell(nParam1, nParam2);
case ITEM_PROPERTY_VISUALEFFECT:
return ItemPropertyVisualEffect(nParam1);
case ITEM_PROPERTY_ARCANE_SPELL_FAILURE:
return ItemPropertyArcaneSpellFailure(nParam1);
case ITEM_PROPERTY_INVIS_VALUE_DECREASE:
return ItemPropertyInvisValueDecrease(nParam1);
case ITEM_PROPERTY_INVIS_BONUS_FEAT:
return ItemPropertyInvisBonusFeat(nParam1);
}
itemproperty ip;
return ip;
}
Instead, you can just do this, and know in advance what all 6 inputs are:
itemproperty ItemPropertyDirect (int nType, int nSubType, int nCostTable, int nCostValue, int nParamTable, int nParamValue) {
itemproperty ip = ItemPropertyAdditional(0);
SetItemPropertyInteger(ip, 0, nType);
SetItemPropertyInteger(ip, 1, nSubType);
SetItemPropertyInteger(ip, 2, nCostTable);
SetItemPropertyInteger(ip, 3, nCostValue);
SetItemPropertyInteger(ip, 4, nParamTable);
SetItemPropertyInteger(ip, 5, nParamValue);
return ip;
}
No, the vanilla way isn't clunky AT ALL.
There's a reason the nwnx devs add the functions they do.
Funky
Modifié par FunkySwerve, 27 juin 2011 - 09:30 .