Jump to content
  • 0

Prohibit change weapon while cast time is ongoing?


johnbond

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Hello guys!

 

Currently in my Server while a player is casting a skill (cast bar ongoing) he can be able to switch weapons. Now the problem here is when a player is casting a "sword/spear-only-skill" he can be able to switch to an axe type weapon not intended for the Spiral pierce skill (should only be sword or spear) which results to a more powerful damage which is like of an exploit.

 

Maybe if we could prohibit changing of weapons while a cast time is ongoing we could fix this exploit. Please show me how I could unallow changing of weapons while a skill is currently being casted but they can immediately change weapons right after the "cast time" finishes.

 

Any help will be greatly appreciated. I can pay for service.

 

Thank you in advance guys!

 

 

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

I don't think that's possible without a src modification

 

that is a technique pretty old, change to an axe heavier than the spear while casting spiral pierce

 

or change to 2 elemental swords while casting cold bolt with ice falchon with assassins

 

you will have to wait for a src modifier, good luck with it :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

I don't think that's possible without a src modification

 

that is a technique pretty old, change to an axe heavier than the spear while casting spiral pierce

 

or change to 2 elemental swords while casting cold bolt with ice falchon with assassins

 

you will have to wait for a src modifier, good luck with it :)

 

 

Yes I believe this will be a SRC modification.

 

Thanks.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

Untested but I think this will work.

diff --git a/src/map/pc.c b/src/map/pc.c
index 752e42f..6a0bc81 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -898,6 +898,7 @@ bool pc_isItemClass (struct map_session_data *sd, struct item_data* item) {
 int pc_isequip(struct map_session_data *sd,int n)
 {
 	struct item_data *item;
+	struct unit_data *ud = unit_bl2ud(&sd->bl);
 
 	nullpo_ret(sd);
 
@@ -917,6 +918,9 @@ int pc_isequip(struct map_session_data *sd,int n)
 	if(item->sex != 2 && sd->status.sex != item->sex)
 		return 0;
 
+	if (ud && ud->skilltimer != INVALID_TIMER)
+		return 0; // Cannot change equipment while casting
+
 	if (sd->sc.count) {
 
 		if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  08/09/12
  • Last Seen:  

What the original poster is really complaining about is a regression in eAthena. It was originally broken in r9861, discussed here, fixed, and then broken 2 years later in r13815 because of splitting skill_check_condition() into skill_check_condition_castbegin() and skill_check_condition_castend() (as reported here). Apparently nobody addressed it since then.

 

I think what you really want to have is having the special skill fail on cast-end if the caster is not holding the right equipment.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

Untested but I think this will work.

diff --git a/src/map/pc.c b/src/map/pc.c
index 752e42f..6a0bc81 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -898,6 +898,7 @@ bool pc_isItemClass (struct map_session_data *sd, struct item_data* item) {
 int pc_isequip(struct map_session_data *sd,int n)
 {
 	struct item_data *item;
+	struct unit_data *ud = unit_bl2ud(&sd->bl);
 
 	nullpo_ret(sd);
 
@@ -917,6 +918,9 @@ int pc_isequip(struct map_session_data *sd,int n)
 	if(item->sex != 2 && sd->status.sex != item->sex)
 		return 0;
 
+	if (ud && ud->skilltimer != INVALID_TIMER)
+		return 0; // Cannot change equipment while casting
+
 	if (sd->sc.count) {
 
 		if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG]

 

Nice it is working! But can we make it to "only" affect weapons and not amors/equips? I want the item changing while cast time is ongoing to only be for weapons and not other items.

 

And can we just make it that the restriction on weapon change will depend on the casted skill if the weapon being changed to is for the skill or not. I mean if the weapon to change to is allowed for the skill then it can be used even while cast time is ongoing. Example the spiral pierce is a spear/sword only skill, if the player will change to an axe while casting spiral pierce then it wont allow the change but if the player will change to another type of spear then he will be allowed to change.

 

I hope you could help me on this my friend.

 

Thank you my friend!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

 

Untested but I think this will work.

diff --git a/src/map/pc.c b/src/map/pc.c
index 752e42f..6a0bc81 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -898,6 +898,7 @@ bool pc_isItemClass (struct map_session_data *sd, struct item_data* item) {
 int pc_isequip(struct map_session_data *sd,int n)
 {
 	struct item_data *item;
+	struct unit_data *ud = unit_bl2ud(&sd->bl);
 
 	nullpo_ret(sd);
 
@@ -917,6 +918,9 @@ int pc_isequip(struct map_session_data *sd,int n)
 	if(item->sex != 2 && sd->status.sex != item->sex)
 		return 0;
 
+	if (ud && ud->skilltimer != INVALID_TIMER)
+		return 0; // Cannot change equipment while casting
+
 	if (sd->sc.count) {
 
 		if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG]

 

Nice it is working! But can we make it to "only" affect weapons and not amors/equips? I want the item changing while cast time is ongoing to only be for weapons and not other items.

 

And can we just make it that the restriction on weapon change will depend on the casted skill if the weapon being changed to is for the skill or not. I mean if the weapon to change to is allowed for the skill then it can be used even while cast time is ongoing. Example the spiral pierce is a spear/sword only skill, if the player will change to an axe while casting spiral pierce then it wont allow the change but if the player will change to another type of spear then he will be allowed to change.

 

I hope you could help me on this my friend.

 

Thank you my friend!

 

 

 

Anyone?

 

Thank you guys.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

wait a little more, someone may answer :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

 

Untested but I think this will work.

diff --git a/src/map/pc.c b/src/map/pc.c
index 752e42f..6a0bc81 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -898,6 +898,7 @@ bool pc_isItemClass (struct map_session_data *sd, struct item_data* item) {
 int pc_isequip(struct map_session_data *sd,int n)
 {
 	struct item_data *item;
+	struct unit_data *ud = unit_bl2ud(&sd->bl);
 
 	nullpo_ret(sd);
 
@@ -917,6 +918,9 @@ int pc_isequip(struct map_session_data *sd,int n)
 	if(item->sex != 2 && sd->status.sex != item->sex)
 		return 0;
 
+	if (ud && ud->skilltimer != INVALID_TIMER)
+		return 0; // Cannot change equipment while casting
+
 	if (sd->sc.count) {
 
 		if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG]

 

Nice it is working! But can we make it to "only" affect weapons and not amors/equips? I want the item changing while cast time is ongoing to only be for weapons and not other items.

 

And can we just make it that the restriction on weapon change will depend on the casted skill if the weapon being changed to is for the skill or not. I mean if the weapon to change to is allowed for the skill then it can be used even while cast time is ongoing. Example the spiral pierce is a spear/sword only skill, if the player will change to an axe while casting spiral pierce then it wont allow the change but if the player will change to another type of spear then he will be allowed to change.

 

I hope you could help me on this my friend.

 

Thank you my friend!

 

Can anyone kindly please help me on this? :)

I can happily pay for service.

 

Thank you guys. ^^

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  187
  • Reputation:   7
  • Joined:  09/04/12
  • Last Seen:  

I am looking for this scr code too.

No one can help?:(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

sorry i don't touc src but just low editing D:

bump for them (?)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

deleted :(

Edited by Sanasol
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...