ID:268233
 
Well, my selection code is kinda messy and there are several the same errors..please help. =)

//*********
//**Login**
//*********
world
mob = /mob/create_character
mob //Trunk meaning Mobile object
caracter
icon = 'person.dmi'
verb //Now to allow this player to do actions, by giving them a verb.
say(msg as text) //The say part is the name of the verb. The () part of this is called the arguments. All verbs and procs(Procedures) have argumentss. In this say verb, the argument tells it to set a new var(msg) to something that the Player types (as text)
view(src) << "[src] says: [msg]" //In view of the source(src), output the message "Jaimy says: Hello!!!". Jaimy being [src] and Hello!!! being [msg].

mob/create_character
var/mob/character
Login()
character = new /mob
usr << "<font color=#FFFFFF>The owners of these sites have helped making this game:"
usr << "<font color=#FF0000>http://www.zelldot.tk/"
usr << "<font color=#FF0000>http://www.dangersprites.tk/"
usr << "<font color=#FFFFFF>also, checkout the L.O.T.M. Site !"
usr << "<font color=#FF0000>http://www.lotmdot.tk/"
usr << sound('lotm_world.mid',1)
var/charactername = input("Whats your name ?","L.O.T.M.")
character.icon = 'person.dmi' //makes it so all mobs will be created with the person icon
character.icon_state = input(usr,"Select your Class :") in list("warrior","mage(f)","ninja", "mage(m)","thief") //when a player logs in, make their icon's state
if(a=="warrior")
usr.HP = 200 //The player will have 100 HP...
usr.Max_HP = 200 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 45 // 10 strength
usr.Defense = 30 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="mage(f)")
usr.HP = 125 //The player will have 100 HP...
usr.Max_HP = 125 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 20 // 10 strength
usr.Defense = 15 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="ninja")
usr.HP = 155 //The player will have 100 HP...
usr.Max_HP = 145 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 25 // 10 strength
usr.Defense = 25 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="mage(m)")
usr.HP = 190 //The player will have 100 HP...
usr.Max_HP = 190 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 30 // 10 strength
usr.Defense = 20 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="thief")
usr.HP = 140 //The player will have 100 HP...
usr.Max_HP = 140 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 20 // 10 strength
usr.Defense = 15 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
character.loc = locate(5,5,2)
character.name = charactername
src.client.mob = character
world << "[usr] has joined the world."
usr << sound('castletheme.mid',1)

mob/Logout()
world << "[usr] has left the world."
del(src)//this deletes the characters mob after they leave


and the errors are :

L.O.T.M..dm:34:error:list:undefined proc
L.O.T.M..dm:35:error:a:undefined var
L.O.T.M..dm:46:error:a:undefined var
L.O.T.M..dm:57:error:a:undefined var
L.O.T.M..dm:68:error:a:undefined var
L.O.T.M..dm:79:error:a:undefined var
L.O.T.M..dm:35:error::invalid expression

I-NEED-YOUR-HELP ! I've tried to fix it around 100 times, and took some looks at demo's but I can't seem to find the right help =\
Well, your first problem is in the if test after you change their icon state to their class. You need to change input to be:
var/a = input(class stuff) in (classlist)
then you'll be able to check which class they've chosen.


Also, the numbers in your comments don't match the code, take the numbers out and replace them, so if someone looks at your code, they'll understand better.
In response to Mooseboy
Well I did that and I now only have one error :

L.O.T.M..dm:34:error::invalid expression

...??? mooseboy ???

here's what i have now, I'll only stick the small piece what you helped me with...

mob/create_character
var/mob/character
Login()
character = new /mob
usr << "<font color=#FFFFFF>The owners of these sites have helped making this game:"
usr << "<font color=#FF0000>http://www.zelldot.tk/"
usr << "<font color=#FF0000>http://www.dangersprites.tk/"
usr << "<font color=#FFFFFF>also, checkout the L.O.T.M. Site !"
usr << "<font color=#FF0000>http://www.lotmdot.tk/"
usr << sound('lotm_world.mid',1)
var/charactername = input("Whats your name ?","L.O.T.M.")
character.icon = 'person.dmi' //makes it so all mobs will be created with the person icon
var/a = input(class stuff) in (classlist)
if(a=="warrior")
usr.HP = 200(...ect)

