anpera.net

anpera.net

experimental server @home
Aktuelle Zeit: Mo 09 Jun, 2025 22:08

Alle Zeiten sind UTC + 1 Stunde




Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Versteht ihr das ?!
BeitragVerfasst: Sa 30 Sep, 2006 19:03 
Offline
Großmeister
Großmeister

Registriert: Fr 21 Jul, 2006 00:00
Beiträge: 416
Hiho ich habe vorhin was gefunden für LotgD. Es ist irrgendwas von NPC abr ich weiss nichts damit an zu fangen oder ehr gesagt ich verstehe den sinn dieses Skriptes nicht :pein: hier ist es :
[php]npc code and instructions
Author Lonny Luberts of http://www.pqcomp.com

mysql account fields to add
`npc` tinyint(4) NOT NULL default '0',
`npccommons` int(11) NOT NULL default '0',
`npccomment1` text NOT NULL,
`npccomment2` text NOT NULL,
`npccomment3` text NOT NULL,
`npccommentary` text NOT NULL,


insert in user.php after
"superuser"=>"Superuser,enum,0,Standard play days per calendar day,1,Unlimited play days per calendar day,2,Admin creatures and taunts,3,Admin users",
the following
"NPC Characters,title",
"npc"=>"NPC Character,bool",
"race"=>"Race (only set this for NPC!),enum,0,Unknown,1,Troll,2,Elf,3,Human,4,Dwarf",
"npccommentary"=>"Commentary Section Name",
"npccomment1"=>"Commentary 1",
"npccomment2"=>"Commentary 2",
"npccomment3"=>"Commentary 3",

