- Little cleanup to OnTouchNPC.

- Updating Release of Wish script.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12757 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
zephyrus 2008-06-04 13:13:34 +00:00
parent f7cb030349
commit e595e1f69f
2 changed files with 36 additions and 45 deletions

View File

@ -831,7 +831,7 @@
1627,Staffy,Staffy,4,,10,0,120,,1,0,0x00818315,7,2,2,1,1,0,10,{ bonus bMatkRate,15; bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{} 1627,Staffy,Staffy,4,,10,0,120,,1,0,0x00818315,7,2,2,1,1,0,10,{ bonus bMatkRate,15; bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{}
1628,Survival_Rod_C,Refined Survivor's Rod,4,,0,0,71,,1,0,0x00818314,7,2,2,3,1,0,10,{ bonus bDex,4; bonus bMatkRate,20; bonus bMaxHP,500; },{},{} 1628,Survival_Rod_C,Refined Survivor's Rod,4,,0,0,71,,1,0,0x00818314,7,2,2,3,1,0,10,{ bonus bDex,4; bonus bMatkRate,20; bonus bMaxHP,500; },{},{}
1629,Walking_Stick,Gentleman's Staff,4,,,500,40,,1,1,0x00818315,7,2,2,4,50,1,10,{ bonus bMatkRate,15+getrefine(); bonus bDex,1; if (isequipped(5045)) bonus bDex,2; bonus bInt,2; bonus bSPrecovRate,5; },{},{} 1629,Walking_Stick,Gentleman's Staff,4,,,500,40,,1,1,0x00818315,7,2,2,4,50,1,10,{ bonus bMatkRate,15+getrefine(); bonus bDex,1; if (isequipped(5045)) bonus bDex,2; bonus bInt,2; bonus bSPrecovRate,5; },{},{}
1630,Radiant_Wisdom,Release of Wish,4,,,500,30,,1,0,0x00018205,7,2,2,3,50,1,10,{ bonus bMatkRate,15; bonus bInt,3; },{},{} 1630,Radiant_Wisdom,Release of Wish,4,,,500,30,,1,0,0x00018205,7,2,2,3,50,1,10,{ bonus bMatkRate,15; bonus bInt,3; bonus bSPrecovRate,6; bonus bHPrecovRate,6; bonusautoscript "{ sc_start4 SC_HPREGEN,2000,100,1,0,0; sc_start4 SC_SPREGEN,2000,50,1,0,0; }",10,BF_MAGIC; },{},{}
1631,Holy_Stick,Holy Stick,4,,,500,50,,1,1,0x00008101,7,2,2,4,70,1,10,{ bonus bMatkRate,15; bonus2 bCastrate,156,-25; bonus2 bCastrate,77,-25; bonus2 bCastrate,79,-25; },{},{} 1631,Holy_Stick,Holy Stick,4,,,500,50,,1,1,0x00008101,7,2,2,4,70,1,10,{ bonus bMatkRate,15; bonus2 bCastrate,156,-25; bonus2 bCastrate,77,-25; bonus2 bCastrate,79,-25; },{},{}
1632,Wolong's_Magic_Staff,Wolong's Magic Staff,4,,0,0,70,,1,0,0x00818315,7,2,2,3,80,1,10,{ bonus bint,4; bonus bDex,3; bonus bMatkRate,15; bonus2 bIgnoreMdefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; },{},{} 1632,Wolong's_Magic_Staff,Wolong's Magic Staff,4,,0,0,70,,1,0,0x00818315,7,2,2,3,80,1,10,{ bonus bint,4; bonus bDex,3; bonus bMatkRate,15; bonus2 bIgnoreMdefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; },{},{}
1633,Wolong's_Battle_Staff,Wolong's Magic Staff,4,,0,0,70,,1,0,0x00818315,7,2,2,3,80,1,10,{ bonus bint,3; bonus bDex,3; bonus bMatkRate,15; bonus2 bMagicAddRace,RC_DemiHuman,15; bonus bUnbreakableWeapon,0; },{},{} 1633,Wolong's_Battle_Staff,Wolong's Magic Staff,4,,0,0,70,,1,0,0x00818315,7,2,2,3,80,1,10,{ bonus bint,3; bonus bDex,3; bonus bMatkRate,15; bonus2 bMagicAddRace,RC_DemiHuman,15; bonus bUnbreakableWeapon,0; },{},{}
@ -3421,7 +3421,7 @@
12207,VIT_Dish,Immortal Stew,0,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_VITFood,1800000, 10; percentheal 15,5; },{},{} 12207,VIT_Dish,Immortal Stew,0,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_VITFood,1800000, 10; percentheal 15,5; },{},{}
12208,Battle_Manual,Battle Manual,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXPBOOST,1800000,50; },{},{} 12208,Battle_Manual,Battle Manual,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXPBOOST,1800000,50; },{},{}
12209,Insurance,Life Insurance,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_LIFEINSURANCE,1800000,0; },{},{} 12209,Insurance,Life Insurance,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_LIFEINSURANCE,1800000,0; },{},{}
12210,Bubble_Gum,Bubble Gum,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_ITEMBOOST,1800000,0;},{},{} 12210,Bubble_Gum,Bubble Gum,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_ITEMBOOST,1800000,0; },{},{}
12211,Kafra_Card,Kafra Card,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashStore"; },{},{} 12211,Kafra_Card,Kafra Card,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashStore"; },{},{}
12212,Giant_Fly_Wing,Giant Fly Wing,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashPartyCall"; },{},{} 12212,Giant_Fly_Wing,Giant Fly Wing,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashPartyCall"; },{},{}
12213,Neuralizer,Neuralizer,2,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashReset"; },{},{} 12213,Neuralizer,Neuralizer,2,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "F_CashReset"; },{},{}

