Explorar el Código

* Cleaned up a mercenary kill check. (bugreport:2222)
Bug Fixes
* Adjusted script commands that use script_isstring and script_isint to use script_getdata to dereference if variable is given. (bugreport:8198)
* Removed the hardcoded password so that users can pass blank passwords through the config for MySQL. (bugreport:7787)
* Increased the hostname array to account for longer hostnames. (bugreport:8003)
* Fixed the CashShop not listing items correctly. (bugreport:7585)
* Fixed Offertorium not consuming the correct amount of SP. (bugreport:8266)
* Cart Boost effect stays even if the cart is removed. Revert of change in r16339. (bugreport:5808)

aleos89 hace 11 años
padre
commit
0f2dd7fcf0
Se han modificado 8 ficheros con 151 adiciones y 59 borrados
  1. 1 1
      src/char/inter.c
  2. 2 0
      src/common/mmo.h
  3. 1 1
      src/login/account_sql.c
  4. 28 17
      src/map/clif.c
  5. 1 1
      src/map/mob.c
  6. 3 3
      src/map/pc.c
  7. 114 35
      src/map/script.c
  8. 1 1
      src/map/status.c

+ 1 - 1
src/char/inter.c

@@ -37,7 +37,7 @@ Sql* sql_handle = NULL;
 int char_server_port = 3306;
 char char_server_ip[32] = "127.0.0.1";
 char char_server_id[32] = "ragnarok";
-char char_server_pw[32] = "ragnarok";
+char char_server_pw[32] = ""; // Allow user to send empty password (bugreport:7787)
 char char_server_db[32] = "ragnarok";
 char default_codepage[32] = ""; //Feature by irmin.
 

+ 2 - 0
src/common/mmo.h

@@ -407,6 +407,8 @@ struct mmo_charstatus {
 
 	// Char server addon system
 	unsigned int character_moves;
+
+	bool cashshop_sent; // Whether the player has received the CashShop list
 };
 
 typedef enum mail_status {

+ 1 - 1
src/login/account_sql.c

@@ -23,7 +23,7 @@ typedef struct AccountDB_SQL
 	Sql* accounts;       // SQL accounts storage
 
 	// global sql settings
-	char   global_db_hostname[32];
+	char   global_db_hostname[64]; // Doubled for long hostnames (bugreport:8003)
 	uint16 global_db_port;
 	char   global_db_username[32];
 	char   global_db_password[32];

+ 28 - 17
src/map/clif.c

@@ -2485,10 +2485,12 @@ void clif_equiplist(struct map_session_data *sd)
 
 void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length)
 {
+	static const int client_buf = 0x5000; // Max buffer to send
 	struct item_data *id;
-	int i,n,ne;
+	int i,n,ne,nn;
 	unsigned char *buf;
 	unsigned char *bufe;
+	unsigned char *bufn;
 #if PACKETVER < 5
 	const int s = 10; //Entry size.normal item
 	const int sidx=4; //start itemlist idx
@@ -2533,33 +2535,39 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
 			n++;
 		}
 	}
-	if( n )
+	for (i = 0; i < n;) // Loop through non-equipable items
 	{
+		nn = n - i < (client_buf - 4)/s ? n - i : (client_buf - 4)/s; // Split up non-equipable items 
+		bufn = buf + i*s; // Update buffer to new index range
+		i += nn;
 #if PACKETVER < 5
-		WBUFW(buf,0)=0xa5;
+		WBUFW(bufn,0)=0xa5;
 #elif PACKETVER < 20080102
-		WBUFW(buf,0)=0x1f0;
+		WBUFW(bufn,0)=0x1f0;
 #elif PACKETVER < 20120925
-		WBUFW(buf,0)=0x2ea;
+		WBUFW(bufn,0)=0x2ea;
 #else
-		WBUFW(buf,0)=0x995;
+		WBUFW(bufn,0)=0x995;
 		memset((char*)WBUFP(buf,4),0,24); //storename
 #endif
-		WBUFW(buf,2)=n*s+sidx;
-		clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+		WBUFW(bufn,2)=4+nn*s;
+		clif_send(bufn, WBUFW(bufn,2), &sd->bl, SELF);
 	}
