| Code: |
var mnoznik:= RandomInt(GetEffectiveSkill(who, SKILLID_NECROMANCY) - NpcResist)/100;
if(mnoznik<=0)
mnoznik:=0.01;
endif
var newStats:=newStatistics(npcConfigElem,mnoznik);
var creature:=CreateNpcFromTemplate(template, trup.x, trup.y, trup.z, [b]newStats[/b]);
print(creature);
|
| Code: |
function newStatistics(npc,m)
var newStat:= struct;
newStat.+Color:=1109; newStat.+trueColor:=1109;
newStat.+STR:=Cint(m*npc.STR); newStat.+INT:=Cint(m*npc.INT); newStat.+DEX:=Cint(m*npc.DEX);
return newStat;
endfunction
|
| Code: |
error{ errortext = "Parameter 4 must be a Struct or Integer(0), got Struct" } |