Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Question about battle-defeat hook
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 18, 2019, 04:41:11 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Question about battle-defeat hook  (Read 2744 times)
0 Members and 1 Guest are viewing this topic.
Zanzaras
Captain of the Guard
***
Offline Offline

Posts: 220


*Snipe*


View Profile
« on: March 25, 2005, 10:50:06 AM »

I run a gem vault in my game (0.9.7) , so in order to keep it interesting, I modified the code so that players will lose any gems they are carrying at death. I'm trying to write a module to add this to my future .9.8 game. So far everything works fine except the death message looks like the following:

All gems on hand were lost!
You have been slain by Bobcat Cub!!!
All gold on hand has been lost!
10% of experience has been lost!
You may begin fighting again tomorrow.

I can't find a way to get the "All gems on hand were lost" message to appear after the "You have been slain" message. I believe this is due to the location of the battle-defeat hook. Does anyone know of a way to move this?  Is there another hook I can use? If so, please point it out because I can't find one.

Any help would be appreciated!
Logged

"Intelligence is like a river, the deeper it is the less noise it makes."
Kendaer
Guest
« Reply #1 on: March 25, 2005, 07:22:57 PM »

The short answer is no.

Those hooks are called from battle.php, at the end of ANY battle (not just forest ones, but even ones against your master, where you don't die).  So firstly you will want to be a bit careful in that hook to make sure you are only performing this loss on a battle where it makes sense (such as forest or travel).

Secondly, those other messages are not being output by a hook but by whatever calls battle.php (or something else called by whatever calls battle.php).

You will not always be able to put a message exactly where you want it, and this case is a perfect example.

Perhaps a better solution would be not to have a gem shop since there are many ways in which they unbalance the game?
Logged
Zanzaras
Captain of the Guard
***
Offline Offline

Posts: 220


*Snipe*


View Profile
« Reply #2 on: March 26, 2005, 08:18:32 AM »

Yeah... I guess I'll be dropping the gem vault when I move to the final .9.8 version.

Oh well... Looks like Lone Strider and his elves are going to get a lot richer.  Wink
Logged

"Intelligence is like a river, the deeper it is the less noise it makes."
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

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