I found out some quirks that wasnt documented in lexicon, might be usefull:
SetBaseAttackBonus- works on player characters
ActionOpen/CloseDoor- when the door are already opened/closed the OnOpen/OnClose event is still fired
SetLocked- when the object is already (un)locked, the On(Un)locked event is still fired
SetImmortal- (I made a big research few year ago about immortality also granting an immunity to many effect, however I lost it, it is somewhere in old bioware scripting forum...)
GetStringLower/UpperCase- can't handle non-english characters, when characters like ÚĚČžýá encountered, it that case functions returns input
GetSpellId- returns -1 if called inside of AOE script, GetEffectSpellId(EffectDaze()) will workaround this
GetSpellSaveDC- if used in spellscript that fired from feat (feat that triggered spell) and the caster has his primary ability for that feat below 10, then this function returs very odd values beyond 100
x works correctly in AOE scripts, at least in 1.69
ResistSpell- passes into consideration spell info from caster's last cast spell, thus for example immunity to AoE spell is not possible to guarantee and may be exploited
GetResRef- works correctly on areas
- returns empty string when used on doors
EffectAttackIncrease- ATTACK_BONUS_ONHAND and OFFHAND does not stacks with weapon's attack/enhancement bonus
GetCreatureTalentBest and GetCreatureTalentRandom- specifying category 1 actually returns talents of category 11 and vice versa
- returns invalid talent if the creature is immobilized (toolset speed setting, entangle effect or cutscene immobility)
- random doesn't return truly random talent but rather random within best CR (EDIT: not sure about this anymore, my recent tests didnt confirmed it)
- best, if CR = -1 works like random, CR = 0 returns potions, scrolls and other items, spell has CR equal to (InnateLevel*2)-1, feats probably 0 as well
- if category = 0, returns anything without category, known feats (but not with 0 uses) and skills
EffectSpellResistanceDecrease- cannot decrease spell resistance gained from Diamond Soul feat, not even if applied permanently/supernaturally
EffectNegativeLevel- limit is indeed 100
- lexicon description is missing parameter int bHPBonus, but this parameter is ignored anyway
GetFirst/NextInShape- returns placeables correctly despite what lexicon says
EffectSeeInvisibility- cannot be used in conjuction with EffectVersus*
EffectTrueSeeing has probably the same issue
GetLastSpellHarmful()- returns exact value passed into EventSpellCastAt function (this can be usefull for custom behavior)
GetTurnResistanceHD- works on non-undead creatures
- doesnt work on player characters except possesed DM/familiar
GetAILevel- on creature with unset AI level or ai level set to -1 (default or invalid), function returs AI_LEVEL_LOW when there is a player character in same area as creature or AI_LEVEL_VERY_LOW when not
SetAILevel- setting AI_LEVEL_VERY_HIGH or any custom value higher than 3 results into AI_LEVEL_HIGH (3)
DecrementRemainingSpellUses- cannot decrement spell that creature have memorised but shouldn't be able to use, for example if creature has a sixth level memorised under Spells tab but has caster ability only 15 or less, this function fails. Same spell given as Special ability is decremented properly.
- function decrements spontaneuos spell uses properly
GetHasSpell- returns 1 for each spontaneou use when looking for cure/inflict spells cast by cleric
Not internal functions done by Bioware. Note the remarks Ive written are fixed and corrected in latests Community Patches.
GetIsMagicStatBonus (x2_i0_spells)
- returns strength bonus for target without any caster class
- this function should be avoided as it doesn't function correctly when target has more casting classes, only one spellscript uses this function and thats Shelgarn's persistent blade
GetShouldNotCastSpellsBecauseofArmor (nw_i0_generic)
- doesn't consider bards, doesn't consider autostill spell feat or using still metamagic
chooseTactics (nw_i0_generic)
- missing ClearActions before using rage feat causes not using this feat when caller doing something in that moment
- while checking for rage effect when determining whether to use spells at all, it doesn't check for Mighty rage effects.
DetermineclassToUse (nw_i0_generic)
- if creature has two classes, the function often returns (third) invalid class
CountEnemiesAndAllies (x0_i0_enemy)
- counts dead PCs and henchmans
IsOutOfAmmo (x0_i0_equip)
- doesn't considering throwing weapons correctly, thus default AI thinks its out of ammo and unequips them
WiseToDualWield (x0_i0_equip)
- doesn't considering ranger's dual wield feat
bkEquipMelee (x0_i0_equip)
- considering unidentified weapons and shields even when caller(henchman) cannot equip unidentified items
- considering weapons and shield that cannot equip due to the missing proficiences or size category
- function might equip inappropriate weapon for monk characters
- right hand (oRight) is switched for left hand (oLeft) causing character to equip new shield from inventory while already using shield
VerifyCombatMeleeTalent (x0_i0_match)
- considering vermins to be generally immune to stunning fist
- attempting to use smite to neutral targets
TalentHealingSelf (x0_i0_talent)
- inapropriate use of bkTalentFilter when trying to use the spell on self - causes using heal spells on self when caller is undead
TalentUseTurning (x0_i0_talent)
- considering animal domain power as qualify for using turn undead on vermins
TalentSneakAttack (x0_i0_talent)
- doesn't consider death attack or sneak attack from BG class
TalentSeeInvisible (x0_i0_talent)
- doesn't check for true seeing itemproperty
- doesn't consider already existing true seeing, see invisibility effects which might lead into casting the TS over and over
TalentBardSong (x0_i0_talent)
- doesn't check silence which might lead into being stucked
- doesn't check deafness which might lead into repeating this talent over and over
SetLastGenericSpellCast (x0_i0_generic)
- delayed deleting variable in fact leads into casting one spell over and over
bkTalentFilter (x0_i0_generic)
- when checking for PW: Death, the spell is decremented twice
bkRespondToHenchmenShout (x0_i0_henai)
- clearing actions before calling DetermineHenchmanRound might lead into never finishing spellcasting
BehDoFireBeam (x2_inc_beholder)
- BEHOLDER_RAY_FEAR has incorrect value
CICraftBrewPotion and
CICraftScribeScroll (x2_inc_craft)
- removes full stack, if CC allowed empty potions to stack
Modifié par ShaDoOoW, 30 juillet 2012 - 11:31 .