Ok so i have the basics of leveling up and death checking down.
What i'm trying to do is award exp based on the players level relative to the target it has killed.
Example
if(M.Level>=src.Level)
//whatever happens
if(M.Level<=src.Level)
//whatever happens
But problem is when i go about setting this up, I tried just adding it into my level check, but it doesnt work, I tired adding it to the attack code, but it doesnt work.
Advise? and/or and example?
ID:155051
Oct 1 2011, 10:42 am (Edited on Oct 1 2011, 5:24 pm)
|
|
In response to Dj dovis
|
|
and i seriously need examples
|
In response to Komuroto
|
|
if(usr.level <= 5)//these would only work if you have 1 type of monster Now here is something to check for another mob if(istype(src,/mob/monster/whatever)) I would personnally have this and check a whole different proc to see how much a person would gain from that kill instead of stacking all of it into a deatcheck proc //heres now how everything could be You could also just check the mobs level and reward the person based on their level.But this depends on your attack and deathcheck procs. Hope this helps |
In response to Dj dovis
|
|
Thanks I'll take that all into consideration as i work on this.
|
In response to Dj dovis
|
|
Dj dovis wrote:
> if(usr.level <= 5)//these would only work if you have 1 type of monster Now here is something to check for another mob > if(istype(src,/mob/monster/whatever)) I would personnally have this and check a whole different proc to see how much a person would gain from that kill instead of stacking all of it into a deatcheck proc > //heres now how everything could be You could also just check the mobs level and reward the person based on their level.But this depends on your attack and deathcheck procs. I might need a bit more elabaration, as what i'm trying to do is have it so when a player attacks any mob(key or !key) they will gain levels accordingly. I know this needs to be figured out through the death proc, but when i try to set things up I never get any exp. Unless i Just do the standard basic level up system... |
In response to Komuroto
|
|
proc/Attack() |
In response to ANiChowy
|
|
For the love of christ.
Use arguements to set that mob = M and do M.exp +=5 |
In response to ANiChowy
|
|
ANiChowy wrote:
> proc/Attack() If you want to help, at least give information with the code snippet contained in your post; the post is very uninformative. if(usr.level <= 5)//these would only work if you have 1 type of monster The 5 in the second <code>if</code> statement should be either 6 or remove the <code>=</code> sign. proc This can be called in your <code>death_check()</code> proc, along the lines of: <code>reward_experience( src , mob )</code> or whatever you are passing the killer for mob. |
In response to Neimo
|
|
fine
some_kinda_stat_thing okay did I give enough example yet? |
In response to ANiChowy
|
|
This is quite irrelevant as I was not talking about that kind of "information". I was merely referring to your simple post with 2 lines of code that had no explanations included within it. Oh and, you do not have to get all defensive.
|
In response to Neimo
|
|
"as what i'm trying to do is have it so when a player attacks any mob(key or !key) they will gain levels accordingly."
Dunno how much explanation you really need for that.. proc |
In response to ANiChowy
|
|
ANiChowy wrote:
"as what i'm trying to do is have it so when a player attacks any mob(key or !key) they will gain levels accordingly." > proc AS this doesnt even answer my question in the first place... Its irrelevant... Edit: I may not know how to do this exact function directly, but you can't assume everyone who doesnt know something is a complete idiot.... Your example is something that ANYONE should already know. |
In response to Neimo
|
|
if(usr.level <= 5)//these would only work if you have 1 type of monster The 5 in the second <code>if</code> statement should be either 6 or remove the <code>=</code> sign. > proc This can be called in your <code>death_check()</code> proc, along the lines of: <code>reward_experience( src , mob )</code> or whatever you are passing the killer for mob. mob So THIS is what I understood from what you said. Correct? EDIT: Dont know why my Del is all the way out there like that xD 2nd:edit: I know this isnt a snippet, it needs to be worked with. But really everyone seems to be avoiding my actual question. So let me readd it. How do I APPLY this? I know where it goes, I know how to stick it in there, what I don't know how to do is make it assign EXP properly... |
In response to Dj dovis
|
|
Dj dovis wrote:
For the love of christ. you mean aproc(mob/m) How on earth does that answer my question in the LEAST? I already know this, thats not what i was asking. |
In response to Komuroto
|
|
I do not understand what you cannot.
var/damage = 10 ; mob.stamina -= damage ; mob.death_check()
Suspecting your attack verb finds a mob, generates damage, subtracts it and then calls the death check like above you would continue like so. if( stamina < 1 ) <code>return_experience( mob/target )</code> would return the amount of experience to add to the killer. This would be the <code>death_check()</code>. return_experience( mob/target ) In this scenario, the <code>target</code> is the one being killed, in the <code>death_check()</code> the enemy is the one who is killing the <code>target</code>. |
In response to Komuroto
|
|
Komuroto wrote:
ANiChowy wrote: > > proc AS this doesnt even answer my question in the first place... I did not assume that. My example is not something that anyone should already know but...anyone posting here should definitely understand the example I posted. |
I give you examples but I am on the phone now :P