SphereCommunity
differencing races? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: differencing races? (/Thread-differencing-races)

Pages: 1 2 3 4


RE: differencing races? - XuN - 06-10-2014 04:13 PM

http://www.uoguide.com/Damage_Calculations


RE: differencing races? - kn4tseb - 06-11-2014 07:24 AM

Thank you both! Smile


RE: differencing races? - kn4tseb - 06-11-2014 09:13 AM

Okey, for some reason i have this issue, might be nothing, but....

if equal race condition is set as for SRC as [] it works fine tried it human vs human; but when i set it to NOT equal like in the example below it doesnt work... ive tried a human vs elf, didnt work, gargoyle vs human didnt work.
PHP Code:
ON=@Hit
If (<WEAPON> && <WEAPON.TYPE> != T_WEAPON_BOW)
   if (<EVAL <
argo.TWOHANDS>> == 0)
      if (<
race> != <src.race>)
     
local.skillneeded=<<argo.skill>>
         if (<
local.skillneeded> >= 60.0)
          
SERV.B HELLO
     
endif
       endif
   endif
endif

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



RE: differencing races? - Extreme - 06-11-2014 09:49 AM

PHP Code:
If (<ARGO.WEAPON> && <ARGO.WEAPON.TYPE> != T_WEAPON_BOW)
 IF (!<
ARGO.TWOHANDS>)
  IF(<
RACE> != <SRC.RACE>)
   IF(<<
ARGO.SKILL>> >= 60.0)
    
SERV.B HELLO
   
ENDIF
  ENDIF
 ENDIF
ENDIF 



RE: differencing races? - kn4tseb - 06-11-2014 10:58 AM

thanks for the tip at twohands check ^^ saves some lines Big Grin

but race vs diff race check isnt working Sad


RE: differencing races? - Extreme - 06-11-2014 12:06 PM

Who is <UID> and who is <SRC> ?

Put a SERV.B <NAME> <SRC.NAME> to check!


RE: differencing races? - kn4tseb - 06-11-2014 12:33 PM

@hit
src= player being hit
and [] player making the hit... ill try what you say but i dont think its about that because when IF(<RACE> == <SRC.RACE>) is set, it works


EDITED: just checked

<SRC.NAME> = Player being hit
<NAME> = Player making the action


RE: differencing races? - Extreme - 06-11-2014 12:46 PM

Well, it should work then.


RE: differencing races? - kn4tseb - 06-11-2014 01:12 PM

Should i try that under the function?

ok i re-checked everything, and this is what i got: when races check are equal, inside the function only at the ELSE side of the function it did work, the other ones didnt.. only the ELSE part

SRC is still the char being hit inside the function
and uid is still me
PHP Code:
[function race]
if (<
obody>==c_man || <obody>==c_woman)
//Serv.B <NAME> <SRC.NAME>
return 1
elseif (<obody>==c_elf_male || <obody>==c_elf_female)
//Serv.B <NAME> <SRC.NAME>
return 2
elseif (<obody>==c_gargoyle_male || <obody>==c_gargoyle_female)
//Serv.B <NAME> <SRC.NAME>
return 3
else
say hello hello hello hello
return -1
endif 

only works at "ELSE"


RE: differencing races? - Extreme - 06-11-2014 01:43 PM

Okay, one tip: when comparing things, if you have more than one condition, you should use () on each condition.

Here you go:
PHP Code:
[FUNCTION RACE]
IF (<
OBODY> == C_MAN) || (<OBODY> == C_WOMAN)
 RETURN 
1
ELIF 
(<OBODY> == C_ELF_MALE) || (<OBODY> == C_ELF_FEMALE)
 RETURN 
2
ELIF 
(<OBODY> == C_GARGOYLE_MALE) || (<OBODY> == C_GARGOYLE_FEMALE)
 RETURN 
3
ELSE
 RETURN -
1
ENDIF