anpera.net
http://anpera.homeip.net/phpbb3/

PvP Immunität in Jägerhütte kaufen
http://anpera.homeip.net/phpbb3/viewtopic.php?f=43&t=234
Seite 1 von 1

Autor:  anpera [ Fr 14 Nov, 2003 16:00 ]
Betreff des Beitrags:  PvP Immunität in Jägerhütte kaufen

Beschreibung:
Manche Spieler mögen PvP nicht. Da PvP aber ein nicht unwesentlicher Bestandteil von LoGD ist, sollte diese Funktion nicht global deaktiviert werden.
Dieser Hack ermöglicht es den Spielern, sich vor PvP-Angriffen und vor Dag Durnick's Kopfgeldliste in Sicherheit zu bringen. Sie können in der Jägerhütte 300 Donationpoints für permanente PvP-Immunität ausgeben. Natürlich dürfen sie dann auch selbst nicht angreifen, weil sie dadurch ihre Immunität sofort wieder verlieren würden und sie nicht gleich neu kaufen können.
Dieser Hack soll zusätzlich das Spendenverhalten ankurbeln, da man im Spiel sehr sehr lange brauchen würde, um 300 Punkte zu sammeln...

Autor: anpera ( logd@anpera.de )

Version: 1.1 (27.9.2003)

Für LoGD Version: 0.9.7+jt mit lodge.php

Einbauanleitung:$this->bbcode_second_pass_code('', '-----
Open:
dag.php

-----
Find (op=addbounty):
output("<input type='submit' class='button' value='Finalize Contract'></form>",true);

-----
After, add:
if ($session['user']['pvpflag']=="2033-10-06 00:42:00") output("`0Dag looks at you. \"`7Petersen told me that he's protecting you from being killed - and now you want to see someone else dead? You'ld lose your protection if I put someone on my list for ya. You know that?`0\"`n`n");

-----
Find (op=finalize) 2x:
$sql = "SELECT acctid,name,login,level,locked,age,dragonkills,pk,experience,bounty

-----
In line, after, insert (in both lines):
,pvpflag

-----
Find:
output("Dag Durnick stares at you angrily, `7\"I told ye that I not be an assassin. That ain't a target worth of a bounty. Now get outta me sight!\"");

-----
After, add:
} elseif ($row['pvpflag']=="2033-10-06 00:42:00") {
output("`7\"This person is protected by J. C. Petersen! Ya really want to lure me on to destruction? No way!\"");

-----
Find:
debuglog("spent $cost gold for a $amt bounty on", $row['acctid']);

-----
After, add:
if ($session['user']['pvpflag']=="2033-10-06 00:42:00"){
$session['user']['pvpflag']="1986-10-06 00:42:00";
output("`n`4`bYou lost your Immunity!`b`0`n");
}


-----
Open:
dragon.php:

-----
Find:
$nochange=array("acctid"=>1
,"name"=>1

-----
After, add:
,"pvpflag"=>1


-----
Open:
inn.php:

-----
Find (act=listupstairs):
$pvptime = getsetting("pvptimeout",600);

-----
Before, add:
if ($session['user']['pvpflag']=="2033-10-06 00:42:00") output("`n`&(You bought PvP immunity. You will lose your immunity if you decide to attack now!)`0`n`n");

-----
Find:
output("<tr class='".($i%2?"trlight":"trdark")."'><td>$row[name]</td><td>$row[level]</td><td>[ <a href='$biolink'>Bio</a> | `iattacked too recently`i ]</td></tr>",true);

-----
Replace with:
output("<tr class='".($i%2?"trlight":"trdark")."'><td>$row[name]</td><td>$row[level]</td><td>[ <a href='$biolink'>Bio</a> | `ican't be attacked`i ]</td></tr>",true);


-----
Open:
lodge.php:

(I don't know if you have the same sourcecode but I'm sure you'll find your way)

-----
Add somewhere to addnav list below "use points"
addnav("PvP-Immunity (300 Points)","lodge.php?op=immun");

-----
Find (if present):
}elseif ($_GET['op']=="namechange"){

-----
Before, add:
}elseif ($_GET['op']=="immun"){
if ($session['user']['pvpflag']=="2033-10-06 00:42:00"){
output("J. C. Petersen nods and explains that you are still under his personal protection.");
} elseif ($session['user']['pvpflag']=="1986-10-06 00:42:00") {
output("J. C. Petersen explains that he is neither willning nor able to protect someone, who is a murderer himself.");
}else{
output("You ask J. C. Petersen if he could protect you against killers.");
output(" He nods and promises you, that for the fillip of 300 points noone will ever dare to touch you again. He would even talk to Dag Durnick for that purpose. But he also tells you that he couldn't grant for nothing if you kill someone!`n`n");
output("Pay 300 points for permanent PvP immunity?`n(You will lose your immunity only when you do PvP or when you set a bounty on someone. If you do so, you will not be able to buy immunity again until you were attacked at least once.)");
addnav("Confirm immunity?");
addnav("YES","lodge.php?op=immunconfirm");
}
addnav("Back to Lodge","lodge.php");
}elseif ($_GET['op']=="immunconfirm"){
if ($pointsavailable>=300){
output("J. C. Petersen uses his influence to hide you from killers in this land. He tells Dag Durnick that your name must not be set on his list, if you're not allready on it.`nNote that your protection is gone as soon as you attack someone ");
output(" or want to put a name on Dag's list.");
$session[user][pvpflag]="2033-10-06 00:42:00";
$session['user']['donationspent']+=300;
}else{
output("Not enough points left!");
}


-----
Open:
pvp.php:

-----
Find:
output("<table border='0' cellpadding='3' cellspacing='0'><tr><td>Name</td><td>Level</td><td>Ops</td></tr>",true);

-----
After, add:
if ($session['user']['pvpflag']=="2033-10-06 00:42:00") output("`n`&(You bought PvP immunity. You will lose your immunity if you decide to attack now!)`0`n`n");

-----
Find:
output("<tr class='".($i%2?"trlight":"trdark")."'><td>$row[name]</td><td>$row[level]</td><td>[ <a href='$biolink'>Bio</a> | `iattacked too recently`i ]</td></tr>",true);

-----
Replace with:
output("<tr class='".($i%2?"trlight":"trdark")."'><td>$row[name]</td><td>$row[level]</td><td>[ <a href='$biolink'>Bio</a> | `ican't be attacked`i ]</td></tr>",true);

-----
Find:
$session['user']['buffbackup']="";

-----
After, add:
if ($session['user']['pvpflag']=="2033-10-06 00:42:00"){
$session['user']['pvpflag']="1986-10-06 00:42:00";
output("`n`4`bYou lost your immunity!`b`0`n");
}


-----
Save and close all files')
Bemerkung:
Hack nutzt den pvpflag-Eintrag in der Userdatenbank; Die Datenbank muss nicht modifiziert werden.

Dateien:
modifizierte dag.php (Source)
modifizierte inn.php (Source)
modifizierte pvp.php (Source)
lodge.php und dragon.php hier vorerst nicht verfügbar.

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/