Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local HealthPoint = {}
- local pNPC = loadSharedAPI("pnpc")
- local graphX = loadSharedAPI("graphX")
- local colliders = loadSharedAPI("colliders")
- function HealthPoint.onInitAPI() --Is called when the api is loaded by loadAPI.
- registerEvent(HealthPoint, "onLoop", "assign", true) --Register the loop event
- registerEvent(HealthPoint, "onNPCKill", "onNPCKill", true) --Register the damage event
- end
- -- Health --
- -- Change these values corresponding to the id inside the [] to change the enemy's health --
- HealthPoint.npcHealth = {}
- HealthPoint.npcHealth[1] = 5
- HealthPoint.npcHealth[2] = 3
- HealthPoint.npcHealth[3] = 3
- HealthPoint.npcHealth[8] = 3
- HealthPoint.npcHealth[17] = 3
- HealthPoint.npcHealth[18] = 3
- HealthPoint.npcHealth[27] = 3
- HealthPoint.npcHealth[28] = 3
- HealthPoint.npcHealth[29] = 3
- HealthPoint.npcHealth[47] = 3
- HealthPoint.npcHealth[50] = 3
- HealthPoint.npcHealth[51] = 3
- HealthPoint.npcHealth[52] = 3
- HealthPoint.npcHealth[55] = 3
- HealthPoint.npcHealth[71] = 3
- HealthPoint.npcHealth[77] = 3
- HealthPoint.npcHealth[89] = 3
- HealthPoint.npcHealth[93] = 3
- HealthPoint.npcHealth[117] = 3
- HealthPoint.npcHealth[118] = 3
- HealthPoint.npcHealth[119] = 3
- HealthPoint.npcHealth[120] = 3
- HealthPoint.npcHealth[125] = 3
- HealthPoint.npcHealth[126] = 3
- HealthPoint.npcHealth[127] = 3
- HealthPoint.npcHealth[128] = 3
- HealthPoint.npcHealth[162] = 3
- HealthPoint.npcHealth[163] = 3
- HealthPoint.npcHealth[203] = 3
- HealthPoint.npcHealth[204] = 3
- HealthPoint.npcHealth[205] = 3
- HealthPoint.npcHealth[232] = 3
- HealthPoint.npcHealth[233] = 3
- HealthPoint.npcHealth[234] = 3
- HealthPoint.npcHealth[235] = 3
- HealthPoint.npcHealth[236] = 3
- HealthPoint.npcHealth[242] = 3
- HealthPoint.npcHealth[243] = 3
- HealthPoint.npcHealth[245] = 3
- HealthPoint.npcHealth[270] = 3
- HealthPoint.npcHealth[271] = 3
- HealthPoint.npcHealth[275] = 3
- -- Jump Damage --
- HealthPoint.jumpDamage = {}
- HealthPoint.jumpDamage[1] = 1
- HealthPoint.jumpDamage[2] = 1
- HealthPoint.jumpDamage[3] = 1
- HealthPoint.jumpDamage[8] = 1
- HealthPoint.jumpDamage[17] = 1
- HealthPoint.jumpDamage[18] = 1
- HealthPoint.jumpDamage[27] = 1
- HealthPoint.jumpDamage[28] = 1
- HealthPoint.jumpDamage[29] = 1
- HealthPoint.jumpDamage[47] = 1
- HealthPoint.jumpDamage[50] = 1
- HealthPoint.jumpDamage[51] = 1
- HealthPoint.jumpDamage[52] = 1
- HealthPoint.jumpDamage[55] = 1
- HealthPoint.jumpDamage[71] = 1
- HealthPoint.jumpDamage[77] = 1
- HealthPoint.jumpDamage[89] = 1
- HealthPoint.jumpDamage[93] = 1
- HealthPoint.jumpDamage[117] = 1
- HealthPoint.jumpDamage[118] = 1
- HealthPoint.jumpDamage[119] = 1
- HealthPoint.jumpDamage[120] = 1
- HealthPoint.jumpDamage[125] = 1
- HealthPoint.jumpDamage[126] = 1
- HealthPoint.jumpDamage[127] = 1
- HealthPoint.jumpDamage[128] = 1
- HealthPoint.jumpDamage[162] = 1
- HealthPoint.jumpDamage[163] = 1
- HealthPoint.jumpDamage[203] = 1
- HealthPoint.jumpDamage[204] = 1
- HealthPoint.jumpDamage[205] = 1
- HealthPoint.jumpDamage[232] = 1
- HealthPoint.jumpDamage[233] = 1
- HealthPoint.jumpDamage[234] = 1
- HealthPoint.jumpDamage[235] = 1
- HealthPoint.jumpDamage[236] = 1
- HealthPoint.jumpDamage[242] = 1
- HealthPoint.jumpDamage[243] = 1
- HealthPoint.jumpDamage[245] = 1
- HealthPoint.jumpDamage[270] = 1
- HealthPoint.jumpDamage[271] = 1
- HealthPoint.jumpDamage[275] = 1
- -- Spinjump Damage --
- HealthPoint.spinjumpDamage = {}
- HealthPoint.spinjumpDamage[1] = 1
- HealthPoint.spinjumpDamage[2] = 1
- HealthPoint.spinjumpDamage[3] = 1
- HealthPoint.spinjumpDamage[8] = 1
- HealthPoint.spinjumpDamage[17] = 1
- HealthPoint.spinjumpDamage[18] = 1
- HealthPoint.spinjumpDamage[27] = 1
- HealthPoint.spinjumpDamage[28] = 1
- HealthPoint.spinjumpDamage[29] = 1
- HealthPoint.spinjumpDamage[47] = 1
- HealthPoint.spinjumpDamage[50] = 1
- HealthPoint.spinjumpDamage[51] = 1
- HealthPoint.spinjumpDamage[52] = 1
- HealthPoint.spinjumpDamage[55] = 1
- HealthPoint.spinjumpDamage[71] = 1
- HealthPoint.spinjumpDamage[77] = 1
- HealthPoint.spinjumpDamage[89] = 1
- HealthPoint.spinjumpDamage[93] = 1
- HealthPoint.spinjumpDamage[117] = 1
- HealthPoint.spinjumpDamage[118] = 1
- HealthPoint.spinjumpDamage[119] = 1
- HealthPoint.spinjumpDamage[120] = 1
- HealthPoint.spinjumpDamage[125] = 1
- HealthPoint.spinjumpDamage[126] = 1
- HealthPoint.spinjumpDamage[127] = 1
- HealthPoint.spinjumpDamage[128] = 1
- HealthPoint.spinjumpDamage[162] = 1
- HealthPoint.spinjumpDamage[163] = 1
- HealthPoint.spinjumpDamage[203] = 1
- HealthPoint.spinjumpDamage[204] = 1
- HealthPoint.spinjumpDamage[205] = 1
- HealthPoint.spinjumpDamage[232] = 1
- HealthPoint.spinjumpDamage[233] = 1
- HealthPoint.spinjumpDamage[234] = 1
- HealthPoint.spinjumpDamage[235] = 1
- HealthPoint.spinjumpDamage[236] = 1
- HealthPoint.spinjumpDamage[242] = 1
- HealthPoint.spinjumpDamage[243] = 1
- HealthPoint.spinjumpDamage[245] = 1
- HealthPoint.spinjumpDamage[270] = 1
- HealthPoint.spinjumpDamage[271] = 1
- HealthPoint.spinjumpDamage[275] = 1
- -- Fireball Damage --
- HealthPoint.fireballDamage = {}
- HealthPoint.fireballDamage[1] = -1
- HealthPoint.fireballDamage[2] = 1
- HealthPoint.fireballDamage[3] = 1
- HealthPoint.fireballDamage[8] = 1
- HealthPoint.fireballDamage[17] = 1
- HealthPoint.fireballDamage[18] = 1
- HealthPoint.fireballDamage[27] = 1
- HealthPoint.fireballDamage[28] = 1
- HealthPoint.fireballDamage[29] = 1
- HealthPoint.fireballDamage[47] = 1
- HealthPoint.fireballDamage[50] = 1
- HealthPoint.fireballDamage[51] = 1
- HealthPoint.fireballDamage[52] = 1
- HealthPoint.fireballDamage[55] = 1
- HealthPoint.fireballDamage[71] = 1
- HealthPoint.fireballDamage[77] = 1
- HealthPoint.fireballDamage[89] = 1
- HealthPoint.fireballDamage[93] = 1
- HealthPoint.fireballDamage[117] = 1
- HealthPoint.fireballDamage[118] = 1
- HealthPoint.fireballDamage[119] = 1
- HealthPoint.fireballDamage[120] = 1
- HealthPoint.fireballDamage[125] = 1
- HealthPoint.fireballDamage[126] = 1
- HealthPoint.fireballDamage[127] = 1
- HealthPoint.fireballDamage[128] = 1
- HealthPoint.fireballDamage[162] = 1
- HealthPoint.fireballDamage[163] = 1
- HealthPoint.fireballDamage[203] = 1
- HealthPoint.fireballDamage[204] = 1
- HealthPoint.fireballDamage[205] = 1
- HealthPoint.fireballDamage[232] = 1
- HealthPoint.fireballDamage[233] = 1
- HealthPoint.fireballDamage[234] = 1
- HealthPoint.fireballDamage[235] = 1
- HealthPoint.fireballDamage[236] = 1
- HealthPoint.fireballDamage[242] = 1
- HealthPoint.fireballDamage[243] = 1
- HealthPoint.fireballDamage[245] = 1
- HealthPoint.fireballDamage[270] = 1
- HealthPoint.fireballDamage[271] = 1
- HealthPoint.fireballDamage[275] = 1
- -- Hammer Damage --
- HealthPoint.hammerDamage = {}
- HealthPoint.hammerDamage[1] = 2
- HealthPoint.hammerDamage[2] = 1
- HealthPoint.hammerDamage[3] = 1
- HealthPoint.hammerDamage[8] = 1
- HealthPoint.hammerDamage[17] = 1
- HealthPoint.hammerDamage[18] = 1
- HealthPoint.hammerDamage[27] = 1
- HealthPoint.hammerDamage[28] = 1
- HealthPoint.hammerDamage[29] = 1
- HealthPoint.hammerDamage[47] = 1
- HealthPoint.hammerDamage[50] = 1
- HealthPoint.hammerDamage[51] = 1
- HealthPoint.hammerDamage[52] = 1
- HealthPoint.hammerDamage[55] = 1
- HealthPoint.hammerDamage[71] = 1
- HealthPoint.hammerDamage[77] = 1
- HealthPoint.hammerDamage[89] = 1
- HealthPoint.hammerDamage[93] = 1
- HealthPoint.hammerDamage[117] = 1
- HealthPoint.hammerDamage[118] = 1
- HealthPoint.hammerDamage[119] = 1
- HealthPoint.hammerDamage[120] = 1
- HealthPoint.hammerDamage[125] = 1
- HealthPoint.hammerDamage[126] = 1
- HealthPoint.hammerDamage[127] = 1
- HealthPoint.hammerDamage[128] = 1
- HealthPoint.hammerDamage[162] = 1
- HealthPoint.hammerDamage[163] = 1
- HealthPoint.hammerDamage[203] = 1
- HealthPoint.hammerDamage[204] = 1
- HealthPoint.hammerDamage[205] = 1
- HealthPoint.hammerDamage[232] = 1
- HealthPoint.hammerDamage[233] = 1
- HealthPoint.hammerDamage[234] = 1
- HealthPoint.hammerDamage[235] = 1
- HealthPoint.hammerDamage[236] = 1
- HealthPoint.hammerDamage[242] = 1
- HealthPoint.hammerDamage[243] = 1
- HealthPoint.hammerDamage[245] = 1
- HealthPoint.hammerDamage[270] = 1
- HealthPoint.hammerDamage[271] = 1
- HealthPoint.hammerDamage[275] = 1
- -- Projectile Damage --
- HealthPoint.projectileDamage = {}
- HealthPoint.projectileDamage[1] = 1
- HealthPoint.projectileDamage[2] = 1
- HealthPoint.projectileDamage[3] = 1
- HealthPoint.projectileDamage[8] = 1
- HealthPoint.projectileDamage[17] = 1
- HealthPoint.projectileDamage[18] = 1
- HealthPoint.projectileDamage[27] = 1
- HealthPoint.projectileDamage[28] = 1
- HealthPoint.projectileDamage[29] = 1
- HealthPoint.projectileDamage[47] = 1
- HealthPoint.projectileDamage[50] = 1
- HealthPoint.projectileDamage[51] = 1
- HealthPoint.projectileDamage[52] = 1
- HealthPoint.projectileDamage[55] = 1
- HealthPoint.projectileDamage[71] = 1
- HealthPoint.projectileDamage[77] = 1
- HealthPoint.projectileDamage[89] = 1
- HealthPoint.projectileDamage[93] = 1
- HealthPoint.projectileDamage[117] = 1
- HealthPoint.projectileDamage[118] = 1
- HealthPoint.projectileDamage[119] = 1
- HealthPoint.projectileDamage[120] = 1
- HealthPoint.projectileDamage[125] = 1
- HealthPoint.projectileDamage[126] = 1
- HealthPoint.projectileDamage[127] = 1
- HealthPoint.projectileDamage[128] = 1
- HealthPoint.projectileDamage[162] = 1
- HealthPoint.projectileDamage[163] = 1
- HealthPoint.projectileDamage[203] = 1
- HealthPoint.projectileDamage[204] = 1
- HealthPoint.projectileDamage[205] = 1
- HealthPoint.projectileDamage[232] = 1
- HealthPoint.projectileDamage[233] = 1
- HealthPoint.projectileDamage[234] = 1
- HealthPoint.projectileDamage[235] = 1
- HealthPoint.projectileDamage[236] = 1
- HealthPoint.projectileDamage[242] = 1
- HealthPoint.projectileDamage[243] = 1
- HealthPoint.projectileDamage[245] = 1
- HealthPoint.projectileDamage[270] = 1
- HealthPoint.projectileDamage[271] = 1
- HealthPoint.projectileDamage[275] = 1
- -- Tail Damage --
- HealthPoint.tailDamage = {}
- HealthPoint.tailDamage[1] = 1
- HealthPoint.tailDamage[2] = 1
- HealthPoint.tailDamage[3] = 1
- HealthPoint.tailDamage[8] = 1
- HealthPoint.tailDamage[17] = 1
- HealthPoint.tailDamage[18] = 1
- HealthPoint.tailDamage[27] = 1
- HealthPoint.tailDamage[28] = 1
- HealthPoint.tailDamage[29] = 1
- HealthPoint.tailDamage[47] = 1
- HealthPoint.tailDamage[50] = 1
- HealthPoint.tailDamage[51] = 1
- HealthPoint.tailDamage[52] = 1
- HealthPoint.tailDamage[55] = 1
- HealthPoint.tailDamage[71] = 1
- HealthPoint.tailDamage[77] = 1
- HealthPoint.tailDamage[89] = 1
- HealthPoint.tailDamage[93] = 1
- HealthPoint.tailDamage[117] = 1
- HealthPoint.tailDamage[118] = 1
- HealthPoint.tailDamage[119] = 1
- HealthPoint.tailDamage[120] = 1
- HealthPoint.tailDamage[125] = 1
- HealthPoint.tailDamage[126] = 1
- HealthPoint.tailDamage[127] = 1
- HealthPoint.tailDamage[128] = 1
- HealthPoint.tailDamage[162] = 1
- HealthPoint.tailDamage[163] = 1
- HealthPoint.tailDamage[203] = 1
- HealthPoint.tailDamage[204] = 1
- HealthPoint.tailDamage[205] = 1
- HealthPoint.tailDamage[232] = 1
- HealthPoint.tailDamage[233] = 1
- HealthPoint.tailDamage[234] = 1
- HealthPoint.tailDamage[235] = 1
- HealthPoint.tailDamage[236] = 1
- HealthPoint.tailDamage[242] = 1
- HealthPoint.tailDamage[243] = 1
- HealthPoint.tailDamage[245] = 1
- HealthPoint.tailDamage[270] = 1
- HealthPoint.tailDamage[271] = 1
- HealthPoint.tailDamage[275] = 1
- -- Link Attack Damage --
- HealthPoint.linkDamage = {}
- HealthPoint.linkDamage[1] = 1
- HealthPoint.linkDamage[2] = 1
- HealthPoint.linkDamage[3] = 1
- HealthPoint.linkDamage[8] = 1
- HealthPoint.linkDamage[17] = 1
- HealthPoint.linkDamage[18] = 1
- HealthPoint.linkDamage[27] = 1
- HealthPoint.linkDamage[28] = 1
- HealthPoint.linkDamage[29] = 1
- HealthPoint.linkDamage[47] = 1
- HealthPoint.linkDamage[50] = 1
- HealthPoint.linkDamage[51] = 1
- HealthPoint.linkDamage[52] = 1
- HealthPoint.linkDamage[55] = 1
- HealthPoint.linkDamage[71] = 1
- HealthPoint.linkDamage[77] = 1
- HealthPoint.linkDamage[89] = 1
- HealthPoint.linkDamage[93] = 1
- HealthPoint.linkDamage[117] = 1
- HealthPoint.linkDamage[118] = 1
- HealthPoint.linkDamage[119] = 1
- HealthPoint.linkDamage[120] = 1
- HealthPoint.linkDamage[125] = 1
- HealthPoint.linkDamage[126] = 1
- HealthPoint.linkDamage[127] = 1
- HealthPoint.linkDamage[128] = 1
- HealthPoint.linkDamage[162] = 1
- HealthPoint.linkDamage[163] = 1
- HealthPoint.linkDamage[203] = 1
- HealthPoint.linkDamage[204] = 1
- HealthPoint.linkDamage[205] = 1
- HealthPoint.linkDamage[232] = 1
- HealthPoint.linkDamage[233] = 1
- HealthPoint.linkDamage[234] = 1
- HealthPoint.linkDamage[235] = 1
- HealthPoint.linkDamage[236] = 1
- HealthPoint.linkDamage[242] = 1
- HealthPoint.linkDamage[243] = 1
- HealthPoint.linkDamage[245] = 1
- HealthPoint.linkDamage[270] = 1
- HealthPoint.linkDamage[271] = 1
- HealthPoint.linkDamage[275] = 1
- -- Thrown Damage --
- HealthPoint.thrownDamage = {}
- HealthPoint.thrownDamage[1] = 1
- HealthPoint.thrownDamage[2] = 1
- HealthPoint.thrownDamage[3] = 1
- HealthPoint.thrownDamage[8] = 1
- HealthPoint.thrownDamage[17] = 1
- HealthPoint.thrownDamage[18] = 1
- HealthPoint.thrownDamage[27] = 1
- HealthPoint.thrownDamage[28] = 1
- HealthPoint.thrownDamage[29] = 1
- HealthPoint.thrownDamage[47] = 1
- HealthPoint.thrownDamage[50] = 1
- HealthPoint.thrownDamage[51] = 1
- HealthPoint.thrownDamage[52] = 1
- HealthPoint.thrownDamage[55] = 1
- HealthPoint.thrownDamage[71] = 1
- HealthPoint.thrownDamage[77] = 1
- HealthPoint.thrownDamage[89] = 1
- HealthPoint.thrownDamage[93] = 1
- HealthPoint.thrownDamage[117] = 1
- HealthPoint.thrownDamage[118] = 1
- HealthPoint.thrownDamage[119] = 1
- HealthPoint.thrownDamage[120] = 1
- HealthPoint.thrownDamage[125] = 1
- HealthPoint.thrownDamage[126] = 1
- HealthPoint.thrownDamage[127] = 1
- HealthPoint.thrownDamage[128] = 1
- HealthPoint.thrownDamage[162] = 1
- HealthPoint.thrownDamage[163] = 1
- HealthPoint.thrownDamage[203] = 1
- HealthPoint.thrownDamage[204] = 1
- HealthPoint.thrownDamage[205] = 1
- HealthPoint.thrownDamage[232] = 1
- HealthPoint.thrownDamage[233] = 1
- HealthPoint.thrownDamage[234] = 1
- HealthPoint.thrownDamage[235] = 1
- HealthPoint.thrownDamage[236] = 1
- HealthPoint.thrownDamage[242] = 1
- HealthPoint.thrownDamage[243] = 1
- HealthPoint.thrownDamage[245] = 1
- HealthPoint.thrownDamage[270] = 1
- HealthPoint.thrownDamage[271] = 1
- HealthPoint.thrownDamage[275] = 1
- ----------------------------------------------------------------------------------------------
- --- THE ACTUAL CODE STUFF ---
- ----------------------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------------------
- --- DAMAGE INPUT ---
- ----------------------------------------------------------------------------------------------
- function HealthPoint.onNPCKill(eventObj, killedNPC, killReason)
- if HealthPoint.npcHealth[killedNPC.id] ~= nil then
- local wrappedNPC = pNPC.wrap(killedNPC)
- if wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.jumpDamage[wrappedNPC.id] and killReason == 1 then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.jumpDamage[wrappedNPC.id]
- playSFX(2)
- elseif wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.fireballDamage[wrappedNPC.id] and killReason == 3 and fire then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.fireballDamage[wrappedNPC.id]
- playSFX(3)
- elseif wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.hammerDamage[wrappedNPC.id] and killReason == 3 and hammer then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.hammerDamage[wrappedNPC.id]
- playSFX(3)
- elseif wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.projectileDamage[wrappedNPC.id] and killReason == 3 and shell then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.projectileDamage[wrappedNPC.id]
- playSFX(3)
- elseif wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.thrownDamage[wrappedNPC.id] and (killReason == 4 or killReason == 5) then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.thrownDamage[wrappedNPC.id]
- elseif wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.tailDamage[wrappedNPC.id] and killReason == 7 then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.tailDamage[wrappedNPC.id]
- playSFX(3)
- elseif wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.spinjumpDamage[wrappedNPC.id] and killReason == 8 then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.spinjumpDamage[wrappedNPC.id]
- playSFX(36)
- elseif wrappedNPC.data.hit > 1 and wrappedNPC.data.hit > HealthPoint.linkDamage[wrappedNPC.id] and killReason == 10 then
- eventObj.cancelled = true
- wrappedNPC:mem(0x156, FIELD_WORD, 20)
- wrappedNPC.data.hit = wrappedNPC.data.hit - HealthPoint.linkDamage[wrappedNPC.id]
- playSFX(89)
- end
- end
- end
- ----------------------------------------------------------------------------------------------
- --- HEALTH ASSIGNMENT ---
- ----------------------------------------------------------------------------------------------
- function HealthPoint.assign()
- for k,v in pairs(NPC.get()) do
- local n = pNPC.wrap(v);
- if n.data.hit == nil then
- if HealthPoint.npcHealth[n.id] ~= nil then
- n.data.hit = HealthPoint.npcHealth[n.id]
- end
- end
- if n.data.hp == nil then
- if HealthPoint.npcHealth[n.id] ~= nil then
- n.data.hp = HealthPoint.npcHealth[n.id]
- end
- end
- if n.data.hpmax == nil then
- if HealthPoint.npcHealth[n.id] ~= nil then
- n.data.hpmax = HealthPoint.npcHealth[n.id]
- end
- end
- if n ~= nil and HealthPoint.healthbar then
- if n:mem(0x12A, FIELD_WORD) ~= 0 and n.data.hp ~= nil then
- graphX.boxLevel (n.x-8,n.y-6, 32, 8, 0xFFFFFFF55)
- graphX.boxLevel (n.x-7,n.y-5, 30, 6, 0x00000055)
- graphX.boxLevel (n.x-7,n.y-5, n.data.hp/n.data.hpmax*30, 6, 0xFFF05BFF)
- graphX.boxLevel (n.x-7,n.y-5, n.data.hit/n.data.hpmax*30, 6, 0xF61818FF)
- end
- end
- if colliders.collideNPC(n.id, 13) then
- fire = true
- hammer = false
- shell = false
- elseif colliders.collideNPC(n.id, 171) then
- hammer = true
- fire = false
- shell = false
- else
- shell = true
- hammer = false
- fire = false
- end
- if n.data.hp ~= nil then
- if n.data.hp > n.data.hit then
- n.data.hp = n.data.hp -0.02
- end
- if n.data.hit > n.data.hpmax then
- n.data.hit = n.data.hpmax
- end
- end
- end
- end
- return HealthPoint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement