SphereCommunity
Guild attack - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Guild attack (/Thread-Guild-attack)



Guild attack - Alias - 05-15-2012 01:31 AM

Hi, could some1 help me creat function on=@hittry, on=@spellcast and corpse looting, when if player is in a guild then he can't attack or loot players from his guild .
Thanks


RE: Guild attack - Barnabus - 05-15-2012 02:06 AM

There could be a problem there...

If you cant loot your guild mates corpse, then all you can do is watch the enemy loot him.
Which is bad espically when he is wearing the armour he borrowed from you Tongue

Also if your guild mate is paraylsed, how can you free him if your cannot hit him?


RE: Guild attack - Alias - 05-15-2012 02:15 AM

(05-15-2012 02:06 AM)Barnabus Wrote:  There could be a problem there...

If you cant loot your guild mates corpse, then all you can do is watch the enemy loot him.
Which is bad espically when he is wearing the armour he borrowed from you Tongue

Also if your guild mate is paraylsed, how can you free him if your cannot hit him?
In my server it's normal when player's can't loot another player's if they are in one fraction and about paralyze
here trapepd i use for paralyze Smile

[itemdef i_trapped_pouch]
id=i_reag_serpent_scale
Name=Trapped Belt Pouch
VALUE=100
type=t_normal

on=@create
color=00

on=@CLICK

IF (<CONT>!=<SRC.FINDLAYER.21.UID>)
SRC.SYSMESSAGE This item must be in your backpack.
RETURN 1
ENDIF

IF (<SRC.FLAGS>&4)
SRC.DAMAGE <eval({30 50})>,1,<uid>
SRC.EFFECT=3,i_FIRE_COLUMN,6,15,1
src.flags &= ~statf_freeze
src.findid.i_rune_paralyze.remove
src.findid.i_rune_paralyze_field.remove
remove 1
ENDIF


RE: Guild attack - Barnabus - 05-15-2012 06:12 AM

Oh I see

Heres an Idea, im a bit rusty so if i make any mistakes hopefully someone will correct me.

ARGO is the Corpse that is created when a character dies.
I and SRC are both the guy that died.
http://wiki.sphere.torfo.org/index.php/@DeathCorpse

A Corpse will not tell you what guild it came from, so this is the first thing we must do.

Get the players guild UID on the corpse :
Using TAG.TheGuildIWasFromUID
Code:
ON=@DeathCorpse
    IF <GUILD.UID>
        SERV.UID.<ARGO.UID>.TAG.TheGuildIWasFromUID = <GUILD.UID>
    ENDIF

Next lets think about what happens, how does a corpse get looted?

Someone DClicks on the corpse to open it...

Ok So why not use ON=@ITEMDCLICK in the main player event ?
Where Act is the Item and I is the clicker..
http://wiki.sphere.torfo.org/index.php/@ItemDClick

Now how are we going to know that the item the player is clicking on is a corpse?
- we could check its ID, i_corpse or its type t_corpse

But what if there is a live player in the same guild called i_corpse?
- we could check it isnt a player

Code:
ON=@ITEMDCLICK
    IF <GUILD.UID>
        IF !<ACT.IsPlayer>
            IF <ACT.TYPE> == t_corpse
                IF <GUILD.UID> == <ACT.TAG0.TheGuildIWasFromUID>
                     SAY @35 You cannot loot your own guild mates.
                     RETURN 1 // The corpse should not open!
                ENDIF
            ENDIF
        ENDIF
    ENDIF

I imagine something like that might do the trick ^^