|
You last visited: Today at 11:47
Advertisement
Redux v2 - Official 5065 Classic Source
Discussion on Redux v2 - Official 5065 Classic Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
02/27/2014, 04:58
|
#1081
|
elite*gold: 0
Join Date: Dec 2010
Posts: 494
Received Thanks: 54
|
I added winning fields in guild.cs, how can I edit that from guildwar.cs at the end?
I have tried Currentwinner.haswon =1; but it's no good as it will crash.
Should it be something like
If(player.guildid = currentwinnerid)
player.guild.haswon =1;??
|
|
|
02/27/2014, 14:14
|
#1082
|
elite*gold: 0
Join Date: Jun 2011
Posts: 31
Received Thanks: 4
|
why when i start source i get this problem help please..
|
|
|
02/27/2014, 14:35
|
#1083
|
elite*gold: 0
Join Date: Dec 2010
Posts: 494
Received Thanks: 54
|
You haven't set it up well or you have problems with database.
|
|
|
02/27/2014, 14:39
|
#1084
|
elite*gold: 0
Join Date: Jun 2011
Posts: 31
Received Thanks: 4
|
Quote:
Originally Posted by mujake
You haven't set it up well or you have problems with database.
|
can you help me how to set up?
|
|
|
02/27/2014, 15:31
|
#1085
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
Looks to me like it hasn't been compiled.
|
|
|
02/27/2014, 17:12
|
#1086
|
elite*gold: 26
Join Date: Jul 2011
Posts: 522
Received Thanks: 284
|
Quote:
Originally Posted by mujake
I added winning fields in guild.cs, how can I edit that from guildwar.cs at the end?
I have tried Currentwinner.haswon =1; but it's no good as it will crash.
Should it be something like
If(player.guildid = currentwinnerid)
player.guild.haswon =1;??
|
Or you could simply check the name on the pole for the winner guild? Let an NPC check if it's talking to the leader of that guild and execute your code?
That would be my go if I were you.
|
|
|
02/27/2014, 17:17
|
#1087
|
elite*gold: 0
Join Date: Dec 2010
Posts: 494
Received Thanks: 54
|
Quote:
Originally Posted by Execution!
Or you could simply check the name on the pole for the winner guild? Let an NPC check if it's talking to the leader of that guild and execute your code?
That would be my go if I were you.
|
Thanks...I didn't thought about that...I always skip simple things..and get stuck by thinking to complicated solutions.
|
|
|
02/27/2014, 17:45
|
#1088
|
elite*gold: 26
Join Date: Jul 2011
Posts: 522
Received Thanks: 284
|
Same, However I haven't done it yet, but I sure will in the future, Still having trouble finding out why scatter doesn't launch in TG, Thats 1, Second thing is Proff experience, it levels correctly but the experience showing isn't correct
|
|
|
02/27/2014, 19:10
|
#1089
|
elite*gold: 0
Join Date: Dec 2010
Posts: 494
Received Thanks: 54
|
Quote:
Originally Posted by Execution!
Same, However I haven't done it yet, but I sure will in the future, Still having trouble finding out why scatter doesn't launch in TG, Thats 1, Second thing is Proff experience, it levels correctly but the experience showing isn't correct
|
Here is what i made so far on NPC, now i am trying to set haswon to 0 the rest of the time after th rewarding time has expired.
Code:
case 1:
var dbsob = Database.ServerDatabase.Context.SOB.GetByUID(6700);
if (_client.Guild.Name == null)
break;
if (_client.Guild.haswon == 1)
{
AddText("You already claimed the reward!");
AddOption("Nevermind...", 255);
break;
}
if (_client.Guild.Name == dbsob.Name && _client.GuildRank == Enum.GuildRank.GuildLeader && DateTime.Now.DayOfWeek == DayOfWeek.Monday)
{
_client.CP += 3000;
_client.Guild.haswon = 1;
Managers.PlayerManager.SendToServer(new TalkPacket(Enum.ChatType.GM, _client.Name + " has GuildLeder of" + _client.Guild.Name + "has claimed the prize for winning this weeks GuildWar!"));
AddOption("I see.", 255);
break;
}
else
{
AddText("You can only claim the reward on Monday before 23.59, else the prize is lost!");
AddOption("Nevermind...", 255);
break;
}
|
|
|
02/27/2014, 19:59
|
#1090
|
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
|
I would check the database for the name of the pole.
Or, I believe the GuildWar class loads the winner at server start. I could be wrong, but if it doesn't it would only take a couple lines to load it.
Then that variable would always have the winner.
|
|
|
02/27/2014, 20:19
|
#1091
|
elite*gold: 26
Join Date: Jul 2011
Posts: 522
Received Thanks: 284
|
Quote:
Originally Posted by Aceking
I would check the database for the name of the pole.
Or, I believe the GuildWar class loads the winner at server start. I could be wrong, but if it doesn't it would only take a couple lines to load it.
Then that variable would always have the winner.
|
Fairly simple , Anyways.. I was planning on coding the love stone, I know that marriage is an attack type, Still no clue on how to do it... Any hints?
|
|
|
02/27/2014, 22:22
|
#1092
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
Quote:
Originally Posted by Execution!
Fairly simple , Anyways.. I was planning on coding the love stone, I know that marriage is an attack type, Still no clue on how to do it... Any hints?
|
First you send 1010, with a subtype of OpenCustom, then go ahead and send the customcommand of 1067, which is the flower pointer mouse.
After that its basically handling the 1022 subtypes, 8 and 9.
|
|
|
02/28/2014, 00:42
|
#1093
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
|
@Insomniac also stringpacket for the spouse names.
|
|
|
02/28/2014, 00:51
|
#1094
|
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
|
Quote:
Originally Posted by Super Aids
@Insomniac also stringpacket for the spouse names.
|
I was trying to leave some things for him to figure out himself.
|
|
|
02/28/2014, 01:19
|
#1095
|
elite*gold: 26
Join Date: Jul 2011
Posts: 522
Received Thanks: 284
|
Figured that out already Lol
//EDIT Thanks for the help with the marriage, Also BIG thanks to Aceking.
Here's the code for marriage
NPC:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Redux.Packets.Game;
namespace Redux.Npcs
{
public class NPC_390 : INpc
{
public NPC_390(Game_Server.Player _client)
: base(_client)
{
ID = 390;
Face = 1;
}
public override void Run(Game_Server.Player _client, ushort _linkback)
{
Responses = new List<NpcDialogPacket>();
AddAvatar();
switch (_linkback)
{
case 0:
AddText("The fate brings lover together. I hope that all can get married and live happily with their lover. What can I do for you?");
AddOption("I would like to get married please.", 1);
AddOption("Just passing by.", 255);
break;
case 1:
if (_client.Spouse == "None")
{
_client.Send(GeneralActionPacket.Create(_client.UID, Enum.DataAction.OpenCustom, 1067));
}
else
{
AddText("Ooh my! You're already married, Wanna cheat on your spouse now?");
AddOption("Sorry.", 255);
}
break;
}
AddFinish();
Send();
}
}
}
CombatManager:
Code:
case InteractAction.Court:
{
var target = PlayerManager.Players[_packet.Target];
if (target != null)
target.Send(_packet);
break;
}
case InteractAction.Marry:
{
var target = PlayerManager.Players[_packet.Target];
var sender = PlayerManager.Players[this.owner.UID];
if (target != null && sender.Spouse == "None" && target.Spouse == "None")
{
sender.Spouse = target.Name.ToString();
target.Spouse = sender.Name.ToString();
sender.Send(StringsPacket.Create(sender.UID, StringAction.Mate, target.Name.ToString()));
target.Send(StringsPacket.Create(target.UID, StringAction.Mate, sender.Name.ToString()));
sender.Save(); target.Save();
PlayerManager.SendToServer(new TalkPacket(ChatType.GM, sender.Name.ToString() + " and " + target.Name.ToString() + " are now married, Congrats.", ChatColour.Red));
}
else
{
sender.Send(new TalkPacket(ChatType.System, "Either you or your target are married."));
}
break;
}
Packets turn out to be fun after all!
|
|
|
All times are GMT +2. The time now is 11:47.
|
|