Increase attack when leveling up

tayloong

New member
Guys, in the case of a levelUP script, I would like to know if there is a possibility of
increase the damage of attack box when player level up.

I tryed this code:

CODE:
changeentityproperty(ent,"offense",openborconstant("ATK_NORMAL"),1.0);

What I am doing wrong?

data\scripts\levelup.c


void setAbi2(void plIndex, void ent, int delta)
{
changeentityproperty(ent,"maxhealth",getentityproperty(ent,"maxhealth")+10*delta);
changeentityproperty(ent,"health",getentityproperty(ent,"maxhealth"));
changeentityproperty(ent,"offense",openborconstant("ATK_NORMAL"),1.0);
//changeentityproperty(ent,"defense",openborconstant("ATK_NORMAL"),1.0);
}
 
FYI
changeentityproperty(ent,"offense",openborconstant("ATK_NORMAL"),1.0);

Makes entity's normal attack x1 IOW same as before

If you want to increase attack damage, you need to acquire entity's level then multiply it with a factor. Something like this:

changeentityproperty(ent,"offense",openborconstant("ATK_NORMAL"), Lvl*R);

With this, at lvl 1, entity will have R power of normal attack; at lvl 2, Rx2 power and so on

I can't give direct script yet cause IIRC there is a way to acquire lvl in levelup scripts you're using but I forgot how
You can define R yourself though
 
Back
Top Bottom