summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-03-14 13:41:49 -0300
committershennetsind <ind@henn.et>2014-03-14 13:41:49 -0300
commit2cc2a97b574a9485394c6da315b38b9cf362c277 (patch)
treea46d1ca0b138d7973e847e57b7234919b0f69d64
parentf4b1ff7426b1c4cd5e8cac37f7e3983cc03c706e (diff)
parent1849d357210bc3d01be99e1a7cd5e8c19e5d53f4 (diff)
downloadhercules-2cc2a97b574a9485394c6da315b38b9cf362c277.tar.gz
hercules-2cc2a97b574a9485394c6da315b38b9cf362c277.tar.bz2
hercules-2cc2a97b574a9485394c6da315b38b9cf362c277.tar.xz
hercules-2cc2a97b574a9485394c6da315b38b9cf362c277.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
-rw-r--r--doc/script_commands.txt21
-rw-r--r--src/map/clif.c14
-rw-r--r--src/map/pc.c14
-rw-r--r--src/map/skill.c21
4 files changed, 45 insertions, 25 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index db2b2ec5a..ada57d783 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -4141,17 +4141,26 @@ character and produces no other output whatsoever.
*itemheal <hp>,<sp>;
-This command heals given absolute amounts of HP and/or SP on the invoking
+This command heals given relative amounts of HP and/or SP on the invoking
character. Unlike heal, this command is intended for use in item scripts.
-It applies potion-related bonuses, such as alchemist ranking, cards and
-status changes. When used inside an NPC script, certain bonuses are
-omitted.
+It applies potion-related bonuses, such as alchemist ranking, cards,
+status changes.
+It also applies a sp/vit-related bonus that is calculated by:
+ heal = heal*[(100+STATUS*2)/100]
+So if a player has 99 vit and the script is 'itemheal 5,0':
+ heal(hp) = 5*[(100+99*2)/100]
+ heal(hp) = 14,9
+ heal(hp) = 14
+ heal(sp) = 0
+
+When used inside an NPC script, potion-related bonuses are omitted.
There is also a nice example on using this with the 'rand' function, to
give you a random amount of healing.
- // This will heal anything thing from 100 to 150 HP and no SP
- itemheal rand(100,150),0;
+ // If the player has 50 vit and no bonuses this will heal
+ // anything from 200 to 300 HP and 5 SP
+ itemheal rand(100,150),5;
---------------------------------------
diff --git a/src/map/clif.c b/src/map/clif.c
index cf6257628..31f2e07c1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11109,16 +11109,16 @@ void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
/// 012a
void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
{
- /**
- * Attempts to remove these options when this function is called (will remove all available)
- **/
-#ifdef NEW_CARTS
- pc->setoption(sd,sd->sc.option&~(OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR));
- if( sd->sc.data[SC_PUSH_CART] )
+ if( !(sd->sc.option&(OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR))
+#ifdef NEW_CARTS
+ && sd->sc.data[SC_PUSH_CART] ){
pc->setcart(sd,0);
#else
- pc->setoption(sd,sd->sc.option&~(OPTION_CART|OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR));
+ ){
+ pc->setoption(sd,sd->sc.option&~OPTION_CART);
#endif
+ }else // priority to remove this option before we can clear cart
+ pc->setoption(sd,sd->sc.option&~(OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR));
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 5eb682415..41a722dfb 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7521,7 +7521,7 @@ void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int ty
*------------------------------------------*/
int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
{
- int bonus;
+ int bonus, tmp;
if(hp) {
int i;
@@ -7541,8 +7541,10 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
break;
}
}
- if(bonus!=100)
- hp = hp * bonus / 100;
+
+ tmp = hp*bonus/100;
+ if(bonus != 100 && tmp > hp)
+ hp = tmp;
// Recovery Potion
if( sd->sc.data[SC_HEALPLUS] )
@@ -7554,8 +7556,10 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
+ pc->checkskill(sd,AM_LEARNINGPOTION)*5;
if (script->potion_flag > 1)
bonus += bonus*(script->potion_flag-1)*50/100;
- if(bonus != 100)
- sp = sp * bonus / 100;
+
+ tmp = sp*bonus/100;
+ if(bonus != 100 && tmp > sp)
+ sp = tmp;
}
if( sd->sc.count ) {
if ( sd->sc.data[SC_CRITICALWOUND] ) {
diff --git a/src/map/skill.c b/src/map/skill.c
index e854b5fe9..7f33c26a5 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -10408,11 +10408,12 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
break;
case SC_FEINTBOMB:
- skill->unitsetting(src,skill_id,skill_lv,x,y,0); // Set bomb on current Position
- clif->skill_nodamage(src,src,skill_id,skill_lv,1);
- skill->blown(src,src,3*skill_lv,unit->getdir(src),0);
- //After back sliding, the player goes into hiding. Hiding level used is throught to be the learned level.
- sc_start(src,src,SC_HIDING,100,(sd?pc->checkskill(sd,TF_HIDING):10),skill->get_time(TF_HIDING,(sd?pc->checkskill(sd,TF_HIDING):10)));
+ skill->unitsetting(src, skill_id, skill_lv, x, y, 0); // Set bomb on current Position
+ clif->skill_nodamage(src, src, skill_id, skill_lv, 1);
+ if( skill->blown(src, src, 3 * skill_lv, unit->getdir(src), 0) && sc){
+ sc->option |= OPTION_INVISIBLE;
+ clif->changeoption(src);
+ }
break;
case SC_ESCAPE:
@@ -15869,8 +15870,14 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) {
case UNT_FEINTBOMB: {
struct block_list *src = map->id2bl(group->src_id);
- if( src )
- map->foreachinrange(skill->area_sub, &group->unit->bl, su->range, splash_target(src), src, SC_FEINTBOMB, group->skill_lv, tick, BCT_ENEMY|1, skill->castend_damage_id);
+ if( src ){
+ struct status_change *sc = status->get_sc(src);
+ map->foreachinrange(skill->area_sub, &group->unit->bl, su->range, splash_target(src), src, SC_FEINTBOMB, group->skill_lv, tick, BCT_ENEMY|SD_ANIMATION|1, skill->castend_damage_id);
+ if(sc){
+ sc->option &= ~OPTION_INVISIBLE;
+ clif->changeoption(src);
+ }
+ }
skill->delunit(su);
break;
}