View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002549SphereServerexecutable - genericpublic17-08-15 14:5929-12-15 14:21
Reporternolok 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002549: SELL/BUY not working under IF clause in @NpcRestock
DescriptionOn a vendor:

ON=@NpcRestock
SELL=i_dagger,2
IF 1
  SELL=i_katana,2
ENDIF


This results in a purchasable dagger but an Undefined keyword 'SELL' for the katana.
I'm using the last nightly.
TagsNo tags attached.
Nightly VersionAutomated (specify build number)
Experimental FlagsNone
Option FlagsNone
Internal Build Number2419
Attached Files

- Relationships

-  Notes
(0002948)
darksun84 (reporter)
17-08-15 19:02

You have to use the BREAK keyword

 Added: "BREAK" function under @create and @npcrestock to return to normal script interpratation after an ITEM= line since any lines under it was designed to modify the item. (any BUY or SELL line will also break ITEM loop)
(0002949)
nolok (reporter)
17-08-15 19:32

24-07-2015, XuN
Fixed 0002535: NPCRestock is now accepting code like any other triggers.

It should work without BREAK, and even with it:
ON=@NpcRestock
SELL=i_dagger,2
BREAK
IF 1
  SELL=i_katana,2
ENDIF

it doesn't work.
(0002991)
Ben (manager)
15-11-15 14:41

I know where this issue is. @create and @npcrestock were designed differently then the others. BUY and SELL are only present in these triggers, and when normal trigger scripting is added, it no longer recognize these keywords as it thinks it's a normal trigger.
I'll see if I can find a way to change that.
(0002997)
Ben (manager)
15-12-15 02:08

Been looking at this some more, and it's not an easy fix with the current engine.
There is one solution to this... Make @NPCRestock and @Create act like regular triggers and be forced to use NEW.attributehere to affect the previous item.

Example how it is now:
BUY=I_katana
COLOR=color_red

With suggested changes this would be required:
BUY=I_katana
NEW.COLOR=color_red
(0003004)
nolok (reporter)
29-12-15 14:21

Would be it possible, in order to achieve both backwards compatibility and a good speed, to enable this suggested behaviour calling FULLINTERP at the beginning of the trigger?

- Issue History
Date Modified Username Field Change
17-08-15 14:59 nolok New Issue
17-08-15 19:02 darksun84 Note Added: 0002948
17-08-15 19:32 nolok Note Added: 0002949
30-10-15 13:11 XuN Summary IF clause not working in @NpcRestock => SELL/BUY not working under IF clause in @NpcRestock
30-10-15 13:11 XuN Status new => confirmed
15-11-15 14:41 Ben Note Added: 0002991
15-12-15 02:08 Ben Note Added: 0002997
29-12-15 14:21 nolok Note Added: 0003004


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker