View Single Post
  #16  
Old 10-03-2007, 12:33 PM
Lalolyen
Banned
 
Join Date: Aug 2007
Location: Sneeking up behind a admin IRL
Posts: 169
Default

spsst!

Code:
function edititem
	(
	$id,
	$name,
	$lore,
	$idfile,
	$ac,
	$hp,
	$mana,
	$endur,
	$str,
	$sta,
	$agi,
	$dex,
	$cha,
	$int,
	$wis,
	$cr,
	$dr,
	$fr,
	$mr,
	$pr,
	$damage,
	$delay,
	$range,
	$reqlevel,
	$reclevel,
	$price,
	$clicktype,
	$clickeffect,
	$clicklevel,
	$clicklevel2,
	$stackable,
	$stacksize,
	$loregroup,
	$classes,
	$deity,
	$races,
	$nodrop,
	$bookid,
	$bookfilename,
	$proctype,
	$proceffect,
	$proclevel,
	$proclevel2,
	$worntype,
	$worneffect,
	$wornlevel,
	$wornlevel2,
	$regen,
	$manaregen,
	$focustype,
	$focuseffect,
	$focuslevel,
	$focuslevel2,
	$haste,
	$itemtype,
	$casttime,
	$icon,
	$slotcharm,
	$slotear1,
	$slothead,
	$slotface,
	$slotear2,
	$slotneck,
	$slotshoulder,
	$slotarms,
	$slotback,
	$slotbracer1,
	$slotbracer2,
	$slotrange,
	$slothands,
	$slotprimary,
	$slotsecondary,
	$slotring1,
	$slotring2,
	$slotchest,
	$slotlegs,
	$slotfeet,
	$slotwaist,
	$slotammo,
	$warrior,
	$cleric,
	$paladin,
	$ranger,
	$shadowknight,
	$druid,
	$monk,
	$bard,
	$rogue,
	$shaman,
	$necromancer,
	$wizard,
	$magician,
	$enchanter,
	$beastlord,
	$berserker,
	$human,
	$barbarian,
	$erudite,
	$woodelf,
	$highelf,
	$darkelf,
	$halfelf,
	$dwarf,
	$troll,
	$ogre,
	$halfling,
	$gnome,
	$iksar,
	$vahshir,
	$froglok,
	$deity1,
	$deity2,
	$deity3,
	$deity4,
	$deity5,
	$deity6,
	$deity7,
	$deity8,
	$deity9,
	$deity10,
	$deity11,
	$deity12,
	$deity13,
	$deity14,
	$deity15,
	$deity16,
	$deity17,
	$magic,
	$artifactflag,
	$norent,
	$procrate
	)

{

	if ($slotcharm == "on") { $slotcharm = 1; } else { $slotcharm = 0; };
	if ($slotear1 == "on") { $slotear1 = 1; } else { $slotear1 = 0; };
        if ($slothead == "on") { $slothead = 1; } else { $slothead = 0; };
        if ($slotface == "on") { $slotface = 1; } else { $slotface = 0; };
        if ($slotear2 == "on") { $slotear2 = 1; } else { $slotear2 = 0; };
        if ($slotneck == "on") { $slotneck = 1; } else { $slotneck = 0; };
        if ($slotshoulder == "on") { $slotshoulder = 1; } else { $slotshoulder = 0; };
        if ($slotarms == "on") { $slotarms = 1; } else { $slotarms = 0; };
        if ($slotback == "on") { $slotback = 1; } else { $slotback = 0; };
        if ($slotbracer1 == "on") { $slotbracer1 = 1; } else { $slotbracer1 = 0; };
        if ($slotbracer2 == "on") { $slotbracer2 = 1; } else { $slotbracer2 = 0; };
        if ($slotrange == "on") { $slotrange = 1; } else { $slotrange = 0; };
        if ($slothands == "on") { $slothands = 1; } else { $slothands = 0; };
        if ($slotprimary == "on") { $slotprimary = 1; } else { $slotprimary = 0; };
        if ($slotsecondary == "on") { $slotsecondary = 1; } else { $slotsecondary = 0; };
        if ($slotring1 == "on") { $slotring1 = 1; } else { $slotring1 = 0; };
        if ($slotring2 == "on") { $slotring2 = 1; } else { $slotring2 = 0; };
        if ($slotchest == "on") { $slotchest = 1; } else { $slotchest = 0; };
        if ($slotlegs == "on") { $slotlegs = 1; } else { $slotlegs = 0; };
        if ($slotfeet == "on") { $slotfeet = 1; } else { $slotfeet = 0; };
        if ($slotwaist == "on") { $slotwaist = 1; } else { $slotwaist = 0; };
        if ($slotammo == "on") { $slotammo = 1; } else { $slotammo = 0; };
Can be trimmed down to:

Code:
function edititem($postitem,$value)
{
if ($value == "on")
   {
   $ret_val = 1;
   } else {
   $ret_val = 0;
   }
$postitem = $ret_val;
return $postitem;
}

Last edited by Lalolyen; 10-03-2007 at 08:37 PM..
Reply With Quote