Welcome!

Join our community of MMORPG enthusiasts and private server developers! By registering, you'll gain access to in-depth discussions on source codes, binaries, and the latest developments in MMORPG server files. Collaborate with like-minded individuals, explore tutorials, and share insights on building and optimizing private servers. Join us today and unlock the full potential of MMORPG server development!

Join Today!

Hero FIX (not the best way, but works for me)

Status
Not open for further replies.
Junior Spellweaver
Joined
Mar 29, 2011
Messages
119
Reaction score
56
Hello Com,
Hero sems to die, but you can´t even recreate him. So here is a little fix, as I said in the subject, it works for me, don´t know, if it works for you as well. It DOESN´T fix, that he doesn´t loose health.

So here it is:

Open GameEngine/Automation.php and add bevore
PHP:
class Automation {

following code:

PHP:
// FIX? //
$result = mysql_query('SELECT * FROM `' . TB_PREFIX . 'hero` WHERE `dead` = 0 AND `wref` = 0');
while($row = mysql_fetch_assoc($result)) {
    $result2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $row['uid'] . ' AND `capital` = 1 LIMIT 1');
    $row2    = mysql_fetch_assoc($result2);
    
    $result3 = mysql_query('UPDATE `' . TB_PREFIX . 'hero` SET `dead` = 1, `wref` = ' . $row2['wref'] . ' WHERE `uid` = ' . $row['uid']);
}
// FIX END //

Thumbs up, if you like it

greets,
Slim
 
<3

No, health doesn´t go down. That's why I did so.
Never mind, it works^^

greets,
Slim
 
Attack Oasis only with hero and die but, in "Hero's mansion" show nod die?
Dzoki Can you do it this script?

when hero die in Hero's mansion automatic show Revive
to do this automatically?
 
That's what my script do lol.
But if you don´t want it, lick my ass ;)

greets,
Slim
 
How to make this on button when click on button this function come
PHP:
mysql_query('UPDATE `' . TB_PREFIX . 'hero` SET `dead` = 1, `wref` = ' . $row2['wref'] . ' WHERE `uid` = ' . $row['uid']);
I made this but i cant i am :grr: can help any that now
 
When you apply this fix, hero is actually db dead, so you can revive him in hero's mansion.
 
Here is another way to fix hero, just add this code to dorf1.php

<?php
mysql_query("UPDATE s1_units SET `hero` = 1 WHERE hero = '0'")or die(mysql_error());
mysql_query("UPDATE s1_units SET `hero` = 1 WHERE hero > '1'")or die(mysql_error());
?>
 
Last edited:
Here is another way to fix hero, just add this code to dorf1.php

<?php
mysql_query("UPDATE s1_units SET `hero` = 1 WHERE hero = '0'")or die(mysql_error());
mysql_query("UPDATE s1_units SET `hero` = 1 WHERE hero > '1'")or die(mysql_error());
?>

Where to paste this code exactly? can you show example thanks.
 


copy the file dorf1.php and replace it with dorf1.php in your website root folder.
 
Here is another way to fix hero, just add this code to dorf1.php

<?php
mysql_query("UPDATE s1_units SET `hero` = 1 WHERE hero = '0'")or die(mysql_error());
mysql_query("UPDATE s1_units SET `hero` = 1 WHERE hero > '1'")or die(mysql_error());
?>

OMG! This function makes another character with every each update to dorf1.php
 
OMG! This function makes another character with every each update to dorf1.php

please try it before commenting THANK YOU!

the script check in all villages to see of there is a hero or not, if not it sets hero to 1 , then it checks all villages to see if any village has more than 1 hero, if yes then it sets it back to 1. This mean the hero never dies.
 
FR: personnellement tout les fix proposez me font rire et ne résolve rien du tout ...

1) un fix et une correction pas un hack !
2) un fix doit être optimisez de préférence !
3) un fix doit passez une baterie de test !
4) un fix doit faire ce qu'il est cencé faire et la ou il doit le faire et seulement la !!!!
5) faire un fix pour la mort du héro et chose simple, bien le faire et autre chose
6) ...
7) ...

je pourrai vous en passer encore et encore mais reston courtois, le héro peut mourir seulement en combatant, donc le seul update décé doit ce faire via le module combat ( qui d'ailleur et une solution très mal conçu )

ensuite le revive serait donc fonctionnel et c'est tout !!!!!!!


alors arreter avec vos pseudo fix avec 300 requêtes tout le temps sa ne résolve rien du tout mais ajoute de la complexité dans ce code déjà très mal conçu a la base

refaire le système de combat servirais bien mieux que de faire un hack du style celui que vous fournissez

les codes php que vous fournissez sont TROP TROP TROP mal conçu alors ajouté des query dans une boucle for/while ... faut arretez


-------------------------------------------------------------------


En: personally fix all offer make me laugh and do solve anything ...

1) a fixed and a correction not a hack!
2) optimize a fix should be preferred!
3) one must go fix a batery test!
4) one has to fix what is cenci how and where he must do and only!!
5) make a fix for the death of the hero and simple thing, do it well and something else
6) ...
7) ...

I can do without it again and again but remain courteous, only the hero can die in combat, so the only update deceleration must do so via the combat module (which in any case and a solution very badly designed)

Then revive would be functional and that's it !!!!!!!


so stop with your pseudo fix with 300 requests all the time its not solve anything, but adds complexity in this code was already very ill-conceived based

redo the combat system serve him better than to make a hack of the style that you provide

php codes you provide is TOO TOO TOO poorly designed query then added in a for loop / while ... to stop
 
Status
Not open for further replies.
Back