Hello all,
(swfote2.1)
Here's a little backstory on what I'm trying to accomplish for clarity. I changed the wanted system from planets to clans and then edited outlaw and unoutlaw to set players wanted by a clan (The Empire for example). I changed all the defines for WANTED to planets and all char constants to clan names.
I put in an apprehend system (a charm) for bounty hunters to arrest people and now I'm working on a claimbounty function for them so they can collect live bounties against wanted players. Claim bounty will eventually act as a jail function once I add it in addition to giving credits and experience. Right now, I'm working on an if statement to basically allow the function to work if the hunter is claiming the bounty on a planet that is controlled by the clan that is flagged as wanted for the player. GDB doesn't work on my MAC and I still cannot figure out how to use LLDB correctly..so I'm stumped. I'm getting emergency copy overs when I run this function with a player argument which I've been told before means pointer or declaration errors.
I'm trying to get all wanted flags loaded on the victim (The Empire, The New Republic) and pass them into an array. There are only 5 clans loaded so the array is 0,1,2,3,4. Then, i'm trying to get the clan name that owns the planet and check if they are the owner of the wanted bounty. If they are, the function can work...if they're not..the player needs to take the bounty elsewhere.
(swfote2.1)
Here's a little backstory on what I'm trying to accomplish for clarity. I changed the wanted system from planets to clans and then edited outlaw and unoutlaw to set players wanted by a clan (The Empire for example). I changed all the defines for WANTED to planets and all char constants to clan names.
I put in an apprehend system (a charm) for bounty hunters to arrest people and now I'm working on a claimbounty function for them so they can collect live bounties against wanted players. Claim bounty will eventually act as a jail function once I add it in addition to giving credits and experience. Right now, I'm working on an if statement to basically allow the function to work if the hunter is claiming the bounty on a planet that is controlled by the clan that is flagged as wanted for the player. GDB doesn't work on my MAC and I still cannot figure out how to use LLDB correctly..so I'm stumped. I'm getting emergency copy overs when I run this function with a player argument which I've been told before means pointer or declaration errors.
I'm trying to get all wanted flags loaded on the victim (The Empire, The New Republic) and pass them into an array. There are only 5 clans loaded so the array is 0,1,2,3,4. Then, i'm trying to get the clan name that owns the planet and check if they are the owner of the wanted bounty. If they are, the function can work...if they're not..the player needs to take the bounty elsewhere.
void do_claimbounty ( CHAR_DATA *ch , char *argument )
{
CHAR_DATA *victim =NULL;
CLAN_DATA *clan =NULL;
PLANET_DATA *planet =NULL;
char *wantedby[4];
char value;
if ( IS_NPC (ch) ) return;
if ( ch->mount )
{
send_to_char( "You can't do that while mounted.\n\r", ch );
return;
}
if ( argument[0] == '\0' )
{
send_to_char( "Usage claimbounty <target>\n\r", ch );
return;
}
if ( ( victim = get_char_room( ch, argument ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( victim == ch )
{
send_to_char( "That's pointless.\n\r", ch );
return;
}
if ( IS_NPC(victim) )
{
send_to_char( "You cannot claim a bounty on an NPC.\n\r", ch );
return;
}
if ( IS_SET( ch->in_room->room_flags, ROOM_SAFE ) )
{
set_char_color( AT_MAGIC, ch );
send_to_char( "This isn't a good place to do that.\n\r", ch );
return;
}
if ( ch->position == POS_FIGHTING )
{
send_to_char( "Not while you are fighting.\n\r" , ch );
return;
}
if ( ch->position <= POS_SLEEPING )
{
send_to_char( "In your dreams or what?\n\r" , ch );
return;
}
if (!IS_AFFECTED( victim, AFF_CHARM ) && (ch != victim->master))
{
send_to_char( "You will have to apprehend them first.\n\r" , ch );
return;
}
wantedby[4] = flag_string(victim->pcdata->wanted_flags, wantedclan_flags);
for (int i =0; i < 4; i++){
if (planet->governed_by->name == wantedby)
{
value = get_wanted_flag( planet->governed_by->name );
REMOVE_BIT(victim->pcdata->wanted_flags, 1 << value);
ch_printf(victim,"&W&RA slight buzz comes over your comlink and you hear, 'Attention all citizens, %s has claimed the wanted bounty on %s for their crimes against %s's planets.Thank you.'\n\r", ch->name, victim->name, clan->name);
return;
}
else
{
send_to_char("You need to claim your bounty on a planet controlled by the clan who set the bounty.\n\r", ch);
return;
}
}
return;
}