alright so simply put
as you can see, sling item equips the food as ammunition and then you can sling it to another player to give them the buff effects of the food
i need help doing the same thing with slim potion pitcher. i already know how to make items into ammo, so the only thing i need help with is the source code aspect and make it search for whatever ammo you have equipped instead of whatever it's doing. i have highlighted the suspected culprits
case CR_SLIMPITCHER:
if (sd) {int i = skill_lv%11 - 1;int j = pc->search_inventory(sd,skill->db[skill_id].itemid[i]);if( j < 0 || skill->db[skill_id].itemid[i] <= 0 ){clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);return 1;}script->potion_flag = 1;script->potion_hp = 0;script->potion_sp = 0;script->run(sd->inventory_data[j]->script,0,sd->bl.id,0); <---- i suspect this to be the game running the effects of the item on the target player(s)script->potion_flag = 0;//Apply skill bonusesi = pc->checkskill(sd,CR_SLIMPITCHER)*10+ pc->checkskill(sd,AM_POTIONPITCHER)*10+ pc->checkskill(sd,AM_LEARNINGPOTION)*5+ pc->skillheal_bonus(sd, skill_id);script->potion_hp = script->potion_hp * (100+i)/100;script->potion_sp = script->potion_sp * (100+i)/100;if(script->potion_hp > 0 || script->potion_sp > 0) {i = skill->get_splash(skill_id, skill_lv);map->foreachinarea(skill->area_sub,src->m,x-i,y-i,x+i,y+i,BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_PARTY|BCT_GUILD|1,skill->castend_nodamage_id);}} else {int i = skill_lv%11 - 1;struct item_data *item;i = skill->db[skill_id].itemid[i];item = itemdb->search(i);script->potion_flag = 1;script->potion_hp = 0;script->potion_sp = 0;script->run(item->script,0,src->id,0);script->potion_flag = 0;i = skill->get_max(CR_SLIMPITCHER)*10;script->potion_hp = script->potion_hp * (100+i)/100;script->potion_sp = script->potion_sp * (100+i)/100;if(script->potion_hp > 0 || script->potion_sp > 0) {i = skill->get_splash(skill_id, skill_lv);map->foreachinarea(skill->area_sub,src->m,x-i,y-i,x+i,y+i,BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_PARTY|BCT_GUILD|1,skill->castend_nodamage_id);}}break;
case CR_SLIMPITCHER:
if( dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARIDAN_STONE2)) )break;if( sd ) {short ammo_id;int equip_idx = sd->equip_index[EQI_AMMO];if( equip_idx <= 0 )break; // No ammo.ammo_id = sd->inventory_data[equip_idx]->nameid;if( ammo_id <= 0 )break;sd->itemid = ammo_id;if( ammo_id == 545 || ammo_id == 546 || ammo_id == 547 ) {struct script_code *scriptroot = sd->inventory_data[equip_idx]->script;if( !scriptroot )break;if( dstsd )script->run(scriptroot,0,dstsd->bl.id,npc->fake_nd->bl.id);elsescript->run(scriptroot,0,src->id,0);}}
Edited by Blinzer, 15 January 2017 - 12:59 AM.