Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once "../../global.php";
- // Getting information from our CreatureAI.php
- $file = $_POST['filename'].$Rand2.".cpp";
- /* Content */
- $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
- */ \n
- class ".$Class." : public ".$Type."
- {
- public:
- MOONSCRIPT_FACTORY_FUNCTION(".$Class.", ".$Type."); \n "
- .$Class."(Creature * pCreature) : ".$Type."(pCreature)
- {"
- .(($_POST['SpellId1'] != "" && $_POST['Chance1'] != "" && $_POST['Casttime1'] != "" && $_POST['Text1'] != "" && $_POST['TextType1'] != "" && $_POST['SoundId1'] != "") ? "
- AddSpell(".$SpellID.",".$Target.",".$Chance.",".$Cast.",".$Cooldown.",".chr(34).$Say.chr(34).",".$TextType.",".$SoundId.");" : "")
- .(($_POST['SpellId1'] != "" && $_POST['Chance1'] != "" && $_POST['Casttime1'] != "" && $_POST['Text1'] == "" && $_POST['TextType1'] == "" && $_POST['SoundId1'] == "") ? "
- AddSpell(".$SpellID.",".$Target.",".$Chance.",".$Cast.",".$Cooldown.");" : "").
- (($_POST['SpellId1'] != "" && $_POST['Chance1'] != "" && $_POST['Casttime1'] != "" && $_POST['Text1'] != "" && $_POST['TextType1'] != "" && $_POST['SoundId1'] == "") ? "
- AddSpell(".$SpellID.",".$Target.",".$Chance.",".$Cast.",".$Cooldown.");" : "").//Continue Spell Two
- (($_POST['SpellId2'] != "" && $_POST['Chance2'] != "" && $_POST['Casttime2'] != "" && $_POST['Text2'] != "" && $_POST['TextType2'] != "" && $_POST['SoundId2'] != "") ? "
- AddSpell(".$SpellID2.",".$Target2.",".$Chance2.",".$Cast2.",".$Cooldown2.",".chr(34).$Say2.chr(34).",".$TextType2.",".$SoundId2.");" : "")
- .(($_POST['SpellId2'] != "" && $_POST['Chance2'] != "" && $_POST['Casttime2'] != "" && $_POST['Text2'] == "" && $_POST['TextType2'] == "" && $_POST['SoundId2'] == "") ? "
- AddSpell(".$SpellID2.",".$Target2.",".$Chance2.",".$Cast2.",".$Cooldown2.");" : "").
- (($_POST['SpellId2'] != "" && $_POST['Chance2'] != "" && $_POST['Casttime2'] != "" && $_POST['Text2'] != "" && $_POST['TextType2'] != "" && $_POST['SoundId2'] == "") ? "
- AddSpell(".$SpellID2.",".$Target2.",".$Chance2.",".$Cast2.",".$Cooldown2.");" : ""). // Continue Spell Three
- (($_POST['SpellId3'] != "" && $_POST['Chance3'] != "" && $_POST['Casttime3'] != "" && $_POST['Text3'] != "" && $_POST['TextType3'] != "" && $_POST['SoundId3'] != "") ? "
- AddSpell(".$SpellID3.",".$Target3.",".$Chance3.",".$Cast3.",".$Cooldown3.",".chr(34).$Say3.chr(34).",".$TextType3.",".$SoundId3.");" : "")
- .(($_POST['SpellId3'] != "" && $_POST['Chance3'] != "" && $_POST['Casttime3'] != "" && $_POST['Text3'] == "" && $_POST['TextType3'] == "" && $_POST['SoundId3'] == "") ? "
- AddSpell(".$SpellID3.",".$Target3.",".$Chance3.",".$Cast3.",".$Cooldown3.");" : "").
- (($_POST['SpellId3'] != "" && $_POST['Chance3'] != "" && $_POST['Casttime3'] != "" && $_POST['Text3'] != "" && $_POST['TextType3'] != "" && $_POST['SoundId3'] == "") ? "
- AddSpell(".$SpellID3.",".$Target3.",".$Chance3.",".$Cast3.",".$Cooldown3.");" : ""). // Continue Spell Four
- (($_POST['SpellId4'] != "" && $_POST['Chance4'] != "" && $_POST['Casttime4'] != "" && $_POST['Text4'] != "" && $_POST['TextType4'] != "" && $_POST['SoundId4'] != "") ? "
- AddSpell(".$SpellID4.",".$Target4.",".$Chance4.",".$Cast4.",".$Cooldown4.",".chr(34).$Say4.chr(34).",".$TextType4.",".$SoundId4.");" : "")
- .(($_POST['SpellId4'] != "" && $_POST['Chance4'] != "" && $_POST['Casttime4'] != "" && $_POST['Text4'] == "" && $_POST['TextType4'] == "" && $_POST['SoundId4'] == "") ? "
- AddSpell(".$SpellID4.",".$Target4.",".$Chance4.",".$Cast4.",".$Cooldown4.");" : "").
- (($_POST['SpellId4'] != "" && $_POST['Chance4'] != "" && $_POST['Casttime4'] != "" && $_POST['Text4'] != "" && $_POST['TextType4'] != "" && $_POST['SoundId4'] == "") ? "
- AddSpell(".$SpellID4.",".$Target4.",".$Chance4.",".$Cast4.",".$Cooldown4.");" : "")."
- }
- void AIUpdate()
- {\n"
- .(($_POST['Percent'] != "0" && $_POST['Percent1'] == "0") ? " if(_unit->GetHealthPct() ".$Percentage.")" : "").
- (($_POST['Percent'] == "0" && $_POST['Percent1'] != "0") ? " if(_unit->GetHealthPct() ".$Percentage1.")" : "")."
- {"
- .(($_POST['PerHeal'] != "Spell ID") ? " AddSpell(".$Heal.", Target_Self,".$HealChance.",".$HealCasttime.",".$HealCooldown.");" : "")
- .(($_POST['PerHeal'] == "Spell ID" && $_POST['PerCastime'] == "" && $_POST['PerChance'] == "" && $_POST['PerCoolDown'] == "") ? "" : "")
- .(($_POST['PerCast'] != "Spell ID") ? " AddSpell(".$Cast.",".$CastTarget.",".$CastChance.",".$CastCasttime.",".$CastCooldown.");" : "")
- .(($_POST['PerCast'] == "Spell ID" && $_POST['PerTarget'] == "Target_Current" && $_POST['PerCastime1'] == "" && $_POST['PerCoolDown1'] == "" && $_POST['PerChance1']) ? "" : "")."
- }
- }";
- if($_POST['filename'] == "")
- {
- echo "File Name cannot be empty! <br /> <br />";
- }
- else if($_POST['NpcID'] == "")
- {
- echo "NPCID cannot be empty! <br /> <br />";
- }
- else if($_POST['Classname'] == "")
- {
- echo "Classname cannot be empty! <br /> <br />";
- }
- else if($_POST['Percent'] != "0" && $_POST['Percent1'] != "0")
- {
- 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 />";
- }
- else if($_POST['PerHeal'] != "Spell ID" && $_POST['PerCastime'] == "" && $_POST['PerChance'] == "" && $_POST['PerCoolDown'] == "")
- {
- echo "You must fill out the rest of your boxes under ".chr(34)."Heal".chr(34)."!";
- }
- else
- {
- // MySql
- //mysql_connect("localhost","tommy_wp","XIW*@!awd1L") or die(mysql_error());
- //mysql_select_db("tommy_conagenerate") or die(mysql_error());
- //$result = mysql_query("INSERT INTO creations VALUES('', 'http://tommy.faded.me/Conagenerate/ArcEmu/CreatureAI/".$_POST['filename'].".cpp','".$_POST['filename']."','ArcEmu');") or die (mysql_error());
- //mysql_fetch_array($result);
- // Saving the file
- $Save = fopen($file, 'a');
- $saving = $content;
- // Writing
- fwrite($Save, $content);
- // Close
- fclose($Save);
- // Then make the member download it
- @header("Pragma: public");
- @header("Expires: 0");
- @header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
- @header("Content-Type: application/octet-stream");
- @header("Content-Disposition: attachment; filename=\"$file\"");
- @header("Content-Description: File Transfert");
- @readfile($file);
- }
- /* End Content */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement