Experience in group ! - kevin465 - 04-03-2014 07:14 PM
Ok i just want to know... my ancient lvl systems give experiance to all players hit the mobs...but now my new just give experience to one player...5 player can hit the mobs but only one have the experience ... how fix that ?
Anciant lvl system
Code:
[EVENTS e_exp]
ON=@CLICK
VAR.X=<EVAL <oSTR> /6>
IF !(0<VAR.X>)
VAR.X=1
ENDIF
message @025,3 (Level: <EVAL <VAR.X>>)
ON=@DEATH
SRC.TAG.KS=
VAR.OLD_ACT=<ACT>
VAR.X1=<EVAL <oSTR> /1> +<EVAL <oSTR> /1>
VAR.X=<EVAL {<VAR.X1> <oSTR>}>
SRC.f_experience
ACT=<VAR.OLD_ACT>
VAR.X1=
[EVENTS e_exp_1]
ON=@CLICK
VAR.X=<EVAL <oSTR> /1>
IF !(0<VAR.X>)
VAR.X=1
ENDIF
New lvl system
Code:
ON=@DEATH
VAR.OLD_ACT=<SRC.ACT.UID>
FINDID.i_memory_spelleffect_agility.REMOVE
FINDID.i_memory_spelleffect_cunning.REMOVE
FINDID.i_memory_spelleffect_strength.REMOVE
FINDID.i_memory_spelleffect_feeblemind.REMOVE
FINDID.i_memory_spelleffect_clumsy.REMOVE
FINDID.i_memory_spelleffect_weaken.REMOVE
FINDID.i_memory_spelleffect_bless.REMOVE
FINDID.i_memory_spelleffect_curse.REMOVE
FINDID.i_memory_spelleffect_chameleon.REMOVE
FINDID.i_memory_spelleffect_regeneration.REMOVE
IF !( <SRC.FLAGS> & statf_conjured )
VAR.EXP=<EVAL <EVAL <SRC.SKILLTOTAL> /10> +<EVAL <SRC.OSTR> +<SRC.ODEX> +<SRC.OINT>> +<EVAL <SRC.MAXHITS> +-<SRC.OSTR>>>
VAR.EXP_TEMP1=<EVAL <EVAL <VAR.EXP> *<EVAL <SRC.ARMOR> +<EVAL <SRC.AR> +-<SRC.ARMOR>>>> /1000>
VAR.EXP_TEMP2=<EVAL <EVAL <VAR.EXP> *<EVAL {<SRC.DAM>}>> /1000>
VAR.EXP=<EVAL <VAR0.EXP> +<VAR0.EXP_TEMP1> +<VAR0.EXP_TEMP2>>
IF (<SRC.TAG0.MODEXP>)
VAR.EXP=<SRC.TAG.MODEXP>
ENDIF
IF (<VAR0.EXP> < 1)
VAR.EXP=1
ENDIF
VAR.EXP_TEMP1=
VAR.EXP_TEMP2=
SRC.EXPERIENCE
VAR.EXP=
ENDIF
SRC.ACT=<VAR.OLD_ACT>
VAR.OLD_ACT=
RETURN 0
Thanks everybody !
RE: Experience in group ! - Runcuks - 04-03-2014 11:37 PM
On=@death
obj=<tag.killer>
obj.expgain 1
Player who done them most damage will get the exp when monster die
RE: Experience in group ! - kevin465 - 04-04-2014 02:08 AM
ok but i want all player have the experience when monster die but just if he hit him !
RE: Experience in group ! - Coruja - 04-04-2014 03:56 AM
Code:
WHILE (<ATTACKER.<LOCAL._WHILE>>)
REF1=<ATTACKER.<LOCAL._WHILE>>
REF1.Experience <eval <VAR0.EXP>/<ATTACKER>> //this will divide the exp to each attacker instead give the full exp to everyone
ENDWHILE
btw you can optimize this code
Code:
ON=@Death
FINDID.i_memory_spelleffect_agility.REMOVE
FINDID.i_memory_spelleffect_cunning.REMOVE
FINDID.i_memory_spelleffect_strength.REMOVE
FINDID.i_memory_spelleffect_feeblemind.REMOVE
FINDID.i_memory_spelleffect_clumsy.REMOVE
FINDID.i_memory_spelleffect_weaken.REMOVE
FINDID.i_memory_spelleffect_bless.REMOVE
FINDID.i_memory_spelleffect_curse.REMOVE
FINDID.i_memory_spelleffect_chameleon.REMOVE
FINDID.i_memory_spelleffect_regeneration.REMOVE
IF (<FLAGS> & statf_conjured)
return 0
ENDIF
LOCAL.ExpBase = <eval (<SKILLTOTAL>/10)+(<OSTR>+<ODEX>+<OINT>)+(<MAXHITS>-<OSTR>)>
LOCAL.Exp = <LOCAL.ExpBase>
LOCAL.Exp += <eval (<LOCAL.ExpBase>*(<ARMOR>+(<AR>-<ARMOR>)))/1000>
LOCAL.Exp += <eval (<LOCAL.ExpBase>*{<DAM>})/1000>
IF (<TAG0.MODEXP>)
LOCAL.Exp = <TAG0.MODEXP>
ENDIF
IF (<LOCAL.Exp> < 1)
LOCAL.Exp = 1
ENDIF
WHILE (<ATTACKER.<LOCAL._WHILE>>)
REF1=<ATTACKER.<LOCAL._WHILE>>
REF1.ExpIncrease <eval <LOCAL.Exp>/<ATTACKER>>
ENDWHILE
you can optimize a bit more, I just leave it this way because it's better to you undestand the code
RE: Experience in group ! - kevin465 - 04-04-2014 07:12 AM
that dont work.. im on 56b ...
RE: Experience in group ! - Coruja - 04-05-2014 01:07 PM
this code works fine on 56b
you need to add this event on all npc's on this section of sphere.ini:
Code:
// Events related to all NPCs
EventsPet=e_exp
and replace the "ExpIncrease" line to match what you're using as exp, maybe
EXP += <eval <LOCAL.Exp>/<ATTACKER>>
or
SRC.TAG.Exp += <eval <LOCAL.Exp>/<ATTACKER>>
RE: Experience in group ! - kevin465 - 04-05-2014 07:07 PM
ok i try this today thanks coruja
RE: Experience in group ! - kevin465 - 04-06-2014 02:08 AM
no coruja always one guys have the exp ! i replace the expincrease line by my exp and always one have the exp
RE: Experience in group ! - Coruja - 04-07-2014 04:49 AM
strange, it works fine here
if you post the entire script it will be easier to find whats wrong
|