12 Swords Of Power

Discussion in 'Script Support' started by Nikoru, Apr 20, 2017.

  1. Nikoru

    Nikoru Sorceror

    Messages:
    275
    I am wanting to revamp the swords of power for my shard. I am wondering how hard would it be to make a sword that can 1 hit kill dragons..but do regular damage to everything else?

    Would this be an easy task? Not sure where to start.
  2. Nikoru

    Nikoru Sorceror

    Messages:
    275
    Okay, So let me show you what I am thinking. I am thinking of using this code:

    Code:
     public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
            {
                base.OnHit(attacker, defender, damageBonus);
    
    
                if (defender Name == "Dragon") // Will this work?
                {
                    defender.Hits -= defender.HitsMax;
                    attacker.Say("*You almost kills their opponent in one swing*");
                }
    }
    Can anyone tell me if that Syntax is correct? Would that compile?
  3. Enroq

    Enroq Sorceror

    Messages:
    2,005
    Code:
            public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
            {
                base.OnHit(attacker, defender, damageBonus);
    
                if (defender.Name == "a dragon") // C# using what's called a 'dot-operator' to access an objects methods and properties.
                {
                    defender.Hits -= defender.HitsMax;
                    attacker.LocalOverheadMessage(MessageType.Regular, 0, false, "*You almost kill the dragon in one swing!*");
                }
             }
    Keep in mind this isn't going to work on dragons that have been tamed and had their name change.

    In general, it would be better to something like:

    Code:
    if(defender is Dragon || defender is Drake) //The 'is' keyword compares object types.
    ++ attacker.say would make it appear as if the player typed those words instead of a message sent to the player.
  4. Nikoru

    Nikoru Sorceror

    Messages:
    275
    I see. Thank you for the clarification.
  5. Fraz

    Fraz Traveler

    Messages:
    164
    Rephrase..

    ARDNEH will be complete in time.
  6. Enroq

    Enroq Sorceror

    Messages:
    2,005
    Huh?
  7. Enroq

    Enroq Sorceror

    Messages:
    2,005
    Ardneh = Harden..
  8. Fraz

    Fraz Traveler

    Messages:
    164
    Last edited: Apr 22, 2017
  9. Enroq

    Enroq Sorceror

    Messages:
    2,005
    I'm not really sure where this is going, but I'm sure you're being a great Fraz-Urb'luu.
  10. Fraz

    Fraz Traveler

    Messages:
    164
    It's one of those things that seem to be being lost to the modern world, called reading books..
    Maybe someday they'll make a movie with Brad Pitt and you'll understand better.. :)
  11. Fraz

    Fraz Traveler

    Messages:
    164
  12. Enroq

    Enroq Sorceror

    Messages:
    2,005
    Eh, I also abruptly stop watching movies when I deem them unworthy. It's not just books.
  13. Fraz

    Fraz Traveler

    Messages:
    164
    Somehow that makes perfect sense..?
  14. Fraz

    Fraz Traveler

    Messages:
    164
    Since you seem to know what you are talking about maybe half of the time.. :D
  15. Fraz

    Fraz Traveler

    Messages:
    164
    and I only said that trying to be remotely funny.. no offense intended.
  16. Fraz

    Fraz Traveler

    Messages:
    164
    What sword are we doing next!? Farslayer?
  17. Enroq

    Enroq Sorceror

    Messages:
    2,005
    No offense taken. I'm practicing for a career in politics.
  18. Fraz

    Fraz Traveler

    Messages:
    164
    Nice, I hear Sweden is hiring.
  19. Fraz

    Fraz Traveler

    Messages:
    164
    I'm studying post-mortem photography which I feel is a truly lost art..
    5946933614b2de617a9b7267cda00b22.jpg
  20. Fraz

    Fraz Traveler

    Messages:
    164
    Oh snap, scratch that.. turns out police departments are taking photos of all the dead people, regardless of cause, and keep a nice album at the station.

    On to the next one..

Share This Page