In response to Jaimy_NL
Jaimy_NL wrote:

var/a = input(class stuff) in (classlist)

Indent that line over by 2.
Take the entire if() block back a tab.
In response to Goku72
uh...what do you mean with "indent that line over by 2" ?
In response to Enigmaster2002
Enig, I only get more errors thru that =)

I only got one error now, look at the other message's in this topic
In response to Jaimy_NL
Ah, I see now. I stuck it in DM and I found one of your problems; the variable "a" isn't defined anywhere. Your prompt for the icon state assigns variable to the person's icon, and not to a variable for later use, as would be useful in this case. Example:
        var/a = input(usr,"Select your Class :") in list("warrior","mage(f)","ninja", "mage(m)","thief")
if(a=="warrior")
usr.HP = 200
usr.Max_HP = 200
usr.Strength = 45
usr.Defense = 30
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0
usr.EXP_Need = 200
usr.EXP_Give = 1
usr.icon_state = a

But that still involves moving that entire if() block back, otherwise it'll still error.
In response to Enigmaster2002
AAH !! I'm going crazy here...I've made that, with everything <- a tab, and this is what I have :

L.O.T.M..dm:34:error::invalid expression

(line is going to be -> pointed under here)

mob/create_character
var/mob/character
Login()
character = new /mob
usr << "<font color=#FFFFFF>The owners of these sites have helped making this game:"
usr << "<font color=#FF0000>http://www.zelldot.tk/"
usr << "<font color=#FF0000>http://www.dangersprites.tk/"
usr << "<font color=#FFFFFF>also, checkout the L.O.T.M. Site !"
usr << "<font color=#FF0000>http://www.lotmdot.tk/"
usr << sound('lotm_world.mid',1)
var/charactername = input("Whats your name ?","L.O.T.M.")
character.icon = 'person.dmi' //makes it so all mobs will be created with the person icon
-> var/a = input(usr,"Select your Class :") in ("warrior","ninja","mage(f)","mage(m)","thief")
if(a=="warrior")
usr.HP = 200 //The player will have 100 HP...
usr.Max_HP = 200 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 45 // 10 strength
usr.Defense = 30 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if...ect.
No put usr in proc. Ungh.

You have a lot of repeated code in those if() blocks, which you should take out and move to just before or after the ifs. Odds are you don't even need it, if you set those vars to use the same values as defaults.

Lummox JR
In response to Lummox JR
What...??
Say that again...Sorry but I didn't really get that =\
In response to Jaimy_NL
-> var/a = input(usr,"Select your Class :") in ("warrior","ninja","mage(f)","mage(m)","thief")

var/a = input(usr,"Select your Class :") in list

Not exactly sure why you took that out.
In response to Enigmaster2002
ACK !!
*goes highwire*
It's not working !! >.< >.< >.<
a) the stats still won't show up
b) I think I know what's wrong, since my map is seriously full with crap.
c) I'm gonna tell the error now XD

Well look, this is my login :

//*********
//**Login**
//*********
world
mob = /mob/create_character
mob //Trunk meaning Mobile object
caracter
icon = 'person.dmi'
verb //Now to allow this player to do actions, by giving them a verb.
say(msg as text) //The say part is the name of the verb. The () part of this is called the arguments. All verbs and procs(Procedures) have argumentss. In this say verb, the argument tells it to set a new var(msg) to something that the Player types (as text)
view(src) << "[src] says: [msg]" //In view of the source(src), output the message "Jaimy says: Hello!!!". Jaimy being [src] and Hello!!! being [msg].

mob/create_character
var/mob/character
Login()
character = new /mob
usr << "<font color=#FFFFFF>The owners of these sites have helped making this game:"
usr << "<font color=#FF0000>http://www.zelldot.tk/"
usr << "<font color=#FF0000>http://www.dangersprites.tk/"
usr << "<font color=#FFFFFF>also, checkout the L.O.T.M. Site !"
usr << "<font color=#FF0000>http://www.lotmdot.tk/"
usr << sound('lotm_world.mid',1)
var/charactername = input("Whats your name ?","L.O.T.M.")
character.icon = 'person.dmi' //makes it so all mobs will be created with the person icon
var/a = input(usr,"Select your Class :") in list("warrior","ninja","mage(f)","mage(m)","thief")
if(a=="warrior")
usr.HP = 200 //The player will have 100 HP...
usr.Max_HP = 200 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 45 // 10 strength
usr.Defense = 30 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="mage(f)")
usr.HP = 125 //The player will have 100 HP...
usr.Max_HP = 125 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 20 // 10 strength
usr.Defense = 15 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="ninja")
usr.HP = 155 //The player will have 100 HP...
usr.Max_HP = 155 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 25 // 10 strength
usr.Defense = 25 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="mage(m)")
usr.HP = 190 //The player will have 100 HP...
usr.Max_HP = 190 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 30 // 10 strength
usr.Defense = 20 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
if(a=="thief")
usr.HP = 140 //The player will have 100 HP...
usr.Max_HP = 140 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 20 // 10 strength
usr.Defense = 15 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
character.loc = locate(5,5,2)
character.name = charactername
src.client.mob = character
world << "[usr] has joined the world."
usr << sound('castletheme.mid',1)

mob/Logout()
world << "[usr] has left the world."
del(src)//this deletes the characters mob after they leave


And this is my Stats and stuff

mob/PC    //You can also set the branch like this.
//Now time to define some of our own vars.
HP = 100 //The player will have 100 HP...
Max_HP = 100 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
Strength = 15 // 10 strength
Defense = 10 //Your natural defense
Gold = 100
Gold_Give = 10
Level = 1
EXP = 0 // it starts out with 0 exp
EXP_Need = 100
EXP_Give = 0 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.
verb // Make a verb...
Attack(mob/M in oview(1,src)) //The verbs name is attack, it will attack a mob that is only in Oview 1 (one space from the mob)
if(M != null) //This prevents you from getting irrational runtime errors when it can't find something that isn't there anymore.
view() << sound('Hit.wav')
var/damage = rand(5,Strength) // Lets define a new var thats only for THIS verb... Its called damage, and damage is a random number between 1 and 3
src << "You attack [M]!" //Output this message to the attacker
src << "[damage] damage!" //Same here
M << "[src] attacks you!" //Output this message to the victim, in case they are a PC and want to know they are being attacked
M << "[damage] damage!" //They would want to know how much damage it did too.
M.HP -= damage //Subtract how much damage he did from the mobs HP
M.Death() //Do a proc on the mob... It is showed below

mob
var
HP
Max_HP
Strength
Defense
weapon
Gold
Gold_Give
Level
EXP
EXP_Need
EXP_Give //We give a var list of what vars a mob can have, but we dont set the numbers(We do that when we put the code for the mob like above)
Drops = list()
Spawned_By
proc //Some new procs
Death(mob/M) //Named deathcheck, and when I put M in the coding for this proc, it will mean the mob (not src, but other mob)
if(src.type == /mob/PC) //If the mobs type is that of /mob/PC
PCDeath() //Then do the PCDeathCheck on it
else //Otherwise...
if(src.HP <= 0) //if its HP is less than or equal to 0...
src.EXP += src.EXP_Give
for(var/O in src.Drops) //If the mob has anything in Drops...
new O(src.loc) //This drops an item (If they have one) where the mob was standing.
range() << "[src] was killed by [usr]."
del(src) //Delete the mob
PCDeath(mob/M)
if(src.HP <= 0)
view(src) << "[src] died."
src.loc = locate(5,5,2) //Move it to the starting point
src.HP = Max_HP //Refill the PC's HP
levelupcheck()//Proc to check if a client has gained a level
if(src.client)//If a person...
if(src.EXP>=src.EXP_Need)//If the person's experience is greater than or equal to the required experience...
src.Level++//Adds 1 to the person's level
src << "You gained a level. You are now in level [src.Level]."//Tells the person who just gained the level that the person just has gained a level
src.Max_HP+=rand(50,75)//Adds the persons hp at random
src.Strength+=rand(5,10)//Adds the persons attack at random
src.Defense+=rand(5,10)//Adds the persons defense at random
src.EXP_Need+=rand(100,500)//Adds the experience needed at random
src.HP=src.Max_HP//Recovers the persons hp
else//Besides that...
return//Continue what you were doing

mob/Stat() //Call the Stat proc that updates the stat window every Tenth of a second...
stat("Stats:",src.desc) //Place in the stat panel, the word Stats:, and the srcs description.
if(src == src) statpanel("Inventory",src.contents) //If the src is that of a src (PC), then make a statpanel displaying the srcs contents(Inventory), and call it "Inventory"
stat("Level: ",usr.Level)
stat("HP: ","[usr.HP]/[usr.Max_HP]") //It makes it easier to read if you put a bunch of spaces like that.
stat("Strength: ",usr.Strength)
stat("Defense: ",usr.Defense)
stat("Experience need: ",usr.EXP_Need)
stat("Experience: ",usr.EXP)
stat("Gold: ",usr.Gold) //Place the stats you want to be displayed like this


I know, you notice straigt away that there's something wrong. I think it's that you see twice the stuff with the HP and stuff, but I can't figure out how to delete one thing so the other things works.....Please don't ignore me now, please help me...
In response to Jaimy_NL
Well, I'm kinda too lazy to look through all of that thouroughly, but a quick skim revealed:

if(src == src) statpanel("Inventory",src.contents)

That will ALWAYS return true, no matter what. It's like checking if 1 = 1, of course it is itself. To check if they're a player:

if(src == usr) statpanel("Inventory",src.contents)

Also, try not to copy and paste your code, which is a pattern I'm seeing all over the place. If it's a big block of code, try defining a proc for mobs that does it, and just use that. Here's a sample one made, and it probably won't be spic and span, but oh well. Try adapting this rather than just copying and pasting it in and expecting it to work:

mob/proc/setnewstats(var/newhp, var/newstr, var/newdef)
usr.HP = newhp
usr.Max_HP = newhp //Sets HP limit for healing and stuff
usr.Strength = newstr
usr.Defense = newdef
usr.Gold = 1000
usr.Gold_Give = 0 //Enemies don't give gold? Dunno bout this
usr.Level = 1
usr.EXP = 0
usr.EXP_Need = 200
usr.EXP_Give = 1 //No EXP Cheating


Okay, you can see that there are alot of changes:
1.You now use a single line, a proc, to define starting stats
2.Alot of the variables that are redudant now don't have to be defined, but if you do want to change them(in the case of exp_need, which should be different for each person) just follow the existing pattern
3.LESS COMMENTS. I can tell by just looking at your code you ripped this directly from a demo or library. That's bad. You should generally use a few comments on simple things like this - the variable names explain everything by themselves. Comments are for things that aren't that obvious.

Don't forget, this should be first in the object tree, AKA all the way to the left - try reading the Blue Book.

If you, which I'm thinking you will, no offense, can't figure out how to do this, here's a sample. Just replace your bulky code with this when you check a(don't forget to change the variables I'm putting to the numbers you need):

src.changenewstats(thehp, thestrength, the defense)


And wasn't there something about you mentioning the errors you get? :)
In response to Mooseboy
Mooseboy wrote:
mob/proc/setnewstats(var/newhp, var/newstr, var/newdef)
usr.HP = newhp
usr.Max_HP = newhp //Sets HP limit for healing and stuff
usr.Strength = newstr
usr.Defense = newdef
usr.Gold = 1000
usr.Gold_Give = 0 //Enemies don't give gold? Dunno bout this
usr.Level = 1
usr.EXP = 0
usr.EXP_Need = 200
usr.EXP_Give = 1


Don't forget, this should be first in the object tree, AKA all the way to the left - try reading the Blue Book.

Also dont forget to not use usr in procs ;). It might be somthing different. One example as I see "death" procs using src and usr. In those usually src is the one dying, and usr is the killer some how. So you would want to use src as that is the mob that it's getting called to.
In response to Wanabe
Well, I considered that, but then again, when would a mob that's not the player create a new player?
In response to Mooseboy
I don't want to interupt you guys, but now, I can't see the player him/herself nor the stats.
I've already tried :

        if(a=="ninja")
---> usr.icon_state = "ninja"
usr.HP = 155 //The player will have 100 HP...
usr.Max_HP = 155 //100 max HP (This must be defined so when the player takes a potion or is healed, the heal won't go over this amount, and you always know how much max HP it has.).
usr.Strength = 25 // 10 strength
usr.Defense = 25 //Your natural defense
usr.Gold = 1000
usr.Gold_Give = 0
usr.Level = 1
usr.EXP = 0 // it starts out with 0 exp
usr.EXP_Need = 200
usr.EXP_Give = 1 //This prevents cheating, set exp_give to 0 so PCs arnt killed for exp also.