-	if( ne )
+	for (i = 0; i < ne;) // Loop through equipable items
 	{
+		nn = ne - i < (client_buf - 4)/se ? ne - i : (client_buf - 4)/se; // Split up equipable items
+		bufn = bufe + i*se; // Update buffer to new index range
+		i += nn;
 #if PACKETVER < 20071002
-		WBUFW(bufe,0)=0xa6;
+		WBUFW(bufn,0)=0xa6;
 #elif PACKETVER < 20120925
-		WBUFW(bufe,0)=0x2d1;
+		WBUFW(bufn,0)=0x2d1;
 #else
-		WBUFW(bufe,0)=0x996;
-		memset((char*)WBUFP(bufe,4),0,24); //storename
+		WBUFW(bufn,0)=0x996;
+		memset((char*)WBUFP(bufn,4),0,24); //storename
 #endif
-		WBUFW(bufe,2)=ne*se+sidxe;
-		clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
+		WBUFW(bufn,2)=4+nn*se;
+		clif_send(bufn, WBUFW(bufn,2), &sd->bl, SELF);
 	}
 
 	if( buf ) aFree(buf);
@@ -14801,7 +14809,7 @@ void clif_cashshop_list( int fd ){
 	int tab;
 
 	for( tab = CASHSHOP_TAB_NEW; tab < CASHSHOP_TAB_SEARCH; tab++ ){
-		int length = 8 + cash_shop_items->count * 6;
+		int length = 8 + cash_shop_items[tab].count * 6;
 		int i, offset;
 
 		WFIFOHEAD( fd, length );
@@ -14820,7 +14828,10 @@ void clif_cashshop_list( int fd ){
 }
 
 void clif_parse_cashshop_list_request( int fd, struct map_session_data* sd ){
-	clif_cashshop_list( fd );
+	if( !sd->status.cashshop_sent ) {
+		clif_cashshop_list( fd );
+		sd->status.cashshop_sent = true;
+	}
 }
 /// List of items offered in a cash shop (ZC_PC_CASH_POINT_ITEMLIST).
 /// 0287 <packet len>.W <cash point>.L { <sell price>.L <discount price>.L <item type>.B <name id>.W }*

+ 1 - 1
src/map/mob.c

@@ -2598,7 +2598,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 			else if( sd->avail_quests )
 				quest_update_objective(sd, md->class_);
 
-			if( sd->md && src && src->type != BL_HOM && mob_db(md->class_)->lv > sd->status.base_level/2 )
+			if( sd->md && src && src->type == BL_MER && mob_db(md->class_)->lv > sd->status.base_level/2 )
 				mercenary_kills(sd->md);
 		}
 

+ 3 - 3
src/map/pc.c

@@ -1141,6 +1141,9 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
 	}
 #endif
 
+	// Player has not yet received the CashShop list
+	sd->status.cashshop_sent = false;
+
 	// Request all registries (auth is considered completed whence they arrive)
 	intif_request_registry(sd,7);
 	return true;