View File

@ -777,6 +777,8 @@ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
return 0; return 0;
} }
// OnTouch NPC or Warp for Mobs
// Return 1 if Warped
int npc_touch_areanpc2(struct mob_data *md) int npc_touch_areanpc2(struct mob_data *md)
{ {
int i, m = md->bl.m, x = md->bl.x, y = md->bl.y; int i, m = md->bl.m, x = md->bl.x, y = md->bl.y;
@ -791,58 +793,47 @@ int npc_touch_areanpc2(struct mob_data *md)
switch( map[m].npc[i]->subtype ) switch( map[m].npc[i]->subtype )
{ {
case WARP: case WARP:
if( battle_config.mob_warp&1 ) if( !battle_config.mob_warp&1 )
{ continue;
xs = map[m].npc[i]->u.warp.xs; xs = map[m].npc[i]->u.warp.xs;
ys = map[m].npc[i]->u.warp.ys; ys = map[m].npc[i]->u.warp.ys;
} break;
else case SCRIPT:
continue; xs = map[m].npc[i]->u.scr.xs;
break; ys = map[m].npc[i]->u.scr.ys;
case SCRIPT: break;
xs = map[m].npc[i]->u.scr.xs; default:
ys = map[m].npc[i]->u.scr.ys; continue; // Keep Searching
snprintf(eventname, ARRAYLENGTH(eventname), "%s::OnTouchNPC", map[m].npc[i]->exname);
break;
default:
continue;
} }
if( x >= map[m].npc[i]->bl.x-xs && x <= map[m].npc[i]->bl.x+xs && y >= map[m].npc[i]->bl.y-ys && y <= map[m].npc[i]->bl.y+ys ) if( x >= map[m].npc[i]->bl.x-xs && x <= map[m].npc[i]->bl.x+xs && y >= map[m].npc[i]->bl.y-ys && y <= map[m].npc[i]->bl.y+ys )
{ { // In the npc touch area
if( map[m].npc[i]->subtype == SCRIPT switch( map[m].npc[i]->subtype )
&& ((ev = (struct event_data*)strdb_get(ev_db, eventname)) == NULL || ev->nd == NULL) ) {
continue; // No OnTouchNPC Event found case WARP:
xs = map_mapindex2mapid(map[m].npc[i]->u.warp.mapindex);
break; if( m < 0 )
} break; // Cannot Warp between map servers
} if( unit_warp(&md->bl, xs, map[m].npc[i]->u.warp.x, map[m].npc[i]->u.warp.y, 0) == 0 )
return 1; // Warped
if( i == map[m].npc_num ) return 0; break;
case SCRIPT:
switch( map[m].npc[i]->subtype ) if( map[m].npc[i]->bl.id == md->areanpc_id )
{ break; // Already touch this NPC
case WARP: snprintf(eventname, ARRAYLENGTH(eventname), "%s::OnTouchNPC", map[m].npc[i]->exname);
xs = map_mapindex2mapid(map[m].npc[i]->u.warp.mapindex); if( (ev = (struct event_data*)strdb_get(ev_db, eventname)) == NULL || ev->nd == NULL )
if( xs < 0 ) break; // No OnTouchNPC Event
return 0; // Can't warp object between map servers... md->areanpc_id = map[m].npc[i]->bl.id;
if( unit_warp(&md->bl, xs, map[m].npc[i]->u.warp.x, map[m].npc[i]->u.warp.y, 0) ) run_script(ev->nd->u.scr.script, ev->pos, md->bl.id, ev->nd->bl.id);
return 0; // Failed to warp. break;
break; }
case SCRIPT:
{
if( md->areanpc_id == map[m].npc[i]->bl.id )
return 0; // Allready touch this NPC
md->areanpc_id = map[m].npc[i]->bl.id;
run_script(ev->nd->u.scr.script, ev->pos, md->bl.id, ev->nd->bl.id);
return 0; return 0;
break;
} }
} }
return 1; return 0;
} }
//Checks if there are any NPC on-touch objects on the given range. //Checks if there are any NPC on-touch objects on the given range.