Thread Rating:
- 0 Votes - 0 Average
- 1
- 2
- 3
- 4
- 5
@DeathCorpse - ATTACKER problem
|
Author |
Message |
xwerswoodx
Journeyman
Posts: 86
Likes Given: 4
Likes Received: 7 in 4 posts
Joined: Jun 2012
Reputation: 0
UoMMO
|
@DeathCorpse - ATTACKER problem
I am trying to do experience system but there is a problem because ATTACKER doesn't work under @DeathCorpse, but I search little and some developers gives feedback that it works under deathcorpse so where I am doing wrong?
Code:
[Events e_npc_level]
On=@DeathCorpse
IF !<dTAG0.LEVEL>
TAG0.LEVEL=1
ENDIF
SERV.ALLCLIENTS SYSMESSAGE A: <ATTACKER.LAST>
IF (<BRAIN> == brain_monster)
LOCAL.TOT=<EVAL <TAG0.LEVEL> * 2>
LOCAL.TOT=<EVAL <DLOCAL.TOT> / <ATTACKER>>
FOR y 0 <EVAL <ATTACKER> - 1>
SERV.ALLCLIENTS SYSMESSAGE X: <ARGO.NAME> - <ATTACKER> - <SRC.NAME> - <SRC.ATTACKER.0> - <ATTACKER.<DLOCAL.y>>
REF1=<ATTACKER.<DLOCAL.Y>>
ARGO.ATTACKER.ADD=<REF1>
IF <REF1.ISINPARTY>
LOCAL.PEXP=<EVAL <DLOCAL.TOT> / <REF1.PARTY.MEMBERS>>
FOR x 0 <eval <REF1.PARTY.MEMBERS> - 1>
ARGO.ATTACKER.ADD=<REF1.PARTY.MEMBER.<DLOCAL.x>>
REF1.PARTY.MEMNER.<DLOCAL.x>.GIVEXP <DLOCAL.PEXP>
ENDFOR
ELSE
REF1.GIVEXP <DLOCAL.TOT>
ENDIF
ENDFOR
ENDIF
Code:
[Function GIVEXP]
LOCAL.GIVEN <DARGS>
IF <ISINPARTY>
TAG0.EXP += <PARTY.MEMBERS>
SYSMESSAGE <REF5.LANG youhaveearned> <PARTY.MEMBERS> <REF5.LANG experience>
ENDIF
IF <UoMMO_CHECKPRE exp>
LOCAL.GIVEN +=<EVAL <DLOCAL.GIVEN> / 2>
ENDIF
TAG0.EXP +=<DLOCAL.GIVEN>
SYSMESSAGE <REF5.LANG youhaveearned> <DLOCAL.GIVEN> <REF5.LANG experience>
<ATTACKER> - RETURN 0
<ATTACKER.LAST> - RETURN 0
Errors: It says eval doesn't divide by 0 (which is equals to <ATTACKER>)
Code:
06:01:ERROR:(sphere_events_uommo.scp,126)Exp_GetVal: Divide by 0
06:01:ERROR:(sphere_events_uommo.scp,129)Undefined keyword 'ATTACKER.ADD'
06:01:ERROR:(sphere_events_uommo.scp,129)Undefined keyword 'ARGO.ATTACKER.ADD'
06:01:ERROR:(sphere_events_uommo.scp,129)Undefined keyword 'ATTACKER.ADD'
06:01:ERROR:(sphere_events_uommo.scp,129)Undefined keyword 'ARGO.ATTACKER.ADD'
(This post was last modified: 01-31-2017 04:11 PM by xwerswoodx.)
|
|
01-31-2017 04:06 PM |
|
|
xwerswoodx
Journeyman
Posts: 86
Likes Given: 4
Likes Received: 7 in 4 posts
Joined: Jun 2012
Reputation: 0
UoMMO
|
RE: @DeathCorpse - ATTACKER problem
Yeah, I just tried it but the problem is, <UID> (which is npc) doesn't attacker either.
On=@Death, I can see attackers, but on=@Deathcorpse, Attacker returns 0 for NPC, I change my code that to save attackers (maybe someone need it);
Code:
[Events e_npc_level]
On=@Death
IF !<dTAG0.LEVEL>
TAG0.LEVEL=1
ENDIF
IF <dATTACKER>
FOR x 0 <EVAL <ATTACKER> - 1>
REF1=<ATTACKER.<DLOCAL.X>>
SERV.LIST.<UID>.ADD <REF1>
ENDFOR
ENDIF
On=@DeathCorpse
IF ((<BRAIN> == brain_monster) && (<SERV.LIST.<UID>.COUNT> > 0))
LOCAL.TOT=<EVAL <TAG0.LEVEL> * 2>
LOCAL.TOT=<EVAL <DLOCAL.TOT> / <SERV.LIST.<UID>.COUNT>>
FOR a 0 <EVAL <SERV.LIST.<UID>.COUNT> - 1>
REF2=<SERV.LIST.<UID>.<DLOCAL.A>>
IF <REF2.ISINPARTY>
LOCAL.TOT=<EVAL <DLOCAL.TOT> / <REF2.PARTY.MEMBERS>>
FOR b 0 <EVAL <REF2.PARTY.MEMBERS> - 1>
REF3=<REF2.PARTY.MEMBER.<DLOCAL.B>>
SERV.LIST.<ARGO>.ADD <REF3>
REF3.GIVEXP <DLOCAL.TOT>
ENDFOR
ELSE
REF2.GIVEXP <DLOCAL.TOT>
SERV.LIST.<ARGO>.ADD <REF2>
ENDIF
ENDFOR
SERV.LIST.<UID>.CLEAR
ENDIF
|
|
02-01-2017 01:42 AM |
|
|
xwerswoodx
Journeyman
Posts: 86
Likes Given: 4
Likes Received: 7 in 4 posts
Joined: Jun 2012
Reputation: 0
UoMMO
|
RE: @DeathCorpse - ATTACKER problem
I remember @Death before than @Kill but this is not important (just for information if someone need it), because I needed to check attacker (list) on deathcorpse and it's possible to get corpse uid only on @Deathcorpse, I thought we can use ATTACKER under @Deathcorpse because I found this topic which has a post from XUN (Developer) with ATTACKER under @Deathcorpse,
https://forum.spherecommunity.net/Thread...elp?page=2
Because I tried to add EXP command which makes you clear corpses near you and get experience, but I try to add block that you don't get if you don't have any damage on it. So I tried to check attackers on from corpse but it's 0 so I tried to add attackers under DeathCorpse but it's cleared like you said. But in the link Xun send a post with attacker under deathcorpse and I thought I did something wrong.
Also I don't wanna post new topic for that, is there any Trigger or Setting to block items get damage? I tried @Damage but it's not working, and I didn't find any settings under Sphere.ini
(This post was last modified: 02-01-2017 02:49 AM by xwerswoodx.)
|
|
02-01-2017 02:46 AM |
|
|
User(s) browsing this thread: 1 Guest(s)