public void DeliverFlag(Character pUser) { if (ServerKernel.CaptureTheFlag.IsInBase(pUser) && pUser.QueryStatus(FlagInt.CTF_FLAG) != null) { ServerKernel.CaptureTheFlag.AddPoints(pUser, 15, true); pUser.DetachStatus(FlagInt.CTF_FLAG); MsgWarFlag pMsg = new MsgWarFlag(); pMsg.Type = WarFlagType.GRAB_FLAG_EFFECT; pMsg.Identity = pUser.Identity; pUser.Send(pMsg); } }
public bool Grab(Character pUser) { try { pUser.AttachStatus(pUser, FlagInt.CTF_FLAG, 0, ALIVE_SECONDS, 0, 0); MsgWarFlag pMsg = new MsgWarFlag { Type = WarFlagType.GRAB_FLAG_EFFECT, Identity = pUser.Identity }; pUser.Send(pMsg); pMsg = new MsgWarFlag(); pMsg.Type = (WarFlagType)8; pMsg.Identity = (uint)ALIVE_SECONDS; pUser.Send(pMsg); Map.RemoveNpc(this); return(true); } catch { return(false); } }
public static void HandleWarFlag(Character pUser, MsgWarFlag pMsg) { switch (pMsg.Type) { case WarFlagType.SYNDICATE_REWARD_TAB: // reward tab syndicate { // if is war, offset 8 is true //pMsg.AddPoints("Felipezudo"); pMsg.IsWar = ServerKernel.CaptureTheFlag.IsRunning; pUser.Send(pMsg); break; } case WarFlagType.BASE_RANK_REQUEST: { ServerKernel.CaptureTheFlag.DeliverFlag(pUser); break; } default: Console.WriteLine("Unhandled 2224:{0}", pMsg.Type); break; } }