diff --git a/MonsterHitDice5e/MonsterHitDice5e.js b/MonsterHitDice5e/MonsterHitDice5e.js index f73560ffe6..51498c94bb 100644 --- a/MonsterHitDice5e/MonsterHitDice5e.js +++ b/MonsterHitDice5e/MonsterHitDice5e.js @@ -1,52 +1,7 @@ -// Github: https://github.com/shdwjk/Roll20API/blob/master/MonsterHitDice/MonsterHitDice5e.js +// Github: https://github.com/shdwjk/Roll20API/blob/master/MonsterHitDice5e/MonsterHitDice5e.js // By: The Aaron, Arcane Scriptomancer // Contact: https://app.roll20.net/users/104025/the-aaron -on('ready', function(){ - on('add:graphic',function(obj){ - if( - 'graphic' == obj.get('type') - && 'token' == obj.get('subtype') - && '' != obj.get('represents') - ) - { - setTimeout(_.bind(function(id){ - var obj=getObj('graphic',id) - - if( - undefined != obj - && '' == obj.get('bar2_link') - ) - { - var attrib = findObjs({ - _type: 'attribute', - _characterid:obj.get('represents'), - name: 'npc_HP_hit_dice' - }) - if( attrib.length ) - { - sendChat('','/r '+attrib[0].get('current'),function(r){ - var hp=0; - _.each(r,function(subr){ - var val=JSON.parse(subr.content); - if(_.has(val,'total')) - { - hp+=val.total; - } - }); - obj.set({ - bar2_value: hp, - bar2_max: hp - }) - }); - } - } - - },this,obj.id), 100); - } - }); -});/ GIST: https://gist.github.com/shdwjk/7377de58100f4e813432 - on('ready', function(){ on('add:graphic',function(obj){ if( diff --git a/MonsterHitDice5e/package.json b/MonsterHitDice5e/package.json index 001d7c5132..a4ea51e550 100644 --- a/MonsterHitDice5e/package.json +++ b/MonsterHitDice5e/package.json @@ -1,6 +1,6 @@ { "name": "MonsterHitDice5e", - "version": "0.1", + "version": "0.2", "description": "Set Monster hit dice on add, usually via drag from journal. Configured for Dungeons and Dragons 5e Character Sheet", "authors": "The Aaron", "roll20userid": "104025",