Posted: Fri Apr 21, 2006 3:25 pm Post subject: Giving a monster...
Okay i would need some help... I don't know where to start but the thing i
need help is giving a moster a certain amount of EXP and level. I want it to be quite easy to change the EXP amount and what lvl a moster got.
Something like this
Code:
NPCTEMPLATE snake
{
Name a snake
script killPCs
objtype 0x0034
Color 0x0000
TrueColor 0x0000
Gender 0
STR 34
DEX 25
INT 10
HITS 34
LEVEL 1
EXP 100
STAM 25
MANA 0
AttackSpeed 35
AttackDamage 2D4
AttackAttribute Wrestling
The EXP should be written in scrips>misc>death.src well atleast ive been told that. But i don't know how to make the script read how much EXP the monster got and the give it to the player.
I wanna know how to display the level over the monster like [Level:1] but thats not necessary.
In NPCkeeper.src make few setobjproperty for every created snake/monster/etc (if in npcdesc.cfg it have EXP). As i think you woul'd like to use such system for other NPC'es.
Your snake is lvl 1 and 100 exp
but for example you would like to have few snakes with different EXP and LEVEL.
Sooooooooo...
back to NPCkeeper
Code:
var pncfg := ReadConfigFile("npcdesc");
var maxlevel := pncfg[who.npctemplate].LEVEL;
var exp:=pncfg[who.npctemplate].EXP;
var lvl:=randomint(maxlevel)+1;
setobjproperty(who,"LEVEL",lvl);
setobjproperty(who,"EXP",exp*lvl);
rename(who,who.name+" [level:"+lvl+"]";
Yea that sounds nice. and for giving the player who killed a monster that amount of experience i would need to write something in death.src right?
like
Code:
var EXP := CInt(GetObjProperty(corpse, "EXP"));
SetObjProperty(killer, "expe", (expe + EXP));
[/code]
Author
Message
Gnafu
Joined: 02 Feb 2006 Posts: 88 Location: Livorno, Italy
Posted: Sat Apr 22, 2006 3:36 am Post subject:
but different levels snakes are the same snake...
i mean:
you don't have any difficult to kill a snake level 200 if you are able to kil a snake level 1..
Well the snake was just an example how i would want to write how much exp and level a monster would have.
Author
Message
Tritan
Joined: 04 Feb 2006 Posts: 136 Location: Illinois, USA
Posted: Sun Apr 23, 2006 4:13 pm Post subject:
I did something like this on my server. I set an experience tag on each npc template with a value of 1 to 5. (level 1 to 5)
With this I do a check in the death and loot scripts to determine how much experience and loot will be found on each npc. Then I take that value and put a small random chance on top of it to keep things somewhat random within a given range.