Page 1 of 1
Alchemist getting experience for killing his own golem
Posted: Fri Jul 16, 2010 1:32 am
by yufra
I stumbled across this on accident, I promise. Then I tested it and the patch below by throwing bombs at my poor unsuspecting golem.
Code: Select all
--- modules/tome/data/talents/spells/golemancy.lua.old 2010-07-15 18:29:22.000000000 -0700
+++ modules/tome/data/talents/spells/golemancy.lua 2010-07-15 18:29:27.000000000 -0700
@@ -65,6 +65,7 @@
disease_immune = 1,
see_invisible = 2,
no_breath = 1,
+ exp_worth = 0,
}
end
This does have the side-effect that nobody gets experience for killing the golem, but that strikes me as harmless.
Re: Alchemist getting experience for killing his own golem
Posted: Fri Jul 16, 2010 1:59 am
by Shoob
well, harmless for now, however, there may be situations where monsters do level up (take mt doom for example).
what really should be done is negate xp gain from killing friendly slaves. (just friendly units should turn on you and lower your relation with their faction iff you target them directly, slaves would be unable to turn on you though)
Re: Alchemist getting experience for killing his own golem
Posted: Fri Jul 16, 2010 4:16 am
by yufra
Good point Shoob, and after thinking about it and looking at the code a bit more there is a better solution. Here is the new patch:
Code: Select all
--- tome/data/talents/spells/golemancy.lua.old 2010-07-15 18:29:22.000000000 -0700
+++ tome/data/talents/spells/golemancy.lua 2010-07-15 21:10:52.000000000 -0700
@@ -27,7 +27,7 @@
end
local function makeGolem()
- return require("mod.class.NPC").new{
+ golem = require("mod.class.NPC").new{
type = "construct", subtype = "golem",
display = 'g', color=colors.WHITE,
level_range = {1, 50},
@@ -66,6 +66,19 @@
see_invisible = 2,
no_breath = 1,
}
+ ---[[
+ --Overwrite the worthExp function to check if the target is the summoner
+ golem.summoner = self
+ golem._worthExp = golem.worthExp
+ golem.worthExp = function(self, target)
+ if target ~= self.summoner then
+ return self:_worthExp(target)
+ else
+ return 0
+ end
+ end
+ --]]
+ return golem
end
newTalent{
Re: Alchemist getting experience for killing his own golem
Posted: Fri Jul 16, 2010 8:29 am
by Antagonist
Heheheh... you can still level up a second pet if you have it kill the golem?
I'm wondering though what kind of effect it will have if we make 0 xp gained global for all members of your own faction. Maybe even for friendly factions, but thats abit more common. The golem I assume is in the players faction, as would any summons or so, so this would be a more general case solution.
Re: Alchemist getting experience for killing his own golem
Posted: Fri Jul 16, 2010 9:50 am
by Shoob
well, not really, right now pets and slaves and summons do not gain exp, they funnel it all to you. I would expect this would eventually change as I would rather see pets and slaves share xp gain with you.