1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733: 734: 735: 736: 737: 738: 739: 740: 741: 742: 743: 744: 745: 746: 747: 748: 749: 750: 751: 752: 753: 754: 755: 756: 757: 758: 759: 760: 761: 762: 763: 764: 765: 766: 767: 768: 769: 770: 771: 772: 773: 774: 775: 776: 777: 778: 779: 780: 781: 782: 783: 784: 785: 786: 787: 788: 789: 790: 791: 792: 793: 794: 795: 796: 797: 798: 799: 800: 801: 802: 803: 804: 805: 806: 807: 808: 809: 810: 811: 812: 813: 814: 815: 816: 817: 818: 819: 820: 821: 822: 823: 824: 825: 826: 827: 828: 829: 830: 831: 832: 833: 834: 835: 836: 837: 838: 839: 840: 841: 842: 843: 844: 845: 846: 847: 848: 849: 850: 851: 852: 853: 854: 855: 856: 857: 858: 859: 860: 861: 862: 863: 864: 865: 866: 867: 868: 869: 870: 871: 872: 873: 874: 875: 876: 877: 878: 879: 880: 881: 882: 883: 884: 885: 886: 887: 888: 889: 890: 891: 892: 893: 894: 895: 896: 897: 898: 899: 900: 901: 902: 903: 904: 905: 906: 907: 908: 909: 910: 911: 912: 913: 914: 915: 916: 917: 918:
|
<?php // // ---------------------------------------------------------------------------- // // Clans/Guilds Pages // CR#Dasher#004 // 25th March 2004 // Version: 0.98 beta // The latest version is always runnning at: www.sembrance.uni.cc/rpg // (c) Dasher [david.ashwood@inspiredthinking.co.uk] 2004 // This module is relased under the LOTGD GNU public license // You may change/modify this module and it's associated modules as you wish but // this copyright MUST be retained. // // I would apprechiate feedback/updates on how it works and changes you make. // Dasher // // ---------------------------------------------------------------------------- // // This module processes the user actions, the included funcs module // provides the main/supporting functionality. // // The activities are in the form: // op= Activity type {SU|Manage|member|nonmember} // action= Action to be performed // task=sub task // // ID=The guild|Clan ID // who=The member affected // type=Where functionality depends if it's a guild or a clan // stage=When a multi stage action is being performed - keeps track of progress // // A Nav Management system has been implemented to simplify functionality // in this and the funcs module, and to aid customisation. // The nav system is for User Display of Nav's and isn't used for hidden Nav's (HTML Forms/Display URL's) // // The following examples illustrate how it works: // NavSystem["Separator"]=""; // NavSystem["DisplayName"]="url"; // NavSystem["Separator"]["DisplayName"]="url"; // // ---------------------------------------------------------------------------- // Changelog: // Ranks, NavSysem, Split into 2 modules: guild.php and guildclanfuncs.php // Many functions: // now support a dymanic return path // are aware of the guilds/clans diff // Deleting a user now changes the management team if they are a member // Pay guild funds to members // Simplified the URL paths // SU can now modify the management team // Promote members to the management team // Ranks can now be assigned // Tidied up the display in many funcs - still needs more work // Custom Weapons & Armor can now be defined in each guild // Going into the Weaponry/Armoury via the guilds (setting the guild=GuildID attribute in the URL) now activates guild functionality // with guild discounts on standard items, access to Special Guild Items and extra earned on trade in price // Now you can spend SitePoints on discounts and revamped the display of Discounts // Interest earned on Guild Funds (just gold), interest is accrued once per real day on management member entering // The Guild TLA can now be a prefix/suffix next to the display name in chat // ViewCommentary code now links to the display summary info for the guild // Fixed a bug with the default ranks (rankorder 0 & 20), now created if they don't exist in PopulateRanks // Fixed a bug in the weapon/Armor upgrade // Fixed a bug in the spying // Fixed a return path problem in Armor.php/Weapons.php // Modified common: Checkday, If passed true, checks if the user is dead, clears the output buffers if set and redirects to the shades if they are dead // and now checks for newday in guild.php // Updated the Healer to use the same stage process // Removed some latent debug info // Updated common: loadsettings/getsettings/savesettings to always use a lowercase settingname // Cost of upgrading weapons/armor is progressively more expensive and the weapon/armor value increases by 10% of the upgrade cost // // Settings used with GetSettings: // MaxInterest - Max Bank Interest, Default:10 // MaxFightPercent - Maximum % from fights (FF/PvP), Default: $MaxInterest // RatioOfSitePoints - Ratio of SitePoints to % increase, Default: 5 // WeaponUpgradeCost - Cost of Upgrading Weapons, Default: 500 // ArmourUpgradeCost - Cost of Upgrading Armour, Default: 500 // ---------------------------------------------------------------------------- // // ToDO: // Differentiate Clans from Guilds - High Priority // Mail other management team members when a management member leaves - low Priority // Spending of SitePoints needs to be a little more balanced and there needs to be some way of unspending SitePoints // Partially done - currently Each DK in dragon.php earns 1 sitepoint for a normal kill and 2 SitePoints for a flawless fight // - PvP earns sitepoints: // -2 => killing somebody on your clan // +1 => standard kill // +1 => Member on your guild hitlist // +1 => You are on their hitlist // +1 => Their guild in on your guild hitlist (Guild Wars) // // Council Management // Assign some kind of reason when an application is denied - low Priority // Guild Management // Define votes - medium Priority // Currently there are no limits on how much you can upgrade weapons/armor - the cost is progressivly more expensive // Member Options // Vote - medium Priority // Site changes // Guild Discounts, update the other pages to support the discounts - background // Bio update - high Priority // // ---------------------------------------------------------------------------- // Gargamel: // - renamed to guild.php // - navigation options by variables: supress parts of the whole menu // - all superuser options transferred into guilds-clans-su.php // - totally separated for guilds // - fixed bug of missing initial cost in case of withdraw guild application // - chatarea "fireside" for management teams of ALL guilds // - help system implemented. For help texts pls. see guildclanhelp.php // // Install instruction: // - copy this file into your LOGD main folder. // // Contact Gargamel: // eMail: gargamel@rabenthal.de or gargamel@silienta-logd.de // Forum: Gargi at dragonprime // ---------------------------------------------------------------------------- // Modified by Raven @ rabenthal.de - locate // ---------------------------------------------------------------------------- // require_once "common.php"; require_once "guildclanfuncs.php";
if ($session[user][alive]==0) redirect("shades.php");
page_header("Guilds/Clans"); //$session[user][locate]=33;
output("`c`& ~ Guilds/Clans ~ `c",true); addcommentary(); checkday(true); populate_guilds(); // Ensures we always have the most up to date info in the session
//variables by Gargamel $helpid=1; $nonav = 0; // standard navs (bottom) - 0:visible 1:suppressed $retnav = 1; // standard return nav - 0:visible 1:suppressed
global $NavSystem;
// Are they a superuser? if ($session[user][superuser]>=2 || $session[user][prayer]) { $NavSystem["Aufsichtsamt"]["b?Übersicht"]="guilds-clans-su.php?type=applications"; }
// ---------------------------------------------------------------------------- // Main decision tree // ---------------------------------------------------------------------------- switch ($HTTP_GET_VARS['op']) {
// ---------------------------------------------------------------------------- // -- MANAGE // ----------------------------------------------------------------------------
case "manage": // Management functions for members who are on the management team $action=$HTTP_GET_VARS['action']; $guildID=$HTTP_GET_VARS['id']; get_clanguild_var($guildID); //$session[user][locate]=15000+$guildID; $ManageGuild=&$session['guilds'][$guildID]; $who=$HTTP_GET_VARS['who']; $helpid=400;
nav_manageguildoptions($guildID); nav_guildoptions($guildID); nav_guildinfo($guildID);
switch ($action) { case "sitepoints": ManageSitePoints($guildID); break;
case "weapons": WeaponEditor($guildID); break;
case "armor": ArmorEditor($guildID); break;
case "create": unset($NavSystem["Leader Optionen"]); unset($NavSystem["Return"]);
$type=$HTTP_GET_VARS['type']; $status=$HTTP_GET_VARS['status']; switch ($status) { case "verifyInfo":
unset($NavSystem["Leader Optionen"]); unset($NavSystem["Return"]); $NavSystem["Zurück"]["Antrag verwerfen"]="guild.php"; // Display data entered by the user, verify for bad language or missing information $Info=$_POST['info']; $Info['GuildLeader']=$session['user']['acctid']; display_guild_info($Info); break;
case "submit":
// Submit data to the council, update the information $tmp=base64_decode($_POST['info']); $Info=unserialize($tmp); if ($Info!=true) { output("`n`nProblem getting data from Verify Form`n"); } else { if ($Info['BadLanguage']!=0) { unset($NavSystem["Leader Optionen"]); unset($NavSystem["Mitglieder Optionen"]); unset($NavSystem["Informationen"]); $NavSystem["Zurück"]["Antrag verwerfen"]="guild.php"; output("`n`%*hicks* `&Unerwünschte Begriffe `%$@#%`& - Bitte Antrag überarbeiten.`n`n`n"); display_edit_guild($Info); } else { if ($Info['MissingVitalInfo']==true) { unset($NavSystem["Leader Optionen"]); unset($NavSystem["Mitglieder Optionen"]); unset($NavSystem["Informationen"]); $NavSystem["Zurück"]["Antrag verwerfen"]="guild.php"; output("`n`&Es fehlen Pflichtangaben! Versuche es nochmal."); display_edit_guild($Info); } else { unset($Info['BadLanguage']); unset($Info['MissingVitalInfo']); $Info['IsGuild']=1; // Save the Guild info if (!isset($Info['ID']) or $Info['ID']==0) { $id=create_guild_info($Info); // Returns the identity of the user $session['user']['guildID']=$id; // Assign the user to the guild PopulateRanks($guildID); output("`n`0Der freundliche Mitarbeiter im Gründungsbüro nimmt Deinen Antrag lächelnd entgegen und prüft ihn.`n \"`3Vielen Dank, er sieht soweit gut aus und ich werde ihn umgehend den Göttern vorlegen. Du wirst dann eine Nachricht erhalten....\"`0`n Mit diesen Worten bedeutet Dir der Mitarbeiter doch nun zu gehen.`n`n Du bemerkst, dass der Mitarbeiter den Antrag, Deinen Antrag, etwas lieblos auf einen Haufen wirft und etwas von einem pergamentlosem Büro murmelt.`0`n"); // Grab the cash $session['user']['gems']-=$GuildPurchaseCostGems; $session['user']['gold']-=$GuildPurchaseCostGold; // Load them the cash into the guild $Info['gems']=$GuildPurchaseCostGems; $Info['gold']=$GuildPurchaseCostGold; $Info['ID']=$id; update_guild_info($Info); } else { update_guild_info($Info); output("`n`0Der Mitarbeiter des Büros schaut auf die Angaben, die Du eingetragen hast. `&\"Hmm... Schaut alles ordentlich aus. Ich werde die Daten übernehmen.\"`0"); } $NavSystem["Sonstiges"]["`@Zurück zum Gildenhaus"]="guild.php"; } } } break;
default: output("Fehler! Kein parameter! Action=create/Status=??`n"); break; } break; // end case "create"
case "manageranks": // Add/modify/remove the ranks of this guild ManageRanks($guildID); break;
case "approveapplicant": // Approve a pending applicant if ($who=="") { // Nothing has been passed output("Wen soll ich denn zulassen?`n"); } else { $Applicants=&$ManageGuild['ApplicantList']; unset($Applicants[$who]); update_guild_info($ManageGuild); $sql="select name, guildID, clanID from accounts where acctid=".$who; $result = db_query($sql); $row = db_fetch_assoc($result); if ($row['guildID']==0 && $row['clanID']==0) { $sql="update accounts set guildID=".$guildID." where acctid=".$who; db_query($sql); output("`n`nMitgliedschaft bestätigt und Information per Brieftaube abgeschickt!"); systemmail($who,"Re: Mitgliedsantrag für die Gilde: ".$ManageGuild['Name']."`0", ($session['user']['name'])." `0hat Deinem Antrag auf Mitgliedschaft in der Gilde ".$ManageGuild['Name']." zugestimmt!`n`n Herzlichen Glückwunsch!!", $session['user']['acctid']); } else { if ($row['guildID']<>0) output($row['name']." `0wurde bereits von ".$session['guilds'][$row['guildID']]['Name']." aufgenommen",true); else output($row['name']." `0wurde bereits von ".$session['guilds'][$row['clanID']]['Name']." aufgenommen",true); output("`0Der Aufnahmeantrag wurde gelöscht."); } } break;
case "denyapplicant": // Deny an pending applicant if ($who!="") { $Applicants=&$ManageGuild['ApplicantList']; unset($Applicants[$who]); update_guild_info($ManageGuild); output("Aufnahme abgelehnt"); systemmail($who,"`%Re: Aufnahmeantrag ".$ManageGuild['Name']." Gilde!`0", ($session['user']['name'])." `0hat Deinen Aufnahmeantrag für die Gilde ".$ManageGuild['Name']." `iabgelehnt`i.`n`n Pech.... `nAntworte auf diese Mail, wenn Du genaueres zur Ablehnung erfahren möchtest.", $session['user']['acctid']); } else { output("Du kannst nur jemanden ablehnen, den Du vorher ausgewählt hast!"); } break;
case "revokemember": // Kick somebody out if ($who!="") { $sql="update accounts set guildID=0,cg_getgold=0,cg_spendgold=0,cg_getgems=0,cg_spendgems=0 where acctid=".$who; db_query($sql); systemmail($who,"`%Re: Mitgliedschaft ".$ManageGuild['Name']." Gilde!`0", ($session['user']['name'])." `0hat Deine Mitgliedschaft in der Gilde ".$ManageGuild['Name']." `&`iwiderrufen`i! `n`nAntworte auf diese Mail für weitere Informationen", $session['user']['acctid']); output("Mitgliedschaft widerrufen"); } else { output("Du musst jemanden auswählen bevor Du ihn kicken kannst!"); } break;
case "assignrank": // Assign one or more members to a rank AssignRank($guildID); break;
case "pay": // Pay a stipend to one or more members PayMember($guildID, $who); break;
case "demote": DemoteMember($guildID); break;
case "promotemember": // Promote somebody to the management team PromoteMember($guildID); break;
case "members": // Display/Manage members GuildMembers($guildID,true); break;
case "guildinfo": // Display the guild Information for editing display_edit_guild($ManageGuild,true,false); break;
case "hitlist": //### Verify // Display/Manage the current Hitlist edit_hitlist($guildID); break;
case "fireside": output("`n"); // this is pure HTML - logd text codes didn't work here.... $titeltext="Das Kaminzimmer"; $fliesstext="Du trittst in das Kaminzimmer ein. Viele Türen führen in diesen wunderschönen Raum, der liebevoll gestaltet seinen Besuchern eine entspannte Gastlichkeit bietet. Ein wärmendes Feuer prasselt in der alten Feuerstelle, die diesen Raum beherscht. Nur die Offiziellen der Gilden haben hier Zutritt. Einige sitzen vor dem grossen Kamin, rauchen eine Pfeiffe oder trinken ein kühles Ale. <br>Wolltest Du nicht etwas wichtiges besprechen?"; rawoutput("<IMG SRC=\"images/fireplace.gif\" align=\"left\">"); rawoutput("<p>".$titeltext."<br><br>".$fliesstext."</p>"); //output("`n"); OTviewcommentary("GuildFire", "Die edlen Führer der Gilden sprechen miteinander", 25,"spricht"); break;
default: // Should not have got here! output("Should not have got here - Option: ".$action); break; } break; // End of op=manage
// ---------------------------------------------------------------------------- // -- MEMBER // ----------------------------------------------------------------------------
case "member": $action=$HTTP_GET_VARS['action']; $guildID=$HTTP_GET_VARS['id']; get_clanguild_var($guildID); //$session[user][locate]=15000+$guildID; $ThisGuild=$session['guilds'][$guildID];
switch ($action) { case "suggestions": $helpid=200; //member menu help output("`n`0Willkommen im Vorschlagszimmmer der Gilde!",true); output("`n`n`0Auf einem grossen Schild steht:"); output("`c`i`&Die `bGildenführung`b hat das Recht, `nalle Vorschläge zu ignorieren oder zu überlesen, `ndie hier hinterlassen werden.`i`c",true); output("`n`0An der Wand siehst Du hunderte kleiner Pergamente, alle vollgeschrieben mit Vorschlägen und Bitten an die Gildenführung.`n`n",true); // Display the welcome intro OTviewcommentary("GuildSuggest:".$guildID,"vorschlagen", 25,"schlägt vor"); break;
case "donate": $helpid=200; //member menu help transfer_cash_guild($guildID, $stage); break;
case "cellar": $ExpandedLinks=true; $retnav = 0; $nonav = 1; $NavSystem["~Kellergewölbe~"]["`fSchatzkammer"]="guild.php?op=member&action=cellar&type=goldsafe&id=".$guildID; $NavSystem["~Kellergewölbe~"]["`qSteinespiel"]="stonesgame.php";
switch ($HTTP_GET_VARS['type']){ case "goldsafe": goldsafe($guildID,$HTTP_GET_VARS['stage']); $retnav = 1; break; default: output("`0`nDu stehst in dem etwas dunklen aber geräumigen Kellergewölbe unterhalb des Gildenhauses.`n Neugierig blickst Du Dich um. Von irgendwoher hallen Schritte und Du kannst einige Stimmen hören - aber niemanden sehen.`0`n"); break; }
break;
case "shop": $ExpandedLinks=true; $retnav = 0; $NavSystem["~Markt~"]["Waffe verbessern"]="guild.php?op=member&action=shop&type=weapon&id=".$guildID; $NavSystem["~Markt~"]["Rüstung verbessern"]="guild.php?op=member&action=shop&type=armour&id=".$guildID; $NavSystem["~Markt~"]["Dr. Ohura"]="guild.php?op=member&action=shop&type=doctors&id=".$guildID; $NavSystem["~Markt~"]["Waffengeschäft"]="weapons.php?guild=".$guildID."&return=".urlencode(CalcReturnPath(true)).""; $NavSystem["~Markt~"]["Rüstungsgalerie"]="armor.php?guild=".$guildID."&return=".urlencode(CalcReturnPath(true)).""; $NavSystem["~Markt~"]["Marktschreier"]="guild.php?op=member&action=shop&type=shout&id=".$guildID;
switch ($HTTP_GET_VARS['type']){ case "weapon": display_weapon_upgrade($guildID); break; case "armour": display_armour_upgrade($guildID); break; case "doctors": display_healer($guildID); break; case "practice": display_practice_field($guildID); break; case "shout": mail2whole_guild($guildID,$HTTP_GET_VARS['stage']); break; default: output("`0`nDu betrittst den kleinen Marktplatz der Gilde. Kleine Geschäfte bieten ihre Waren und Dienstleistungen den Mitgliedern der Gilde ".$ThisGuild['Name']."`0 an.`0"); break; }
break;
case "leaveguild": $helpid=200; //member menu help switch ($HTTP_GET_VARS['choice']){ case "yes": if (IsOnManagementTeam($guildID)) { $ThisGuild=&$session['guilds'][$guildID]; // Send mail to other management - ?also to the members if ($ThisGuild['GuildLeader']==$session['user']['acctid']) $ThisGuild['GuildLeader']=0; if ($ThisGuild['HeadOfWar']==$session['user']['acctid']) $ThisGuild['HeadOfWar']=0; if ($ThisGuild['HeadOfMembership']==$session['user']['acctid']) $ThisGuild['HeadOfMembership']=0; update_guild_info($ThisGuild); } $session['user']['guildID']=0; $session['user']['guildrank']=0; $session['user']['cg_getgold']=0; $session['user']['cg_spendgold']=0; $session['user']['cg_getgems']=0; $session['user']['cg_spendgems']=0; output("`n`0Du entscheidest Dich, in Zukunft mehr Zeit mit Deinem eigenen Kram zu verbringen.`nDu gibst Deine Mitgliedskarte ab und verlässt die Gilde mit einer kleinen Träne im Auge. Gerne erinnerst Du Dich an die schönen Momente, die Du hier erlebt hast. Du hältst einen Moment inne. Gleich bist Du wieder im Dorf."); // ### Send a mail to the GuildLeader or the head of membership clearnav(); header("Refresh: 10; URL=village.php"); addnav("","village.php"); break; case "no": output("`n`0Du überlegst noch einmal und entscheidest Dich dann doch zu bleiben. Das Positive überwiegt doch und Du willst es nicht missen.`0"); break; default: if (IsOnManagementTeam($guildID)) { output("`nDu gehörst zum Führungsteam!!!"); output("`nWie sollen die ohne Deine Erfahrung bloß weitermachen??"); } output("`n`n`0Bist Du sicher, dass Du die Gilde verlassen willst?"); $NavSystem["~Options~"]["J?`fJa - lass mich hier raus"]="guild.php?op=member&action=leaveguild&choice=yes&id=".$guildID; $NavSystem["~Options~"]["N?`qNein - Ich will bleiben"]="guild.php?op=member&action=leaveguild&choice=no&id=".$guildID; $ExpandedLinks=true; $nonav = 1; //suppress standard navs break; } break;
case "viewrules": $helpid=300; //information menu help output("`n`n`&`cRegeln der Gilde`c",true); output("`n`c~~~`c",true); output("`n`c".$ThisGuild['RulesText']."`c",true); break;
case "viewdesc": $helpid=300; //information menu help output("`n`n`&`cBeschreibung der Gilde`c",true); output("`n`c~~~`c",true); output("`n`c".$ThisGuild['PublicText']."`c",true); break;
case "showstatus": $helpid=300; //information menu help $sort= $HTTP_GET_VARS['sort']; output("`n`c`iRangliste Gilden`i`c`n"); GuildsHOF($guildID,$sort); break;
case "showmembers": $helpid=300; //information menu help GuildMembers($guildID); break;
case "kassenbuch": $helpid=300; //information menu help CGKasse($guildID); break;
case "gemkasse": $helpid=300; CGGemkasse($guildID); break;
case "discounts": $helpid=300; //information menu help output("`n`0Die folgenden Rabatte und Vorteile werden Dir durch Deine Gilde gewährt:`n`n"); output("`c",true); displaySitePoints($guildID); output("`c",true); break;
case "enter": $helpid=200; //member menu help $guildID=$HTTP_GET_VARS['id']; $ThisGuild=&$session['guilds'][$guildID]; $ExpandedLinks=false;
// Wanna fall into default! default: // We have entered the mightly guild
output("<table align='top'><tr><td>`n`0Willkommen in der grossen Versammlungshalle der Gilde `3".$ThisGuild['Name']."`0. Die Mitglieder stehen in kleinen Gruppen zusammen und unterhalten sich...`n Einige gehen geschäftig umher und verschwinden in einem der zahlreichen Räume.`n`n`0</td>",true);
//gildenavatar if (getsetting("avatare",0)==1){ if ($ThisGuild['avatar']){ $avatar=gce_makepic($ThisGuild[avatar],$ThisGuild[avatarbig]); if ($avatar['LINK'] <> ""){ output('<TD align="right">'.$avatar['LINK'],true); }else{ output('<TD align="right">'.$avatar['TAG'],true); } output("</td></tr></table>",true); } else { output("<tr><td> </td></tr></table>",true); } } $news=fetchNews($ThisGuild['ID']); if (isset($news)) output("Die letzte Nachricht aus der Gilde:`n`n`0`c`i".$news['newstext']."`i`c`n`0",true); //if (isset($news)) output("The latest Guild News:`n`n`0`c`i".$news['newstext']."`i`c`n`0",true);
// Display the welcome intro OTviewcommentary("GuildChat:".$guildID,"Rede mit anderen Mitgliedern", 25);
break; }
// Display the links if ($action == "leaveguild") { unset($NavSystem["Informationen"]); unset($NavSystem["Mitglieder Optionen"]); unset($NavSystem["Leader Optionen"]); } if (!$ExpandedLinks) { $onTeam=IsOnManagementTeam($guildID); if ($onTeam) { nav_manageguildoptions($guildID); } //nav_manageoptions($guildID); nav_guildoptions($guildID); nav_guildinfo($guildID); // External Page link $NavSystem[]="~"; } if (!$retnav) { $NavSystem["Zurück"][$ThisGuild['Name']]="guild.php?op=member&action=enter&id=".$guildID; // $NavSystem[]="~"; }
break;
// ---------------------------------------------------------------------------- // -- NON MEMBER // ----------------------------------------------------------------------------
case "nonmember": $action=$HTTP_GET_VARS['action']; switch ($action) { case "join": switch ($HTTP_GET_VARS['task']) { default: // You wish to join the Guild $guildID=$HTTP_GET_VARS['id']; $ApplyGuild=&$session['guilds'][$guildID]; if ($session['user']['guildID']!=0) { // You are a member of one already $ThisGuild=&$session['guilds'][$session['user']['guildID']]; if ($session['user']['guildID']==$guildID){ StrollIn(); output("Duh! Du bist doch schon Mitglied!"); } else { if ($ThisGuild['Status']<>1) { // You cannot spy unless the guild is approved } else { // Include the option to spy addnav("Spionieren ".$ApplyGuild['Name'],"guild.php?op=nonmember&action=join&task=spy&id=".$guildID); output("`0Du bist bereits Mitglied der ".$ThisGuild['Name']."`0 Gilde",true); output("`n`0Aber du kannst versuchen zu spionieren, vielleicht hast du ja Glück.!"); } } } else { // You are not a member of any other Guild output("`n`nWenn du der Gilde beitreten willst wirst du ihre Regeln befolgen müssen"); output("`n`n`&`cRegeln`c",true); output("`n`c~~~`c",true); output("`n`c".$ApplyGuild['RulesText']."`c",true); output("`0<form action='guild.php?op=nonmember&action=join&task=submit&id=".$guildID."' method='POST'>",true); output("`n`n`c<input type='submit' name='submit' class='button' value='Apply'>`c",true); output("`n`c<input type='submit' name='submit' class='button' value='Forget it'>`c",true); addnav("","guild.php?op=nonmember&action=join&task=submit&id=".$guildID); } break;
case "submit": $buttonClicked=$_POST['submit']; $guildID=$HTTP_GET_VARS['id'];
if ($buttonClicked=="Apply") { $ApplyGuild=&$session['guilds'][$guildID]; // This won't handle applications to multiple Guilds! $ApplicantList=array(); $ApplicantList=&$ApplyGuild['ApplicantList']; if (array_key_exists($session['user']['acctid'],$ApplicantList)==true) { output("Du hast di bereits bei dieser Gilde beworben"); } else { $ApplicantList[$session['user']['acctid']]=""; update_guild_info($ApplyGuild); if ($ApplyGuild['HeadOfMembership']!=0) { $MailTo=$ApplyGuild['HeadOfMembership']; } else { $MailTo=$ApplyGuild['GuildLeader']; }
systemmail($MailTo,"`%Du hast eine Gildenbewerbung erhalten!`0", ($session['user']['name'])."`& hat eine Bewerbung an deine Gilde ".$ApplyGuild['Name']." `&geschickt", $session[user]['acctid']); $sql="select name from accounts where acctid=".$MailTo; // Determine the name of the person - makes the mail pretty $result=db_query($sql); $row=db_fetch_assoc($result);
systemmail($session['user']['acctid'],"`%Du hast dich bei der Gilde ".$ApplyGuild['Name']." `%beworben!`0", "Deine Bewerbung ging an ".$row['name'],$MailTo); output("`nDeine Bewerbung wurde abgeschickt"); output("`nÜberprüfe deine Mails um genaueres zu erfahren"); } // Array_Key_Exists } else { $ApplyGuild=&$session['guilds'][$guildID]; output("`n`0Du beschließt der Gilde ".$ApplyGuild['Name']." `0doch nicht beizutreten",true); strollin(); } // Button clicked = Apply
break;
case "spy": $Success = (e_rand(50,100)==76); $guildID=$HTTP_GET_VARS['id']; $SpyGuild=&$session['guilds'][$guildID]; output("`n`0You try to spy!"); if ($Success) { output("`n`n`0Du schleichst dich durch den Gildengarten bis zum Büro der Gildenleiter"); output("`n`0Mit viel Geschick schaffst du es den Save zu öffnen ohne den Alarm auszulösen!!"); $gold = e_rand(($SpyGuild['gold']/10),$SpyGuild['gold']); $gems = e_rand(($SpyGuild['gems']/10),$SpyGuild['gems']); output("`n`nDu hast es geschafft `^".$gold."`0 Gold and `%".$gems."`0 Gems zu stehelen"); $SpyGuild['gold']-=$gold; $SpyGuild['gems']-=$gems; $session['user']['gold']+=$gold; $session['user']['gems']+=$gems; $hitpoints=e_rand(2,20); $experience=e_rand(100,3000); output("`n`0Für deinen Mut bekommst du zusätzliche `&".$hitpoints." `0Lebenspunkte und `&".$experience." `0Erfahrung"); $session['maxhitpoints']+=$hitpoints; $session['user']['experience']+=$experience; update_guild_info($SpyGuild); $Discovered=(e_rand(1,20)==17); output("`n`nDu hörst wie sich dir jemand von außerhalb nähert"); output("`n`0Du schaffst es gerade noch aus dem Fenster zu fliehen, bevor dich jemand sieht, du musstest aber alles was du erbeutet hattest zurück lassen."); if ($Discovered) { // Inform the leader and head of war about being spied upon systemmail($SpyGuild['GuildLeader'],"`0A Ein Spion in deiner Gilde!!`0", ($session['user']['name'])."`0 Ist in das Güro der Gilde eingebrochen und schaffte es `^".$gold."`0Gold und`%".$gems."`0 Edelsteine zu stehlen", 0); systemmail($SpyGuild['HeadOfWar'],"`0A Ein Spion in deiner Gilde!!`0", ($session['user']['name'])."`0 Ist in das Güro der Gilde eingebrochen und schaffte es `^".$gold."`0Gold und`%".$gems."`0 Edelsteine zu stehlen", 0); }
} else { output("`n`n`&Yikes.. Spionage wird von der ".$SpyGuild['Name']." `&Gilde nicht gern gesehen",true); output("`n`n`0Plötzlich siehst du dich von schwer bewaffneten Soldaten umringt. Am Ende wirst du unfreundlich aus dem Gildengebäude geschmissen!!");
// Determine the name of the person - makes the mail pretty if ($SpyGuild['HeadOfWar']!=0) { $PersonID=$SpyGuild['HeadOfWar']; $PrettyTitle = "Head of War"; } else { $PersonID=$SpyGuild['GuildLeader']; $PrettyTitle = "Guild Leader"; }
$sql="select name from accounts where acctid=".$PersonID; $result=db_query($sql); $row=db_fetch_assoc($result);
output("`n`n`0From the shadows the ".$PrettyTitle." - ".$row['name']." `0walks up with an angry scowl and barks a command to the guards.",true); output("`n`0They grin and suddenly jump you!!");
$HPLoss = e_rand(1,$session['user']['hitpoints']); $goldLoss= e_rand(1,$session['user']['gold']); $session['user']['hitpoints']-=$HPLoss; $session['user']['gold']-=$goldLoss;
$SpyGuild['gold']+=$goldLoss; //### $SpyGuild['SitePoints']+=(int)($HPLoss/1000); update_guild_info($SpyGuild);
output("`n`n`&Du verlierst `4".$HPLoss." `&Lebenspunkte und `^".$goldLoss." `&Gold!!"); output("`n`&Pech gehabt!!"); if ($SpyGuild['GuildLeader']<>0) { systemmail($SpyGuild['GuildLeader'],"`0Ein Spion in deiner Gilde!!`0", ($session['user']['name'])."`0 barch in deine Gilde ein, aber die Wachen konnten ihn gefangen nehmen!", 0); } if ($SpyGuild['HeadOfWar']<>0) { systemmail($SpyGuild['HeadOfWar'],"`0Ein Spion in deiner Gilde!!`0", ($session['user']['name'])."`0 barch in deine Gilde ein, aber die Wachen konnten ihn gefangen nehmen!", 0); } addnews($session['user']['name']." Wurde beim Einbruch in die Gilde ".$SpyGuild['Name']."von den Wachen erwischt!!!"); } break; } break;
case "examine": case "viewintro": strollin(); // View the intro info for a guild $guildID=$HTTP_GET_VARS['id']; $ThisGuild=&$session['guilds'][$guildID]; $return=$HTTP_GET_VARS['return']; if (isset($return)) { $NavSystem=array(); $NavSystem['zurück']=$return; } // We have a guild name output("`n`n`n`c`i`0`@Du besuchst die Gilde ".$ThisGuild['Name']. "`0 `@und ritzt Dir mit einem Messer ihre Besonderheiten auf einer kleinen Baumrinde, um Dich eventuell bei ihr zu bewerben.`i`c",true); output("`n`n`c`i`k~~~~`qW`^i`@l`9l`%k`ko`qm`^m`@e`9n`k~~~`i`c",true); output("`n`n`c`i`b`k~~~~`qGi`^ld`@en`9in`%fo`krm`qat`^io`@n`k~~~`b`i`c",true); output("`%`c~~`c",true); output("`&`c".$ThisGuild['PublicText']."`c",true);
output("`n`n`&`c`i`b`k~~~~`qBew`^erb`@ungs`9in`%fo`krm`qat`^io`@n`k~~~`b`i`c",true); output("`%`c~~`c",true); output("`&`c".$ThisGuild['ApplyText']."`c",true);
output("`n`n`&`c`i`b`k~~~~`qGi`^ld`@en `9R`%e`kg`qe`^l`@n`k~~~`b`i`c",true); output("`%`c~~`c",true); output("`&`c".$ThisGuild['RulesText']."`c",true); if ( $session['user']['guildID'] == 0 && $session['user']['clanID'] == 0 ) { //$NavSystem[]="~"; $NavSystem["Bewerber"] ["`b`qMitgliedsantrag für ".$ThisGuild['Name']." abgeben`b"]="guild.php?op=nonmember&action=join&id=".$guildID; } break;
case "list": strollin(); listall_guildclan(); break;
case "create": $type=$HTTP_GET_VARS['type']; switch ($type){ case "guild": $status=$HTTP_GET_VARS['status']; switch ($status) { case "verifyInfo": $NavSystem["Zurück"]["Antrag verwerfen"]="guild.php"; // Display data entered by the user $Info=$_POST['info']; $Info['GuildLeader']=$session['user']['acctid']; display_guild_info($Info); break;
default: if (($session['user']['gems']>=$GuildPurchaseCostGems) && ($session['user']['gold']>=$GuildPurchaseCostGold)) { output("`n`nIm Gründungsbüro erhälst Du ein Antragspergament:`n`n"); display_edit_guild($Info); } else { output("`n`nIm Gründungsbüro bekommst Du mitgeteilt:`n`n"); output("`0Du hast nicht genug Reichtümer, um eine Gilde zu gründen.`n Du benötigst `%".$GuildPurchaseCostGems." `0Edelsteine und `^".$GuildPurchaseCostGold." `0Goldstücke.`n`n `0Komm' später wieder!`0`n"); } break; } break;
case "clan": output("`n`nClans noch nicht implementiert!"); break; } default: break; }
break;
break;
// ---------------------------------------------------------------------------- // -- DEFAULT // ----------------------------------------------------------------------------
default: // Are they a member of a guild/Clan // gargamel: nop, they aren't.... output("`n`n`0Du gehst in die edle Klingengasse und passierst die Bauten, bis Du vor dem majestätischen Hauptgebäude der Gilden von Rabenthal etwas ehrfürchtig stehen bleibst.`n`n Weiter die Strasse herunter lässt Du Deinen Blick über ein offenes Feld schweifen, auf dem sich die Clans von Rabenthal in einem bunten Lager gewaltiger Zelte zusammengefunden haben."); // Work out what nav's to display StrollIn();
break; }
$linkback = URLEncode(calcreturnpath());
//$NavSystem[]="~"; if ( $nonav == 0 ) { $NavSystem[]="~"; $NavSystem["Auskunftsbüro"]["A?Alle Gilden/Clans"]="guild.php?op=nonmember&action=list"; $NavSystem["Auskunftsbüro"]["H?Hilfe"]="guildclanhelp.php?id=".$helpid."&ret=".$linkback; //$NavSystem[]="~"; if ($HTTP_GET_VARS['op'] != "" ) { $NavSystem["Sonstiges"]["Z?`9Zurück zum Hauptgebäude"]="guild.php"; } $NavSystem["Sonstiges"]["Z?Zurück zum Dorf"]="village.php"; }
PopulateNavs();
page_footer(); ?>
|