Advertisement
Easelm

Untitled

Apr 22nd, 2012
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.49 KB | None | 0 0
  1. <?php
  2.     include_once "../../global.php";
  3.     // Getting information from our CreatureAI.php
  4.     $file = $_POST['filename'].$Rand2.".cpp";
  5.    
  6.     /* Content */
  7.     $content = "/* \n    Generated using Conagenerate. \n    Owners of this script: Tommy and Conagenerate. \n    Credits go to: Tommy and Conagenerate. \n    © forumgods.com - 2011 Conagenerate © Nomsoftware - 2011
  8.     */ \n
  9.     class ".$Class." : public ".$Type."
  10.     {
  11.     public:
  12.     MOONSCRIPT_FACTORY_FUNCTION(".$Class.", ".$Type."); \n    "
  13.     .$Class."(Creature * pCreature) : ".$Type."(pCreature)
  14.     {"
  15.       .(($_POST['SpellId1'] != "" && $_POST['Chance1'] != "" && $_POST['Casttime1'] != "" && $_POST['Text1'] != "" && $_POST['TextType1'] != "" && $_POST['SoundId1'] != "") ? "
  16.       AddSpell(".$SpellID.",".$Target.",".$Chance.",".$Cast.",".$Cooldown.",".chr(34).$Say.chr(34).",".$TextType.",".$SoundId.");" : "")
  17.       .(($_POST['SpellId1'] != "" && $_POST['Chance1'] != "" && $_POST['Casttime1'] != "" && $_POST['Text1'] == "" && $_POST['TextType1'] == "" && $_POST['SoundId1'] == "") ? "
  18.       AddSpell(".$SpellID.",".$Target.",".$Chance.",".$Cast.",".$Cooldown.");" : "").
  19.       (($_POST['SpellId1'] != "" && $_POST['Chance1'] != "" && $_POST['Casttime1'] != "" && $_POST['Text1'] != "" && $_POST['TextType1'] != "" && $_POST['SoundId1'] == "") ? "
  20.       AddSpell(".$SpellID.",".$Target.",".$Chance.",".$Cast.",".$Cooldown.");" : "").//Continue Spell Two
  21.       (($_POST['SpellId2'] != "" && $_POST['Chance2'] != "" && $_POST['Casttime2'] != "" && $_POST['Text2'] != "" && $_POST['TextType2'] != "" && $_POST['SoundId2'] != "") ? "
  22.       AddSpell(".$SpellID2.",".$Target2.",".$Chance2.",".$Cast2.",".$Cooldown2.",".chr(34).$Say2.chr(34).",".$TextType2.",".$SoundId2.");" : "")
  23.       .(($_POST['SpellId2'] != "" && $_POST['Chance2'] != "" && $_POST['Casttime2'] != "" && $_POST['Text2'] == "" && $_POST['TextType2'] == "" && $_POST['SoundId2'] == "") ? "
  24.       AddSpell(".$SpellID2.",".$Target2.",".$Chance2.",".$Cast2.",".$Cooldown2.");" : "").
  25.       (($_POST['SpellId2'] != "" && $_POST['Chance2'] != "" && $_POST['Casttime2'] != "" && $_POST['Text2'] != "" && $_POST['TextType2'] != "" && $_POST['SoundId2'] == "") ? "
  26.       AddSpell(".$SpellID2.",".$Target2.",".$Chance2.",".$Cast2.",".$Cooldown2.");" : ""). // Continue Spell Three
  27.       (($_POST['SpellId3'] != "" && $_POST['Chance3'] != "" && $_POST['Casttime3'] != "" && $_POST['Text3'] != "" && $_POST['TextType3'] != "" && $_POST['SoundId3'] != "") ? "
  28.       AddSpell(".$SpellID3.",".$Target3.",".$Chance3.",".$Cast3.",".$Cooldown3.",".chr(34).$Say3.chr(34).",".$TextType3.",".$SoundId3.");" : "")
  29.       .(($_POST['SpellId3'] != "" && $_POST['Chance3'] != "" && $_POST['Casttime3'] != "" && $_POST['Text3'] == "" && $_POST['TextType3'] == "" && $_POST['SoundId3'] == "") ? "
  30.       AddSpell(".$SpellID3.",".$Target3.",".$Chance3.",".$Cast3.",".$Cooldown3.");" : "").
  31.       (($_POST['SpellId3'] != "" && $_POST['Chance3'] != "" && $_POST['Casttime3'] != "" && $_POST['Text3'] != "" && $_POST['TextType3'] != "" && $_POST['SoundId3'] == "") ? "
  32.       AddSpell(".$SpellID3.",".$Target3.",".$Chance3.",".$Cast3.",".$Cooldown3.");" : ""). // Continue Spell Four
  33.       (($_POST['SpellId4'] != "" && $_POST['Chance4'] != "" && $_POST['Casttime4'] != "" && $_POST['Text4'] != "" && $_POST['TextType4'] != "" && $_POST['SoundId4'] != "") ? "
  34.       AddSpell(".$SpellID4.",".$Target4.",".$Chance4.",".$Cast4.",".$Cooldown4.",".chr(34).$Say4.chr(34).",".$TextType4.",".$SoundId4.");" : "")
  35.       .(($_POST['SpellId4'] != "" && $_POST['Chance4'] != "" && $_POST['Casttime4'] != "" && $_POST['Text4'] == "" && $_POST['TextType4'] == "" && $_POST['SoundId4'] == "") ? "
  36.       AddSpell(".$SpellID4.",".$Target4.",".$Chance4.",".$Cast4.",".$Cooldown4.");" : "").
  37.       (($_POST['SpellId4'] != "" && $_POST['Chance4'] != "" && $_POST['Casttime4'] != "" && $_POST['Text4'] != "" && $_POST['TextType4'] != "" && $_POST['SoundId4'] == "") ? "
  38.       AddSpell(".$SpellID4.",".$Target4.",".$Chance4.",".$Cast4.",".$Cooldown4.");" : "")."
  39.     }
  40.    
  41.     void AIUpdate()
  42.     {\n"
  43.        .(($_POST['Percent'] != "0" && $_POST['Percent1'] == "0") ? "       if(_unit->GetHealthPct() ".$Percentage.")" : "").
  44.        (($_POST['Percent'] == "0" && $_POST['Percent1'] != "0") ? "       if(_unit->GetHealthPct() ".$Percentage1.")" : "")."
  45.        {"
  46.        .(($_POST['PerHeal'] != "Spell ID") ? "   AddSpell(".$Heal.", Target_Self,".$HealChance.",".$HealCasttime.",".$HealCooldown.");" : "")
  47.        .(($_POST['PerHeal'] == "Spell ID" && $_POST['PerCastime'] == "" && $_POST['PerChance'] == "" && $_POST['PerCoolDown'] == "") ? "" : "")
  48.        .(($_POST['PerCast'] != "Spell ID") ? "   AddSpell(".$Cast.",".$CastTarget.",".$CastChance.",".$CastCasttime.",".$CastCooldown.");" : "")
  49.        .(($_POST['PerCast'] == "Spell ID" && $_POST['PerTarget'] == "Target_Current" && $_POST['PerCastime1'] == "" && $_POST['PerCoolDown1'] == "" && $_POST['PerChance1']) ? "" : "")."
  50.        }
  51.     }";
  52.    
  53.     if($_POST['filename'] == "")
  54.     {
  55.        echo "File Name cannot be empty! <br /> <br />";
  56.     }
  57.     else if($_POST['NpcID'] == "")
  58.     {
  59.        echo "NPCID cannot be empty! <br /> <br />";
  60.     }
  61.     else if($_POST['Classname'] == "")
  62.     {
  63.        echo "Classname cannot be empty! <br /> <br />";
  64.     }
  65.     else if($_POST['Percent'] != "0" && $_POST['Percent1'] != "0")
  66.     {
  67.        echo "'Get Greater Than Health %' and 'Get Less Than Health %' cannot both have a value greater than 0. <br /> Please only choose one and leave the other box's value at 0. <br /> <br />";
  68.     }
  69.     else if($_POST['PerHeal'] != "Spell ID" && $_POST['PerCastime'] == "" && $_POST['PerChance'] == "" && $_POST['PerCoolDown'] == "")
  70.     {
  71.        echo "You must fill out the rest of your boxes under ".chr(34)."Heal".chr(34)."!";
  72.     }
  73.     else
  74.     {
  75.         // MySql
  76.         //mysql_connect("localhost","tommy_wp","XIW*@!awd1L") or die(mysql_error());
  77.         //mysql_select_db("tommy_conagenerate") or die(mysql_error());
  78.            
  79.         //$result = mysql_query("INSERT INTO creations VALUES('', 'http://tommy.faded.me/Conagenerate/ArcEmu/CreatureAI/".$_POST['filename'].".cpp','".$_POST['filename']."','ArcEmu');") or die (mysql_error());
  80.         //mysql_fetch_array($result);
  81.        
  82.         // Saving the file
  83.         $Save = fopen($file, 'a');
  84.         $saving = $content;
  85.         // Writing
  86.         fwrite($Save, $content);
  87.         // Close
  88.         fclose($Save);
  89.         // Then make the member download it
  90.         @header("Pragma: public");
  91.         @header("Expires: 0");
  92.         @header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  93.         @header("Content-Type: application/octet-stream");
  94.         @header("Content-Disposition: attachment; filename=\"$file\"");
  95.         @header("Content-Description: File Transfert");
  96.         @readfile($file);
  97.     }
  98.     /* End Content */
  99. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement