Osirirs
Journeyman
Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2
|
races bodies
Hey guys, im trying to find the right code
for my bodies, thing is, some of my races will either use the human body and other the elf body.
What Im trying to do is to change the body accordingly to the current sex of the player.
Like, if I choose the female elf body, and then in game, on the race selection, I decide I want to be a human afterall, I gotta have the human body, but the female one, of course, so I wanted to know the IF statement I can add to check if the body is male or female, thanks guys.
|
|
09-01-2015 11:42 AM |
|
|
escribano
Journeyman
Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2
Dragon Shard
|
RE: races bodies
Osiris, here is some funcitons i use to make this verifications:
Code:
[function ishuman]
if (<body> == c_man) || (<body> == c_woman)
return 1
endif
return 0
[function isgargoyle]
if (<body> == c_gargoyle_male) || (<body> == c_gargoyle_female)
return 1
endif
return 0
[function iselven]
if (<body> == c_elf_male) || (<body> == c_elf_female)
return 1
endif
return 0
[function ismale]
if (<body> == c_gargoyle_male) || (<body> == c_elf_male) || (<body> == c_man)
return 1
endif
return 0
[function isfemale]
if (<body> == c_gargoyle_female) || (<body> == c_elf_female) || (<body> == c_woman)
return 1
endif
return 0
[FUNCTION ishumanaid]
if (<ismale> || <isfemale>)
RETURN 1
endif
RETURN 0
There is a function that checks if the player is male or female in any race.
Hope it help you!
UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
|
|
09-02-2015 07:03 AM |
|
|
Osirirs
Journeyman
Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2
|
RE: races bodies
Thanks guys ! This all helps a lot ! Not so sure about how to use the CAN flag yet in a script but Ill try to find some examples to learn from. Im starting to see how limitless scripting can become, its epic
Thanks escribano for these functions examples, its exactly what I was looking for
EDIT:
Hmmm for some reasons I get an error in my console saying it can't resolve o.O
So I tried this but the body doesnt change.
IF (<src.body> == c_man || c_elf_male)
Src.body = c_man
Src. Obody = c_man
ELSE
SRC.BODY = c_woman
SRC.OBODY = c_woman
return 1
Endif
return 0
Probably the return 0 huh ? Forgot to try removing it
(This post was last modified: 09-02-2015 11:16 AM by Osirirs.)
|
|
09-02-2015 10:02 AM |
|
|
escribano
Journeyman
Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2
Dragon Shard
|
RE: races bodies
I'm Glad to help!!! thats why we are all here for!
Are u sure that <SRC> is the player?
Try this:
Code:
if (<src.body> == c_man) || (<src.body> == c_elf_male)
src.id = c_man
src.body = c_man
src.obody = c_man
else
src.id = c_woman
src.body = c_woman
src.obody = c_woman
endif
UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
(This post was last modified: 09-02-2015 11:33 AM by escribano.)
|
|
09-02-2015 11:15 AM |
|
|
escribano
Journeyman
Posts: 170
Likes Given: 16
Likes Received: 32 in 23 posts
Joined: Nov 2012
Reputation: 2
Dragon Shard
|
RE: races bodies
What pointhz sayed makes PERFECT sense!
If the src.body doesn't work (what is really, REALLY, strange... ) try to use this one:
Code:
if (<src.body> == c_elf_male)
src.id = c_man
src.body = c_man
src.obody = c_man
else if (<src.body> == c_elf_female)
src.id = c_woman
src.body = c_woman
src.obody = c_woman
endif
UltimaPHP - OpenSource Ultima Online Server v0.1-pre-alpha under development, we need help!
(This post was last modified: 09-02-2015 12:35 PM by escribano.)
|
|
09-02-2015 12:27 PM |
|
|
Osirirs
Journeyman
Posts: 73
Likes Given: 6
Likes Received: 4 in 2 posts
Joined: Feb 2014
Reputation: 2
|
RE: races bodies
Oooops... Guys, I must have been really tired yesterday... O.o wow haha, Im trying that right ahead ! Thanks !!
EDIT: Okay.. hmmm I dont see what I'm doing wrong here.. I've tried many things.. Here's what I got at the moment o.O :
Code:
[FUNCTION f_gender1]
IF (<src.body>==c_elf_male)
SRC.ID=c_man
SRC.BODY=c_man
SRC.OBODY=c_man
ELSEIF (<SRC.BODY>==c_elf_female)
SRC.ID=c_woman
SRC.BODY=c_woman
SRC.OBODY=c_woman
RETURN 1
ENDIF
ENDIF
[/spoiler]
Oh and while you're there, its not part of the same topic but is there any way to change de value of hits to got ten times the str ? Same with mana and stam.
1 STR = 10 Hitpoints
1 DEX = 10 Stamina
1 INT = 10 mana ??
I know Ill have to change lots of stuff to keep the game balanced haha
(This post was last modified: 09-03-2015 10:40 AM by Osirirs.)
|
|
09-03-2015 08:38 AM |
|
|
azmanomer
Journeyman
Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1
|
|
09-03-2015 11:43 AM |
|
|