|
||
|
|||||||
| Custom Script Release Archive This is a pre-script database archive of what our users had released. |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Account Terminated
Join Date: Jul 2005
Age: 18
Posts: 455
|
Alright, i saw somebody requesting this script, and i tough a hell, ill just make it, Its a door, but you'l have to hit it 10x before it will "open", funny texts, animations, and effect added when hitting
![]() |
|
|
|
|
#6 (permalink) |
|
Account Terminated
Join Date: Dec 2005
Posts: 116
|
I reworked this script, I take no credit except for some cleaning and minor code additions to simplify and add changable yields.
edit: Dec 05, 2005 Made some more edits, see below for the new upload of the script. Last edited by Chinook; 12-05-2005 at 07:26 PM. |
|
|
|
|
#10 (permalink) |
|
Account Terminated
Join Date: Dec 2005
Posts: 116
|
I made some more mods to this script to add in some bug control and admin msg's for set up. Plus I never mentioned that I also added the yields int to the save/load process. Cleaned up the code and added some corrections to the rubble left after the door explodes. Like I said before, I take no credit, just love the script and wanted to share some improvements.
Edit: Dec 06, 2005 Uploaded a new version with Door HP counter, look page 2 in this thread for zip. Last edited by Chinook; 12-06-2005 at 05:56 PM. |
|
|
|
|
#14 (permalink) |
|
Join Date: Dec 2004
Location: Sweden
Posts: 117
|
hehe thx(NollKoll helped out allot with the idea), but something that would be realy cool, is that you could drag a life bar from the door(or wall) so the players know this door cant last forever. or just a thing that indicates Hit points for the player that bashes wildy on the door and not knowing when its going to break. maby just give up :P
|
|
|
|
|
#16 (permalink) |
|
Account Terminated
Join Date: Dec 2005
Posts: 116
|
I added a server msg that shows the current HP's of the door. Also added another bool called HideHP, this will give you the choice in props to show or hide the doors hitpoints to the player.
Last edited by Chinook; 12-06-2005 at 06:31 PM. |
|
|
|
|
#17 (permalink) |
|
Account Terminated
Join Date: Dec 2005
Posts: 116
|
Well I got to thinking of expanding this door into a package with the addition of bashing weapons (like the warhammer), will do extra damage to the door.
To use, just hold or have a bashing weapon in your backpack, double tap for cursor and target the bashable door. Just replace your basebashing.cs with the one I included and drop the bashingtarget.cs in your scripts folder. *I also included my reworked bashdoor.cs* |
|
|
|
|
#20 (permalink) |
|
Forum Novice
|
I made some edits to the script, hope you don't mind. I didn't like how it required distro changes, so I fixed that. I changed it so it's more like hit points on the door, and the damage will be based on your weapon. Also you have to be in war mode to damage the door.
I can't seem to attach the rar, so I'm just gonna post the code: Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Engines.Craft;
using Server.Targeting;
using Server.Items;
using Server.Mobiles;
namespace Server.Items
{
[FlipableAttribute( 1663, 1664, 1655, 1656 )]
public class BashDoor : Item
{
private int m_yield = 100;
private int m_RuinedHue = 1000;
private bool m_hide;
private bool m_ruined;
[CommandProperty( AccessLevel.GameMaster )]
public int Yield
{
get{ return m_yield; }
set{ m_yield = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public bool HideHP
{
get{ return m_hide; }
set{ m_hide = value; }
}
[Constructable]
public BashDoor() : base( 1663 )
{
Name = "a door";
Weight = 31.1;
Movable = false;
HideHP = true;
}
public BashDoor( Serial serial ) : base( serial )
{
}
public override void OnDoubleClick( Mobile from )
{
BaseWeapon weapon = from.Weapon as BaseWeapon;
if ( !from.InRange( GetWorldLocation(), 1 ) )
{
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
else if ( from.Warmode )
{
if ( this.m_yield >= 1 && m_ruined == false )
{
int damage = 0;
from.Direction = from.GetDirectionTo( GetWorldLocation() );
if ( weapon != null )
{
weapon.PlaySwingAnimation( from );
Effects.PlaySound( GetWorldLocation(), Map, weapon.HitSound );
if ( weapon is BaseBashing )
{
damage = Utility.Random( weapon.MinDamage, weapon.MaxDamage );
damage = damage * 2;
damage += from.Str / 10;
//Effects.SendLocationEffect( new Point3D( this.X, this.Y, this.Z ), from.Map, 14360, 10 );
m_yield -= damage;
}
else
{
damage = Utility.Random( weapon.MinDamage, weapon.MaxDamage );
damage += from.Str / 10;
m_yield -= damage;
}
}
else
{
damage = from.Str / 10;
Effects.PlaySound( GetWorldLocation(), Map, Utility.RandomList( 0x3A4, 0x3A6, 0x3A9, 0x3AE, 0x3B4, 0x3B6 ) );
}
if ( m_hide == false )
{
from.SendMessage( "Door Hitpoints = "+ Yield );
}
}
else if ( m_yield <= 0 && m_ruined == false )
{
from.Direction = from.GetDirectionTo( GetWorldLocation() );
Effects.SendLocationEffect( new Point3D( this.X, this.Y, this.Z ), from.Map, 14000, 10 );
from.PlaySound( 0x307 );
new BashDoorTimer( this ).Start();
ItemID = 4338;
Name = "Rubble";
Hue = m_RuinedHue;
m_yield = 0;
m_ruined = true;
}
else
{
}
}
else
{
from.SendMessage( "This door is locked" );
}
}
private class BashDoorTimer : Timer
{
private BashDoor m_Door;
public BashDoorTimer( BashDoor Door ) : base( TimeSpan.FromMinutes( 1 ))
{
m_Door = Door;
}
protected override void OnTick()
{
m_Door.Delete();
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)m_yield);
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch(version)
{
case 0:
m_yield = reader.ReadInt();
break;
default:
break;
}
}
}
}
Last edited by TheNorthStar; 12-08-2005 at 09:15 PM. |
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|