sahisahi
Member
Trying to make players gain double points if they are in Order/Chaos guild type:
This is what i added:
Full method:
Errors:
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
tried a differnt approach:
Errors:
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cann
ot be used like a method.
thanks....
This is what i added:
Code:
/////////////Guild type edit method 1///////////////////////
if (killer.GuildType.Order !=null && killed.GuildType.Chaos != null && killer.GuildType.Order != killed.GuildType.Chaos)
{
cval *= 2;
}
/////////////////////////////////////
Full method:
Code:
public override void OnKill(Mobile killed, Mobile killer)
{
if (killer == null || killed == null || !(killed.Player) || killer == killed) return;
bool awardpoints = true;
// if this was a team or challenge duel then clear agressor list
if (killed == m_Challenger || killer == m_Challenger || AreInSameGame(killed, killer))
{
// and remove the challenger from the aggressor list so that the res noto is not affected
ClearAggression(killed, killer);
}
// handle challenge team kills
if (ChallengeGame != null && !ChallengeGame.Deleted)
{
ChallengeGame.OnKillPlayer(killer, killed);
}
// check to see whether points can be given
if (!(AttachedTo is Mobile) || !CanAffectPoints((Mobile)AttachedTo, killer, killed, false))
{
awardpoints = false;
}
// if this was a challenge duel then clear the challenger field
if (killed == m_Challenger || killer == m_Challenger)
{
m_Challenger = null;
}
// begin the section to award points
if (!awardpoints) return;
if (LogKills)
{
try
{
using (StreamWriter op = new StreamWriter("kills.log", true))
{
op.WriteLine("{0}: {1} killed {2}", DateTime.Now, killer, killed);
}
}
catch { }
}
int killedpoints = 0;
// give the killer his points, either a fixed amount or scaled by the difference with the points of the killed
// if the killed has more points than the killed then gain more
ArrayList list = XmlAttach.FindAttachments(killed, typeof(XmlPoints));
if (list != null && list.Count > 0)
{
killedpoints = ((XmlPoints)list[0]).Points;
}
int val = (int)((killedpoints - Points) * m_WinScale);
if (val <= 0) val = 1;
Points += val;
int cval = (int)((killedpoints - Points) * m_CreditScale);
if (cval <= 0) cval = 1;
Credits += cval;
m_LastKill = DateTime.Now;
killer.SendMessage(String.Format(Text(100215), val, killed.Name)); // "You receive {0} points for killing {1}"
if (GainHonorFromDuel)
{
bool gainedPath = false;
if (VirtueHelper.Award(killer, VirtueName.Honor, val, ref gainedPath))
{
if (gainedPath)
{
killer.SendLocalizedMessage(1063226); // You have gained a path in Honor!
}
else
{
killer.SendLocalizedMessage(1063225); // You have gained in Honor.
}
}
}
/////////////Guild type edit method 1///////////////////////
if (killer.GuildType.Order !=null && killed.GuildType.Chaos != null && killer.GuildType.Order != killed.GuildType.Chaos)
{
cval *= 2;
}
/////////////////////////////////////
// add to the recently killed list
//KillList.Add(new KillEntry(killed, DateTime.Now));
// add to the cumulative death count
Kills++;
// update the overall ranking list
UpdateRanking(killer, this);
// if broadcast is enabled then announce it
if (Broadcast && m_SystemBroadcast)
{
BroadcastMessage(AccessLevel.Player, 2569, String.Format(SystemText(100216), killer.Name, killed.Name)); // "{0} has defeated {1} in combat."
}
// update the points gump if it is open
if (killer.HasGump(typeof(PointsGump)))
{
// redisplay it with the new info
OnIdentify(killer);
}
// update the top players gump if it is open
if (killer.HasGump(typeof(TopPlayersGump)))
{
killer.CloseGump(typeof(TopPlayersGump));
killer.SendGump(new TopPlayersGump(this));
}
}
Errors:
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
tried a differnt approach:
Code:
if (killer.GuildType.Order !=null && killed.GuildType.Chaos != null && killer.GuildType.Order != killed.GuildType.Chaos)
{
cval *= 2;
}
Errors:
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cann
ot be used like a method.
thanks....