DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • December 11, 2018, 12:41:16 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Keep gold after dragonkill  (Read 7129 times)
0 Members and 1 Guest are viewing this topic.
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« on: December 06, 2005, 07:17:36 AM »

This has been written, because it has been asked for.

I strongly suggest you ignore this module, as its usage is HIGHLY unbalancing!

Download: Here.

Functionality: Allows to set an amount of gold (either hand or bank or both) which can be kept after dk.

It hasn't been tested, so there might be parse errors due to misspelling. I'm not sure... Wink
« Last Edit: May 22, 2007, 11:38:22 AM by Elessa » Logged

Running for more than three years now:
sixf00t4
Mod God
*****
Offline Offline

Posts: 1916



View Profile WWW
« Reply #1 on: December 06, 2005, 07:19:29 AM »

heh, take that extra quote out of line 11...(so far  Tongue )
Logged

XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #2 on: December 06, 2005, 07:21:17 AM »

And I already thought that this syntax highlighting looked a bit strange... Wink

FIXED.
« Last Edit: December 06, 2005, 07:23:10 AM by XChrisX » Logged

Running for more than three years now:
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #3 on: December 06, 2005, 09:51:32 AM »

Updated to work better (at all....)
Logged

Running for more than three years now:
Freeze
Guest
« Reply #4 on: January 02, 2006, 09:17:16 PM »

I belive this is a bug..

When you dk, you dont get the prize gold. Not sure about the gems though..

I've tried this with both 'Keep gold on hand' off and on.

For a short period of time, i just dont want gold in bank to go away.

« Last Edit: January 02, 2006, 09:19:44 PM by Abraxas » Logged
Syb2
Militia
**
Offline Offline

Posts: 13



View Profile WWW
« Reply #5 on: June 10, 2006, 07:46:52 PM »

I belive this is a bug..

When you dk, you dont get the prize gold. Not sure about the gems though..

I've tried this with both 'Keep gold on hand' off and on.

For a short period of time, i just dont want gold in bank to go away.



I also have tried it on and off, went so far as to remove it and with it removed players get DK rewards.
Now with it on, logs state that they DID recieve the reward though I know they have not. tested it myself and though I got nothing, logs show I did.
 I also would like to have bank gold stay in bank but also have the players actaully recieve the reward at DK.  Tongue
Is there a fix for this?
Logged
Elessa
Faerie
Mod God
*****
Offline Offline

Posts: 3598


short, sweet and to the point


View Profile
« Reply #6 on: May 22, 2007, 11:40:17 AM »

* Elessa uploads the missing file to the downloads area

the file for keepgold.php can be downloaded here.

if there is a new version than v 1.0, xchrisx needs to update the download.  Wink
Logged

Uuma ma ten rashwe, ta tuluva a lle

Play the latest beta version here on LoGD DragonPrime - Axebridge
Iori
Mod God
*****
Offline Offline

Posts: 832


View Profile WWW
« Reply #7 on: May 22, 2007, 04:46:35 PM »

I belive this is a bug..

When you dk, you dont get the prize gold. Not sure about the gems though..

I've tried this with both 'Keep gold on hand' off and on.

For a short period of time, i just dont want gold in bank to go away.



Line 42:
         
Code:
$session['user']['gold'] = get_module_pref("gold");
change to:
         
Code:
$session['user']['gold'] += get_module_pref("gold");
to get the default DK gold rewards (and any other gold rewards due to modules such as clan stipend)  to add gold properly.
Logged

Aeolus
Mod God
*****
Offline Offline

Posts: 1912


You're welcome.


View Profile WWW
« Reply #8 on: February 24, 2013, 06:07:27 AM »

A Staffer of mine noticed that if a user has a debt before a DK, this module keeps that debt. To anyone else that uses this module and requires a fix:

Find Line 43:
Code:
$session['user']['goldinbank'] = get_module_pref("bank");

Replace With:
Code:
$session['user']['goldinbank'] = (get_module_pref("bank") > 0 ? get_module_pref("bank") : 0);
Logged

rjwboys
Militia
**
Offline Offline

Posts: 70


View Profile
« Reply #9 on: October 10, 2014, 12:37:26 PM »

i had an issue when installing this and i found out the first line had
<?
and it should of been
<?php
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1748


View Profile
« Reply #10 on: October 10, 2014, 03:21:00 PM »

