summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-24 19:33:37 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-24 19:33:37 +0000
commit34a1a63f26ecc52c524183e6aa477ebfc5dab904 (patch)
tree4da6076ebc49228099c95e6306720cf9ff02b4bc /src/map
parent6240fbceaa9a5f366bfcf7b95c3dd959ec04e60c (diff)
downloadhercules-34a1a63f26ecc52c524183e6aa477ebfc5dab904.tar.gz
hercules-34a1a63f26ecc52c524183e6aa477ebfc5dab904.tar.bz2
hercules-34a1a63f26ecc52c524183e6aa477ebfc5dab904.tar.xz
hercules-34a1a63f26ecc52c524183e6aa477ebfc5dab904.zip
- NPC_MAGICALATTACK now starts a state similar to Sacrificial Ritual, in the sense that every normal attack afterwards becomes a Magical Attack. The skill duration is 15 secs.
- Corrected some trade-cancel calls in trade_traderequest. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10346 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c8
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/skill.c6
-rw-r--r--src/map/status.c1
-rw-r--r--src/map/status.h1
-rw-r--r--src/map/trade.c4
6 files changed, 16 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 60fdc0a3b..38be508dd 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -2899,8 +2899,12 @@ int battle_weapon_attack(struct block_list* src, struct block_list* target, unsi
if (rand()%100 < triple_rate)
return skill_attack(BF_WEAPON,src,src,target,MO_TRIPLEATTACK,damage,tick,0);
}
- else if (sc && sc->data[SC_SACRIFICE].timer != -1)
- return skill_attack(BF_WEAPON,src,src,target,PA_SACRIFICE,sc->data[SC_SACRIFICE].val1,tick,0);
+ else if (sc) {
+ if (sc->data[SC_SACRIFICE].timer != -1)
+ return skill_attack(BF_WEAPON,src,src,target,PA_SACRIFICE,sc->data[SC_SACRIFICE].val1,tick,0);
+ if (sc->data[SC_MAGICALATTACK].timer != -1)
+ return skill_attack(BF_MAGIC,src,src,target,NPC_MAGICALATTACK,sc->data[SC_MAGICALATTACK].val1,tick,0);
+ }
wd = battle_calc_weapon_attack(src, target, 0, 0, flag);
diff --git a/src/map/clif.c b/src/map/clif.c
index f3d18b702..5dd222ebd 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -53,7 +53,7 @@ struct Clif_Config {
struct packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
//Converts item type in case of pet eggs.
-#define itemtype(a) (a == 7)?4:a
+#define itemtype(a) (a == IT_PETEGG)?IT_WEAPON:a
#define WBUFPOS(p,pos,x,y,dir) \
do { \
diff --git a/src/map/skill.c b/src/map/skill.c
index 36477a61d..bb895c68d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3133,7 +3133,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
case AL_HOLYLIGHT:
case WZ_JUPITEL:
case NPC_DARKTHUNDER:
- case NPC_MAGICALATTACK:
case PR_ASPERSIO:
case MG_FROSTDIVER:
case WZ_SIGHTBLASTER:
@@ -3144,6 +3143,11 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
break;
+ case NPC_MAGICALATTACK:
+ skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
+ sc_start(src,SkillStatusChangeTable(skillid),100,skilllv,skill_get_time(skillid,skilllv));
+ break;
+
case HVAN_CAPRICE: //[blackhole89]
{
int ran=rand()%4;
diff --git a/src/map/status.c b/src/map/status.c
index d8921ef70..5ba30b62a 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -212,6 +212,7 @@ void initChangeTables(void) {
add_sc(NPC_PETRIFYATTACK, SC_STONE);
add_sc(NPC_CURSEATTACK, SC_CURSE);
add_sc(NPC_SLEEPATTACK, SC_SLEEP);
+ add_sc(NPC_MAGICALATTACK, SC_MAGICALATTACK);
set_sc(NPC_KEEPING, SC_KEEPING, SI_BLANK, SCB_DEF);
add_sc(NPC_DARKBLESSING, SC_COMA);
set_sc(NPC_BARRIER, SC_BARRIER, SI_BLANK, SCB_MDEF|SCB_DEF);
diff --git a/src/map/status.h b/src/map/status.h
index cb101450c..4f51c61ab 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -259,6 +259,7 @@ enum {
SC_INCDEXRATE,
SC_JAILED,
SC_ENCHANTARMS,
+ SC_MAGICALATTACK,
SC_MAX, //Automatically updated max, used in for's and at startup to check we are within bounds. [Skotlex]
};
int SkillStatusChangeTable(int skill);
diff --git a/src/map/trade.c b/src/map/trade.c
index 40f63e888..41d919daa 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -54,7 +54,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
}
if ((target_sd->trade_partner != 0) || (sd->trade_partner != 0)) {
- trade_tradecancel(sd); // person is in another trade
+ clif_tradestart(sd, 2); // person is in another trade
return;
}
@@ -62,7 +62,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
if ( pc_can_give_items(level) || pc_can_give_items(pc_isGM(target_sd)) ) //check if both GMs are allowed to trade
{
clif_displaymessage(sd->fd, msg_txt(246));
- trade_tradecancel(sd); // GM is not allowed to trade
+ clif_tradestart(sd, 2); // GM is not allowed to trade
return;
}