Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2795e8c
Optimization Pass
MalefactorIX May 15, 2020
55e9a73
Create LBH-AG v1.2.3.lsl
MalefactorIX May 15, 2020
965973e
Fixed missing " and deprecate variables
MalefactorIX May 16, 2020
664968b
Reverted unintended edit
MalefactorIX May 16, 2020
fcf509c
Reeeee healing
MalefactorIX May 17, 2020
59ad9d2
Fixed conflict with scripts that look for LBA.V.L
MalefactorIX May 17, 2020
2204568
Update and rename LBHD, Directional Armor v1.2.4.lsl to LBHD, Directi…
MalefactorIX May 17, 2020
c65fd68
v1.3 'Fixed-Location' Update
MalefactorIX May 19, 2020
e0e0515
Create LBHD+HD, v1.3.0.lsl
MalefactorIX May 19, 2020
022eb35
Rename LBHD+HD, v1.3.0.lsl to LBHD+AG, v1.3.0.lsl
MalefactorIX May 19, 2020
c4492bb
Fixed desc conflict with certain weapons
MalefactorIX May 21, 2020
da4b61b
Fixed desc conflict for certain weapons
MalefactorIX May 21, 2020
ef393d7
Minor tweak to previous change to keep in theme
MalefactorIX May 21, 2020
579fedc
Rename LBH-AG v1.2.3.lsl to LBH-AG v1.2.4.lsl
MalefactorIX May 21, 2020
b4f15c1
Streamlined 'fixed-location' method
MalefactorIX May 23, 2020
fcfaedf
Updated 'fixed-location' method
MalefactorIX May 23, 2020
d6d4267
Oops
MalefactorIX May 29, 2020
f4f0389
Oops
MalefactorIX May 29, 2020
22dc446
Rename LBHD+AG, v1.3.1.lsl to LBHD+AG, v1.3.2.lsl
MalefactorIX May 29, 2020
d5d2e36
Rename LBHD, Directional Armor v1.3.1.lsl to LBHD, Directional Armor …
MalefactorIX May 29, 2020
b1a7061
Version fix
MalefactorIX Jun 2, 2020
19f6d77
Fix for raycast modifier triggers
MalefactorIX Jun 5, 2020
e64c8c6
Raycast fix, more data for owner when damaged
MalefactorIX Jun 5, 2020
f10b30c
Forced LoS on RC Fix
MalefactorIX Jun 5, 2020
3963132
Rename LBHD+AG, v1.3.4.lsl to LBHD+AG, v1.3.5.lsl
MalefactorIX Jun 5, 2020
77028c7
Forced LoS on RC Fix
MalefactorIX Jun 5, 2020
aa63ff9
woops
MalefactorIX Jun 5, 2020
a6e87aa
Text cleanup
MalefactorIX Jun 5, 2020
725bc76
Increased information given to owner when damaged
MalefactorIX Jun 5, 2020
1784acb
Rename LBH Slim v1.2.4.lsl to LBH/LBH Slim v1.2.4.lsl
MalefactorIX Jun 7, 2020
2c0cd3d
Rename LBH-AG v1.2.4.lsl to LBH/LBH-AG v1.2.4.lsl
MalefactorIX Jun 7, 2020
1d70df3
Rename LBHD+AG, v1.3.5.lsl to LBH/LBHD+AG, v1.3.5.lsl
MalefactorIX Jun 7, 2020
cdb3edf
Rename LBHD, Directional Armor v1.3.5.lsl to LBH/LBHD, Directional Ar…
MalefactorIX Jun 7, 2020
f0880c1
Rename LBHD+AG, v1.3.5.lsl to LBHD+AG, Directional Armorv1.3.5.lsl
MalefactorIX Jun 7, 2020
6ff3f36
Rename LBHD+AG, Directional Armorv1.3.5.lsl to LBHD+AG, Directional A…
MalefactorIX Jun 7, 2020
4660f14
Merged LBAPOS and COLLISIONMOD
MalefactorIX Jun 9, 2020
066cd11
Merged LBAPOS and COLLISIONMOD
MalefactorIX Jun 9, 2020
e498a4c
Rename LBHD+AG, Directional Armor v1.3.5.lsl to LBHD+AG, Directional …
MalefactorIX Jun 9, 2020
ce85171
Create LBHD-Component, v1.3.6.lsl
MalefactorIX Jun 9, 2020
f5f2005
Create README.md
MalefactorIX Jun 9, 2020
b86b4b5
Update README.md
MalefactorIX Jun 9, 2020
be7b0a5
Update README.md
MalefactorIX Jun 9, 2020
f123b83
Update LBHD+AG, Directional Armor v1.3.6.lsl
MalefactorIX Jun 9, 2020
5ee0423
Update LBHD, Directional Armor v1.3.6.lsl
MalefactorIX Jun 9, 2020
eaca2de
Update README.md
MalefactorIX Jun 9, 2020
71981a8
Update README.md
MalefactorIX Jun 9, 2020
51fee74
Update README.md
MalefactorIX Jun 9, 2020
d18379f
Incline fix
MalefactorIX Jun 16, 2020
ef7665e
Incline fix
MalefactorIX Jun 16, 2020
b504a29
Incline fix
MalefactorIX Jun 16, 2020
3f5d581
Oops
MalefactorIX Jun 21, 2020
e2b22d5
Oops
MalefactorIX Jun 21, 2020
7f15c31
No longer supported. LBA or GTFO
MalefactorIX Jun 21, 2020
1a477ec
Updated note with current use-case
MalefactorIX Jun 21, 2020
fa1260a
Updated note with current use-case
MalefactorIX Jun 21, 2020
1a9dd81
Resolved slight disagreement
MalefactorIX Jun 21, 2020
83eb3e8
v1.4 Threshold Update
MalefactorIX Jun 26, 2020
86264a6
v1.4 Threshold Update
MalefactorIX Jun 26, 2020
bc95af1
Rename LBHD-Component, v1.3.7.lsl to LBHD-Component, v1.4.lsl
MalefactorIX Jun 26, 2020
3885128
v1.4 Threshold Update
MalefactorIX Jun 26, 2020
239b5a7
Bye Nerd
MalefactorIX Jun 26, 2020
0de8777
Clarified legacy support
MalefactorIX Jun 26, 2020
d1ae3c4
v1.4.1 Update
MalefactorIX Jul 27, 2020
b098808
Update and rename LBHD, Directional Armor v1.4.lsl to LBHD, Direction…
MalefactorIX Jul 27, 2020
d559b42
Update and rename LBHD+AG, Directional Armor v1.4.lsl to LBHD+AG, Dir…
MalefactorIX Jul 27, 2020
7dbb3e5
Fixed incorrect typecast
MalefactorIX Aug 7, 2020
e2fe811
Rotational fix for top/bottom modifiers(TEST THIS)
MalefactorIX Aug 18, 2020
1ab8e0c
Update LBHD-Component, v1.4.3.lsl
MalefactorIX Sep 10, 2020
9be159b
Update and rename LBHD+AG, Directional Armor v1.4.1.lsl to LBHD+AG, D…
MalefactorIX Sep 10, 2020
cd5f91e
Update and rename LBHD, Directional Armor v1.4.1.lsl to LBHD, Directi…
MalefactorIX Sep 10, 2020
9fa4b1b
How did I not catch this
MalefactorIX Oct 12, 2022
e840677
Update LBHD+AG, Directional Armor v1.4.3.lsl
MalefactorIX Oct 12, 2022
a5915a8
Fixed healing cap not working
MalefactorIX Oct 12, 2022
1d3ecb8
Update and rename LBHD-Component, v1.4.3.lsl to LBHD-Component, v1.4.…
MalefactorIX Oct 12, 2022
9621ca5
Update LBHD, Directional Armor v1.4.3.lsl
MalefactorIX Oct 12, 2022
bc0f679
Update LBHD+AG, Directional Armor v1.4.3.lsl
MalefactorIX Oct 12, 2022
56a9af8
Update and rename LBH-AG v1.2.4.lsl to LBH-AG v1.2.5.lsl
MalefactorIX Oct 12, 2022
1214301
Update and rename LBH Slim v1.2.4.lsl to LBH Slim v1.2.5.lsl
MalefactorIX Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions LBH Slim v1.2.2.lsl → LBH/LBH Slim v1.2.5.lsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ integer hp=mhp;//Current HP
//Negative Numbers Restore Health
integer atcap=50;
//Damage Processor
damage(integer amt, key id,vector pos, vector targetPos)
damage(integer amt, key id)
{
if(amt>atcap)amt=atcap;
if(amt<0)//Allows the object to be healed/repaired
{
if(llGetTime()>1.0)//Optional healing cooldown
{
amt*=-1;
if(amt>(float)hp*0.1)amt=llRound((float)hp*0.1);//Optional healing cap
hp-=amt;
hp+=amt;
if(hp>mhp)hp=mhp;//Used to prevent overhealing
llResetTime();
}
Expand All @@ -33,7 +34,7 @@ damage(integer amt, key id,vector pos, vector targetPos)
update()//SetText
{
llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHS]\n "+(string)hp+" / "+(string)mhp+" HP",<1.0,1.0,1.0>,1.0,
PRIM_DESC,"LBA.v.LBHS,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]);
PRIM_DESC,"LBA.v.HS,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]);
//In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented)
}
die()
Expand Down Expand Up @@ -83,11 +84,9 @@ default
list parse=llParseString2List(message,[","],[" "]);
if(llList2Key(parse,0)==me)//targetcheck
{
vector pos=llGetPos();
vector targetPos=tar(id);
float amt=llList2Float(parse,-1);
if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts
//if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing
if(llFabs(amt)<666.0)damage((integer)amt,id);//Use this code to allow object healing, Blocks overflow attempts
//if(amt>0)damage((integer)amt,id);//Use this code if you do not wish to support healing
}
}
collision_start(integer c)//Enable this block if you want to support legacy collisions.
Expand Down
171 changes: 171 additions & 0 deletions LBH/LBH-AG v1.2.5.lsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
//AG Variant includes a built-in anti-grief and blacklisting system. See line 49+ for details.
integer mhp=100;//Maximum HP
integer hp=mhp;//Current HP
//Positive Numbers Deal Damage
//Negative Numbers Restore Health
integer atcap=50;
//Damage Processor
damage(integer amt, key id)
{
if(amt>atcap)amt=atcap;
if(amt<0)//Allows the object to be healed/repaired
{
if(llGetTime()>1.0)//Optional healing cooldown
{
amt*=-1;
if(amt>(float)hp*0.1)amt=llRound((float)hp*0.1);//Optional healing cap
hp+=amt;
if(hp>mhp)hp=mhp;//Used to prevent overhealing
llResetTime();
}
//Be sure to update the listen event code block to allow negative damage values through.
}
/*else if(amt<6)return; //Blocks micro-LBA*/
else if(amt)
{
if(amt>atcap)amt=atcap;
hp-=amt;
}
else return;
if(hp<1)die();
else update();
}

update()//SetText
{
llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBH-AG]\n "+(string)hp+" / "+(string)mhp+" HP",<1.0,1.0,1.0>,1.0,
PRIM_DESC,"LBA.v.HAG,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]);
//In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented)
}
die()
{
//Add extra shit here
//llResetScript();//Debug
llDie();//Otherwise, use this
}
vector tar(key id)
{
vector av=(vector)((string)llGetObjectDetails(id,[OBJECT_POS]));
return av;
}
//Anti-Grief
float interval=2.0;//How many seconds before the threshold is cleared. Recommended 2 seconds.
integer banthresh=80;//How much HP within the interval is considered ban worth, this affects single-hits as well as ATCAP is used only during damage calculations. Note that exceeding the ATCAP will still count against the user as the difference is not factored with the tracker.
//With a 2s interval at 80 damage, it will require a single owner to deal more than 40 DPS in order to get blacklisted.
list banlist;
//Tracker stores information like so: OWNER_UUID,DMG_TRACKED
list tracker;
integer checkdmg(string source, key owner, integer amt)//0 = Do not take damage, 1 = Take damage
{
if(llListFindList(banlist,[owner])>-1)return 0;//Checks for previously banned source
else
{
integer param=llListFindList(banlist,[owner]);
if(param>-1)//Owner damage is already in tracker.
{
integer totalamt=llList2Integer(tracker,param+1);
if(totalamt<banthresh)//Check ban threshold
{
tracker=llListReplaceList(tracker,[totalamt],param+1,param+1);//Update damage dealt thus far
return 1;
}
else //Ban them instead if it fails
{
tracker=llDeleteSubList(tracker,param,param+1);
banlist+=owner;
llOwnerSay("Banned "+llKey2Name(owner)+" for dealing "+(string)totalamt+" damage
Last source: ["+source+"] for "+(string)amt+" damage");
llRegionSayTo(owner,0,"Blacklisted for dealing too much damage too quickly");
hp+=llList2Integer(tracker,param+1); //Refund the damage they already did.
if(hp>mhp)hp=mhp;
return 0;
}
}
else
{
if(amt>banthresh)
{
banlist+=owner;
llOwnerSay("Banned "+llKey2Name(owner)+" for dealing "+(string)amt+" damage
Last source: ["+source+"] for "+(string)amt+" damage");
llRegionSayTo(owner,0,"Blacklisted for dealing too much damage too quickly");
return 0;
//No need to refund damage since they were not already in tracker
}
else
{
tracker+=[owner,amt];
return 1;
}
}
}
}
//
key user;
key gen;//Object rezzer
key me;
integer hear;
boot()
{
user=llGetOwner();
me=llGetKey();
gen=(string)llGetObjectDetails(me,[OBJECT_REZZER_KEY]);
if(hear)llListenRemove(hear);
integer hex=(integer)("0x" + llGetSubString(llMD5String((string)me,0), 0, 3));
hear=llListen(hex,"","","");
llSetTimerEvent(interval);
update();
}
default
{
state_entry()
{
boot();
}
on_rez(integer p)
{
if(p>1)//Allows HUD/Objects to set HP value when rezzed with a param, otherwise uses default
{
mhp=p;
hp=p;
}
boot();
}
listen(integer chan, string name, key id, string message)
{
//[ALWAYS] USE llRegionSayTo(). Do not flood the channel with useless garbage that'll poll every object in listening range.
list parse=llParseString2List(message,[","],[" "]);
if(llList2Key(parse,0)==me)//targetcheck
{
integer amt=llList2Integer(parse,-1);
if(llFabs(amt)<666.0)//Overflow check
{
if(amt>0.0)
{
if(checkdmg(name,llGetOwnerKey(id),amt))
{
llSetTimerEvent(interval);//Reset interval on new damage update
damage(amt,id);
}
}
else damage(amt,id);
}
}
}
collision_start(integer c)//Enable this block if you want to support legacy collisions.
{
if(llVecMag(llDetectedVel(0))>40.0)
{
hp-=c;
if(hp<1)die();//llDie();
else update();
}
}
timer()
{
tracker=[];//Clear tracker
//Auto-Deleter
if(tar(gen))return;
llDie();
}
}
Loading