insert into village.php after checkday();
//begin npc code
$sql = "SELECT * FROM accounts WHERE npc = '1'";
$result = db_query($sql);
for ($i=0;$i<db_num_rows($result);$i++){
$row = db_fetch_assoc($result);
$section=e_rand(1,10);
if ($section>=8) $row[npccommons]=2;
if ($section==7) $row[npccommons]=29;
if ($section==6) $row[npccommons]=1;
if ($row[laston] < date("Y-m-d H:i:s")){
$sql2="UPDATE accounts SET laston = '".date("Y-m-d H:i:s",strtotime("+ 300 seconds"))."', alive = '1', loggedin = '1', lasthit = '".date("Y-m-d H:i:s",strtotime("+ 300 seconds"))."', commons = '".$row[npccommons]."' WHERE login = '".$row[login]."'";
db_query($sql2);
}
if (e_rand(1,2000) < 21 and $row[npccommentary]<>""){
if ($section>=8) $row[npccommentary]="village";
if ($section==7) $row[npccommentary]="charsford";
if ($section==6) $row[npccommentary]="commons";
$go=e_rand(1,20);
if ($go==1) $smile=":grin:";
if ($go==2) $smile=":happy:";
if ($go==3) $smile=":laugh:";
if ($go==4) $smile=":wink:";
if ($go==5) $smile=":slimer:";
if ($go==6) $smile=":purple:";
if ($go==7) $smile=":tongue:";
if ($go==8) $smile=":wink2:";
if ($go==9) $smile=":wink3:";
if ($go>9) $smile="";
switch(e_rand(1,32)){
case 1:
case 2:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"".$row[npccomment1]."\")";
break;
case 3:
case 4:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"".$row[npccomment2]."\")";
break;
case 5:
case 6:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"".$row[npccomment3]."\")";
break;
case 7:
$go=e_rand(1,5);
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Hello everyone. $smile \")";
break;
case 8:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"What's up? :biggrin:\")";
break;
case 9:
$sql4 = "SELECT value FROM settings where setting='weather'";
$result4 = db_query($sql4);
$row4 = db_fetch_assoc($result4);
$weather=$row4['value'];
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"How bout that weather? I see it's $weather :biggrin:\")";
break;
case 10:
$sql4 = "SELECT name,evil FROM accounts ORDER BY RAND(".e_rand().") LIMIT 1";
$result4 = db_query($sql4);
$row4 = db_fetch_assoc($result4);
$tname = $row4[name];
if ($row4[evil]>=33) $evil="Evil";
if ($row4[evil]<33 and $row[evil]>-32) $evil="Neutral";
if ($row4[evil]<=-32) $evil="Good";
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"I hear that $tname is $evil. :shocked:\")";
break;
case 11:
$sql4 = "SELECT name,job FROM accounts ORDER BY RAND(".e_rand().") LIMIT 1";
$result4 = db_query($sql4);
$go=e_rand(1,db_num_rows($result4));
$row4 = db_fetch_assoc($result4);
$tname = $row4[name];
if ($row4[job]==0) $job="Slacker";
if ($row4[job]==1) $job="Farmer";
if ($row4[job]==2) $job="Miller";
if ($row4[job]==3) $job="Textile Miller";
if ($row4[job]==4) $job="Brewer";
if ($row4[job]==5) $job="Foundry Worker";
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"I hear that $tname is a $job. :wink:\")";
break;
case 12:
$sql4 = "SELECT name,charm FROM accounts ORDER BY RAND(".e_rand().") LIMIT 1";
$result4 = db_query($sql4);
$go=e_rand(1,db_num_rows($result4));
$row4 = db_fetch_assoc($result4);
$tname = $row4[name];
if ($row4[charm] > -1 and $row4[charm] < 4) $charm="pretty darn ugly";
if ($row4[charm] > 3 and $row4[charm] < 7) $charm="ugly";
if ($row4[charm] > 6 and $row4[charm] < 11) $charm="average";
if ($row4[charm] > 10 and $row4[charm] < 14) $charm="cute";
if ($row4[charm] > 13 and $row4[charm] < 17) $charm="looking good";
if ($row4[charm] > 16 and $row4[charm] < 20) $charm="Beautiful";
if ($row4[charm] > 19 and $row4[charm] < 23) $charm="Hot`n";
if ($row4[charm] > 22 and $row4[charm] < 27) $charm="Smokin' Hot";
if ($row4[charm] > 26 and $row4[charm] < 30) $charm="Dreamy";
if ($row4[charm] > 29) $charm="one of the fairest in the land";
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"I hear that $tname is $charm. :wink2:\")";
break;
case 13:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"I hear that Charsford is really cool. $smile \")";
break;
case 14:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"I've heard tales of ghosts in Lonny's Castle. $smile \")";
break;
case 15:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"You can cast a spell on someone at the Voodoo Priestess. $smile \")";
break;
case 16:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"The Forum is a good place to find out about what is new, and socialize with other warriors. $smile \")";
break;
case 17:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Gems are sometimes available at the Gem Store. $smile \")";
break;
case 18:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"I have heard rumors of Rare Black Unicorns in the forest. $smile \")";
break;
case 19:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Did you know you can have a custom picture for yourself? Check out avatars in the preferences section. $smile \")";
break;
case 20:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Did you know that you can colorize your name? Check out the preferences section. $smile \")";
break;
case 21:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\":: slams an Ale $smile \")";
break;
case 22:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\":: falls asleep $smile \")";
break;
case 23:
$sql4 = "SELECT name,charm FROM accounts ORDER BY RAND(".e_rand().") LIMIT 1";
$result4 = db_query($sql4);
$go=e_rand(1,db_num_rows($result4));
$row4 = db_fetch_assoc($result4);
$tname = $row4[name];
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\":: slaps $tname $smile \")";
break;
case 24:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\":: wishes ".($row[sex]?"she":"he")." were a real person $smile \")";
break;
case 25:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"What? $smile \")";
break;
case 26:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Are you nuts? $smile \")";
break;
case 27:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Are you crazy? $smile \")";
break;
case 28:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Someone let me out of this game! $smile \")";
break;
case 29:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"This one time at Band Camp.... $smile \")";
break;
case 30:
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Huh? $smile \")";
break;
case 31:
$sql4 = "SELECT name,charm FROM accounts WHERE loggedin =1 ORDER BY RAND(".e_rand().") LIMIT 1";
$result4 = db_query($sql4);
$go=e_rand(1,db_num_rows($result4));
$row4 = db_fetch_assoc($result4);
$tname = $row4[name];
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Hi $tname $smile \")";
break;
case 32:
$sql4 = "SELECT name,charm FROM accounts WHERE loggedin =1 ORDER BY RAND(".e_rand().") LIMIT 1";
$result4 = db_query($sql4);
$go=e_rand(1,db_num_rows($result4));
$row4 = db_fetch_assoc($result4);
$tname = $row4[name];
$sql3 ="INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'".$row[npccommentary]."','".$row[acctid]."',\"Hey $tname $smile \")";
break;
}
db_query($sql3);
}
}
//end npc code
[/php]
Weiss jemand was das bringen soll?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa 30 Sep, 2006 19:10 
Offline
Marquis Pherae
Marquis Pherae

Registriert: Mi 09 Feb, 2005 16:01
Beiträge: 3925
Wohnort: Basel
Geschlecht: Männlich
NPC => Non Player Charakter... oO
Damit machst du im Prinzip einen Charakter, der vom Spiel selbst gespielt wird und ab und zu mal seine Kommentare abgibt... Naja. Wems gefällt...


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa 30 Sep, 2006 19:15 
Offline
Großmeister
Großmeister

Registriert: Fr 21 Jul, 2006 00:00
Beiträge: 416
XD Sorry das ich mich so dumm angestellt habe naja ich finde es auch nicht so berauschend wollte nur mal den zweck dieses Skriptes erfahren mehr nicht vielen dank ^^


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 30 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen
Du darfst keine Antworten zu Themen in diesem Forum erstellen
Du darfst deine Beiträge in diesem Forum nicht ändern
Du darfst deine Beiträge in diesem Forum nicht löschen
Du darfst keine Dateianhänge in diesem Forum erstellen

Suche nach:
Gehe zu:  
cron
POWERED_BY
Deutsche Übersetzung durch phpBB.de
anpera.net - Impressum