Jump to content
  • 0
Sign in to follow this  
java

[HELP] edit compatibility source old to new herc

Question

Hi, i was left from RO long time ago and now i want to run my offline server, but several code is outdate, can someone fix code for me

here is new herc:

 

for (int i = 0; i < MAX_PARTY; i++) {
		if ((p_sd = p->data[i].sd) == NULL || p_sd->status.party_id != p_id || pc_isdead(p_sd))
			continue;

		if (p->party.member[i].online == 0 || (!include_leader && p->party.member[i].leader == 1))
			continue;

		if (m_name_from != NULL && strcmp(m_name_from, map->list[p_sd->bl.m].name) != 0)
			continue;

		if (!ignore_mapflags) {
			if (((type == 0 || type > 2) && map->list[p_sd->bl.m].flag.nowarp == 1) ||
			    (type > 0 && map->list[p_sd->bl.m].flag.noreturn == 1))
				continue;
		}

		if (type == 1) {
			map_index = p_sd->status.save_point.map;
			x = p_sd->status.save_point.x;
			y = p_sd->status.save_point.y;
		}

		if (type > 0)

			if(pc_isdead(p_sd)) status->revive(&p_sd->bl, 1, 1); //and this line is what i want to add but seems not compatible
			pc->setpos(p_sd, map_index, x, y, CLR_TELEPORT);
		//else
			//pc->randomwarp(p_sd, CLR_TELEPORT); // this is original updated from herc
	}

	script_pushint(st, 1);
	return true;
}

 

 

and this is old herc
 

for (i = 0; i < MAX_PARTY; i++) {
		if( !(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id )
			continue;

		if( str2 && strcmp(str2, map->list[pl_sd->bl.m].name) != 0 )
			continue;

		if( pc_isdead(pl_sd) )
			continue;

		switch( type )
		{
			case 0: // Random
				if(!map->list[pl_sd->bl.m].flag.nowarp)
					pc->randomwarp(pl_sd,CLR_TELEPORT);
				break;
			case 1: // SavePointAll
				if(!map->list[pl_sd->bl.m].flag.noreturn)
					pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
				break;
			case 2: // SavePoint
				if(!map->list[pl_sd->bl.m].flag.noreturn)
					pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
				break;
			case 3: // Leader
			case 4: // m,x,y
				//if(!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp)
				if(pc_isdead(pl_sd)) status->revive(&pl_sd->bl, 1, 1); //i want to make this line compatible to newest herc
					pc->setpos(pl_sd,map_index,x,y,CLR_TELEPORT);
				break;
		}
	}

	return true;
}

any help is appreciated

Edited by java

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.