but that didn't work.
somehow, when I changed the stats from scr==scr to scr==usr
it still didn't work...<,<
In response to Jaimy_NL
*Sigh* Alright, here's something you NEED to understand before we help you with anything else - DON'T RIP CODE FROM A SAMPLE GAME!!! You definately took this from a demo game that taught coding and tried to morph it into something else. It would be a whol lot better to take a tutorial and read it, understand it, and try to write the code yourself.

Now that we have that across, we can try and save this.

Now, I've read the entire thing, and you have three different mobs that are doing different things, when this should all be contained under a single mob, which we'll call new_char. So go to:

mob/create_character
var/mob/character
Login()
character = new /mob


Change create character to new_char, and delete both var/mob/character and character = new /mob. We don't need either of them.

Next, you need to change around some things:

var/charactername = input("Whats your name ?","L.O.T.M.")
character.icon = 'person.dmi'


Here, change character.icon to new_char.icon and var/character name to new_char.name

Now here's where we get a little sketchy. Delete all of the code for classes from var/a down to the end of the theif If and replace it with:

var/class = input(usr,"Select your Class :") in list("warrior","ninja","mage(f)","mage(m)","thief")
if(class=="warrior")
usr.setnewstats(200,45,30)
if(class=="mage(f)")
usr.setnewstats(125,20,15)
if(class=="ninja")
usr.setnewstats(155,25,25)
if(class=="mage(m)")
usr.setnewstats(190,30,20)
if(class=="thief")
usr.setnewstats(140,20,15)


proc/setnewstats(var/newhp, var/newstr, var/newdef)
src.HP = newhp
src.Max_HP = newhp //Sets HP limit for healing and stuff
src.Strength = newstr
src.Defense = newdef
src.Gold = 1000
src.Gold_Give = 0 //Enemies don't give gold? Dunno bout this
src.Level = 1
src.EXP = 0
src.EXP_Need = 200
src.EXP_Give = 1 //No EXP Cheating


That might be a bit hard to swallow, but basically setnewstats takes the hp, str, and def you give yo it and sets the stats accordingly. Using src.var means that it will edit the vars of the thing that initiated it, in this case the usr.

The reason you can't use src == src, besides the fact that it is asking if src is itself, which it always is, is that src is whatever started the current action, like a mob that walked on a switch or hit a key or something.

Also, you declare all the stats in a mob that's not even used! Here:

mob/PC //You can also set the branch like this.
//Now time to define some of our own vars.
HP = 100 //The player will have 100 HP...


You don't even need mob/PC, but he does have something we need...

verb // Make a verb...
Attack(mob/M in oview(1,src)) //The verbs name is attack, it will attack a mob that is only in Oview 1 (one space from the mob)
if(M != null) //This prevents you from getting irrational runtime errors when it can't find something that isn't there anymore.
view() << sound('Hit.wav')
var/damage = rand(5,src.Strength) // Lets define a new var thats only for THIS verb... Its called damage, and damage is a random number between 1 and 3
src << "You attack [M]!" //Output this message to the attacker
src << "[damage] damage!" //Same here
M << "[src] attacks you!" //Output this message to the victim, in case they are a PC and want to know they are being attacked
M << "[damage] damage!" //They would want to know how much damage it did too.
M.HP -= damage //Subtract how much damage he did from the mobs HP
M.Death() //Do a proc on the mob... It is showed below


This is a clean attack verb that should be moved to the new_char mob, with the proper indentation. The rest of the stuff in mob/PC should be deleted (ONLY IN mob/PC, WE STILL HAVE MORE STUFF TO DO, so don't think that means delete EVERYTHING ELSE)

Your mob vars and procs look like they're in order to me, so keep them. The final step is to edit the Stat() part. First, change the if like I told you before. Also, change the vars with src in them(not the if part) to usr so as to make sure the usr sees their own stats.

I've probably made a billion mistakes, but I want to make my message clear: READ A TUTORIAL! READ THE DM GUIDE(look left)! DON'T RIP FROM DEMOS! USE THEM ONLY FOR GUIDENCE AND WRITE YOU OWN CODE!