summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-16 19:50:52 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-16 19:50:52 +0000
commite5be0261a4419cb2b6849a751d04477ef40dca79 (patch)
tree0fd6506778c1ff806bed61abff36d24bf5cd6b1e /src
parentf8047993636ed47b0cb6c49ff650f0bd5e9217b0 (diff)
downloadhercules-e5be0261a4419cb2b6849a751d04477ef40dca79.tar.gz
hercules-e5be0261a4419cb2b6849a751d04477ef40dca79.tar.bz2
hercules-e5be0261a4419cb2b6849a751d04477ef40dca79.tar.xz
hercules-e5be0261a4419cb2b6849a751d04477ef40dca79.zip
- Spirit of Wizard will now consume an item 7321 each time it blocks reflected magic.
- Added script command jobname, retrieves a given's class name as per the appropiate msg_athena.txt entry (this command should had been added years ago) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8320 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char/inter.c2
-rw-r--r--src/map/script.c13
-rw-r--r--src/map/skill.c7
3 files changed, 19 insertions, 3 deletions
diff --git a/src/char/inter.c b/src/char/inter.c
index 416ab308c..094e67675 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -396,7 +396,7 @@ int mapif_disconnectplayer(int fd, int account_id, int char_id, int reason)
if (fd < 0)
return -1;
- WFIFOHEAD(fd, 7);
+ WFIFOHEAD(fd, 7);
WFIFOW(fd,0) = 0x2b1f;
WFIFOL(fd,2) = account_id;
WFIFOB(fd,6) = reason;
diff --git a/src/map/script.c b/src/map/script.c
index f680ce297..46a73fbd7 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3267,6 +3267,7 @@ int buildin_heal(struct script_state *st);
int buildin_itemheal(struct script_state *st);
int buildin_percentheal(struct script_state *st);
int buildin_jobchange(struct script_state *st);
+int buildin_jobname(struct script_state *st);
int buildin_input(struct script_state *st);
int buildin_setlook(struct script_state *st);
int buildin_set(struct script_state *st);
@@ -3583,6 +3584,7 @@ struct script_function buildin_func[] = {
{buildin_return,"return","*"},
{buildin_getarg,"getarg","i"},
{buildin_jobchange,"jobchange","i*"},
+ {buildin_jobname,"jobname","i"},
{buildin_input,"input","*"},
{buildin_warp,"warp","sii"},
{buildin_areawarp,"areawarp","siiiisii"},
@@ -4570,6 +4572,17 @@ int buildin_jobchange(struct script_state *st)
*
*------------------------------------------
*/
+int buildin_jobname(struct script_state *st)
+{
+ int class_=conv_num(st,& (st->stack->stack_data[st->start+2]));
+ push_str(st->stack,C_CONSTSTR,job_name(class_));
+ return 0;
+}
+
+/*==========================================
+ *
+ *------------------------------------------
+ */
int buildin_input(struct script_state *st)
{
struct map_session_data *sd = script_rid2sd(st);
diff --git a/src/map/skill.c b/src/map/skill.c
index 75ae90425..671dce936 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1877,8 +1877,11 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
tsd = (bl->type == BL_PC)?(TBL_PC*)bl:NULL;
if (sc && !sc->count)
sc = NULL; //Don't need it.
- if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_WIZARD)
- { //Spirit of Wizard blocks bounced back spells.
+ //Spirit of Wizard blocks bounced back spells.
+ if (sc && sc->data[SC_SPIRIT].timer != -1 && sc->data[SC_SPIRIT].val2 == SL_WIZARD
+ && !(tsd && (type = pc_search_inventory (tsd, 7321)) < 0))
+ {
+ if (tsd) pc_delitem(tsd, type, 1, 0);
dmg.damage = dmg.damage2 = 0;
dmg.dmg_lv = ATK_FLEE;
}