Name | Type | is_array | initial_value |
Destructable | destructable | No |
//TESH.scrollpos=4
//TESH.alwaysfold=0
/*This system is the most efficient way to detect whether or not a destructable is a tree.
The only downside to this, is that you must save every tree ID into the hashtable.
To do so do the following:
Go to object editor and find your tree. Press CTR+D. Now take the first four characters
before the name.
Example:
ATtr (Ashenvale Tree Wall)
Take ATtr and put it into the apostrophes
call SaveBoolean(h,'HERE',0,true)
So the result would be:
call SaveBoolean(h,'ATtr',0,true//And for organization purposes, you may put the name here.
IsDestructableTree takes destructable returns boolean
IsDestructableTypeTree takes destructabletype/ID/Integer returns boolean
*/
library IsDestructableTree initializer init
globals
private hashtable h=InitHashtable()
endglobals
private function init takes nothing returns nothing
call SaveBoolean(h,'ATtr',0,true)//Ashenvale Tree Wall
call SaveBoolean(h,'BTtw',0,true)//Barrens Tree Wall
call SaveBoolean(h,'KTtw',0,true)//Black Citadel Tree Wall
call SaveBoolean(h,'YTft',0,true)//Cityscape Fall Tree Wall
call SaveBoolean(h,'JTct',0,true)//Cityscape Ruined Tree Wall
call SaveBoolean(h,'YTst',0,true)//Cityscape Snowy Tree Wall
call SaveBoolean(h,'YTct',0,true)//Cityscape Summer Tree Wall
call SaveBoolean(h,'YTwt',0,true)//Cityscape Winter Tree Wall
call SaveBoolean(h,'Jtwt',0,true)//Dalaran Ruins Tree Wall
call SaveBoolean(h,'DTsh',0,true)//Dungeon Tree Wall
call SaveBoolean(h,'FTtw',0,true)//Fall Tree Wall
call SaveBoolean(h,'CTtr',0,true)//Felwood Tree Wall
call SaveBoolean(h,'ITtw',0,true)//Icecrown Tree Wall
call SaveBoolean(h,'NTtw',0,true)//Northrend Tree Wall
call SaveBoolean(h,'OTtw',0,true)//Outland Tree Wall
call SaveBoolean(h,'ZTtw',0,true)//Ruins Tree Wall
call SaveBoolean(h,'WTst',0,true)//Snowy Tree Wall
call SaveBoolean(h,'LTlt',0,true)//Summer Tree Wall
call SaveBoolean(h,'GTsh',0,true)//Underground Tree Wall
call SaveBoolean(h,'VTlt',0,true)//Village Tree Wall
call SaveBoolean(h,'WTtw',0,true)//Winter Tree Wall
call SaveBoolean(h,'ATtc',0,true)//Ashenvale Canopy Tree
call SaveBoolean(h,'BTtc',0,true)//Barrens Canopy Tree
call SaveBoolean(h,'CTtc',0,true)//Felwood Canopy Tree
call SaveBoolean(h,'ITtc',0,true)//Icecrown Canopy Tree
call SaveBoolean(h,'NTtc',0,true)//Northrend Canopy Tree
call SaveBoolean(h,'ZTtc',0,true)//Ruins Canopy Tree
endfunction
function IsDestructableTree takes destructable d returns boolean
return LoadBoolean(h,GetDestructableTypeId(d),0)
endfunction
function IsDestructableTypeTree takes integer i returns boolean
return LoadBoolean(h,i,0)
endfunction
endlibrary