ID:155636
Apr 27 2011, 1:06 pm
|
|
hi i would like to know what tyhe proper formula is to have a mob attack my avatar and vice versa. i need to be able to calculate damage attack and defence thank you
|
Apr 27 2011, 3:38 pm
|
|
Be more specific, do you want an attack verb that deals damage or a formula?
|
In response to Neimo
|
|
well im kinda new so i guesse it would be the formula since i want the npc mob to use an attack verb that deals damage to a player avatar when in a distance and if possible also how do i set a certain delay between the time they can attack ( sort of like in world of warcraft with the cooldown)
thanks a bunch in advance |
In response to Natasdrol
|
|
A verb is the code that makes it happen.
A formula is the mathematics used inside the verb to calculate damage. In any case, If you are unable to code this on your own i suggest you read the DM Guide and also view some demos. There is a large amount of demos in the resource section (located at the top of the site under developers menu). Usually a good place to start |
In response to Midgetbuster
|
|
ok i understand the principle but what i mean is how do i make the npc use his attack verb on his own when i get to lets say an inview (3) or something every like 3 seconds. if anyone could help with the formula to make that happen it would be of much help thanks.
|
In response to Natasdrol
|
|
I think he wants to say he wants a proc that makes a monster attacks player if he walks near it and deals damage with 3 seconds delay.
I tried to make that code for you, but failed. I will leave it to professionals. |
In response to Martys1103
|
|
mob/verb/Attack() Tell me if it works. |
In response to Xirre
|
|
If it's npc AI you want, there are plenty of demo's and libs available on the resources for this.
|
In response to Xirre
|
|
thanks a bunch ill try that out and btw this is the best answer iv got up to now ( structured and well explained with examples) and ya ill tell you if it work out good
|
In response to Xirre
|
|
im kinda new to proggraming altogether and this is my first challenge.
this is what ive got up to now. mob icon = 'warrior.dmi' var/life=100 var/def=0.50 // i actually want this to be put into percentage proc/Attack(Att) life=life-Att*def /* life=100 - (att=50 - def=25%) life=87.5 is what i want it to give but since percentage is off it gives me weird numerical outcomes*/ if(life <0) view() <<"[src] dies!" del src if(life >0) view()<< "ennemy has [life] hp left" verb/attack() set src in oview() src.Attack(50) mob/monster/rat icon = 'rat.dmi' life=100 def=0.25 /*id like for the rat to use an attack verb on its own every 5 secs. obj/sword icon = 'sword.dmi' verb get() set src in usr.loc loc = usr drop() set src in usr loc = usr.loc //add Att to mob!!! if anyone could help me out would be great thanks |
In response to Natasdrol
|
|
Try this(?. I might be a bit rusty but it will be simpler code)
mob The rest of this code i will have to look at in more depth but scince 100% = the base defence of the mob that means 50% = half of the mobs defence. /2 = devide by 2 so the math up there say user's defence equals half of its base defence or soemthing to that effect. Of course it could just poop out and end up chaning the default defence var into half of the warriors defence meaning the rat might have the full 100% defence of a warrior.. Uber rat much |