checkemblem()

Poison

New member
Messages
45
Points
0
Github
pois8n
Emulator
*checkemblem(<guild_id>,{<char_id>});

Check if guild emblem is on or off. Returns 0 if its off and 1 if its on.

Is this possible?

 
Never realized there was no script function for this lol

Whats the point of the char_id param?

 
How about if the guildhaving emblem but no image? So its useless..

 
Never realized there was no script function for this lol

Whats the point of the char_id param?
If argument is used, script command will run to that specific character.

How about if the guildhaving emblem but no image? So its useless..
This script command can be used for events that requires an emblem. If guild has transparent emblem, it will still return 1.  Should some players bypass the check using transparent emblem, then it can be reported by other players and game master can take action. 

Just a suggestion though.

 
Suggestion:

Make the command return opaqueness level of the emblem, for example if 30% of pixels in the image is magenta (transparent), return 70 (70% is opaque). If it's all transparent return 0, and also return 0 if there is no emblem. 

This way you can set your own threshold in scripts, and allow some transparency.

 
Last edited by a moderator:
Question is this necessary anymore? now that there is:

Code:
// Limits use of blank (transparent) pixels in guild emblems to a set// percentage of the total.// Official servers do not enforce this technically to date, but some disallow// use of blank emblems in their rules. (Note 2)// A value of 100 (allowing 100% blank pixels) disables this check.// NOTE: Enabling this option slightly degrades performance.client_emblem_max_blank_percent: 100
 
Question is this necessary anymore? now that there is:

// Limits use of blank (transparent) pixels in guild emblems to a set// percentage of the total.// Official servers do not enforce this technically to date, but some disallow// use of blank emblems in their rules. (Note 2)// A value of 100 (allowing 100% blank pixels) disables this check.// NOTE: Enabling this option slightly degrades performance.client_emblem_max_blank_percent: 100
it is, since we want to check if guild have an emblem or not, maybe for events, not to see if it is breaking any rule
default_tongue.png


 
BUILDIN(checkemblem) { struct guild *g = guild->search( script_getnum(st,2) ); if ( g && g->emblem_id ) script_pushint(st,1); else script_pushint(st,0); return true;}
Code:
BUILDIN_DEF(checkemblem,"i"),
.tested with

prontera,155,185,5 script khdsgfjshf 100,{ if ( checkemblem( getcharid(2) ) ) dispbottom "You can join this event"; else dispbottom "Your guild needs an emblem to join King of Emperium Hill event"; end;}..

there is no need for optional parameter because getcharid itself can support optional parameter

checkemblem( getcharid(2, rid2name( <account_id> ) ) );

 
Last edited by a moderator:
For the records: this (still unaccepted) suggestion has also been requested on Spanish section: http://herc.ws/board/topic/6782-emblema-transparente-guild/

We've got Annie's implementation, so it shouldn't be quite hard to implement it if we eventually decide to include this script command. I'll refrain from voting since I see its usefulness but I don't see plenty of use cases for it.

 
Last edited by a moderator:
For the records: this (still unaccepted) suggestion has also been requested on Spanish section: http://herc.ws/board/topic/6782-emblema-transparente-guild/

We've got Annie's implementation, so it shouldn't be quite hard to implement it if we eventually decide to include this script command. I'll refrain from voting since I see its usefulness but I don't see plenty of use cases for it.
Nice command no doubt, but I also do doubt for uses for it, I can't even imagine more than 1 use of it.

 
And, for example if an emblem is required. What does make it sure other guilds won't copy an existent one for their profit or so on?

 
Back
Top