Jump to content

[Request] Grant money on Player vs Player kill.


Guest thampz

Recommended Posts

Hello,

I would love to have this on my server.

Example

Player A kills Player B -> Player A is granted for 1gold

Player B kills Player A -> Player B is granted for 1 gold

Player A kills Player B for 10 times in a row -> Is granted 1gold for each 10 kills, and extra 2 gold for the 10 kills in a row

Player B kills Player A after Player A has obtained 10 kills in a row reward -> Player B is granted for 1 gold for the kill and 2 gold for the breaking the 10 kills in a row streak of Player A

And so on, I know this has been in somewhere but I just cant seem to find it anywhere. :(

And if I try to look at the source code, I only see gibberish with special letters and cant understand anything.

Fulfilling this request would save my world basicly<3 Thank you in advance :)

Link to comment
Share on other sites

   // add honor points
   ModifyHonorPoints(int32(honor));

That is what I found in the player.cpp

By modifying it to "ModifyMoney(int32(50000));" should it grant 50silver to a player on kill?

I dont understand this at all <.< Im a complete newb on these kind of things :(

Link to comment
Share on other sites

   // add honor points
   ModifyHonorPoints(int32(honor));

That is what I found in the player.cpp

By modifying it to "ModifyMoney(int32(50000));" should it grant 50silver to a player on kill?

I dont understand this at all <.< Im a complete newb on these kind of things :(

If there's a ModifyMoney method it might work, I'd say compile it and test it out.

Link to comment
Share on other sites

How about this: it's also listed in my 3 in 1 under review:

--- mangos/src/game/Player.cpp 2009-11-13 19:57:49.000000000 +0000
+++ mangoso/src/game/Player.cpp 2009-11-13 19:55:30.000000000 +0000
@@ -6113,6 +6113,16 @@

    // add honor points
    ModifyHonorPoints(int32(honor));
+ 
+ // add money for hk
+ int hntmn = honor * 10000 / 3 + rand() % 2 * 1000 + rand() % 2 * 100;
+ int buffer, gold = hntmn / 10000, silv = (hntmn % 10000) / 1000, copp = (hntmn % 10000) % 100;
+ char mainstr[180]; 
+ 
+ buffer = sprintf(mainstr, "You earned %ig%is%ic and %i honor for killing %s!", gold, silv, copp, int32(honor), uVictim->GetName());
+ 
+ ModifyMoney(hntmn);
+ ChatHandler(this).SendSysMessage(mainstr);

    ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, uint32(honor), true);
    return true;
@@ -6430,9 +6440,28 @@

    if (type == DUEL_WON)
    {
-        GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
+  
+  // add money and honor for duel win
+  int hntmn = 25 * 10000 / 3 + rand() % 2 * 1000 + rand() % 2 * 100;
+  int buffer, gold = hntmn / 10000, silv = (hntmn % 10000) / 1000, copp = (hntmn % 10000) % 100;
+  char mainstr[180];
+  
+  buffer = sprintf(mainstr, "You earned %ig%is%ic and %i honor for beating %s in a duel!", gold, silv, copp, int32(30), GetName());
+  
+  ChatHandler(duel->opponent).SendSysMessage(mainstr);
+  
+  duel->opponent->ModifyMoney(hntmn);
+  duel->opponent->ModifyHonorPoints(int32(30));
+  
+  GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
        if (duel->opponent)
            duel->opponent->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1);
+  
+  // add honor for duel loss, no money
+  ModifyHonorPoints(int32(15));
+  buffer = sprintf(mainstr, "You earned %i honor even though %s won the duel!", int32(15), duel->opponent->GetName());
+  ChatHandler(this).SendSysMessage(mainstr);
+  
    }

    //Remove Duel Flag object

It might be modified for your use as well B)

Link to comment
Share on other sites

How about this: it's also listed in my 3 in 1 under review:

--- mangos/src/game/Player.cpp 2009-11-13 19:57:49.000000000 +0000
+++ mangoso/src/game/Player.cpp 2009-11-13 19:55:30.000000000 +0000
@@ -6113,6 +6113,16 @@

    // add honor points
    ModifyHonorPoints(int32(honor));
+ 
+ // add money for hk
+ int hntmn = honor * 10000 / 3 + rand() % 2 * 1000 + rand() % 2 * 100;
+ int buffer, gold = hntmn / 10000, silv = (hntmn % 10000) / 1000, copp = (hntmn % 10000) % 100;
+ char mainstr[180]; 
+ 
+ buffer = sprintf(mainstr, "You earned %ig%is%ic and %i honor for killing %s!", gold, silv, copp, int32(honor), uVictim->GetName());
+ 
+ ModifyMoney(hntmn);
+ ChatHandler(this).SendSysMessage(mainstr);

    ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, uint32(honor), true);
    return true;
@@ -6430,9 +6440,28 @@

    if (type == DUEL_WON)
    {
-        GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
+  
+  // add money and honor for duel win
+  int hntmn = 25 * 10000 / 3 + rand() % 2 * 1000 + rand() % 2 * 100;
+  int buffer, gold = hntmn / 10000, silv = (hntmn % 10000) / 1000, copp = (hntmn % 10000) % 100;
+  char mainstr[180];
+  
+  buffer = sprintf(mainstr, "You earned %ig%is%ic and %i honor for beating %s in a duel!", gold, silv, copp, int32(30), GetName());
+  
+  ChatHandler(duel->opponent).SendSysMessage(mainstr);
+  
+  duel->opponent->ModifyMoney(hntmn);
+  duel->opponent->ModifyHonorPoints(int32(30));
+  
+  GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1);
        if (duel->opponent)
            duel->opponent->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1);
+  
+  // add honor for duel loss, no money
+  ModifyHonorPoints(int32(15));
+  buffer = sprintf(mainstr, "You earned %i honor even though %s won the duel!", int32(15), duel->opponent->GetName());
+  ChatHandler(this).SendSysMessage(mainstr);
+  
    }

    //Remove Duel Flag object

It might be modified for your use as well B)

Thats what Im looking for, looks awesome :P But um, I really don't need honor to be added, only basic 1gold per kill, and duel could be 10silver

I've been trying to fork it the way it would most suit me, but everytime I try to do that, my eyes are slowly going into a >< and I cant see anything :D

Link to comment
Share on other sites

If you are just going to say something like that without explaining anything. Why even bother to post? There's no prize for increasing your post count btw.

I thought it is obvious that players will just kill each other at the graveyard for gold.

ps: I give a **** about your postcounter.

Link to comment
Share on other sites

CXX    Player.o
../../../src/game/Player.cpp: In member function 'bool Player::RewardHonor(Unit*, uint32, float)':
../../../src/game/Player.cpp:6731: error: 'type' was not declared in this scope
../../../src/game/Player.cpp:6761: error: a function-definition is not allowed here before '{' token
../../../src/game/Player.cpp:22591: error: expected `}' at end of input
make[3]: *** [Player.o] Error 1

Getting this error :( Any suggestions?

Link to comment
Share on other sites

What Forusim means is that friends can just keep killing eachother over and over again, for what is basically free gold.

Or some people just start camping corpses of those who just want to play, ruining the server.

This should be something that is only active in battle grounds or arena.

Link to comment
Share on other sites

@thampz--- I have no clue I just applied the patch today to a new repo because of the errors I got with the last 2 core comits and had no problem what so ever...

I tried with the newest core as of yesterday, (12 huors ago), and got the error.. :(

I've now setuped it with the

ModifyMoney(int32(honor*multiplier))
ModifyHonorPoints(int32((honor*multiplier)/adjustmentdivider))

And it works fine now :o

Getting 5-10honor/kill and 30-40silver money.

All I want that I am missing from your script is, is that nice post message that player has received x ammount of money and honor.. :(

Or some people just start camping corpses of those who just want to play, ruining the server.

This should be something that is only active in battle grounds or arena.

Or a custom pvp server where is only supposed to kill players? All monster spawns have been removed, all npcs has been removed and replaced with some new npcs.

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use