Getting weird errors in the complier for reasons I don't understand. I made a duplicate of talent_singletarget.nss to play around with using the toolset right-click menu command "duplicate." I proceed to jump straight down to case ABILITY_TALENT_MIGHTY _BLOW and start playing with the damage, writing two lines.
case ABILITY_TALENT_MIGHTY_BLOW:
{
object oWeapon = GetItemInEquipSlot(INVENTORY_SLOT_MAIN, stEvent.oCaster);
float nStrength = GetCreatureProperty(stEvent.oCaster, PROPERTY_ATTRIBUTE_STRENGTH ,PROPERTY_VALUE_CURRENT); // Curtesy of SuperD
// if the attack hit
int nResult = Combat_GetAttackResult(stEvent.oCaster, stEvent.oTarget, oWeapon, 10.0f, stEvent.nAbility);
if (IsCombatHit(nResult) == TRUE)
{
if (nResult == COMBAT_RESULT_HIT)
{
nResult = COMBAT_RESULT_CRITICALHIT;
}
float fDamage = Combat_Damage_GetAttackDamage(stEvent.oCaster, stEvent.oTarget, oWeapon, nResult, 0.0f);
/*
DML says: Let strength scale the damage. 1% damage per point of strength. It is MIGHTY blow, after all.
*/
fDamage = fDamage;// * (1.0f + .01f * (float)nStrength);
// apply impact
eEffect = EffectImpact(fDamage, oWeapon,0, stEvent.nAbility);
Combat_HandleAttackImpact(stEvent.oCaster, stEvent.oTarget, nResult, eEffect);
if (IsCreatureSpecialRank(stEvent.oTarget) == FALSE)
{
eEffect = Effect(EFFECT_TYPE_HEAVY_IMPACT);
ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);
}
}
break;
}
The two red lines are the ones I added. The second line, as you can see, has a comment dead center: essentially it does nothing but annoy the compiler into giving me "E: 16:38:36 - dmltalent_singletarget.nss - dmltalent_singletarget.nss(704): Unknown state in compiler". Commenting out the second line (that is, fDamage = fDamage) lets the compiler skip right past it to the other errors I've made such as fKillshotRatio = .15f; and other unoffensive things of that nature. I'm not sure what's wrong here, but it feels like I'm missing something really simple.
Modifié par DodgeMoreLightning, 02 janvier 2010 - 01:38 .





Retour en haut






