SphereCommunity
Summon in houses. - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Summon in houses. (/Thread-Summon-in-houses)



Summon in houses. - Lethal - 06-30-2014 08:31 AM

Hi!

I have the following problem: my idea is that summoning char would not be posible inside houses. A temporary solution:

Code:
[regiontype r_house_system]
on=@enter
if!(<src.isplayer>)                                        
if (<src.flags>&statf_conjured)
src.kill
return 1
endif
endif

that works fine but not in all regions, (for example in Northern Minoc, where the mines are located) is that you apply the restriction that should only work inside the houses, but in some places the restriction affects the whole region and not only the interior of the houses. The strange thing is that the flags of these regions are identical to the others where this problem does not occur. Any idea?

Sorry for my bad english Tongue


RE: Summon in houses. - Skul - 06-30-2014 01:32 PM

You need to check if the region is a multi, try this:
Code:
[regiontype r_house_system]
on=@enter
if (<uid.<src.region.uid>.type>==t_multi) || (<uid.<src.region.uid>.type>==t_multi_custom) //is a multi?
  if!(<src.isplayer>)                                        
    if (<src.flags>&statf_conjured)
      src.kill
      return 1
    endif
  endif
endif



RE: Summon in houses. - Lethal - 07-01-2014 02:30 AM

It works fine, thx!


RE: Summon in houses. - Coruja - 07-01-2014 02:42 AM

try using this
Code:
[FUNCTION CheckSummonHouse]
IF (<SERV.MAP(<ARGS>).REGION.TYPE> != 0)
  SYSMESSAGE You cant summon creatures inside houses.
  return 1
ENDIF
return 0

just add this function somewhere and use this @Start check on all summon spells:
Code:
[SPELL xxx]
...

ON=@Start
return <CheckSummonHouse <TARGP>>

PS:I dont tested this code but maybe it works


RE: Summon in houses. - Lethal - 07-02-2014 05:38 AM

@Skul

It works perfectly but only in the region of Minoc Tongue, where i had the problem before.

@Coruja

Thx!, error occurs:

Code:
16:01:ERROR:(SistemaCasas.scp,102)Can't resolve <SERV.MAP(1400>

try but it works in any region of the map, inside or outside the houses.

Code:
[FUNCTION CheckSummonHouse]
if (<serv.map(<src.targp.x>,<src.targp.y>,<src.targp.z>,<src.targp.m>).type>!= 0)
  SYSMESSAGE You cant summon creatures inside houses.
  return 1
ENDIF
return 0



RE: Summon in houses. - Skul - 07-02-2014 07:03 PM

Try catching the summon on spellselect:
Code:
on=@spellselect
if (<dargn3>==3)
  if (<uid.<targp.region.uid>.type>==t_multi) || (<uid.<targp.region.uid>.type>==t_multi_custom)
    sysmessage You can not summon a creature here.
    action=-1
    return 1
  endif
endif



RE: Summon in houses. - Lethal - 07-07-2014 03:07 AM

Works! thx Skull & Coruja!