Page 1 of 1
Attack without ctrl and peace zone
Posted: Mon Jan 31, 2011 9:31 am
by xrs
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision
Number:4487
L2JDP Revision
Number:7760
I'm trying to make that players could attack each other without holding ctrl. So far I only managed to make it work only for simple attack. But for skills you still need to hold ctrl. And skills like, aura flare dont work at all (I gues server checks your target, no target = no skill). Second problem is that I need to dissable peace zones. Once again I managed to modify code so that you could use simple attack in peace zone, but not skills. Where exactly these this are being handled?
And one more thing. Is it posible to modify how offten server writes all players data to database?
Re: Attack without ctrl and peace zone
Posted: Mon Jan 31, 2011 11:13 am
by xrs
Attacking in peace zone allready done. Now I still cant find attacking with skill without ctrl. Sleep, fear and etc works withour ctrl. Just attack type skills dont work. And aura flash does absolutely nothing. Any sugestions?

Re: Attack without ctrl and peace zone
Posted: Mon Jan 31, 2011 2:05 pm
by xrs
Fixed the ctrl problem. Only problem left is non working aura flare skill. I gues that all TARGET_AURA type skills does nothing. It doesnt display any "incorect target" or similar errors. It just does nothing(no animation). Where all "mechanics" of this skill type are declared?
Re: Attack without ctrl and peace zone
Posted: Mon Jan 31, 2011 2:30 pm
by _DS_
L2Skill.checkForAreaOffensiveSkill or smth like this.
Re: Attack without ctrl and peace zone
Posted: Mon Jan 31, 2011 3:14 pm
by xrs
I tryed debuging and found a place in the code whe casting aura flash stops.
it is function checkUseMagicConditions in l2pcinstance.java
to be more exact I think its this code:
Code: Select all
L2Object target = null; switch (sklTargetType){ // Target the player if skill type is AURA, PARTY, CLAN or SELF case TARGET_AURA: case TARGET_FRONT_AURA: case TARGET_BEHIND_AURA: case TARGET_PARTY: case TARGET_ALLY: case TARGET_CLAN: case TARGET_PARTY_CLAN: case TARGET_GROUND: case TARGET_SELF: case TARGET_AREA_SUMMON: target = this; break; case TARGET_PET: case TARGET_SUMMON: target = getPet(); break; default: target = getTarget(); break;} if (target == null){ sendPacket(ActionFailed.STATIC_PACKET); return false;}
I'm not sure that I do understand this part of a code. If it is TARGET_AURA type skill, it assigns no target at all, so it returns false and casting is aborted. I'm not getting it right or the code is messed up?
Re: Attack without ctrl and peace zone
Posted: Mon Jan 31, 2011 3:59 pm
by _DS_
target = this
Re: Attack without ctrl and peace zone
Posted: Mon Jan 31, 2011 4:43 pm
by xrs
Problem solved. It was my own mistake in code with faction handling during attack.
if (player.factionid() == target.factionid()) return false;
But with type_aura skills target is equal player. So using skills wich doesnt require target was imposible

Litle mistake, but it took me couple days to find it.