Kaynağa Gözat

Gunslinger Fixes
* Fixed #879. Added check while equiping Gun-type weapon X Ammo (bullets and grenades).
* Fixed Gunslinger's Spread Shot can be used by equipping Shotgun + Bullet or Grenade Launcher + Grenade.
* Fixed Gunslinger's Mine (Ground Drift) must cannot be casted on target's foot and must cannot be stacked.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

Cydh Ramdh 9 yıl önce
ebeveyn
işleme
c699304bd9
3 değiştirilmiş dosya ile 34 ekleme ve 2 silme
  1. 1 1
      db/re/skill_require_db.txt
  2. 1 1
      db/re/skill_unit_db.txt
  3. 32 0
      src/map/pc.c

+ 1 - 1
db/re/skill_require_db.txt

@@ -502,7 +502,7 @@
 517,0,0,30:32:34:36:38:40:42:44:46:48,0,0,0,19,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//GS_GATLINGFEVER
 518,0,0,3:6:9:12:15:18:21:24:27:30,0,0,0,20,3,1,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0		//GS_DUST
 519,0,0,20:25:30:35:40:45:50:55:60:65,0,0,0,20,3,2:2:4:4:6:6:8:8:10:10,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0	//GS_FULLBUSTER
-520,0,0,15:20:25:30:35:40:45:50:55:60,0,0,0,20:21,3,5,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0//GS_SPREADATTACK
+520,0,0,15:20:25:30:35:40:45:50:55:60,0,0,0,20:21,3:5,5,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0//GS_SPREADATTACK
 521,0,0,4:8:12:16:20:24:28:32:36:40,0,0,0,21,5,1,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0		//GS_GROUNDDRIFT
 
 //****

+ 1 - 1
db/re/skill_unit_db.txt

@@ -97,7 +97,7 @@
 484,0xb8,    ,  2, 0, 500,enemy, 0x8808	//HW_GRAVITATION
 488,0xb9,    ,  3, 0,  -1,all,   0x200	//CG_HERMODE
 516,0x86,    ,  3, 0, 100,enemy, 0x000	//GS_DESPERADO
-521,0xbe,    ,  0, 1,1000,enemy, 0x000	//GS_GROUNDDRIFT
+521,0xbe,    ,  0, 1,1000,enemy, 0x006	//GS_GROUNDDRIFT
 525,0x86,    ,  0, 2,1000,enemy, 0x018	//NJ_HUUMA
 527,0xbc,    , -1, 0,2000,enemy, 0x018	//NJ_TATAMIGAESHI
 535,0xbd,    , -1, 0,  20,enemy, 0x8010	//NJ_KAENSIN

+ 32 - 0
src/map/pc.c

@@ -9306,6 +9306,38 @@ bool pc_equipitem(struct map_session_data *sd,short n,int req_pos)
 		return false;
 	}
 
+	if ((sd->class_&MAPID_BASEMASK) == MAPID_GUNSLINGER && (id->type == IT_AMMO || (id->type == IT_WEAPON && id->look >= W_REVOLVER && id->look <= W_GRENADE))) {
+		/** Failing condition:
+		 * 1. Always failed to equip ammo if no weapon equipped yet
+		 * 2. Grenade only can be equipped if weapon is Grenade Launcher
+		 * 3. Bullet cannot be equipped if the weapon is Grenade Launcher
+		 * (4. The rest is relying on item job/class restriction).
+		 **/
+		if (id->type == IT_AMMO) {
+			int w_idx = sd->equip_index[EQI_HAND_R];
+			enum weapon_type w_type = (w_idx != -1) ? (enum weapon_type)sd->inventory_data[w_idx]->look : W_FIST;
+			if (w_idx == -1 ||
+				(id->look == A_GRENADE && w_type != W_GRENADE) ||
+				(id->look != A_GRENADE && w_type == W_GRENADE))
+			{
+				clif_equipitemack(sd, 0, 0, ITEM_EQUIP_ACK_FAIL);
+				return false;
+			}
+		}
+		else {
+			int a_idx = sd->equip_index[EQI_AMMO];
+			if (a_idx != -1) {
+				enum ammo_type a_type = (enum ammo_type)sd->inventory_data[a_idx]->look;
+				if ((a_type == A_GRENADE && id->look != W_GRENADE) ||
+					(a_type != A_GRENADE && id->look == W_GRENADE))
+				{
+					clif_equipitemack(sd, 0, 0, ITEM_EQUIP_ACK_FAIL);
+					return false;
+				}
+			}
+		}
+	}
+
 	if (id->flag.bindOnEquip && !sd->status.inventory[n].bound) {
 		sd->status.inventory[n].bound = (char)battle_config.default_bind_on_equip;
 		clif_notify_bindOnEquip(sd,n);