Jump to content
  • 0

instant cast for trans and lower job with 150 dex but not with 3rd class


Question

Posted

this is a source code mabe by sir clydelion, can someone help me to edit it, what I plan is when a char is trans or lower job, he/she will have a instant cast of 150 dex but when a char is 3rd class there will be no instant cast, it will used the renewal casting formula for 3rd class only, I hope someone can make it for me, thanks in advance

Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 16781)
+++ src/map/battle.c (working copy)
@@ -5596,6 +5596,8 @@
 { "max_cloth_color",				    &battle_config.max_cloth_color,				 4,	  0,	  INT_MAX,	    },
 { "pet_hair_style",					 &battle_config.pet_hair_style,				  100,    0,	  INT_MAX,	    },
 { "castrate_dex_scale",				 &battle_config.castrate_dex_scale,			  150,    1,	  INT_MAX,	    },
+ { "castrate_dex_scale_2",			   &battle_config.castrate_dex_scale_2,		    150,    1,	  INT_MAX,	    },
+ { "castrate_dex_scale_3",			   &battle_config.castrate_dex_scale_3,		    150,    1,	  INT_MAX,	    },
 { "vcast_stat_scale",	 &battle_config.vcast_stat_scale,	   530,    1,	  INT_MAX,	    },
 { "area_size",						  &battle_config.area_size,					   14,	 0,	  INT_MAX,	    },
 { "zeny_from_mobs",					 &battle_config.zeny_from_mobs,				  0,	  0,	  1,			  },

Index: src/map/battle.h
===================================================================
--- src/map/battle.h (revision 16781)
+++ src/map/battle.h (working copy)
@@ -345,6 +345,8 @@
 int pet_hair_style; // added by [skotlex]

 int castrate_dex_scale; // added by [MouseJstr]
+ int castrate_dex_scale_2;
+ int castrate_dex_scale_3;
 int area_size; // added by [MouseJstr]

 int max_def, over_def_bonus; //added by [skotlex]

Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 16781)
+++ src/map/skill.c (working copy)
@@ -13356,10 +13356,22 @@

  // calculate base cast time (reduced by dex)
  if( !(skill_get_castnodex(skill_id, skill_lv)&1) ) {
-   int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
-   if( scale > 0 ) // not instant cast
-    time = time * scale / battle_config.castrate_dex_scale;
+   int scale = 0;
+   if(sd && sd->class_&JOBL_THIRD)
+    scale = battle_config.castrate_dex_scale_3 - status_get_dex(bl);
+   else if (sd && sd->class_&JOBL_2)
+    scale = battle_config.castrate_dex_scale_2 - status_get_dex(bl);
   else
+    scale = battle_config.castrate_dex_scale - status_get_dex(bl);
+   if( scale > 0 ){ // not instant cast
+    if(sd && sd->class_&JOBL_THIRD)
+	 time = time * scale / battle_config.castrate_dex_scale_3;
+    else if (sd && sd->class_&JOBL_2)
+	 time = time * scale / battle_config.castrate_dex_scale_2;
+    else
+	 time = time * scale / battle_config.castrate_dex_scale;
+   }
+   else
 return 0; // instant cast
  }

Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 16781)
+++ src/map/skill.c (working copy)
@@ -13356,10 +13356,22 @@

  // calculate base cast time (reduced by dex)
  if( !(skill_get_castnodex(skill_id, skill_lv)&1) ) {
-   int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
-   if( scale > 0 ) // not instant cast
-    time = time * scale / battle_config.castrate_dex_scale;
+   int scale = 0;
+   if(sd && sd->class_&JOBL_THIRD)
+    scale = battle_config.castrate_dex_scale_3 - status_get_dex(bl);
+   else if (sd && sd->class_&JOBL_2)
+    scale = battle_config.castrate_dex_scale_2 - status_get_dex(bl);
   else
+    scale = battle_config.castrate_dex_scale - status_get_dex(bl);
+   if( scale > 0 ){ // not instant cast
+    if(sd && sd->class_&JOBL_THIRD)
+	 time = time * scale / battle_config.castrate_dex_scale_3;
+    else if (sd && sd->class_&JOBL_2)
+	 time = time * scale / battle_config.castrate_dex_scale_2;
+    else
+	 time = time * scale / battle_config.castrate_dex_scale;
+   }
+   else
 return 0; // instant cast
  }

Index: conf/battle/skill.conf
===================================================================
--- conf/battle/skill.conf (revision 16781)
+++ conf/battle/skill.conf (working copy)
@@ -38,7 +38,9 @@
no_skill_delay: 2

// At what dex does the cast time become zero (instacast)?
-castrate_dex_scale: 150
+castrate_dex_scale: 150 //1st class
+castrate_dex_scale_2: 150 //2nd class
+castrate_dex_scale_3: 150 //3rd class

// How much (dex*2+int) does variable cast turns zero?
vcast_stat_scale: 530

1 answer to this question

Recommended Posts

Posted

That's a bit more complicated.

You have to apply the code as it is, but then add in the fixed casting time that's in rA already to the 3rd job calculation.

Also, this code looks a bit old? I recently made something like this and I remember the renewal cast function being a lot different.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...