diff --git a/config/application.php b/config/application.php index 6ab595e1..fb72cf31 100644 --- a/config/application.php +++ b/config/application.php @@ -407,6 +407,13 @@ array('module' => 'guild', 'action' => 'emblem') ), + // Card0 special flag. Older rAthena the values are 254,255,-256 + 'ItemSpecial' => array( + 'forge' => 0x00FF, + 'create' => 0x00FE, + 'pet' => 0x0100, + ), + // Job classes, loaded from another file to avoid cluttering this one. // There isn't normally a need to modify this file, unless it's been // modified in an update. (In English: DON'T TOUCH THIS.) diff --git a/lib/Flux.php b/lib/Flux.php index 329dc1b3..f1eb75c6 100644 --- a/lib/Flux.php +++ b/lib/Flux.php @@ -934,5 +934,19 @@ public static function monsterSizeName($size) $size = Flux::config("MonsterSizes.$size"); return $size; } + + /** + * Check if item is special + * @param $item Item object fetched from table + * @return True if item's card0 is special, false otherwise + */ + public static function itemIsSpecial($item) { + $special = Flux::config('ItemSpecial'); + if (!$special) + return false; + if ($item->card0 && ($item->card0 == $special->get('forge') || $item->card0 == $special->get('create') || $item->card0 == $special->get('pet'))) + return true; + return false; + } } ?> diff --git a/lib/Flux/Template.php b/lib/Flux/Template.php index fadfd78b..a3324bf4 100644 --- a/lib/Flux/Template.php +++ b/lib/Flux/Template.php @@ -165,6 +165,21 @@ class Flux_Template { protected $urlWithQs; protected $urlWithQS; // compatibility. + /** + * CARD0_FORGE value for checking + */ + protected $itemIsForged; + + /** + * CARD0_CREATE value for checking + */ + protected $itemIsCreation; + + /** + * CARD0_PET value for checking + */ + protected $itemIsPetEgg; + /** * Module/action for missing action's event. * @@ -228,6 +243,11 @@ public function __construct(Flux_Config $config) $this->missingViewModuleAction = $config->get('missingViewModuleAction', false); $this->referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + $special = Flux::config('ItemSpecial'); + $this->itemIsForged = $special->get('forge'); + $this->itemIsCreation = $special->get('create'); + $this->itemIsPetEgg = $special->get('pet'); + // Read manifest file if exists if (file_exists($this->themePath.'/'.$this->themeName.'/manifest.php')) { $manifest = include($this->themePath.'/'.$this->themeName.'/manifest.php');