Yeah, most servers have php configured to only allow <?php
Logged

Check My Modules for the latest versions.
TGTarheel
Codemeister
****
Offline Offline

Posts: 491


View Profile
« Reply #11 on: November 23, 2018, 09:28:23 PM »

OK...question:

I looked over this module.  I do not think it quite does what I am after.

Would there be a way to make it so that the amount of gold allowed to be saved was dependent on how many DK the player has?

Ideally, I'd like all players less than 50 DK not to carry any gold in bank
players for 50 -100 DK to be able to carry 50,000
players for 100-200 DK to be able to carry 100,000
players for 200-500 DK to be able to carry 250,000
and over 500 DK to be able to carry 500,000

The problem here, as I see it...is getting the value of gold in bank before DK....because if they have less than the allowed amount for their level, I want them to only keep that...for example, a player with 300 DK would be allowed to carry 250,000 - but if they only had 120,000 in bank at time of DK they only carry that 120,000 and not the 250,000 max....on the other hand if they had a million in gold, they would lose all but 250,000

Trying to find where in the actual coding that dragonkill resets bank gold to zero, to see if a core/module change could d what I want, but damned if I can find where it is done that bank gold is set to zero on a dragonkill.
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1748


View Profile
« Reply #12 on: November 24, 2018, 07:27:57 AM »

Check out my DK Stats Reset module. There's a hook in the Dragon.php (line 280ish) that allows you to block fields being reset. Directly above that is the array for fields that wont be reset. :-)
Logged

Check My Modules for the latest versions.
Aeolus
Mod God
*****
Offline Offline

Posts: 1912


You're welcome.


View Profile WWW
« Reply #13 on: November 24, 2018, 03:29:18 PM »

As for the actual checks, in the module, find where $session['user']['goldinbank'] is being set. (Hint, it's not being set to zero, it's being set to a module pref, calculated earlier.)

If they have 120k and the limit is 250k, then they get 120k. If they have 1m and the limit is 250k, then they get 250k. So, what you're wanting is the minimum between the limit and their current gold. So, use the following logic:

If dragonkills < 50 then goldinbank = 0
else if dragonkills >= 50 and dragonkills < 100 then goldinbank = (minimum of 50000 and current gold)
else if dragonkills >= 100 and dragonkills < 200 then goldinbank = (minimum of 100000 and current gold)
else if dragonkills >= 200 and dragonkills < 500 then goldinbank = (minimum of 250000 and current gold)
else if dragonkills >= 500 then goldinbank = (minimum of 500000 and current gold)
« Last Edit: November 24, 2018, 03:31:52 PM by Aeolus » Logged

TGTarheel
Codemeister
****
Offline Offline

Posts: 491


View Profile
« Reply #14 on: November 24, 2018, 09:17:06 PM »

As for the actual checks, in the module, find where $session['user']['goldinbank'] is being set. (Hint, it's not being set to zero, it's being set to a module pref, calculated earlier.)

If they have 120k and the limit is 250k, then they get 120k. If they have 1m and the limit is 250k, then they get 250k. So, what you're wanting is the minimum between the limit and their current gold. So, use the following logic:

If dragonkills < 50 then goldinbank = 0
else if dragonkills >= 50 and dragonkills < 100 then goldinbank = (minimum of 50000 and current gold)
else if dragonkills >= 100 and dragonkills < 200 then goldinbank = (minimum of 100000 and current gold)
else if dragonkills >= 200 and dragonkills < 500 then goldinbank = (minimum of 250000 and current gold)
else if dragonkills >= 500 then goldinbank = (minimum of 500000 and current gold)
Right.  I sorta got that figured.  I was trying to find it within the core code and make a core edit.
The module presented seemed to require a fair bit of reworking to get where I wanted.  I am gonna check out the other module presented and see if it more meets my needs here.
Will update.

Not quite there, either.  I need to not have booleans...I need to be able to have values of goldinbank saved across a DK - and set those based on number of DK's

Damn...seems like this is an easier core rewrite, if only I can find exactly WHERE in the core the damn reset happens.

UPDATE:  Paying careful attention across a DK, I was able to find where the reset happens, and believe I have now made the correct core modification...have to see.
« Last Edit: November 25, 2018, 12:16:25 AM by TGTarheel » Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
53 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search