summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/map/script.c b/src/map/script.c
index bf8e81cbd..7ac638848 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5759,7 +5759,7 @@ BUILDIN(checkweight)
// item is already in inventory, but there is still space for the requested amount
break;
case ADDITEM_NEW:
- if( itemdb_isstackable(nameid) ) {// stackable
+ if( itemdb->isstackable(nameid) ) {// stackable
amount2++;
if( slots < amount2 ) {
script_pushint(st,0);
@@ -5864,7 +5864,7 @@ BUILDIN(checkweight2)
// item is already in inventory, but there is still space for the requested amount
break;
case ADDITEM_NEW:
- if( itemdb_isstackable(nameid) ){// stackable
+ if( itemdb->isstackable(nameid) ){// stackable
amount2++;
if( slots < amount2 )
fail = 1;
@@ -5932,7 +5932,7 @@ BUILDIN(getitem)
if(!flag)
it.identify=1;
else
- it.identify=itemdb_isidentified2(item_data);
+ it.identify=itemdb->isidentified2(item_data);
if( script_hasdata(st,4) )
sd=iMap->id2sd(script_getnum(st,4)); // <Account ID>
@@ -5943,7 +5943,7 @@ BUILDIN(getitem)
return true;
//Check if it's stackable.
- if (!itemdb_isstackable(nameid))
+ if (!itemdb->isstackable(nameid))
get_count = 1;
else
get_count = amount;
@@ -6041,7 +6041,7 @@ BUILDIN(getitem2)
item_tmp.card[3]=(short)c4;
//Check if it's stackable.
- if (!itemdb_isstackable(nameid))
+ if (!itemdb->isstackable(nameid))
get_count = 1;
else
get_count = amount;
@@ -6157,7 +6157,7 @@ BUILDIN(getnameditem)
}else
nameid = script->conv_num(st,data);
- if(!itemdb->exists(nameid)/* || itemdb_isstackable(nameid)*/)
+ if(!itemdb->exists(nameid)/* || itemdb->isstackable(nameid)*/)
{ //Even though named stackable items "could" be risky, they are required for certain quests.
script_pushint(st,0);
return true;
@@ -6275,7 +6275,7 @@ BUILDIN(makeitem)
if(!flag)
item_tmp.identify=1;
else
- item_tmp.identify=itemdb_isidentified2(item_data);
+ item_tmp.identify=itemdb->isidentified2(item_data);
iMap->addflooritem(&item_tmp,amount,m,x,y,0,0,0,0);
@@ -13220,7 +13220,7 @@ BUILDIN(autoequip)
return false;
}
- if( !itemdb_isequip2(item_data) )
+ if( !itemdb->isequip2(item_data) )
{
ShowError("buildin_autoequip: Item '%d' cannot be equipped.\n", nameid);
return false;
@@ -15747,7 +15747,7 @@ BUILDIN(waitingroom2bg)
ev = script_getstr(st,5); // Logout Event
dev = script_getstr(st,6); // Die Event
- if( (bg_id = bg_create(mapindex, x, y, ev, dev)) == 0 )
+ if( (bg_id = bg->create(mapindex, x, y, ev, dev)) == 0 )
{ // Creation failed
script_pushint(st,0);
return true;
@@ -15756,7 +15756,7 @@ BUILDIN(waitingroom2bg)
n = cd->users;
for( i = 0; i < n && i < MAX_BG_MEMBERS; i++ )
{
- if( (sd = cd->usersd[i]) != NULL && bg_team_join(bg_id, sd) )
+ if( (sd = cd->usersd[i]) != NULL && bg->team_join(bg_id, sd) )
mapreg->setreg(reference_uid(script->add_str("$@arenamembers"), i), sd->bl.id);
else
mapreg->setreg(reference_uid(script->add_str("$@arenamembers"), i), 0);
@@ -15790,7 +15790,7 @@ BUILDIN(waitingroom2bg_single)
if( (sd = cd->usersd[0]) == NULL )
return true;
- if( bg_team_join(bg_id, sd) )
+ if( bg->team_join(bg_id, sd) )
{
pc->setpos(sd, mapindex, x, y, CLR_TELEPORT);
script_pushint(st,1);
@@ -15803,15 +15803,15 @@ BUILDIN(waitingroom2bg_single)
BUILDIN(bg_team_setxy)
{
- struct battleground_data *bg;
+ struct battleground_data *bgd;
int bg_id;
bg_id = script_getnum(st,2);
- if( (bg = bg_team_search(bg_id)) == NULL )
+ if( (bgd = bg->team_search(bg_id)) == NULL )
return true;
- bg->x = script_getnum(st,3);
- bg->y = script_getnum(st,4);
+ bgd->x = script_getnum(st,3);
+ bgd->y = script_getnum(st,4);
return true;
}
@@ -15826,7 +15826,7 @@ BUILDIN(bg_warp)
return true; // Invalid Map
x = script_getnum(st,4);
y = script_getnum(st,5);
- bg_team_warp(bg_id, mapindex, x, y);
+ bg->team_warp(bg_id, mapindex, x, y);
return true;
}
@@ -15873,14 +15873,14 @@ BUILDIN(bg_leave)
if( sd == NULL || !sd->bg_id )
return true;
- bg_team_leave(sd,0);
+ bg->team_leave(sd,0);
return true;
}
BUILDIN(bg_destroy)
{
int bg_id = script_getnum(st,2);
- bg_team_delete(bg_id);
+ bg->team_delete(bg_id);
return true;
}
@@ -15890,13 +15890,13 @@ BUILDIN(bg_getareausers)
int16 m, x0, y0, x1, y1;
int bg_id;
int i = 0, c = 0;
- struct battleground_data *bg = NULL;
+ struct battleground_data *bgd = NULL;
struct map_session_data *sd;
bg_id = script_getnum(st,2);
str = script_getstr(st,3);
- if( (bg = bg_team_search(bg_id)) == NULL || (m = iMap->mapname2mapid(str)) < 0 )
+ if( (bgd = bg->team_search(bg_id)) == NULL || (m = iMap->mapname2mapid(str)) < 0 )
{
script_pushint(st,0);
return true;
@@ -15909,7 +15909,7 @@ BUILDIN(bg_getareausers)
for( i = 0; i < MAX_BG_MEMBERS; i++ )
{
- if( (sd = bg->members[i].sd) == NULL )
+ if( (sd = bgd->members[i].sd) == NULL )
continue;
if( sd->bl.m != m || sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1 )
continue;
@@ -15938,11 +15938,11 @@ BUILDIN(bg_updatescore)
BUILDIN(bg_get_data)
{
- struct battleground_data *bg;
+ struct battleground_data *bgd;
int bg_id = script_getnum(st,2),
type = script_getnum(st,3);
- if( (bg = bg_team_search(bg_id)) == NULL )
+ if( (bgd = bg->team_search(bg_id)) == NULL )
{
script_pushint(st,0);
return true;
@@ -15950,7 +15950,7 @@ BUILDIN(bg_get_data)
switch( type )
{
- case 0: script_pushint(st, bg->count); break;
+ case 0: script_pushint(st, bgd->count); break;
default:
ShowError("script:bg_get_data: unknown data identifier %d\n", type);
break;
@@ -17037,9 +17037,9 @@ BUILDIN(getrandgroupitem) {
nameid = itemdb->group_item(data->group);
it.nameid = nameid;
- it.identify = itemdb_isidentified(nameid);
+ it.identify = itemdb->isidentified(nameid);
- if (!itemdb_isstackable(nameid))
+ if (!itemdb->isstackable(nameid))
get_count = 1;
else
get_count = count;
@@ -17545,7 +17545,7 @@ BUILDIN(bg_create_team) {
x = script_getnum(st,3);
y = script_getnum(st,4);
- if( (bg_id = bg_create(mapindex, x, y, ev, dev)) == 0 ) { // Creation failed
+ if( (bg_id = bg->create(mapindex, x, y, ev, dev)) == 0 ) { // Creation failed
script_pushint(st,-1);
} else
script_pushint(st,bg_id);
@@ -17568,7 +17568,7 @@ BUILDIN(bg_join_team) {
if( !sd )
script_pushint(st, 1);
else
- script_pushint(st,bg_team_join(team_id, sd)?0:1);
+ script_pushint(st,bg->team_join(team_id, sd)?0:1);
return true;
}