[Question] Change the PKP for killing an Enemy

08/30/2010 13:38 2087#1
Good morning Community :)

i think the threadname says everything.
I want to change the values of Pk points you get by killing some1 of enemy guild.

that's what i tried by now:


And i'm getting this error:
Code:
Eine implizite Konvertierung vom Typ "NewestCOServer.Features.Guild" in "System.Collections.Generic.Dictionary<uint,string>" ist nicht möglich.
Someone could help me? :)
08/30/2010 14:38 pro4never#2
MyGuild = a guild structure... not a player..


if

MyGuild.Enemies.Contains(Attacker.Owner.MyGuild)

or something along those lines would be the more likely solution.
08/30/2010 16:22 2087#3
tried that already - didnt work :(
08/30/2010 16:25 pro4never#4
then you're doing it wrong... you need to run a check on your enemy guilds uid's and the guild uid of the player being killed... My example is simply an example as I don't use lotf and don't know how things are named/setup... but it is the way things need to be done.
08/30/2010 16:51 -Shunsui-#5
shouldent it be if (Attacker.Owner.MyGuild.Enemies == MyGuild.Members)
or something
08/30/2010 17:02 pro4never#6
Quote:
Originally Posted by -Shunsui- View Post
shouldent it be if (Attacker.Owner.MyGuild.Enemies == MyGuild.Members)
or something
<_<... enemies = list of enemy guilds (unless lotf is super messed up) and members is list of guild members... so no.


Grrr this is bugging me, opening lotf.


Ok: first problem. Lotf doesn't have allies/enemies coded (at least in the old shitty version I have)

For the random crap source I have here, under character.cs there is

Code:
if (!BlueName)
                        {
                            Attacker.BlueNameLasts += 45;
                            if (Attacker.Enemies.Contains(EntityID))
                                Attacker.PKPoints += 5;                           
                            else
                                Attacker.PKPoints += 10;
                        }
what you SHOULD be able to do (if allies/enemies were coded properly) is

Code:
if (!BlueName)
                        {
                            Attacker.BlueNameLasts += 45;
                            if (Attacker.Enemies.Contains(EntityID))
                                Attacker.PKPoints += 5;
                            else if (Attacker.MyGuild.Enemies.ContainsKey(MyGuild.GuildID))
                                Attacker.PKPoints += 3;
                            else
                                Attacker.PKPoints += 10;
                        }

This is using a dictionary to store int/guild structure for enemies where the int key is the guild id.
08/31/2010 01:20 2087#7
thanks pro4never, it worked :)

& i wondered why it didn't work when i was trying it with
Code:
Attacker.MyGuild.Enemies.Contains(MyGuild.GuildID)
>.<