Jump to content
  • 0

About pk target battle.c


Misuke

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/14/14
  • Last Seen:  

hi rathena! i check all the battle.c database can someone knows how to check the target player whether he/she has a cash point?

 

example

player 1 has cash point

 

and player 2 activates cash point killing

 

condition: player 2 only can hit is those who has cash points but others who dont have cash points cannot be hit?

 

like duel thing only the player who accepts the duel invitation can be attack others who not join are cannot i just want to know how can player 2 checks player 1 that he/she has a cash point?

 

sorry im very noob here can someone tell me how to or any tips that you can give me

 

thank in advance to those who help me thank you so much! 

Edited by misuke
Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  208
  • Reputation:   11
  • Joined:  05/31/12
  • Last Seen:  

prontera,157,181,5<tab>script<tab>Soul L<tab>-1,{
OnPCKillEvent:
    .@lvl_killer = BaseLevel;
    .@self_rid = getcharid(3);
    attachrid( killedrid );
    .@down = BaseLevel; // a readparam with an gid argument would be useful
    attachrid( .@self_rid );
    if( #CASHPOINTS + .cash_num <= ( .@lvl_killer - .@down ) )
        .@bonus = 0;
    else
        .@bonus = .cash_num - ( .@lvl_killer - .@down );
    dispbottom "You get "+ .@bonus +" Cash Points. Total: "+ #CASHPOINTS +".";
    #CASHPOINTS = #CASHPOINTS + .@bonus;
    end;
OnInit:
    .cash_num = 20;
    end;
}

a player kills another one, but with a twist: It should give 20 cash points per kill, minus the level difference between the players

if you are trying to make source modification i'll try my best!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/14/14
  • Last Seen:  

prontera,157,181,5<tab>script<tab>Soul L<tab>-1,{
OnPCKillEvent:
    .@lvl_killer = BaseLevel;
    .@self_rid = getcharid(3);
    attachrid( killedrid );
    .@down = BaseLevel; // a readparam with an gid argument would be useful
    attachrid( .@self_rid );
    if( #CASHPOINTS + .cash_num <= ( .@lvl_killer - .@down ) )
        .@bonus = 0;
    else
        .@bonus = .cash_num - ( .@lvl_killer - .@down );
    dispbottom "You get "+ .@bonus +" Cash Points. Total: "+ #CASHPOINTS +".";
    #CASHPOINTS = #CASHPOINTS + .@bonus;
    end;
OnInit:
    .cash_num = 20;
    end;
}

a player kills another one, but with a twist: It should give 20 cash points per kill, minus the level difference between the players

if you are trying to make source modification i'll try my best!

 

hehe thank you sir but i just want to know from the src code where should the target will check where he/she has a cash point

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  208
  • Reputation:   11
  • Joined:  05/31/12
  • Last Seen:  

I'll try to provide a script :)


- script Dev -1,{
OnInit:
bindatcmd("checkpoints","Sample::OnAtcommand");
end;
OnAtcommand:
dispbottom "Cash Point : "+#CASHPOINTS+" Points.";
dispbottom "Event Point : "+#EVENTPOINTS+" Points.";
dispbottom "Vote Point : "+#VOTEPOINTS+" Points.";
end;
}

run through @checkpoints! 

 

Don't Forget my reputation points :) Just kiddin!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/14/14
  • Last Seen:  

I'll try to provide a script :)

- script Dev -1,{
OnInit:
bindatcmd("checkpoints","Sample::OnAtcommand");
end;
OnAtcommand:
dispbottom "Cash Point : "+#CASHPOINTS+" Points.";
dispbottom "Event Point : "+#EVENTPOINTS+" Points.";
dispbottom "Vote Point : "+#VOTEPOINTS+" Points.";
end;
}

run through @checkpoints! 

 

Don't Forget my reputation points :) Just kiddin!

 

ok so how can the player 1 will be immune to attack

 

like the condition : player 2 only can hit is those who has cash points but others who dont have cash points cannot be hit?

when using the cash point killing command?

i think i already found the clue from the battle_check_target so i try a test but i think i dont get it :(
 
this condition are put to { //Checks on target master below
 
if (map[m].flag.pvp && sd->state.pk_stateset == 1 && pc_readaccountreg(sd, "#CASHPOINTS") == 1)
return 1; // if the pk_stateset command is active only enemy with #cashpoints of 1 can be the target
 
if (map[m].flag.pvp && sd->state.pk_stateset == 0 && pc_readaccountreg(sd, "#CASHPOINTS") == 0)
return 1; // if the pk_stateset command is deactive only enemy without #cashpoints can be the target
 
but didnt work 
when i test it the player who has that condition is the one who checks by the system
Ex. player 1 activates the pk_stateset and has cash point of 1 the failed thing is player 2 can attack him :(
 
please someone help me i think i mess up with pc_readaccountreg? because the player has it the only one who checks by the system
not the player that target help guys
Edited by misuke
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  02/14/14
  • Last Seen:  

no one helps :( close this topic :(

 

thank you all guys :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...