From f1499d5aed6aecff54e234ac5e305d6748eda3af Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 23 Jan 2020 21:51:46 -0300 Subject: Calculate HR in the flow, create function for PVP Mapflags vs duel --- npc/functions/honor.txt | 6 ++++++ npc/functions/hub.txt | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'npc') diff --git a/npc/functions/honor.txt b/npc/functions/honor.txt index 3b470bf63..3794ce4c3 100644 --- a/npc/functions/honor.txt +++ b/npc/functions/honor.txt @@ -4,6 +4,12 @@ // Description: // PvP Honor Rank system +// Returns if a map is on PVP Mode or Not +// ispvpmap( {mapid} ) +function script ispvpmap { + .@mapa$=getarg(0, getmapname()); + return (getmapflag(.@mapa$, mf_pvp) || getmapflag(.@mapa$, mf_pvp_noparty) || getmapflag(.@mapa$, mf_pvpnoguild)); + // Numerical representation of player strength // get_BR( getcharid(3) ) function script get_BR { diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt index 7263037f7..9fc9c9876 100644 --- a/npc/functions/hub.txt +++ b/npc/functions/hub.txt @@ -260,8 +260,12 @@ function script HUB_PvP { // Prepare local variables .@atk=get_BR(getcharid(3)); .@def=get_BR(killedrid); + .@honor=calc_HR(.@atk, .@def); .@m$=getmap(); + if (ispvpmap(.@m$)) { + } + // TODO: Start using readparam2() to read if the opponent was worthy // That is, read total attack, defense, HP, evasion and hit chance // And compare with your own readparam2(), then use a % and a table -- cgit v1.2.3-60-g2f50