@@ -7932,9 +7935,6 @@ int pc_setcart(struct map_session_data *sd,int type) {
 	if( pc_checkskill(sd,MC_PUSHCART) <= 0 && type != 0 )
 		return 1;// Push cart is required
 
-	if( type == 0 && pc_iscarton(sd) )
-		status_change_end(&sd->bl,SC_GN_CARTBOOST,INVALID_TIMER);
-
 #ifdef NEW_CARTS
 
 	switch( type ) {

+ 114 - 35
src/map/script.c

@@ -6103,7 +6103,7 @@ BUILDIN_FUNC(countitem)
 	}
 
 	data = script_getdata(st,2);
-	get_val(st, data);  // convert into value in case of a variable
+	get_val(st, data); // Convert into value in case of a variable
 
 	if( data_isstring(data) ) // item name
 		id = itemdb_searchname(conv_str(st, data));
@@ -6220,7 +6220,7 @@ BUILDIN_FUNC(checkweight)
 
 	for(i=2; i<nbargs; i=i+2) {
 		data = script_getdata(st,i);
-		get_val(st, data);  // convert into value in case of a variable
+		get_val(st, data); // Convert into value in case of a variable
 		if( data_isstring(data) ) // item name
 			id = itemdb_searchname(conv_str(st, data));
 		else // item id
@@ -7878,6 +7878,7 @@ BUILDIN_FUNC(bonus)
 	int val4 = 0;
 	int val5 = 0;
 	TBL_PC* sd;
+	struct script_data *data;
 
 	sd = script_rid2sd(st);
 	if( sd == NULL )
@@ -7902,7 +7903,9 @@ BUILDIN_FUNC(bonus)
 		case SP_FIXCASTRATE:
 		case SP_SKILL_USE_SP:
 			// these bonuses support skill names
-			val1 = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
+			data = script_getdata(st, 3);
+			get_val(st, data); // Convert into value in case of a variable
+			val1 = ( data_isstring(data) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
 			break;
 		default:
 			val1 = script_getnum(st,3);
@@ -7923,7 +7926,9 @@ BUILDIN_FUNC(bonus)
 			pc_bonus3(sd, type, val1, val2, val3);
 			break;
 		case 4:
-			if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
+			data = script_getdata(st, 4);
+			get_val(st, data); // Convert into value in case of a variable
+			if( type == SP_AUTOSPELL_ONSKILL && data_isstring(data) )
 				val2 = skill_name2id(script_getstr(st,4)); // 2nd value can be skill name
 			else
 				val2 = script_getnum(st,4);
@@ -7933,7 +7938,9 @@ BUILDIN_FUNC(bonus)
 			pc_bonus4(sd, type, val1, val2, val3, val4);
 			break;
 		case 5:
-			if( type == SP_AUTOSPELL_ONSKILL && script_isstring(st,4) )
+			data = script_getdata(st, 4);
+			get_val(st, data); // Convert into value in case of a variable
+			if( type == SP_AUTOSPELL_ONSKILL && data_isstring(data) )
 				val2 = skill_name2id(script_getstr(st,4)); // 2nd value can be skill name
 			else
 				val2 = script_getnum(st,4);
@@ -8031,6 +8038,7 @@ BUILDIN_FUNC(autobonus3)
 	short rate,atk_type;
 	TBL_PC* sd;
 	const char *bonus_script, *other_script = NULL;
+	struct script_data *data;
 
 	sd = script_rid2sd(st);
 	if( sd == NULL )
@@ -8041,7 +8049,9 @@ BUILDIN_FUNC(autobonus3)
 
 	rate = script_getnum(st,3);
 	dur = script_getnum(st,4);
-	atk_type = ( script_isstring(st,5) ? skill_name2id(script_getstr(st,5)) : script_getnum(st,5) );
+	data = script_getdata(st, 5);
+	get_val(st, data); // Convert into value in case of a variable
+	atk_type = ( data_isstring(data) ? skill_name2id(script_getstr(st,5)) : script_getnum(st,5) );
 	bonus_script = script_getstr(st,2);
 	if( !rate || !dur || !atk_type || !bonus_script )
 		return 0;
@@ -8076,12 +8086,15 @@ BUILDIN_FUNC(skill)
 	int level;
 	int flag = 1;
 	TBL_PC* sd;
+	struct script_data *data;
 
 	sd = script_rid2sd(st);
 	if( sd == NULL )
 		return 0;// no player attached, report source
 
-	id = ( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	id = ( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	level = script_getnum(st,3);
 	if( script_hasdata(st,4) )
 		flag = script_getnum(st,4);
@@ -8105,12 +8118,15 @@ BUILDIN_FUNC(addtoskill)
 	int level;
 	int flag = 2;
 	TBL_PC* sd;
+	struct script_data *data;
 
 	sd = script_rid2sd(st);
 	if( sd == NULL )
 		return 0;// no player attached, report source
 
-	id = ( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	id = ( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	level = script_getnum(st,3);
 	if( script_hasdata(st,4) )
 		flag = script_getnum(st,4);
@@ -8129,12 +8145,15 @@ BUILDIN_FUNC(guildskill)
 	int level;
 	TBL_PC* sd;
 	int i;
+	struct script_data *data;
 
 	sd = script_rid2sd(st);
 	if( sd == NULL )
 		return 0;// no player attached, report source
 
-	id = ( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	id = ( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	level = script_getnum(st,3);
 	for( i=0; i < level; i++ )
 		guild_skillup(sd, id);
@@ -8150,12 +8169,15 @@ BUILDIN_FUNC(getskilllv)
 {
 	int id;
 	TBL_PC* sd;
+	struct script_data *data;
 
 	sd = script_rid2sd(st);
 	if( sd == NULL )
 		return 0;// no player attached, report source
 
-	id = ( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	id = ( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	script_pushint(st, pc_checkskill(sd,id));
 
 	return SCRIPT_CMD_SUCCESS;
@@ -8170,9 +8192,12 @@ BUILDIN_FUNC(getgdskilllv)
 	int guild_id;
 	uint16 skill_id;
 	struct guild* g;
+	struct script_data *data;
 
 	guild_id = script_getnum(st,2);
-	skill_id = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
+	data = script_getdata(st, 3);
+	get_val(st, data); // Convert into value in case of a variable
+	skill_id = ( data_isstring(data) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
 	g = guild_search(guild_id);
 	if( g == NULL )
 		script_pushint(st, -1);
@@ -8702,12 +8727,15 @@ BUILDIN_FUNC(itemskill)
 	int id;
 	int lv;
 	TBL_PC* sd;
+	struct script_data *data;
 
 	sd = script_rid2sd(st);
 	if( sd == NULL || sd->ud.skilltimer != INVALID_TIMER )
 		return 0;
 
-	id = ( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	id = ( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	lv = script_getnum(st,3);
 
 	sd->skillitem=id;
@@ -12599,6 +12627,7 @@ BUILDIN_FUNC(petheal)
 BUILDIN_FUNC(petskillattack)
 {
 	struct pet_data *pd;
+	struct script_data *data;
 	TBL_PC *sd=script_rid2sd(st);
 
 	if(sd==NULL || sd->pd==NULL)
@@ -12608,7 +12637,9 @@ BUILDIN_FUNC(petskillattack)
 	if (pd->a_skill == NULL)
 		pd->a_skill = (struct pet_skill_attack *)aMalloc(sizeof(struct pet_skill_attack));
 
-	pd->a_skill->id=( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	pd->a_skill->id=( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	pd->a_skill->lv=script_getnum(st,3);
 	pd->a_skill->div_ = 0;
 	pd->a_skill->rate=script_getnum(st,4);
@@ -12624,6 +12655,7 @@ BUILDIN_FUNC(petskillattack)
 BUILDIN_FUNC(petskillattack2)
 {
 	struct pet_data *pd;
+	struct script_data *data;
 	TBL_PC *sd=script_rid2sd(st);
 
 	if(sd==NULL || sd->pd==NULL)
@@ -12633,7 +12665,9 @@ BUILDIN_FUNC(petskillattack2)
 	if (pd->a_skill == NULL)
 		pd->a_skill = (struct pet_skill_attack *)aMalloc(sizeof(struct pet_skill_attack));
 
-	pd->a_skill->id=( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	pd->a_skill->id=( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	pd->a_skill->lv=script_getnum(st,3);
 	pd->a_skill->div_ = script_getnum(st,4);
 	pd->a_skill->rate=script_getnum(st,5);
@@ -12649,6 +12683,7 @@ BUILDIN_FUNC(petskillattack2)
 BUILDIN_FUNC(petskillsupport)
 {
 	struct pet_data *pd;
+	struct script_data *data;
 	TBL_PC *sd=script_rid2sd(st);
 
 	if(sd==NULL || sd->pd==NULL)
@@ -12667,7 +12702,9 @@ BUILDIN_FUNC(petskillsupport)
 	} else //init memory
 		pd->s_skill = (struct pet_skill_support *) aMalloc(sizeof(struct pet_skill_support));
 
-	pd->s_skill->id=( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	pd->s_skill->id=( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
 	pd->s_skill->lv=script_getnum(st,3);
 	pd->s_skill->delay=script_getnum(st,4);
 	pd->s_skill->hp=script_getnum(st,5);
@@ -12689,9 +12726,12 @@ BUILDIN_FUNC(petskillsupport)
 BUILDIN_FUNC(skilleffect)
 {
 	TBL_PC *sd;
+	uint16 skill_id, skill_lv;
+	struct script_data *data = script_getdata(st, 2);
 
-	uint16 skill_id=( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
-	uint16 skill_lv=script_getnum(st,3);
+	get_val(st, data); // Convert into value in case of a variable
+	skill_id=( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	skill_lv=script_getnum(st,3);
 	sd=script_rid2sd(st);
 
 	clif_skill_nodamage(&sd->bl,&sd->bl,skill_id,skill_lv,1);
@@ -12706,11 +12746,15 @@ BUILDIN_FUNC(skilleffect)
 BUILDIN_FUNC(npcskilleffect)
 {
 	struct block_list *bl= map_id2bl(st->oid);
+	uint16 skill_id, skill_lv;
+	int x, y;
+	struct script_data *data = script_getdata(st, 2);
 
-	uint16 skill_id=( script_isstring(st,2) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
-	uint16 skill_lv=script_getnum(st,3);
-	int x=script_getnum(st,4);
-	int y=script_getnum(st,5);
+	get_val(st, data); // Convert into value in case of a variable
+	skill_id=( data_isstring(data) ? skill_name2id(script_getstr(st,2)) : script_getnum(st,2) );
+	skill_lv=script_getnum(st,3);
+	x=script_getnum(st,4);
+	y=script_getnum(st,5);
 
 	if (bl)
 		clif_skill_poseffect(bl,skill_id,skill_lv,x,y,gettick());
@@ -12955,7 +12999,10 @@ BUILDIN_FUNC(recovery)
 		case 4:
 		{
 			struct s_mapiterator *iter;
-			if(script_hasdata(st,3) && !script_isstring(st,3))
+			struct script_data *data = script_getdata(st, 3);
+
+			get_val(st, data); // Convert into value in case of a variable
+			if(script_hasdata(st,3) && !data_isstring(data))
 				revive = script_getnum(st,3); // recovery 4,<revive_flag>;
 			iter = mapit_getallusers();
 			for (sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); sd = (TBL_PC*)mapit_next(iter)) {
@@ -14517,7 +14564,10 @@ BUILDIN_FUNC(replacestr)
 	}
 
 	if(script_hasdata(st, 5)) {
-		if( !script_isstring(st,5) )
+		struct script_data *data = script_getdata(st, 5);
+
+		get_val(st, data); // Convert into value in case of a variable
+		if( !data_isstring(data) )
 			usecase = script_getnum(st, 5) != 0;
 		else {
 			ShowError("script:replacestr: Invalid usecase value. Expected int got string\n");
@@ -14598,7 +14648,11 @@ BUILDIN_FUNC(countstr)
 	}
 
 	if(script_hasdata(st, 4)) {
-		if( !script_isstring(st,4) )
+		struct script_data *data;
+
+		data = script_getdata(st, 4);
+		get_val(st, data); // Convert into value in case of a variable
+		if( !data_isstring(data) )
 			usecase = script_getnum(st, 4) != 0;
 		else {
 			ShowError("script:countstr: Invalid usecase value. Expected int got string\n");
@@ -15167,9 +15221,12 @@ BUILDIN_FUNC(setitemscript)
 BUILDIN_FUNC(addmonsterdrop)
 {
 	struct mob_db *mob;
+	struct script_data *data;
 	int item_id,rate,i,c = 0;
 
-	if(script_isstring(st,2))
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	if(data_isstring(data))
 		mob = mob_db(mobdb_searchname(script_getstr(st,2)));
 	else
 		mob = mob_db(script_getnum(st,2));
@@ -15219,9 +15276,12 @@ BUILDIN_FUNC(addmonsterdrop)
 BUILDIN_FUNC(delmonsterdrop)
 {
 	struct mob_db *mob;
+	struct script_data *data;
 	int item_id,i;
 
-	if(script_isstring(st,2))
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	if(data_isstring(data))
 		mob = mob_db(mobdb_searchname(script_getstr(st,2)));
 	else
 		mob = mob_db(script_getnum(st,2));
@@ -15764,9 +15824,12 @@ BUILDIN_FUNC(unitskilluseid)
 	uint16 skill_lv;
 	int target_id;
 	struct block_list* bl;
+	struct script_data *data;
 
 	unit_id  = script_getnum(st,2);
-	skill_id = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
+	data = script_getdata(st, 3);
+	get_val(st, data); // Convert into value in case of a variable
+	skill_id = ( data_isstring(data) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
 	skill_lv = script_getnum(st,4);
 	target_id = ( script_hasdata(st,5) ? script_getnum(st,5) : unit_id );
 
@@ -15789,9 +15852,12 @@ BUILDIN_FUNC(unitskillusepos)
 	int skill_x;
 	int skill_y;
 	struct block_list* bl;
+	struct script_data *data;
 
 	unit_id  = script_getnum(st,2);
-	skill_id = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
+	data = script_getdata(st, 3);
+	get_val(st, data); // Convert into value in case of a variable
+	skill_id = ( data_isstring(data) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) );
 	skill_lv = script_getnum(st,4);
 	skill_x  = script_getnum(st,5);
 	skill_y  = script_getnum(st,6);
@@ -16921,6 +16987,7 @@ static int buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
 BUILDIN_FUNC(areamobuseskill)
 {
 	struct block_list center;
+	struct script_data *data;
 	int16 m;
 	int range,mobid,skill_id,skill_lv,casttime,emotion,target,cancel;
 
@@ -16934,7 +17001,9 @@ BUILDIN_FUNC(areamobuseskill)
 	center.y = script_getnum(st,4);
 	range = script_getnum(st,5);
 	mobid = script_getnum(st,6);
-	skill_id = ( script_isstring(st,7) ? skill_name2id(script_getstr(st,7)) : script_getnum(st,7) );
+	data = script_getdata(st, 7);
+	get_val(st, data); // Convert into value in case of a variable
+	skill_id = ( data_isstring(data) ? skill_name2id(script_getstr(st,7)) : script_getnum(st,7) );
 	if( (skill_lv = script_getnum(st,8)) > battle_config.mob_max_skilllvl )
 		skill_lv = battle_config.mob_max_skilllvl;
 
@@ -17218,9 +17287,13 @@ BUILDIN_FUNC(getcharip)
 	/* check if a character name is specified */
 	if( script_hasdata(st, 2) )
 	{
-		if (script_isstring(st, 2))
+		struct script_data *data;
+
+		data = script_getdata(st, 2);
+		get_val(st, data); // Convert into value in case of a variable
+		if (data_isstring(data))
 			sd = map_nick2sd(script_getstr(st, 2));
-		else if (script_isint(st, 2) || script_getnum(st, 2))
+		else if (data_isint(data) || script_getnum(st, 2))
 		{
 			int id = 0;
 			id = script_getnum(st, 2);
@@ -17527,8 +17600,11 @@ BUILDIN_FUNC(npcskill)
 	unsigned int npc_level;
 	struct npc_data *nd;
 	struct map_session_data *sd;
-
-	skill_id	= script_isstring(st, 2) ? skill_name2id(script_getstr(st, 2)) : script_getnum(st, 2);
+	struct script_data *data;
+	
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	skill_id	= data_isstring(data) ? skill_name2id(script_getstr(st, 2)) : script_getnum(st, 2);
 	skill_level	= script_getnum(st, 3);
 	stat_point	= script_getnum(st, 4);
 	npc_level	= script_getnum(st, 5);
@@ -18041,11 +18117,14 @@ BUILDIN_FUNC(montransform) {
 	enum sc_type type;
 	char msg[CHAT_SIZE_MAX];
 	int tick, mob_id, val1, val2, val3, val4;
+	struct script_data *data;
 
 	if( (sd = script_rid2sd(st)) == NULL )
 		return 1;
 
-	if( script_isstring(st, 2) )
+	data = script_getdata(st, 2);
+	get_val(st, data); // Convert into value in case of a variable
+	if( data_isstring(data) )
 		mob_id = mobdb_searchname(script_getstr(st, 2));
 	else
 		mob_id = mobdb_checkid(script_getnum(st, 2));
@@ -18055,7 +18134,7 @@ BUILDIN_FUNC(montransform) {
 	val1 = val2 = val3 = val4 = 0;
 
 	if (mob_id == 0) {
-		if( script_isstring(st,2) )
+		if( data_isstring(data) )
 			ShowWarning("buildin_montransform: Attempted to use non-existing monster '%s'.\n", script_getstr(st, 2));
 		else
 			ShowWarning("buildin_montransform: Attempted to use non-existing monster of ID '%d'.\n", script_getnum(st, 2));

+ 1 - 1
src/map/status.c

@@ -9279,7 +9279,7 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 			break;
 		case SC_OFFERTORIUM:
 			val2 = 30 * val1; // heal power bonus
-			val3 = 20 * val1; // sp cost inc
+			val3 = 100 + (20 * val1); // sp cost inc
 			break;
 		case SC_FRIGG_SONG:
 			val2 = 5 * val1; // maxhp bonus