summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt7
-rw-r--r--src/map/skill.c58
2 files changed, 44 insertions, 21 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 92b8e95d0..db0654449 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,13 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/10/18
+ * Optimized the skill unit code [Playtester]
+ - reverted the unit timer interval to 100ms to save CPU usage
+ - rewrote the unit code of Fire Wall, Fire Formation and Heat so that they hit
+ every 20ms if the target wasn't knocked back despite of the unit timer interval
+ - Heat now does 15 SP damage to players instead of 60 per hit
+ - optimized memory usage
+ - TODO: Renaming or removing firewall_hits_on_undead config
* Clarified how npc names work in script_commands.txt.
* Fixed a forgotten "return 0;" that stopped the parsing of the file
after the first "script" of the file is parsed sucessfully (caused by r11502).
diff --git a/src/map/skill.c b/src/map/skill.c
index f3cc9a2c5..659ca6817 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -36,7 +36,7 @@
#include <time.h>
-#define SKILLUNITTIMER_INVERVAL 20
+#define SKILLUNITTIMER_INVERVAL 100
//Guild Skills are shifted to these to make them stick into the skill array.
#define GD_SKILLRANGEMIN 900
#define GD_SKILLRANGEMAX GD_SKILLRANGEMIN+MAX_GUILDSKILL
@@ -7288,21 +7288,22 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
switch (sg->unit_id)
{
case UNT_FIREWALL:
- {
+ if (tstatus->def_ele == ELE_FIRE || battle_check_undead(tstatus->race, tstatus->def_ele)) {
int count=0;
- if (tstatus->def_ele == ELE_FIRE || battle_check_undead(tstatus->race, tstatus->def_ele)) {
- //This is the best Aegis approximation we can do without
- //changing the minimum skill unit interval. [Skotlex]
- while (count++ < battle_config.firewall_hits_on_undead && src->val2-- && !status_isdead(bl))
- skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*10,1);
- } else {
- skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
- src->val2--;
- }
- if (src->val2<=0)
- skill_delunit(src);
- break;
+ //Fire property mobs and Undeads are never knocked back by firewall
+ //Should hit every 20ms [Playtester]
+ while (count++ < battle_config.firewall_hits_on_undead && !status_isdead(bl) && src->val2--)
+ skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*20,1);
+ } else {
+ int count=0;
+ int x = bl->x, y = bl->y;
+ //If mob isn't knocked back it should hit every 20ms [Playtester]
+ while (count++ < battle_config.firewall_hits_on_undead && x == bl->x && y == bl->y && !status_isdead(bl) && src->val2--)
+ skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*20,0);
}
+ if (src->val2<=0)
+ skill_delunit(src);
+ break;
case UNT_SANCTUARY:
if (battle_check_undead(tstatus->race, tstatus->def_ele) || tstatus->race==RC_DEMON)
@@ -7358,12 +7359,22 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
case SG_SUN_WARM: //SG skills [Komurka]
case SG_MOON_WARM:
case SG_STAR_WARM:
- if(bl->type==BL_PC)
+ if(!status_charge(ss, 0, 2)){ //should end when out of sp.
+ sg->limit=DIFF_TICK(tick,sg->tick);
+ break;
+ }
+ else if(bl->type==BL_PC){
//Only damage SP [Skotlex]
- status_zap(bl, 0, 60);
- else if(status_charge(ss, 0, 2))
- //Otherwise, Knockback attack.
+ status_zap(bl, 0, 15);
+ }
+ else{
+ int count=1;
+ int x = bl->x, y = bl->y;
skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
+ //If mob isn't knocked back it should hit every 20ms [Playtester]
+ while (count++ < battle_config.firewall_hits_on_undead && x == bl->x && y == bl->y && !status_isdead(bl) && status_charge(ss, 0, 2))
+ skill_attack(BF_WEAPON,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*20,0);
+ }
break;
case WZ_STORMGUST:
if (tsc && tsc->data[SC_FREEZE].val4 != sg->group_id)
@@ -7620,9 +7631,14 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
break;
case UNT_KAENSIN:
- skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
- if (--src->val2 <= 0)
- skill_delunit(src);
+ {
+ int count=0;
+ //Should hit every 20ms [Playtester]
+ while (count++ < battle_config.firewall_hits_on_undead && !status_isdead(bl) && src->val2--)
+ skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*20,0);
+ if (src->val2 <= 0)
+ skill_delunit(src);
+ }
break;
}