The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
differencing races?
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #1
differencing races?
Is there a way to check if players race are equal or different between each other?
second question... might sound really noob but i ll ask it either way.

how can i get the type of an item under a FOR loop?

example:
typedefs
t_weapon_mace_smith 11 //
t_weapon_mace_sharp 12 //
t_weapon_sword 13
t_weapon_fence 14

ON=@Hit
for x 11 14
local.weapon = <argo.<dlocal.x>????????????????

ty Smile
(This post was last modified: 06-09-2014 04:44 PM by kn4tseb.)
06-09-2014 07:27 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: differencing races?
How are you defining the 'races'?

Code:
if (<race>==<src.race>)

[function race]
if (<body>==c_man || <body>==c_woman)
return 1
elseif (<body>==c_elf_male || <body>==c_elf_female)
return 2
elseif (<body>==c_gargoyle_male || <body>==c_gargoyle_female)
return 3
else
return -1
endif
06-09-2014 05:28 PM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #3
RE: differencing races?
What about 'obody' to avoid functionality while morf.
06-09-2014 09:21 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #4
RE: differencing races?
thank you both, think obody is what ill use, might be not a bad feature to check if obody of a player is != to otherones, so there would be no need of all those conditions..

Btw, what's the best way to get the type of weapons excluding t_bow, using a @hit trigger?
i would reallty like to know how to get types, maybe with findlayer(1).x or STRMATCH(*WEAPON*,<ARGO.TYPE>)..... something like that, would you help me plz?

-----------
something like and better than:

IF ((<findlayer.layer_hand1.type> && STRMATCH(*WEAPON*,<ARGO.TYPE>) || (<findlayer.layer_hand2.type> && STRMATCH(*WEAPON*,<ARGO.TYPE>) && <argo.type>!=t_weapon_bow))


t_weapon_bow uses layer(2), right?
(This post was last modified: 06-10-2014 04:20 AM by kn4tseb.)
06-10-2014 02:56 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: differencing races?
<weapon.type>
06-10-2014 03:14 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #6
RE: differencing races?
(06-09-2014 05:28 PM)XuN Wrote:  How are you defining the 'races'?

Code:
if (<race>==<src.race>)

[function race]
if (<body>==c_man || <body>==c_woman)
return 1
elseif (<body>==c_elf_male || <body>==c_elf_female)
return 2
elseif (<body>==c_gargoyle_male || <body>==c_gargoyle_female)
return 3
else
return -1
endif

The fact that a function returns (return 1) a value, would it alter the original behavior of a @trigger? which on this case would be @hit ???

@hit
"Return 1 Cancels the combat swing."
(This post was last modified: 06-10-2014 05:28 AM by kn4tseb.)
06-10-2014 05:26 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #7
RE: differencing races?
Tell us what you want to do, whats the objective.
You want to cancel the hit if the player is using bow?

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
06-10-2014 05:42 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #8
RE: differencing races?
Using a function returning a value inside a trigger will not stop the trigger, imagine the hardcoded function <NAME> as this
Code:
[FUNCTION NAME]
return character_name

Every function returns a value, but this value will represente the called function and will not alter the trigger/function's behaviour.
Code:
ON=@Any_Trigger
local.race=<race> //this won't stop the trigger since the return is in the [function race]
local.name=<name> // this won't stop the trigger for same reason for name function
local.your_something=<tag.something> //this won't stop the trigger for the same reason with the tags
return <eval <local.race>+<local.something>> //this will return the trigger since you are using the return directly
06-10-2014 06:55 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #9
RE: differencing races?
Perfectly understoood Big Grin

and my last question for today, it is not a MAJOR need but will help me to understand better a lot of things:
having in mind that types have a number which reference them like the fallowing.
t_weapon_mace_smith 11
t_weapon_mace_sharp 12
t_weapon_sword 13
t_weapon_fence 14

if i want to make an intance that checks only those types, would you give me a 2 lines example for this?

in the case i want to check weapon types with the exception of bows so.

ON=@Hit
for x 11 14
local.anyname = <HOWdo.<dlocal.x>.iGetTheType>???
thanks!

PD: XuN, would you share with me fhe formula for anatomy+tactics+lumberjaking (in case of using axe) bonus hits?
thank you.
(This post was last modified: 06-10-2014 12:27 PM by kn4tseb.)
06-10-2014 10:21 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #10
RE: differencing races?
If <WEAPON> && <WEAPON.TYPE> != T_WEAPON_BOW

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
06-10-2014 02:46 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)